ESP32-Mesh-OTA/components/mesh_ota/include/Mesh_OTA_Util.h

36 lines
1.2 KiB
C
Raw Normal View History

#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
2021-01-20 21:40:51 +01:00
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
2021-01-20 21:40:51 +01:00
void vMeshOtaUtilAddNodeToPossibleUpdatableQueue(uint8_t* pu8MAC);
void vMeshOtaUtilAddOtaMessageToQueue(MESH_PACKET_t* puMeshPacket);
void vMeshOtaUtilChangeStateOfServerWorker(bool bState);
#endif /* H_MESH_OTA_UTIL */