Example:
˃ CALL /MEDIA/ETHERNET.tcpText(192.168.0.20:5555=pwr_on)
˂ mO /MEDIA/ETHERNET:tcpText
Send HEX or BIN message
Message can be sent in other formats by the following methods:
▪ tcpMessage: sending in HEX format.
▪ tcpBinary: sending in BIN format.
The command- and response formats are the same as above mentioned.
INFO
Use the udpMessage, udpText, and udpBinary commands to send a UDP message.
8.9. GPIO settings
ATTENTION!
The following commands can be used for SW4-OPT-TX240RAK model only.
INFO
Use the GET command to query a parameter.
8.9.1. Set the direction of a GPIO pin
Command format: SET●/MEDIA/GPIO/P
n
.Direction=<dir>
Response format: pw●/MEDIA/GPIO/ P
n
.Direction=<dir>
Legend: <dir>: direction of the GPIO pin: I=input; O=output
Example:
˃ SET /MEDIA/GPIO/P1.Direction=I
˂ pw /MEDIA/GPIO/P1.Direction=I
8.9.2. Set the output value of a GPIO pin
Command format: SET●/MEDIA/GPIO/P
n
.Output=<value>
Response format: pw●/MEDIA/GPIO/ P
n
.Output=<value>
Legend: <value>: value of the GPIO pin: H=high level; O=low level
Example:
˃ SET /MEDIA/GPIO/P1.Output
˂ pw /MEDIA/GPIO/P1.Output=H
8.9.3. Toggle the value of a GPIO pin
Command format: CALL●/MEDIA/GPIO/P
n
:toggle(1)
Response format: pw●/MEDIA/GPIO/ P
n
:toggle
˃ CALL●/MEDIA/GPIO/P1:toggle(1)
˂ mO●/MEDIA/GPIO/P1:toggle
Explanation: If the direction of the pin is input: the output value is toggled.
If the direction of the pin is output: the output value and the input
value are toggled.
Page 84 / 106 LW3 programmers' reference