Skip to content

Commit

Permalink
Ota interface Default: adding download progress status report
Browse files Browse the repository at this point in the history
  • Loading branch information
andreagilardoni authored and pennam committed May 16, 2024
1 parent bde17fb commit 98406e4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/ota/interface/OTAInterfaceDefault.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,10 @@ void OTADefaultCloudProcessInterface::parseOta(uint8_t* buffer, size_t buf_len)
cursor += buf_len - (cursor-buffer);
context->downloadedSize += (cursor-buffer);

if((millis() - context->lastReportTime) > 2000) { // Report the download progress each X millisecond
if((millis() - context->lastReportTime) > 10000) { // Report the download progress each X millisecond
DEBUG_VERBOSE("OTA Download Progress %d/%d", context->downloadedSize, http_client->contentLength());

// FIXME the following line enables the report for download progress, it breaks
// reportStatus(context->downloadedSize);
reportStatus(context->downloadedSize);
context->lastReportTime = millis();
}

Expand Down

0 comments on commit 98406e4

Please sign in to comment.