1. P2P通道

P2P通道由P2P服务提供建立,APP通过P2P协议通道,发送命令控制门铃和门锁以及音视频通信。

1.1 可视对讲

门铃可视化通信对讲。

1.2 设备控制

Request:
{"clientid":"",//客户端ID "gatewayid":"",//Gateway ID "timestamp":"",//时间 "data":{ "type":"",//设备类型 "command":"",//设备命令 "commandparam":""//设备命令参数 } }
Response:


{ "clientid":"",//客户端ID "gatewayid":"",//Gateway ID "timestamp":"",//时间 "data":{ // data中为指令反馈的信息 "code": 0,//响应码 "message": "Success",//响应信息 "result": { // XXXXXXX 返回结果 }, "type": "resp",//响应类型 "callid": 12341235,//callid "method": "DeviceManager.List"//请求命令 } }

2. MQTT通道

通过mqtt 发布订阅模式实现设备心跳和状态上报以及设备控制。以下示例参数为zwave协议控制命令

2.1 设备心跳

mosquitto_pub -h 192.168.9.164 -p port -t "/neohubcloud/device/data/heartbeat/JKCCS1YE1EC82CK9111A" -m "{\"clientid\":\"JKCCS1YE1EC82CK9111A\",\"timestamp\":\"1487919300\",\"data\":{\"type\":\"99\"}}" --cafile /etc/mosquitto/ca_certificates/ca.crt --tls-version tlsv1 -P password -u username

2.2 设备状态

mosquitto_pub -h 192.168.9.164 -p port -t "/neohubcloud/device/date/deviceinfo/JKCCS1YE1EC82CK9111A" -m "{\"clientid\":\"JKCCS1YE1EC82CK9111A\",\"gatewayid\":\"311DLEHTJBBY2VH2111A\",\"timestamp\":\"1487919300\",\"data\":{\"type\":\"req\",\"productid\":\"xxxxxx\",,\"producttype\":\"xxxxxx\"\" data11\":{\"address\":\"zwave://0/0/0\"}}}" --cafile /etc/mosquitto/ca_certificates/ca.crt --tls-version tlsv1 -P password -u username

2.3 设备控制

mosquitto_pub -h 192.168.9.164 -p port -t "/neohubcloud/client/req/server/JKCCS1YE1EC82CK9111A" -m "{\"clientid\":\"JKCCS1YE1EC82CK9111A\",\"gatewayid\":\"311DLEHTJBBY2VH2111A\",\"timestamp\":\"1487919300\",\"data\":{\"type\":\"req\",\"command\":\"DeviceManager.List\",\"commandparam\":{\"address\":\"zwave://0/0/0\"}}}" --cafile /etc/mosquitto/ca_certificates/ca.crt --tls-version tlsv1 -P password -u username

3 HTTP通道

3.1 设备控制

• HTTP Method: POST
• URL: https://neohubcloud.wanliantek.com/business/common/device/control/synchco
• Note:
Request:

名称 类型 是否必须 描述
command String y 设备命令,json字符串格式
access_token String y 平台访问token

Response:

名称 类型 是否必须 描述
code Integer y 响应码
message String y 响应码对应的消息
data String y 返回的响应信息,没有返回信息时为null。

• Example:
Request:
curl --request POST -k https://neohubcloud.wanliantek.com/business/common/device/control/synchcommand -d "command={\"clientid\":\"JKCCS1YE1EC82CK9111A\",\"gatewayid\":\"311DLEHTJBBY2VH2111A\",\"timestamp\":\"1487919300\",\"data\":{\"type\":\"req\",\"command\":\"DeviceManager.Control\",\"commandparam\":{\"address\":\"zwave://f3da428f/2/37/0/0\",\"index\":0,\"value\":0}}}&access_token=d6ffd2536b87e968937da727fd3fecb2" Response:
{"code":0,"message":"Operation successfully.","data":null}