Topic作为所有设备发布和订阅之间最重要的传输中介,所有具有MQTT通信能力的设备(网关设备或者子设备),都能通过对应的Topic实现消息的发送和接收
Topic格式#
固定部分 | 产品id | 设备id。可为网关id,也可为子设备id | 固定部分 | 模块 | 响应/动作/gateway(按需) |
---|
sys | {product_id} | {device_id} | thing | heart:心跳 | up:上报 |
| | | | ntp:校时 | set:写值 |
| | | | properties:属性 | response:响应 |
| | | | service:服务 | geteway:网关 |
| | | | event:事件 | |
| | | | status:状态 | |
Topic列表#
功能 | Topic | 发布者 | 订阅者 | 说明 |
---|
属性上报 | sys/{product_id}/{device_id}/thing/properties/up | 网关/设备 | 平台 | 无 |
属性上报回复 | sys/{product_id}/{device_id}/thing/properties/up/response | 平台 | 网关/设备 | 无 |
批量属性上报 | sys/{product_id}/{device_id}/thing/properties/gateway/up | 网关/设备 | 平台 | 无 |
批量属性上报回复 | sys/{product_id}/{device_id}/thing/properties/gateway/up/response | 平台 | 网关/设备 | 无 |
属性查询全量 | sys/{product_id}/{device_id}/thing/properties/gateway/get/all | 平台 | 网关/设备 | 无 |
属性写值 | sys/{product_id}/{device_id}/thing/properties/set | 平台 | 网关/设备 | 无 |
属性写值回复 | sys/{product_id}/{device_id}/thing/properties/set/response | 网关/设备 | 平台 | 无 |
属性查询 | sys/{product_id}/{device_id}/thing/properties/get | 平台 | 网关/设备 | 无 |
属性查询回复 | sys/{product_id}/{device_id}/thing/properties/get/response | 网关/设备 | 平台 | 无 |