-`secure` 0/1 for `false`/`true`, default 0. [As per #539](https://github.com/nodemcu/nodemcu-firmware/issues/539#issuecomment-170298120) secure connections use TLS 1.2.
-`secure` 0/1 for `false`/`true`, default 0. [As per #539](https://github.com/nodemcu/nodemcu-firmware/issues/539#issuecomment-170298120) secure connections use TLS 1.2.
-`autoreconnect` 0/1 for `false`/`true`, default 0
-`function(client)` call back function for when the connection was established
-`function(client)` call back function for when the connection was established
#### Returns
#### Returns
...
@@ -94,7 +95,7 @@ Connects to the broker specified by the given host, port, and secure options.
...
@@ -94,7 +95,7 @@ Connects to the broker specified by the given host, port, and secure options.
Setup [Last Will and Testament](http://www.hivemq.com/blog/mqtt-essentials-part-9-last-will-and-testament)(optional). A broker will publish a message with qos = 0, retain = 0, data = "offline" to topic "/lwt" if client does not send keepalive packet.
Setup [Last Will and Testament](http://www.hivemq.com/blog/mqtt-essentials-part-9-last-will-and-testament)(optional). A broker will publish a message with qos = 0, retain = 0, data = "offline" to topic "/lwt" if client does not send keepalive packet.
#### Syntax
#### Syntax
`mqtt:lwt(topic, message, qos, retain)`
`mqtt:lwt(topic, message[, qos[, retain]])`
#### Parameters
#### Parameters
-`topic` the topic to publish to (string)
-`topic` the topic to publish to (string)
...
@@ -124,14 +125,14 @@ Registers a callback function for an event.
...
@@ -124,14 +125,14 @@ Registers a callback function for an event.