Contents
Abstract................................................................................................................................................ 1
Contents............................................................................................................................................... 2
Figures.................................................................................................................................................. 3
Tables ................................................................................................................................................... 3
Terms and Definitions......................................................................................................................... 4
References ........................................................................................................................................... 4
1 Overview......................................................................................................................................... 5
2 SDK Build....................................................................................................................................... 5
3 Application Programming Interface ............................................................................................ 6
3.1 Operation APIs...................................................................................................................... 6
3.2 Configuration APIs ................................................................................................................ 7
4 Example Code.............................................................................................................................. 11
4.1 MQTT Publisher..................................................................................................................11
4.2 MQTT Subscriber................................................................................................................ 12
4.3 Receiving/Processing Message (from MQTT Publisher).................................................... 12
4.4 Periodic Message Publishing..............................................................................................13
4.5 Running Sub and Pub at the Same Time (with DPM) ........................................................ 13
4.6 MQTT Client Sample...........................................................................................................14
5 Test............................................................................................................................................... 15
5.1 Test Environment................................................................................................................15
5.2 Setup...................................................................................................................................15
5.3 Publisher ............................................................................................................................. 16
5.3.1 Non-QoS Message .............................................................................................. 16
5.3.2 QoS Message......................................................................................................17
5.3.3 MQTT over TLS...................................................................................................19
5.3.4 Username and Password .................................................................................... 20
5.4 Subscriber...........................................................................................................................21
5.4.1 Setup.................................................................................................................... 21
5.4.2 MQTT over TLS...................................................................................................21
5.4.3 Username and Password .................................................................................... 21
5.4.4 WILL..................................................................................................................... 22
5.5 MQTT Pub/Sub Test with DPM and TLS............................................................................22
5.5.1 MQTT Reconnection Scheme ............................................................................. 24
5.5.2 DPM Power Profile .............................................................................................. 24
5.6 MQTT CleanSession=0 Test Guide.................................................................................... 25
5.6.1 CleanSession=0 Mode ........................................................................................25
5.6.1.1 CleanSession and QoS Matrix Table for PUBLISH Rx ................... 27
5.6.1.2 CleanSession and QoS Matrix Table for PUBLISH Tx....................28
5.6.2 Test steps ............................................................................................................ 29
5.6.2.1 How to connect with CleanSession=0.............................................29
5.6.2.2 How to restart CleanSession=0 test................................................30
5.6.2.3 PUBLISH Rx Test............................................................................ 31