This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| sdk:scripts:dio-server [2015/05/05 15:04] – external edit 127.0.0.1 | sdk:scripts:dio-server [2022/06/28 13:28] (current) – schmitt | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== SDK Script dio-server.are ====== | ====== SDK Script dio-server.are ====== | ||
| + | |||
| + | Connect to the tcp port with telnet or somethine elase and you can get and set digital in and output. | ||
| + | |||
| + | Please keep in mind there is no authentification! | ||
| + | |||
| + | Everybody who has access to the IP of the Router could access this server | ||
| + | |||
| + | ===== Available commands ===== | ||
| + | |||
| + | * Set output port: out1 = 1, out1=0, out2=1, out2=0 | ||
| + | * Get status of input port: in1, in2 | ||
| + | * Get status of output port: out2, out2 | ||
| + | * Stop server: | ||
| + | * Disconnect from server: | ||
| + | |||
| + | |||
| <code c dio-server.are> | <code c dio-server.are> | ||
| /* DESC: This script implements a TCP server which can be used to control the DIO ports. | /* DESC: This script implements a TCP server which can be used to control the DIO ports. | ||
| Line 128: | Line 144: | ||
| /* bind to port (and address) */ | /* bind to port (and address) */ | ||
| - | if (ADDR == "" | + | ret = bind(sock, PORT, ADDR); |
| - | ret = bind(sock, PORT); | + | |
| - | } else { | + | |
| - | | + | |
| - | } | + | |
| if (ret == -1) { | if (ret == -1) { | ||
| printf(" | printf(" | ||