niMQTT is an MQTT library designed for the new EthernetInteface lib.
To use it, you only need a callback with the prototype
void callback(const char *topic, const char *message)
Once you have it, you can create your MQTT's client following this prototype:
niMQTT Client prototype
niMQTT(char *server, void (*callback)(const char *, const char*), char *id="mbed", int port=1883, char *username="", char *password="", bool debug=false);
On creating an instance, a Thread will listen and call your callback when necessary, and you can meanwhile:
- subscribe to a topic:
- publish a message to a topic:
You can see this example as a starting point:
4 comments on niMQTT's usage:
Please log in to post comments.