#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 bMeshOtaUtilNewerVersion(const char* pu8Local, const char* pu8Remote); esp_err_t errMeshOtaUtilExtractVersionNumber(const char* pu8Data, uint32_t* pu32DataLenght, char* pc8RemoteVersionNumber); esp_err_t errMeshOtaUtilFindImageStart(const char* pu8Data, uint32_t* pu32DataLenght, uint32_t* pu32StartOffset); esp_err_t errMeshOtaUtilSendOTAVersionRequest(mesh_addr_t* pMeshReceiverAddr); esp_err_t errMeshOtaUtilSendOTAVersionResponse(mesh_addr_t* pMeshReceiverAddr); void vMeshOtaUtilPrintOTAProgress(const uint32_t* const cpcu32TotalImageSize, const uint32_t* const cpcu32BytesWritten, OTA_MESH_ROLE_t eRole); void vMeshOtaUtilAddAllNeighboursToQueue(void); void vMeshOtaUtilClearOtaMessageQueue(mesh_addr_t* pMeshNodeAddr); //Handler void vMeshOtaUtilAddNodeToPossibleUpdatableQueue(uint8_t* pu8MAC); void vMeshOtaUtilAddOtaMessageToQueue(MESH_PACKET_t* puMeshPacket); void vMeshOtaUtilChangeStateOfServerWorker(bool bState); #endif /* H_MESH_OTA_UTIL */