2、设置回调地址
<p><strong>请求URL:</strong> </p>
<ul>
<li><code>http://10.27.204.40:8006/api/wz_set_callbackurl</code></li>
</ul>
<p><strong>参数:</strong> </p>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">必选</th>
<th style="text-align: left;">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">macno</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>设备号</td>
</tr>
<tr>
<td style="text-align: left;">url</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>心跳回调地址</td>
</tr>
<tr>
<td style="text-align: left;">notify_url</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>透传命令结果上报地址</td>
</tr>
<tr>
<td style="text-align: left;">back_url</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>状态上报地址</td>
</tr>
<tr>
<td style="text-align: left;">sign</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>签名 md5("dlc")</td>
</tr>
</tbody>
</table>
<p><strong>返回示例</strong></p>
<pre><code>{
"code": 1,
"data": "",
"msg": "回调地址设置成功!"
}</code></pre>
<p><strong>心跳回调地址返回数据格式(url)</strong></p>
<pre><code>{
"macno":"868994036484447",//设备号
"last_beat":"1555573022",//最后通讯的时间
"fd":"1",//文件描述符 无需关注
"ip":"192.168.1.221", //远端IP地址
"port":"8811", //设备端口
"url":"http:\/\/adm.hbfyun.com\/babycar\/writelog\/"//无需关注
}</code></pre>
<p><strong>状态上报地址(notify_url)</strong></p>
<pre><code> "msg":"\u8bbe\u5907\u6210\u529f\u54cd\u5e94",
"code":"1",
"macno":"868994036484447",
"msgid":"85",
"data": //存储结果的json字符串 需要再次jsondecode处理
"{
\\status\\:1, //0为关机 1为开机
\\function\\:1,//0=关闭,1=衣物90,2=衣物120,3=衣物180,4=杯具消毒,5=自动
\\auto_time_hour\\:90,//小时(几点)
\\auto_time_min\\:12,//(分钟)
\\door_status\\:0,//门状态 0=关闭,1=打开
\\remind_time\\:0, //工作剩余时间
\\temperature\\:90,//温度值 0~150度
\\error\\:27 //错误码 0=无故障,1=传感器短路,2=传感器开路,3=门打开
}",
"url":"http:\/\/adm.hbfyun.com\/babycar\/writelog\/"//设置的回调地址,此值无需关注
}</code></pre>
<p><strong>透传命令结果上报地址(back_url)</strong></p>
<pre><code>{
status:1, //0为关机 1为开机
function:1,//0=关闭,1=衣物90,2=衣物120,3=衣物180,4=杯具消毒,5=自动
auto_time_hour:90,//小时(几点)
auto_time_min:12,//(分钟)
door_status:0,//门状态 0=关闭,1=打开
remind_time:0, //工作剩余时间
temperature:90,//温度值 0~150度
error:27 //错误码 0=无故障,1=传感器短路,2=传感器开路,3=门打开
url:"http:\/\/adm.hbfyun.com\/babycar\/writelog\/"//设置的回调地址,此值无需关注
}</code></pre>