Reading Messages


If there are messages published to the subscribed topics, those messages will be received and can be read. In the case of multiple received messages, you can only read the last received message.

Reading a Message: +MNG

AT+MNG="<Topic>"
AT+MNG=<An ID of Topic Buffer>

at+mng="test/test_topic"
+MNG:12,test message
OK

at+mbt=0,"test/test_topic"
OK
at+mng=0
+MNG:12,test message
OK

Getting the Number of Unread Messages: +MQNU

AT+MQNU
AT+MQNU="<Topic>"
AT+MQNU=<An ID of a Topid Buffer>

If you omit the topic or topic buffer ID, it will check all subscribed topics.

at+mqnu="test/test_topic"
+MQNU:1
OK

at+mbt=0,"test/test_topic"
OK
at+mqnu=0
+MQNU:1
OK

Getting the Size of a Received Message: +MQNR

AT+MQNR="<Topic>"
AT+MQNR=<An ID of a Topic Buffer>

at+mqnr="test/test_topic"
+MQNU:12
OK

at+mbt=0,"test/test_topic"
OK
at+mqnr=0
+MQNU:12
OK