diff --git a/docs/en/modules/coap.md b/docs/en/modules/coap.md index 916843c4..6f50d9f9 100755 --- a/docs/en/modules/coap.md +++ b/docs/en/modules/coap.md @@ -78,7 +78,7 @@ cs:func("myfun") -- post coap://192.168.18.103:5683/v1/f/myfun will call myfun Issues a GET request to the server. #### Syntax -`coap.client:get(type, uri, [payload])` +`coap.client:get(type, uri[, payload])` #### Parameters - `type` `coap.CON`, `coap.NON`, defaults to CON. If the type is CON and request fails, the library retries four more times before giving up. @@ -93,7 +93,7 @@ Issues a GET request to the server. Issues a PUT request to the server. #### Syntax -`coap.client:put(type, uri, [payload])` +`coap.client:put(type, uri[, payload])` #### Parameters - `type` `coap.CON`, `coap.NON`, defaults to CON. If the type is CON and request fails, the library retries four more times before giving up. @@ -108,7 +108,7 @@ Issues a PUT request to the server. Issues a POST request to the server. #### Syntax -`coap.client:post(type, uri, [payload])` +`coap.client:post(type, uri[, payload])` #### Parameters - `type` coap.CON, coap.NON, defaults to CON. when type is CON, and request failed, the request will retry another 4 times before giving up. @@ -123,7 +123,7 @@ Issues a POST request to the server. Issues a DELETE request to the server. #### Syntax -`coap.client:delete(type, uri, [payload])` +`coap.client:delete(type, uri[, payload])` #### Parameters - `type` `coap.CON`, `coap.NON`, defaults to CON. If the type is CON and request fails, the library retries four more times before giving up. @@ -140,7 +140,7 @@ Issues a DELETE request to the server. Starts the CoAP server on the given port. #### Syntax -`coap.server:listen(port, [ip])` +`coap.server:listen(port[, ip])` #### Parameters - `port` server port (number) @@ -167,7 +167,7 @@ none Registers a Lua variable as an endpoint in the server. the variable value then can be retrieved by a client via GET method, represented as an [URI](http://tools.ietf.org/html/rfc7252#section-6) to the client. The endpoint path for varialble is '/v1/v/'. #### Syntax -`coap.server:var(name, [content_type])` +`coap.server:var(name[, content_type])` #### Parameters - `name` the Lua variable's name @@ -198,7 +198,7 @@ When the client issues a POST request to this URI, the payload will be passed to The function registered SHOULD accept ONLY ONE string type parameter, and return ONE string value or return nothing. #### Syntax -`coap.server:func(name, [content_type])` +`coap.server:func(name[, content_type])` #### Parameters - `name` the Lua function's name diff --git a/docs/en/modules/mqtt.md b/docs/en/modules/mqtt.md index 30a3db35..d2ec0f5e 100644 --- a/docs/en/modules/mqtt.md +++ b/docs/en/modules/mqtt.md @@ -7,7 +7,7 @@ The client adheres to version 3.1.1 of the [MQTT](https://en.wikipedia.org/wiki/ Creates a MQTT client. #### Syntax -`mqtt.Client(clientid, keepalive, username, password, [cleansession])` +`mqtt.Client(clientid, keepalive, username, password[, cleansession])` #### Parameters - `clientid` client ID @@ -110,11 +110,11 @@ Setup [Last Will and Testament](http://www.hivemq.com/blog/mqtt-essentials-part- Registers a callback function for an event. #### Syntax -`mqtt:on(event, function(client, [topic], [message]))` +`mqtt:on(event, function(client[, topic[, message]]))` #### Parameters - `event` can be "connect", "message" or "offline" -- `function(client, [topic], [message])` callback function. The first parameter is the client. If event is "message", the 2nd and 3rd param are received topic and message (strings). +- `function(client[, topic[, message]])` callback function. The first parameter is the client. If event is "message", the 2nd and 3rd param are received topic and message (strings). #### Returns `nil` diff --git a/docs/en/modules/net.md b/docs/en/modules/net.md index d1cb73a9..63522798 100644 --- a/docs/en/modules/net.md +++ b/docs/en/modules/net.md @@ -173,7 +173,7 @@ Register callback functions for specific events. #### Parameters - `event` string, which can be "connection", "reconnection", "disconnection", "receive" or "sent" -- `function(net.socket, [string])` callback function. The first parameter is the socket. If event is "receive", the second parameter is the received data as string. +- `function(net.socket[, string])` callback function. The first parameter is the socket. If event is "receive", the second parameter is the received data as string. #### Returns `nil` diff --git a/docs/en/modules/u8g.md b/docs/en/modules/u8g.md index 6ebd8bb2..f047e00a 100644 --- a/docs/en/modules/u8g.md +++ b/docs/en/modules/u8g.md @@ -169,7 +169,7 @@ Initialize a display via Hardware SPI. - `u8g.uc1701_mini12864_hw_spi()` #### Syntax -`u8g.ssd1306_128x64_spi(cs, dc, [res])` +`u8g.ssd1306_128x64_spi(cs, dc[, res])` #### Parameters - `cs` GPIO pin for /CS diff --git a/docs/en/modules/ucg.md b/docs/en/modules/ucg.md index b2e652db..ad7c1e16 100644 --- a/docs/en/modules/ucg.md +++ b/docs/en/modules/ucg.md @@ -80,7 +80,7 @@ Initialize a display via Hardware SPI. - `st7735_18x128x160_hw_spi()` #### Syntax -`ucg.st7735_18x128x160_hw_spi(cs, dc, [res])` +`ucg.st7735_18x128x160_hw_spi(cs, dc[, res])` #### Parameters - `cs` GPIO pin for /CS diff --git a/docs/en/modules/wifi.md b/docs/en/modules/wifi.md index 164ee84e..3a124ad2 100644 --- a/docs/en/modules/wifi.md +++ b/docs/en/modules/wifi.md @@ -225,7 +225,7 @@ wifi.sta.autoconnect(1) Sets the WiFi station configuration. #### Syntax -`wifi.sta.config(ssid, password, [auto], [bssid])` +`wifi.sta.config(ssid, password[, auto[, bssid]])` #### Parameters