I am using the OTA Agent library of FreeRTOS and I am successfully able to download, verify and flash the new firmware to my MCU.
But most of the times I do not have the firmware update job created in the AWS IoT core because I do not have any new firmware that needs to be upgraded in the MCU but still the OTA agent task (named as “prvOTAAgentTask” in aws_iot_ota_agent.c) is still waiting in the infinite loop for any new firmware update because I created the OTA Task by calling “OTA_AgentInit()”.
Actually the behavior which I want to implement is that if there is no firmware update job created in the AWS IoT core, then I should turn off my network interface device which in my case is cellular modem. Is there any API or SDK function available in FreeRTOS which can give me information if there is any firmware update job created in the AWS IoT core or not. Accordingly I will call the “OTA_AgentInit()” to create the OTA task if there is any firmware update job scheduled. Else I will not call “OTA_AgentInit()” because there is no need for it and turn off my cellular modem to save power.
Please help me on how to solve this requirement of mine.
Thanks and Regards,