add example for support Last Will and Testament LWT, resolve #22

develop
Tuan PM 2015-01-14 12:34:54 +07:00
rodzic 008fd11b59
commit 4f4209c0a7
1 zmienionych plików z 12 dodań i 0 usunięć

Wyświetl plik

@ -99,6 +99,18 @@ BOOL MQTT_Publish(MQTT_Client *client, const char* topic, const char* data, int
```
**Already support LWT: (Last Will and Testament)***
Setup in **MQTT_InitClient** file ***mqtt.c***
```c
char willTopic[] = "/lwt";
char willMessage[] = "offline";
mqttClient->connect_info.will_topic = willTopic;
mqttClient->connect_info.will_message = willMessage;
mqttClient->will_qos = 0;
mqttClient->will_retain = 0;
```
**Default configuration**
See: *include/user_config.h* and *include/config.c*