企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
## 心跳接口 > 心跳功能是控制器在间隔一段时间(默认 5 秒)后或者控制器发生了状态变化,即主动向服务器发送的一个请求,服务器 可以知道设备的数据和输入输出状态,也可以知道设备是否在线。 ~~~[api] get:/getStatus *int:partnerID#联合分配的合作方ID。 *int:now#机器当前 unix 时间戳 *int:key#随机码,服务器原样返回 *string:deviceID#设备id *json:body#提交内容json格式数据,参考提交数据demo <<< success { "errNum": 0, "retMsg": "success", "deviceID":"设备id", *int:key#随机码,服务器原样返回 "nowDIff":"服务器与当前请求时间戳相差时间,计算方式服务器减去请求时间戳得出", "retData": { direction:1, command:5, type:check } } direction:当前闸机方向,0进1出 command:命令值,每次仅接收一条命令,具体参考接口说明命令码返回值0~z type:闸机类型,buy购票闸机,check检票闸机 <<< error { "errNum": 非零错误码, "retMsg": "错误信息", "deviceID":"设备id", *int:key#随机码,服务器原样返回 "nowDIff":"服务器与当前请求时间戳相差时间,计算方式服务器减去请求时间戳得出", } ~~~ ## request body说明 ~~~json { body:{ direction:当前方向0进1出 type:闸机类型,buy购票闸机,check检票闸机 } } ~~~ ![执行流程](https://box.kancloud.cn/6fca3adc5e829d3a0603fe479b911cff_470x640.png)