I see - so what you are asking is how can you combine 2 demos. Like you want to run both MQTT and OTA. If that is correct, you will need to make some changes:
- At this point you have a MQTT session established: https://github.com/aws/amazon-freertos/blob/master/demos/mqtt/iot_demo_mqtt.c#L789
- You can use the same connection to initialize OTA agent: https://github.com/aws/amazon-freertos/blob/master/demos/ota/aws_iot_ota_update_demo.c#L420
- You probably would want to run MQTT and OTA in separate tasks.
Hope that helps.
Thanks.