Differences

This shows you the differences between two versions of the page.

Link to this comparison view

sdk:scripts:dio-server [2015/05/05 17:04]
127.0.0.1 external edit
sdk:scripts:dio-server [2018/06/20 17:42] (current)
juraschek
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: ​                 quit
 +  * Disconnect from server: ​      bye
 +
 +
 <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 129: Line 145:
 /* bind to port (and address) */ /* bind to port (and address) */
 if (ADDR == ""​) { if (ADDR == ""​) {
-    ret = bind(sock, PORT);+    ret = bind(sock, PORT, ""​);
 } else { } else {
     ret = bind(sock, PORT, ADDR);     ret = bind(sock, PORT, ADDR);