Skip to content

Commit

Permalink
Fix the version strings in logs for new/old image (#197)
Browse files Browse the repository at this point in the history
* Fix the version strings in logs for new/old image

* Update variable name

* Add previousversion to lexicon
  • Loading branch information
pvyawaha authored Feb 27, 2021
1 parent 58f060f commit 666241d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions source/ota.c
Original file line number Diff line number Diff line change
Expand Up @@ -1897,9 +1897,9 @@ static DocParseErr_t initDocModel( JsonDocModel_t * pDocModel,
static OtaErr_t validateUpdateVersion( const OtaFileContext_t * pFileContext )
{
OtaErr_t err = OtaErrNone;
AppVersion32_t newVersion;
AppVersion32_t previousVersion;

( void ) newVersion; /* For suppressing compiler-warning: unused variable. */
( void ) previousVersion; /* For suppressing compiler-warning: unused variable. */

/* Only check for versions if the target is self */
if( ( otaAgent.serverFileID == 0U ) && ( otaAgent.fileContext.fileType == configOTA_FIRMWARE_UPDATE_FILE_TYPE_ID ) )
Expand Down Expand Up @@ -1928,12 +1928,12 @@ static OtaErr_t validateUpdateVersion( const OtaFileContext_t * pFileContext )
* Update version received is newer than current version. */
else
{
newVersion.u.unsignedVersion32 = pFileContext->updaterVersion;
previousVersion.u.unsignedVersion32 = pFileContext->updaterVersion;
LogInfo( ( "New image has a higher version number than the current image: "
"Old image version=%u.%u.%u"
", New image version=%u.%u.%u",
"New image version=%u.%u.%u"
", Previous image version=%u.%u.%u",
appFirmwareVersion.u.x.major, appFirmwareVersion.u.x.minor, appFirmwareVersion.u.x.build,
newVersion.u.x.major, newVersion.u.x.minor, newVersion.u.x.build ) );
previousVersion.u.x.major, previousVersion.u.x.minor, previousVersion.u.x.build ) );
}
}

Expand Down
3 changes: 2 additions & 1 deletion tools/lexicon.txt
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@ presigned
presponse
presultlen
pretryparams
previousversion
printf
processdatahandler
processjobhandler
Expand Down Expand Up @@ -807,4 +808,4 @@ writeblock
www
xaa
xyz
zg
zg

0 comments on commit 666241d

Please sign in to comment.