Closed phlegx closed 2 years ago
Hi! I use the latest mbed-mqtt (master) library. The topic should be composed from a variable and passed to the subscribe function like this:
char topic[128]; snprintf(topic, 128, "PR/test/%s/+", mqttd_channel); mqttc.subscribe((const char *)topic, MQTT::QOS2, callbackFc);
From my device I can see incoming cellular data from AT debug, but the MQTT client don't dispatch the callback. If I set the topic directly, the dispatch works fine:
mqttc.subscribe((const char *)"PR/test/c1/+", MQTT::QOS2, callbackFc);
Any idea what I'm doing wrong?
The pointer of topic was gone. Now I have declared the topic on my object instance and all works fine. My bad!
Hi! I use the latest mbed-mqtt (master) library. The topic should be composed from a variable and passed to the subscribe function like this:
From my device I can see incoming cellular data from AT debug, but the MQTT client don't dispatch the callback. If I set the topic directly, the dispatch works fine:
Any idea what I'm doing wrong?