![](/media/cache/group/mqtt.png.50x50_q85.png)
Sample MQTT program - simple send and receive
This program and the MQTT libraries it uses are part of the EclipseTM Paho project; specifically the embedded client.
This example and API are working, but are still in progress. Please give us your feedback.
HelloMQTT is an example of using the MQTT API. The MQTT API is portable across network interface stacks. MQTT is designed to be used with TCP/IP, but any transport with similar characteristics should be suitable.
HelloMQTT uses the NetworkInterface APIs in mbed OS 5 to show how this works. The MQTT library contains an MQTTNetwork.h header, which is a wrapper around the mbed networking interface. To switch between connectivity methods (the default is Ethernet) the easy-connect library is provided in this example application. You can change the connectivity method in mbed_app.json
.
Adding new connectivity methods to the program is trivial, as long as they implement the mbed OS 5 NetworkStack
API.
mbed-os.lib@20:49c9daf2b0ff, 2017-01-10 (annotated)
- Committer:
- Jan Jongboom
- Date:
- Tue Jan 10 18:10:17 2017 -0600
- Revision:
- 20:49c9daf2b0ff
- Child:
- 21:a68bd76740f9
Update to mbed OS 5, use NetworkInterface for multiple connectivity methods - not just ethernet
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Jan Jongboom |
20:49c9daf2b0ff | 1 | https://github.com/ARMmbed/mbed-os/#2885c1b41e63158cb6faf5f107cd821ae06ef26c |