splitted into several modules; include cleanup

This commit is contained in:
2021-01-20 20:55:33 +01:00
parent 14028679e1
commit e4c620c9c5
17 changed files with 757 additions and 697 deletions

View File

@ -0,0 +1,35 @@
#ifndef H_MESH_OTA_UTIL
#define H_MESH_OTA_UTIL
#include "esp_system.h"
#include "esp_event.h"
#include "esp_log.h"
#include "Mesh_Network.h"
#include "HTTPS_Client.h"
#include "Mesh_OTA.h"
enum otaMeshRole
{
Transmitter,
Receiver
};
typedef enum otaMeshRole OTA_MESH_ROLE_t;
//helper functions
bool bNewerVersion(const char* pu8Local, const char* pu8Remote);
esp_err_t errExtractVersionNumber(const char* pu8Data, uint32_t* pu32DataLenght, char* pc8RemoteVersionNumber);
esp_err_t errFindImageStart(const char* pu8Data, uint32_t* pu32DataLenght, uint32_t* pu32StartOffset);
void vPrintOTAProgress(const uint32_t* const pu32TotalImageSize, const uint32_t* const pu32BytesWritten, OTA_MESH_ROLE_t eRole);
void vAddAllNeighboursToQueue(void);
esp_err_t errSendOTAVersionResponse(mesh_addr_t* meshReceiverAddr);
esp_err_t errSendOTAVersionRequest(mesh_addr_t* meshReceiverAddr);
void vClearOtaMessageQueue(mesh_addr_t* pMeshNodeAddr);
//Handler
void vAddNodeToPossibleUpdatableQueue(uint8_t* pu8MAC);
void vAddOtaMessageToQueue(MESH_PACKET_t* puMeshPacket);
void vChangeStateOfServerWorker(bool state);
#endif /* H_MESH_OTA_UTIL */