I’m sorry I ask this again but I think my question was lost in the previous question thread (How to get MQTT disconnected callbacks in an application based on the Shadow demo (202011))
I’m a bit confuse regarding the best practice implementation of a shadow handler application where I’m update the shadow based on internal device status changes in parallel to possible asynchronous delta message from the core that origin from user inputs.
I’m porting my existing application FW that is based on 202002, this application creates a global MQTT handler when it starts (using IotMqtt_Connect) and then I handle the various callbacs:
- MQTT Disconnect messages via disconnectCallback
- Shadow update messages via AwsIotShadow_SetUpdatedCallback
- Shadow delta messages via AwsIotShadow_SetDeltaCallback
I also use this global MQTT connection to handle OTA.
Now, when I’m porting to 202012 I need to preserve the main application concept of handling the shadow and the OTA, so my question is, should I use the FreeRTOS-Plus-MQTT as it is in the MQTT agent demo, that is, using the MQTTAgent_CommandLoop as the main MQTT handler in a stand alone task (prvMQTTAgentTask) and handle the rest of shadow and OTA activities in a different tasks?
I’m aware to the fact that FreeRTOS-Plus-MQTT is not officially release yet and I can use the coreMQTT directly (that is using MQTT_ProcessLoop) but I don’t want to restructure the code again in a month or so when the FreeRTOS-Plus-MQTT will be released.
Please advise,
Thanks