added OTA process mutex; progress log; reboot flag

This commit is contained in:
2021-01-18 19:03:32 +01:00
parent a0546aa3ef
commit 88fd2c69a9
5 changed files with 86 additions and 40 deletions

View File

@ -66,12 +66,12 @@ struct HTTPS_Client
typedef int32_t https_client_ret_t;
typedef struct HTTPS_Client HTTPS_Client_t;
https_client_ret_t https_clientInitialize();
https_client_ret_t https_clientConnectToServer();
https_client_ret_t https_clientValidateServer();
https_client_ret_t https_clientSendRequest();
https_client_ret_t https_clientRetrieveData(char* pu8Data, uint32_t* pu32DataLenght, uint32_t* pu32BytesRead);
https_client_ret_t https_clientReset();
https_client_ret_t errHTTPSClientInitialize();
https_client_ret_t errHTTPSClientConnectToServer();
https_client_ret_t errHTTPSClientValidateServer();
https_client_ret_t errHTTPSClientSendRequest();
https_client_ret_t errHTTPSClientRetrieveData(char* pu8Data, uint32_t* pu32DataLenght, uint32_t* pu32BytesRead);
https_client_ret_t errHTTPSClientReset();
#endif /* H_HTTPS_CLIENT */

View File

@ -21,6 +21,7 @@
#define QUEUE_MESSAGE_OTA_SIZE 10
#define SERVER_CHECK_INTERVAL 30 //in seconds
#define OTA_HTTPS_SEGMENT_SIZE 2048U
#define OTA_PROGRESS_LOG_INTERVAL 7U
#define ERROR_CHECK(x) if (err == ESP_OK) \
{ \
@ -39,6 +40,7 @@ esp_err_t errOTAHTTPS(bool* pbNewOTAImage);
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);
//Handler
void vAddNodeToPossibleUpdatableQueue(uint8_t* pu8Data);
@ -46,7 +48,7 @@ void vAddOTAControllMessageToQueue(MESH_PACKET_t* puMeshPacket);
void vChangeStateOfServerWorker(bool state);
//Tasks
void vTaskServerWorker(void *arg);
inline void vTaskServerWorker(void *arg);

View File

@ -95,8 +95,5 @@ void vIPEventHandler(void *arg, esp_event_base_t event_base, int32_t i32EventID,
esp_err_t errSendMeshPacket(mesh_addr_t* pAddrDest, MESH_PACKET_t* pPacket);
#endif /* H_MESH_NETWORK */