Open LeandroVanolli opened 3 years ago
@LeandroVanolli , I haven't myself tried this, but as per the documentation of iotc_publish, the user_data you pass to iotc_publish will be received back in the callback. If that is set as NULL, the data in the callback would also be NULL. The broker itself won't send back any data because a response to a QOS1 PUB message is just an acknowledgement (PUBACK).
As I'm using QoS 1, I want to read the callback the API returns, so that I can know if my message was sucessfully sent or not. However, in the example "smart_outlet" this callback function is not implemented, and the publish function sends NULL on parameter which we can put the pointer for a callback function.
Knowing that, I modified the publish function puting my callback function in the place of NULL, and put a LOGI in the callback function to know if the function is being called. It worked fine, however, I want to read the data that is returned to this callback.
Between 3 or 7 seconds after calling the publish function, my callback is called. I hope someone could help me to decode the data.