AV_MQTT's usage

Import libraryAV_MQTT

An AirVantage layer for MQTT

AV_MQTT is an AirVantage library designed on top of

Import libraryniMQTT

An MQTT Client for the new etherNet Interface.

To use it, you only need a callback with the prototype

callback

void callback(const char *key, const char *value)

Once you have it, you can create your AV_MQTT's client following this prototype:

AV_MQTT Client prototype

AV_MQTT(char *server, void (*callback)(const char *, const char*), char *username="", char *password="", char *id="mbed", int port=1883, bool debug=false);

On creating an instance, a Thread will listen and call your callback when necessary, and you can meanwhile publish a message with a key and a value:

publish

client.pub("key", "value");

You can see this example as a starting point:

Import programAV_MQTT_example

Example for AV_MQTT


Please log in to post comments.