- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
in the apps/waf/ota2_failsafe application that is built in by default for ota2 projects one of the first things it does is call wiced_ota2_image_extract_uncompressed_component to extract the APPS LUT. This is in SDK 5.0.1
The first line in that function looks like this
/* we only support LUT and OTA_APP */
if ((component != WICED_OTA2_IMAGE_COMPONENT_LUT) && (component != WICED_OTA2_IMAGE_COMPONENT_OTA_APP))
{
OTA2_WPRINT_ERROR(("wiced_ota2_image_extract_uncompressed_component(%s) bad arg!\r\n", ota2_image_type_name_string[ota_type]));
return WICED_BADARG;
}
This looks incorrect as there is no way past this line unless component isn't LUT or OTA_APP, which is contrary to the comment. Is this correct?
Should it instead be:
/* we only support LUT and OTA_APP */
if ((component != WICED_OTA2_IMAGE_COMPONENT_LUT) || (component != WICED_OTA2_IMAGE_COMPONENT_OTA_APP))
{
OTA2_WPRINT_ERROR(("wiced_ota2_image_extract_uncompressed_component(%s) bad arg!\r\n", ota2_image_type_name_string[ota_type]));
return WICED_BADARG;
}
Thank you!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My bad axel.lin_1746341 , devin_1684766 . I was wrong in my previous comment about the code. After carefully looking into the code, I found it is correct.
The explanation is:
if component == WICED_OTA2_IMAGE_COMPONENT_LUT , the condition will fail and it won't enter the if loop which implies no bad argument and
if component == WICED_OTA2_IMAGE_COMPONENT_OTA_APP, the condition will fail and it won't enter the if loop which implies no bad argument
Hence it supports only LUT and OTA_APP.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It certainly seems incorrect. Thank you for pointing out the error. I have raised a ticket to take care of the matter.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
riya wrote:
It certainly seems incorrect. Thank you for pointing out the error. I have raised a ticket to take care of the matter.
Thank you.
Are you kidding? Please read the code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My bad axel.lin_1746341 , devin_1684766 . I was wrong in my previous comment about the code. After carefully looking into the code, I found it is correct.
The explanation is:
if component == WICED_OTA2_IMAGE_COMPONENT_LUT , the condition will fail and it won't enter the if loop which implies no bad argument and
if component == WICED_OTA2_IMAGE_COMPONENT_OTA_APP, the condition will fail and it won't enter the if loop which implies no bad argument
Hence it supports only LUT and OTA_APP.