Tcp

tcp

tcp command

request: connect

path type conditions description
tcpX.connect.port integer
  • required
  • 0 ≤ value ≤ 65535
TCP port 
tcpX.connect.domain string
  • required
  • length ≤ 30
Server Domain 
// Json Example
[
    {
        "tcp0": {
            "connect": {
                "port": 32767,
                "domain": "obniz.io"
            }
        }
    }
]

request: disconnect

path type conditions description
tcpX.disconnect boolean
  • required
 
// Json Example
[
    {
        "tcp0": {
            "disconnect": true
        }
    }
]

request: write

path type conditions description
tcpX.write.data dataArray
  • required
TCP data 
// Json Example
[
    {
        "tcp0": {
            "write": {
                "data": [16, 34, 242]
            }
        }
    }
]

response: read

path type conditions description
tcpX.read.data dataArray
  • required
 
//Response Example
[
    {
        "tcp0": {
            "read": {
                "data": [16, 34, 242]
            }
        }
    }
]

response: connect

path type conditions description
tcpX.connect.message string
  • required
  • enum
    • "ok"
    • "Port Used"
    • "Port Area Error"
    • "Lookup Error"
    • "Error"
 
tcpX.connect.code number
  • required
 
//Response Example
[
    {
        "tcp0": {
            "connect": {
                "message": "ok",
                "code": 500
            }
        }
    }
]

response: connection

path type conditions description
tcpX.connection.connected boolean
  • required
 
//Response Example
[
    {
        "tcp0": {
            "connection": {
                "connected": true
            }
        }
    }
]

type defines

dataArray

type conditions examples description
array
  • items
    • 0 ≤ value ≤ 255
  • [16, 34, 242]
  • [100, 255, 21, 0, 21]
Binary data array.