From d5b4532633ca08f67201bf36c0e2539c1a59fc82 Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Sun, 24 Dec 2023 15:24:33 +0800 Subject: [PATCH] fix docs --- docs/websocket.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/websocket.md b/docs/websocket.md index 37eae6c..53d54b9 100644 --- a/docs/websocket.md +++ b/docs/websocket.md @@ -233,6 +233,14 @@ Body: 事件内容,AES加密 ## 指令说明 +### 指令返回格式说明(按照json_rpc 2.0的规范) + +```text + 成功: {"result": map | array | string | any} + + 失败: {"error": {code: int, message: "错误描述"}} +``` + ### 服务器对主机推送的指令格式 <<0x05, PacketId:4, Body:任意长度>> @@ -247,6 +255,7 @@ Body: 事件内容,AES加密 "device_uuid": "xxxxxx", // 设备的device_uuid, 数组格式 "version": "1.0", "directive_type": 0x01, // 中电计费电表控制 + "timeout": 10, // 指令执行超时时间 "directive": { "type": "ctrl", // 遥控 "stype": int, // 遥控类型,0: 遥控, 1: 遥调, 2: 置数 @@ -254,4 +263,5 @@ Body: 事件内容,AES加密 "value": double, // 控制参数 "timestamp": 17031000000 // 发命令时间 } -} \ No newline at end of file +} +