NB IoT
This category contains functions specific to NB-IoT devices.
- Overview
- Arguments
- Return
- Examples
Sends message to NB-IoT on specified IP, port and protocol type.
info
Maximum length of Rx and Tx messages is 512
Bytes. Maximum execution time is limited by timeout
in milliseconds.
api.nbSend(addr, port, msg, timeout, type, nownewdatatimeout, rxport)
- addr (string) - IP address
- port (integer) - Port
- msg (string) - Message to be sent to NB-IoT
- timeout (integer) - The maximum execution time in milliseconds
- type (string) - Protocol type:
"UDP"
,"TCP"
or"DTLS"
. - nownewdatatimeout (integer, optional) - The maximum delay between data chunks on reception
- rxport (integer, optional) - Port to use for reception, if not specified, Port value is used
api.nbSend(addr, port, bufferlen, timeout, type, nownewdatatimeout, rxport)
- addr (string) - IP address
- port (integer) - Port
- bufferlen (integer) - Scratchpad (api.nbReceiveBuffer) buffer is sent in given length
- timeout (integer) - The maximum execution time in milliseconds
- type (string) - Protocol type:
"UDP"
,"TCP"
or"DTLS"
- nownewdatatimeout (integer, optional) - The maximum delay between data chunks on reception
- rxport (integer, optional) - Port to use for reception, if not specified, Port value is used
api.nbSend(addr, port, msg, timeout, type, nownewdatatimeout, rxport)
- status (integer) - Zero for success, negative for failure
- rxbuffer (string) - Received data or
nil
for failure
api.nbSend(addr, port, bufferlen, timeout, type, nownewdatatimeout, rxport)
- status (integer) - Zero for success, negative for failure
- rxbufferlen (integer) - Length of the received data, zero for failure
Example how to send a message to NB-IoT via UDP:
-- sends "test message" string to IP 185.8.239.192 on port 5566 with 6s timeout
status,answer = api.nbSend("185.8.239.192", 5566, "test message", 6000, "UDP")
Example how to send a message to NB-IoT via TCP:
-- sends "test message" string to IP 185.8.239.192 on port 5566 with 6s timeout
status,answer = api.nbSend("185.8.239.192", 5566, "test message", 6000, "TCP")
- Overview
- Options
- Arguments
- Return
- Example
Activates, configures and uses NB-IoT scratchpad buffer.
- "activate" - Activates the buffer
- "deactivate" - Deactivates the buffer
- "dump" - Dumps content of the buffer
- "set-size" - Set size of the buffer
- "get-size" - Get size of the buffer
- start (integer) - Index/location where the first byte will be written