地址:
ws://localhost:8765
协议:WebSocket
说明:本服务用于AICOIOT RFID系列读卡器设备检测、连接、断开、升级等功能的客户端交互。
{ "type": "command", "command": "..." }
scan
{ "type": "command", "command": "scan" }
{ "type": "status", "status": "connected", "port": "COM3", "info": "DvicesModel=...;Facturer=...;..." }
{ "type": "status", "status": "not_found" }
connect
{ "type": "command", "command": "connect", "device": "COM3" }
disconnect
{ "type": "command", "command": "disconnect", "device": "COM3" }
getlist
{ "type": "command", "command": "getlist" }
{"type": "status", "status": "device_list", "devices": [{"port": "COM10", "description": "USB-SERIAL CH340 (COM10)"}]}
update
{ "type": "command", "command": "update", "device": "COM3" }
exit
{ "type": "command", "command": "exit" }
{ "type": "data", "port": "COM3", "payload": "DATA LINE" }
{ "type": "disconnect", "port": "COM3", "message": "设备已断开" }
{ "type": "error", "message": "错误描述" }
命令 | 说明 |
---|---|
scan |
扫描并连接设备 |
connect |
连接指定端口 |
disconnect |
断开指定端口 |
getlist |
获取串口设备列表 |
update |
下载并烧录固件 |
exit |
关闭 WebSocket 服务 |