Skip to content

Commit 666241d

Browse files
authored
Fix the version strings in logs for new/old image (#197)
* Fix the version strings in logs for new/old image * Update variable name * Add previousversion to lexicon
1 parent 58f060f commit 666241d

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

source/ota.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1897,9 +1897,9 @@ static DocParseErr_t initDocModel( JsonDocModel_t * pDocModel,
18971897
static OtaErr_t validateUpdateVersion( const OtaFileContext_t * pFileContext )
18981898
{
18991899
OtaErr_t err = OtaErrNone;
1900-
AppVersion32_t newVersion;
1900+
AppVersion32_t previousVersion;
19011901

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

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

tools/lexicon.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,7 @@ presigned
624624
presponse
625625
presultlen
626626
pretryparams
627+
previousversion
627628
printf
628629
processdatahandler
629630
processjobhandler
@@ -807,4 +808,4 @@ writeblock
807808
www
808809
xaa
809810
xyz
810-
zg
811+
zg

0 commit comments

Comments
 (0)