Hi support,
I am using the AWS IoT Over-the-air Update v3.0.0 in my project with the TI board CC3220SF-LaunchXL.
After OTA download and committing the new image, when the device is sending the status as accepted with the version to cloud, it is unable to send the zero (‘0’) in the status if build/major/minor part of version.
For Example, the new updated version, be x.x.0. Here the status to cloud is sent as {“status”:“SUCCEEDED”,“statusDetails”: {“reason”:“accepted vx.x.”}}. Even from the cloud end, the version is reported as x.x._
When I was debugging the same, I came to know that in stringBuilderUInt32Decimal() fucntion (in ota_mqtt.c) checks only for values greater than 0. I have modified the code now and it is working fine and sending the entire version including the 0.
My main concern is, if I modify the code making the zero to be included, will it affect any of the operations in OTA application or at the Cloud end.
Below is the modified code
static size_t stringBuilderUInt32Decimal( char * pBuffer,
size_t bufferSizeBytes,
uint32_t value )
{
char workBuf[ U32_MAX_LEN ];
char * pCur = workBuf;
char * pDest = pBuffer;
size_t size = 0;
/* Assert if there is not enough buffer space. */
assert( bufferSizeBytes >= U32_MAX_LEN );
( void ) bufferSizeBytes;
if(value > 0U)
{
while( value > 0U )
{
*pCur++ = asciiDigits[ ( value % 10U ) ];
value /= 10U;
}
}
else
{
*pCur++ = asciiDigits[ ( 0U ) ];
}
while( pCur > workBuf )
{
pDest[ size++ ] = *--pCur;
}
pDest[ size++ ] = '\0';
return size;
}
Thanks,
Sai Jnaneswar