设备端对接腾讯连连小程序 IoT Video 标准面板时使用的信令交互协议。
一、请求方法
/** * command 为字符串或对象 */function sendCommand(command) { message_id++ if (typeof command !== 'string') command = 'action=user_define&channel=0&cmd=' + JSON.stringify(command) return p2pExports.sendCommand(id, command)}
二、内部信令
参考文档 设备端与应用端信令交互说明_内部信令。
三、操作云台
请求字段
| 字段 | 类型 | 说明 |
| topic | string | ptz 操作类型。 |
| message_id | number | string | 请求 ID。 |
| cmd | string | ptz_release_pre:松手 。ptz_up_press:上 。ptz_right_press:右 。ptz_down_press:下 。ptz_left_press:左。 |
四、请求示例
{ "topic": "ptz", "message_id": 0, "data": { "cmd": "ptz_release_pre" }}
五、返回字段
| 字段 | 类型 | 说明 |
| apex | string | 是否到顶。yes:到顶。no:未到顶。 |
| current_x | number | 横向位置。 |
| current_y | number | 纵向位置。 |
| max_x | number | 横向位置最大值。 |
| max_y | number | 纵向位置最大值。 |
| min_x | number | 横向位置最小值。 |
| min_y | number | 纵向位置最小值。 |
六、返回示例
{ "confirmation_topic": "ptz", "result": "0", "apex": "yes", "current_x": 123, "current_y": 123, "max_x": 123, "max_y": 123, "min_x": 123, "min_y": 123, "message_id": 0}