@@ -17,7 +17,7 @@ void BytebeamUpdateProgress(int cur, int total) {
1717 static int loopVar = 0 ;
1818 static int percentOffset = 10 ;
1919 static int progressPercent = 0 ;
20- char * progressStatus = " Downloading" ;
20+ static char * progressStatus = " Downloading" ;
2121
2222 BytebeamLogger::Warn (__FILE__, __func__, " CALLBACK: HTTP update process at %d of %d bytes" , cur, total);
2323 progressPercent = (((float )cur / (float )total) * 100.00 );
@@ -26,7 +26,12 @@ void BytebeamUpdateProgress(int cur, int total) {
2626 BytebeamLogger::Debug (__FILE__, __func__, " progressPercent : %d" , progressPercent);
2727 BytebeamLogger::Debug (__FILE__, __func__, " tempOtaActionId : %s" , tempOtaActionId);
2828
29- // publish the OTA progress
29+ // If we are done, change the status to downloaded
30+ if (progressPercent == 100 ) {
31+ progressStatus = " Downloaded" ;
32+ }
33+
34+ // publish the OTA progress status
3035 if (!Bytebeam.publishActionProgress (tempOtaActionId, progressPercent, progressStatus)) {
3136 BytebeamLogger::Error (__FILE__, __func__, " Failed to publish OTA progress status." );
3237 }
0 commit comments