Implement subscribe using PAHO embedded C client

27 views
Skip to first unread message

Mike

unread,
Jan 2, 2017, 9:41:35 AM1/2/17
to MQTT
Hello Members,

I am using PAHO embedded C client for MQTT implementation. I have successfully implemented publish and now working on subscribe. I see a while loop when a SUBACK is received and the code is checking for PUBLISH value (I am referring a file pub0sub1.c from folder \\org.eclipse.paho.mqtt.embedded-c-1.0.0\MQTTPacket\samples).
  1. It looks that the code will remain in this loop till a message is received. How to break this loop in case no message is received or desired message is received?
  2. I tried adding a timeout (using timer) and also checking the received message but it is not working. Has anyone tried using this example to implement subscribe? Any type of help will be highly appreciated.

Thanks in advance.

Mike
Reply all
Reply to author
Forward
0 new messages