Porting code that uses coreMQTT to one that uses coreMQTT-Agent or vice versa?

I have example code that currently uses coreMQTT to connect to the AWS IoT shadow service. I want to add OTA code to it but the OTA library that the chip vendor provides uses coreMQTT-Agent instead. It seems I have to alter one or the other since I don’t have enough memory for 2 simultaneous TLS/MQTT connections. Do you have any advice about doing such a change (ease of which way, pitfalls, etc.)?

In theory, it should be possible to do either. IMO, you can update your application first to use coreMQTT-Agent. That way you will be able to debug and test your changes without OTA. Once it works, you can then add OTA. Let us know if you face any problem along the way.

Thank you for the reply. Yes, I know it’s possible, I just wanted to know what’s involved (mutexes, contexts, etc.); but I understand this is deep stuff so not many people know about the differences between the two. I guess I’ll just dig into it.

You can refer these coreMQTT-Agent examples - GitHub - FreeRTOS/coreMQTT-Agent-Demos: Demonstrates use of coreMQTT-Agent for simple MQTT connection sharing among different threads of execution.. Feel free to create a post here if you face any problem.

Thank you; I’m already exploring that.