Fix syntax for optional parameters for a few modules

This commit is contained in:
Marcel Stör 2016-01-17 14:14:34 +01:00
parent e86347acf3
commit 96a05dcd41
6 changed files with 14 additions and 14 deletions

View File

@ -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

View File

@ -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`

View File

@ -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`

View File

@ -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

View File

@ -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

View File

@ -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