Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
doc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
胡高建
doc
Commits
0dc62b84
Commit
0dc62b84
authored
Apr 21, 2021
by
胡高建
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README.md
parent
0d410d10
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
15 deletions
+17
-15
README.md
README.md
+17
-15
No files found.
README.md
View file @
0dc62b84
### MQTT交互接口
###
自定义
MQTT交互接口
#### Change Log
-
2021-04-21:
-
xxx
上行payload中的公共参数
####
上行payload中的公共参数
```
javascript
{
"version"
:
{
version
},
"device_
id"
:
{
device_id
},
"device_
name"
:
{
device_name
},
"lan_ip"
:
{
lan_ip
},
"timestamp"
:
{
timestamp
}
}
```
version、device_
id、lan_ip都是字符型,timestamp是整型,13
位数的时间戳
version、device_
name、lan_ip都是字符型,timestamp是整型,为10
位数的时间戳
...
...
@@ -21,11 +24,12 @@ version、device_id、lan_ip都是字符型,timestamp是整型,13位数的
| Function | Topic | Payload | Remark |
| ---------------- | -------------------------------------------------------- | ------------------------------------------------------------ | ------------------------------- |
| 关机上报 | /{productID}/{deviceName}/up/device_state_changed | {"version": {version}, "device_id": {device_id}, "lan_ip": {lan_ip}, "timestamp": {timestamp}, "params": {"state": "off", "auto": true}} | 自动关机auto传true,手动传false |
| 开机上报 | /{productID}/{deviceName}/up/device_state_changed | {"version": {version}, "device_id": {device_id}, "lan_ip": {lan_ip}, "timestamp": {timestamp}, "params": {"state": "on"}} | |
| 指令执行完成上报 | /{productID}/{deviceName}/up/commands_execution_finished | {"version": {version}, "device_id": {device_id}, "lan_ip": {lan_ip}, "timestamp": {timestamp}, "params": {"success": true}} | 成功传true,失败传false |
| 资源更新完成 | /{productID}/{deviceName}/up/resource_updated | {"version": {version}, "device_id": {device_id}, "lan_ip": {lan_ip}, "timestamp": {timestamp}, "params": {"resource_id": {resource_id}} | |
| 缓存数据超时 | /{productID}/{deviceName}/up/cache_timed_out | {"version": {version}, "device_id": {device_id}, "lan_ip": {lan_ip}, "timestamp": {timestamp}, "params": {"cache_id": {cache_id}} | |
| 关机上报 | /{productID}/{deviceName}/up/device_state_changed | {"version": "1.0.0", "device_name": "device1", "lan_ip": "192.168.1.2", "timestamp": 1618903842, "params": {"state": "off", "auto": true}} | 自动关机时auto传true,手动传false |
| 开机上报 | /{productID}/{deviceName}/up/device_state_changed | {"version": "1.0.0", "device_name": "device1", "lan_ip": "192.168.1.2", "timestamp": 1618903842, "params": {"state": "on"}} | |
| 指令执行完成上报 | /{productID}/{deviceName}/up/commands_execution_finished | {"version": "1.0.0", "device_name": "device1", "lan_ip": "192.168.1.2", "timestamp": 1618903842, "params": {"success": true}} | 成功传true,失败传false |
| 资源更新完成 | /{productID}/{deviceName}/up/resource_updated | {"version": "1.0.0", "device_name": "device1", "lan_ip": "192.168.1.2", "timestamp": 1618903842, "params": {"resource_id": "1"} | |
| 资源更新进度上报 | /{productID}/{deviceName}/up/resource_updating_progress | {"version": "1.0.0", "device_name": "device1", "lan_ip": "192.168.1.2", "timestamp": 1618903842, "params": {"resource_id": "1", "progress": 0.8} | progress为当前进度,取值0<=progress<=1 |
| 缓存数据超时 | /{productID}/{deviceName}/up/cache_timed_out | {"version": "1.0.0", "device_name": "device1", "lan_ip": "192.168.1.2", "timestamp": 1618903842, "params": {"cache_id": "1"} | |
...
...
@@ -33,9 +37,8 @@ version、device_id、lan_ip都是字符型,timestamp是整型,13位数的
| Function | Topic | Payload | Remark |
| ------------------- | ---------------------------------------------------- | -------------------------------- | ------------------- |
| 资源下载地址 | /{productID}/{deviceName}/down/resource_download_url | {"resource_url":
{resource_url
} | |
| 资源上传id | /{productID}/{deviceName}/down/resource_upload_id | {"resource_id":
{resource_id}
} | resource_id为字符型 |
| 资源上传地址 | /{productID}/{deviceName}/down/resource_upload_url | {"resource_url":
{resource_url}
} | |
| 心跳间隔最大周期(s) | /{productID}/{deviceName}/down/heartbeat_max_seconds | {"seconds":
{seconds}
} | seconds为整型 |
| 资源下载地址 | /{productID}/{deviceName}/down/resource_download_url | {"resource_url":
"https://xxx.yyy.zzz"
} | |
| 资源上传id | /{productID}/{deviceName}/down/resource_upload_id | {"resource_id":
"xxx"
} | resource_id为字符型 |
| 资源上传地址 | /{productID}/{deviceName}/down/resource_upload_url | {"resource_url":
"https://xxx.yyy.zzz"
} | |
| 心跳间隔最大周期(s) | /{productID}/{deviceName}/down/heartbeat_max_seconds | {"seconds":
300
} | seconds为整型 |
b
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment