completet https ota

This commit is contained in:
2021-01-18 17:38:08 +01:00
parent c542dc05ab
commit a0546aa3ef
4 changed files with 72 additions and 125 deletions

View File

@ -51,6 +51,8 @@
#define HTTPS_CLIENT_ERROR_INIT_VALIDATE_SERVER -4
#define HTTPS_CLIENT_ERROR_INIT_SEND_REQUEST -5
#define HTTPS_READ_TIMEOUT 1000 //ms
struct HTTPS_Client
{
mbedtls_entropy_context entropy;
@ -65,9 +67,11 @@ 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 https_clientDeinitialize();
#endif /* H_HTTPS_CLIENT */

View File

@ -20,6 +20,7 @@
#define QUEUE_NODES_SIZE 10
#define QUEUE_MESSAGE_OTA_SIZE 10
#define SERVER_CHECK_INTERVAL 30 //in seconds
#define OTA_HTTPS_SEGMENT_SIZE 2048U
#define ERROR_CHECK(x) if (err == ESP_OK) \
{ \