commons iot framework with solen slot machine ic to controll and monitor massive terminals
Solen provide all interface is rest style. Http Header must have a 'Content-Type: application/json' entry. for example:
curl -H 'Content-Type: application/json' http://ip:port/api/listAll
终端列表(全状态)
path: GET /api/listAll
response: [ { "deviceId" : "xxx", "lac" : xx, "ci" : xx, "channel": { "registered" : true, "shutdown": false, "active": true, }, "idCode" : xx, "inputStat" : 0, "outputStat" : 1, }, ... ]
终端详情
path: GET /api/device/{deviceId}
response: { "deviceId" : "xxx", "lac" : xx, "ci" : xx, "channel": { "registered" : true, "shutdown": false, "active": true, }, "idCode" : xx, "inputStat" : 0, "outputStat" : 1, "reports" : [ { "time" : "2019-08-01 10:00:00,112", "content" : "adf" }, { "time" : "2019-08-01 10:00:00,112", "content" : "adf" } ] }
删除终端
path: DELETE /api/device/{deviceId}[?force=true]
默认不可以删除连接状态正常的终端,加force参数后,可以强制删除 response: 不存在时返回404, 删除正常返回200, 结果是已删除的设备详情。 { "deviceId" : "xxx", "lac" : xx, "ci" : xx, "channel": { "registered" : true, "shutdown": false, "active": true, }, "idCode" : xx, "inputStat" : 0, "outputStat" : 1, "reports" : [ { "time" : "2019-08-01 10:00:00,112", "content" : "adf" }, { "time" : "2019-08-01 10:00:00,112", "content" : "adf" } ] }
发送控制命令 (cmd=3)
path: POST /api/sendControl request: { "deviceId" : "ss", "ctrl" : 0/1 } response: 状态码200表示成功, 结果是调试信息 超过20秒终端没有响应, 会返回408 请求超时 一个设备超过3个请求, 会返回429 to many request for device
发送ascii信息 (cmd=129)
path: POST /api/sendAscii request: { "deviceId" : "ss", "data" : "message body" } response: 状态码200表示成功, 结果是调试信息