diff --git a/README.md b/README.md index 50e19c8..9b31284 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ all blame for bugs in the C port shall go to me. The library provides the following functions: +### Initialization + void mqttClientInit(mqttClient_t *mqttClient, client_t *client, callback_t callback); Initializes the MQTT client, handover a client handle according to the definition @@ -35,8 +37,7 @@ Implement this callback function for incoming messages with this footprint: typedef void (*callback_t)(char*, uint8_t*, uint16_t); - - +### Connect bool mqttConnect(mqttClient_t *mqttClient, uint8_t *address, uint16_t port, @@ -47,21 +48,33 @@ Implement this callback function for incoming messages with this footprint: bool cleanSession); +### Disconnect + void mqttDisconnect(mqttClient_t *mqttClient); +### Publish + bool publish(mqttClient_t *mqttClient, const char *topic, const uint8_t *payload, uint16_t plength, bool retained); +### Subscribe and Unsubscribe + bool subscribe(mqttClient_t *mqttClient, const char *topic, uint8_t qos); bool unsubscribe(mqttClient_t *mqttClient, const char* topic); +### Loop + bool mqttLoop(mqttClient_t *mqttClient); +Call this function in your idle loop. For my own part, I've implemented a time-triggered system +and call it with a period of 100ms. + +### Connection status + bool mqttConnected(mqttClient_t *mqttClient); - \ No newline at end of file