https image ota
This commit is contained in:
@ -80,6 +80,8 @@ https_client_ret_t https_clientRetrieveData(char* pu8Data, uint32_t* pu32DataLen
|
||||
//Reading HTTP response
|
||||
i32RetRetrieveData = mbedtls_ssl_read(&sHTTPS_ClientConfig.ssl, (unsigned char *)pu8Data, *pu32DataLenght);
|
||||
|
||||
printf("HTTPSread: %i\n", i32RetRetrieveData);
|
||||
|
||||
if(i32RetRetrieveData > 0)
|
||||
{
|
||||
//Data received
|
||||
@ -102,6 +104,12 @@ https_client_ret_t https_clientRetrieveData(char* pu8Data, uint32_t* pu32DataLen
|
||||
{
|
||||
//all data read --> stop reading
|
||||
bRetriveData = false;
|
||||
pu32BytesRead = 0;
|
||||
|
||||
printf("finished HTTPSread: %i\n", i32RetRetrieveData);
|
||||
|
||||
while(1){}
|
||||
|
||||
}
|
||||
|
||||
if(i32RetRetrieveData == MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY)
|
||||
|
@ -68,7 +68,7 @@ esp_err_t errFindImageStart(const char* pu8Data, uint32_t* pu32DataLenght, uint3
|
||||
if(pu8Data[u32DataIndex] == 0xe9)
|
||||
{
|
||||
//magic byte found
|
||||
//printf("\n magic byte found: %i\n", u32DataIndex);
|
||||
printf("\n magic byte found: %i\n", u32DataIndex);
|
||||
while ((u8FirstDotIndex < 3) && (u32FirstDotOffset == 0))
|
||||
{
|
||||
//search first dot in version number
|
||||
@ -140,13 +140,13 @@ esp_err_t errExtractVersionNumber(const char* pu8Data, uint32_t* pu32DataLenght,
|
||||
if(err == ESP_OK)
|
||||
{
|
||||
|
||||
//printf("\nImage start found: %i\n", u32StartOffset);
|
||||
printf("\nImage start found: %i\n", u32StartOffset);
|
||||
|
||||
strncpy(pc8RemoteVersionNumber, pu8Data+(u32StartOffset+48), 11);
|
||||
|
||||
pc8RemoteVersionNumber[12] = '\0';
|
||||
|
||||
//printf("remote version number %s\n\n", pc8RemoteVersionNumber);
|
||||
printf("remote version number %s\n\n", pc8RemoteVersionNumber);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user