coreMQTT-Agent-demos, Lab-Project-ota-example and QoS

Hi,

First of all, I don’t know if the coreMQTT-Agent-demos repository is still up to date.

We’ve seen that the demos for the new OTA modular approach doesn’t use coreMQTT-Agent and only use QoS 0. But we try to understand the best way to handle QoS1 with completion result using coreMQTT-Agent as the OTA library was using QoS1 for job request (maybe is it not necessary anymore ?)

When looking into the ota over mqtt demo (in coreMQTT-Agent-demos), I see that an interface to publish on MQTT was passed to the OTA library. In this interface, the pointer to the message is passed in a structure which will get handled by coreMQTT-Agent. Then there is a wait for a configurable timeout. This interface could be called by requestJob_mqtt where the message buffer is allocated locally in the function; this function also using QoS1 with (in the interface wrapper) a callback which will notify a task by a handle stored in a structure locally allocated too. With a finite timeout, we end up quitting functions scopes sometimes (for example when losing connection) and having problems with pointers. We would have to define equivalent to mqttWrapper_publish using coreMQTT-Agent but then we may have the same problematics.

The interface (wrapper) approach is interesting but the coreMQTT-Agent documentation states that structures must remain in scope until the command is completed, so what would be robust ways to handle this ? Is it enough to play with the timeout value ?

Hi @steriDeca, thanks for reaching out! Our team will take a look shortly!