HxNvr/ReadMe.md
2024-01-28 01:08:40 +08:00

212 lines
4.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 通讯协议
- [协议结构](#协议结构)
- [数据格式](#数据格式)
- [心跳](#心跳)
- [查询软件参数信息](#查询软件参数信息)
- [修改软件参数信息](#修改软件参数信息)
- [查询日志](#查询日志)
- [添加日志](#添加日志)
- [查询录像](#查询录像)
- [更新录像数据](#更新录像数据)
- [删除录像数据](#删除录像数据)
## 协议结构
| 参数名称 | 类型 | 描述 |
| --- | --- | --- |
| action_type | int | 操作类型 |
| msgInfo | object | 每个接口特有的参数,详见每个接口定义 |
## 数据格式
### 心跳
| 参数名称 | 类型 | 描述 |
| --- | --- | --- |
| action_type | int | 0 |
| msgInfo | object | |
**msgInfo** 参数如下
| 参数名称 | 类型 | 描述 |
| --- | --- | --- |
| name | string | 程序名称 |
| version | string | 版本信息 |
### 查询软件参数信息
* 请求
| 参数名称 | 类型 | 描述 |
| --- | --- | --- |
| action_type | int | 1 |
* 回复
| 参数名称 | 类型 | 描述 |
| --- | --- | --- |
| action_type | int | 1 |
| msgInfo | Dictionary < string, string > | 设置信息 |
### 修改软件参数信息
* 请求
| 参数名称 | 类型 | 描述 |
| --- | --- | --- |
| action_type | int | 2 |
| msgInfo | Dictionary < string, string > | 设置信息 |
* 回复
| 参数名称 | 类型 | 描述 |
| --- | --- | --- |
| action_type | int | 2 |
| msgInfo | object | |
**msgInfo** 参数如下
| 参数名称 | 类型 | 描述 |
| --- | --- | --- |
| status | bool | true: 成功; false: 失败; |
| message | string | 异常信息 |
### 查询日志
* 请求
| 参数名称 | 类型 | 描述 |
| --- | --- | --- |
| action_type | int | 3 |
| msgInfo | object | |
**msgInfo** 参数如下
| 参数名称 | 类型 | 描述 |
| --- | --- | --- |
| type | int | 0: 系统事件; 1: 用户操作; 2 视频通道; |
| date | string | 日期 |
| index | int | 通道号(仅视频通道日志有效) |
| month | bool | true: 检索全月; false: 不检索全月 |
* 回复
| 参数名称 | 类型 | 描述 |
| --- | --- | --- |
| action_type | int | 3 |
| msgInfo | object[] | |
**msgInfo ** 参数如下
| 参数名称 | 类型 | 描述 |
| --- | --- | --- |
| timestamp | DateTime | 事件事件 |
| type | int | 事件类型 |
| index | int | 视频通道日志类型时为通道号,其他为空 |
| message | string | 消息 |
| data | string | 详细信息 |
### 添加日志
* 请求
| 参数名称 | 类型 | 描述 |
| --- | --- | --- |
| action_type | int | 4 |
| msgInfo | object | |
**msgInfo** 参数如下
| 参数名称 | 类型 | 描述 |
| --- | --- | --- |
| timestamp | DateTime | 事件事件 |
| type | int | 事件类型 |
| index | int | 视频通道日志类型时为通道号,其他为空 |
| message | string | 消息 |
| data | string | 详细信息 |
### 查询录像
* 请求
| 参数名称 | 类型 | 描述 |
| --- | --- | --- |
| action_type | int | 5 |
| msgInfo | object | |
> **msgInfo** 参数为空,查询最早的一条录像数据
> **msgInfo** 参数如下, 按通道、开始日期、结束日期参数查询录像数据
| 参数名称 | 类型 | 描述 |
| --- | --- | --- |
| channel | int | 通道号 |
| start_date | DateTime | 开始日期 |
| end_date | DateTime | 结束日期 |
> **msgInfo** 参数如下, 按日期查询录像数据
| 参数名称 | 类型 | 描述 |
| --- | --- | --- |
| date | DateTime | 日期 |
* 回复
| 参数名称 | 类型 | 描述 |
| --- | --- | --- |
| action_type | int | 5 |
| msgInfo | object[] | |
**msgInfo ** 参数如下
| 参数名称 | 类型 | 描述 |
| --- | --- | --- |
| channel | int | 通道号 |
| start_date | DateTime | 开始日期 |
| end_date | DateTime | 结束日期 |
| duration | int | 录像时长 |
| name | string | 文件名称 |
| path | string | 文件路径 |
### 更新录像数据
* 请求
| 参数名称 | 类型 | 描述 |
| --- | --- | --- |
| action_type | int | 6 |
| msgInfo | object | |
**msgInfo ** 参数如下
| 参数名称 | 类型 | 描述 |
| --- | --- | --- |
| channel | int | 通道号 |
| start_date | DateTime | 开始日期 |
| end_date | DateTime | 结束日期 |
| duration | int | 录像时长 |
| name | string | 文件名称 |
| path | string | 文件路径 |
### 删除录像数据
| 参数名称 | 类型 | 描述 |
| --- | --- | --- |
| action_type | int | 7 |
| msgInfo | object | |
> **msgInfo** 参数如下, 按文件路径删除录像
| 参数名称 | 类型 | 描述 |
| --- | --- | --- |
| path | string | 文件路径 |
> **msgInfo** 参数如下, 按录像日期删除录像
| 参数名称 | 类型 | 描述 |
| --- | --- | --- |
| date | DateTime | 日期 |