Updating OTA status (#596)

* Updating OTA status

* Fixed build error
This commit is contained in:
Indu Prakash
2023-01-15 08:39:17 -06:00
committed by GitHub
parent 14e640ef3f
commit 5b4bf0a630
4 changed files with 76 additions and 18 deletions

View File

@ -823,7 +823,7 @@ int http_fn_index(http_request_t* request) {
#elif PLATFORM_BK7231N || PLATFORM_BK7231T
if (ota_progress() >= 0)
{
hprintf255(request, "<h5>OTA In Progress. Downloaded: %i B Flashed: %06lXh</h5>", ota_total_bytes(), ota_progress());
hprintf255(request, "<h5>OTA In Progress. Downloaded: %i B Flashed: %06lXh</h5>", OTA_GetTotalBytes(), ota_progress());
}
#endif
if (bSafeMode) {

View File

@ -947,7 +947,7 @@ static int http_rest_post_flash(http_request_t* request, int startaddr, int maxa
int recvLen = 0;
int totalLen = 0;
//bk_printf("\ntowrite %d writelen=%d\n", towrite, writelen);
//printf("\ntowrite %d writelen=%d\n", towrite, writelen);
do
{
@ -962,6 +962,8 @@ static int http_rest_post_flash(http_request_t* request, int startaddr, int maxa
if (TRUE == tls_fwup_img_header_check(booter))
{
totalLen = booter->upd_img_len + sizeof(T_BOOTER);
OTA_ResetProgress();
OTA_SetTotalBytes(totalLen);
}
else
{
@ -1005,8 +1007,9 @@ static int http_rest_post_flash(http_request_t* request, int startaddr, int maxa
break;
}
else {
OTA_IncrementProgress(writelen);
recvLen += writelen;
bk_printf("Downloaded %d / %d\n", recvLen, totalLen);
printf("Downloaded %d / %d\n", recvLen, totalLen);
}
towrite -= writelen;