Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
f176697e
Commit
f176697e
authored
Jan 15, 2017
by
Alexis Lothoré
Committed by
Marcel Stör
Jan 15, 2017
Browse files
Document user/pass as optional in MQTT client doc (#1727)
parent
46dc9eae
Changes
1
Show whitespace changes
Inline
Side-by-side
docs/en/modules/mqtt.md
View file @
f176697e
...
@@ -11,7 +11,7 @@ The client adheres to version 3.1.1 of the [MQTT](https://en.wikipedia.org/wiki/
...
@@ -11,7 +11,7 @@ The client adheres to version 3.1.1 of the [MQTT](https://en.wikipedia.org/wiki/
Creates a MQTT client.
Creates a MQTT client.
#### Syntax
#### Syntax
`mqtt.Client(clientid, keepalive, username, password
[
, cleansession])`
`mqtt.Client(clientid, keepalive
[
, username, password, cleansession])`
#### Parameters
#### Parameters
-
`clientid`
client ID
-
`clientid`
client ID
...
@@ -25,7 +25,10 @@ MQTT client
...
@@ -25,7 +25,10 @@ MQTT client
#### Example
#### Example
```
lua
```
lua
-- init mqtt client with keepalive timer 120sec
-- init mqtt client without logins, keepalive timer 120s
m
=
mqtt
.
Client
(
"clientid"
,
120
)
-- init mqtt client with logins, keepalive timer 120sec
m
=
mqtt
.
Client
(
"clientid"
,
120
,
"user"
,
"password"
)
m
=
mqtt
.
Client
(
"clientid"
,
120
,
"user"
,
"password"
)
-- setup Last Will and Testament (optional)
-- setup Last Will and Testament (optional)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment