巴诺扫地机api接口


test

<h3>协议应答样例</h3> <h5>下发命令描述</h5> <table> <thead> <tr> <th>字段名称</th> <th>字段描述</th> </tr> </thead> <tbody> <tr> <td>cmd</td> <td>下发协议号</td> </tr> <tr> <td>ack</td> <td>1:需接收服务器应答,未收到应答时需重发 0:不需要服务器应答</td> </tr> <tr> <td>seq</td> <td>服务器产生唯一标识</td> </tr> <tr> <td>data</td> <td>数据包</td> </tr> </tbody> </table> <h4>cmd:137 下发示例ack为1 - 添加WIFI</h4> <h5>下发示例ack为1</h5> <pre><code>{ &amp;quot;cmd&amp;quot;:137, &amp;quot;ack&amp;quot;:1,// 1:需上报原数据 &amp;quot;seq&amp;quot;:1213232,//服务器产生唯一标识 &amp;quot;data&amp;quot;:{ &amp;quot;wifiAccount&amp;quot;:&amp;quot;wifi名&amp;quot;, &amp;quot;wifiPassword&amp;quot;:&amp;quot;wifi密码&amp;quot; } }</code></pre> <h5>设备应答命令描述</h5> <table> <thead> <tr> <th>字段名称</th> <th>字段描述</th> </tr> </thead> <tbody> <tr> <td>cmd</td> <td>应答协议号</td> </tr> <tr> <td>code</td> <td>0:成功 1:失败</td> </tr> <tr> <td>keys</td> <td>用于封装服务器需要的参数KEY</td> </tr> <tr> <td>seq</td> <td>应答唯一标识</td> </tr> </tbody> </table> <h5>设备应答返回示例</h5> <pre><code>{ &amp;quot;cmd&amp;quot;:137, &amp;quot;code&amp;quot;:0, //0:成功 1:失败 &amp;quot;keys&amp;quot;:{ &amp;quot;id&amp;quot;:1 //wifi ID }, &amp;quot;seq&amp;quot;:1213232 //应答唯一标识 }</code></pre> <h5>服务器应答设备描述</h5> <table> <thead> <tr> <th>字段名称</th> <th>字段描述</th> </tr> </thead> <tbody> <tr> <td>cmd</td> <td>应答协议号 固定为: 11111</td> </tr> <tr> <td>seq</td> <td>应答唯一标识:未收到应答唯一标识,设备需要重复上报</td> </tr> </tbody> </table> <h5>服务器应答设备示例</h5> <pre><code>{ &amp;quot;cmd&amp;quot;:11111, &amp;quot;seq&amp;quot;:1213232 //应答唯一标识 }</code></pre> <h4>cmd:137 下发示例ack为0 - 添加WIFI</h4> <h5>下发示例ack为1</h5> <pre><code>{ &amp;quot;cmd&amp;quot;:137, &amp;quot;ack&amp;quot;:0,// 0:不需上报原数据 &amp;quot;data&amp;quot;:{ &amp;quot;wifiAccount&amp;quot;:&amp;quot;wifi名&amp;quot;, &amp;quot;wifiPassword&amp;quot;:&amp;quot;wifi密码&amp;quot; } }</code></pre> <h5>设备应答命令描述</h5> <table> <thead> <tr> <th>字段名称</th> <th>字段描述</th> </tr> </thead> <tbody> <tr> <td>cmd</td> <td>应答协议号</td> </tr> <tr> <td>code</td> <td>0:成功 1:失败</td> </tr> <tr> <td>ackData</td> <td>数据包</td> </tr> <tr> <td>keys</td> <td>用于封装服务器需要的参数KEY</td> </tr> <tr> <td>seq</td> <td>应答唯一标识</td> </tr> </tbody> </table> <h5>设备应答返回示例</h5> <pre><code>{ &amp;quot;cmd&amp;quot;:137, &amp;quot;code&amp;quot;:0, //0:成功 1:失败 }</code></pre> <p>&lt;br /&gt; &lt;br /&gt;</p> <h1>扫地机上报</h1> <h4>cmd:103 配网状态</h4> <pre><code>{ &amp;quot;cmd&amp;quot;: 103, &amp;quot;data&amp;quot;: { &amp;quot;status&amp;quot;: 1, &amp;quot;user_id&amp;quot;: 123, &amp;quot;model&amp;quot;: 1, //机型 0:s40 1:s40max &amp;quot;wifiId&amp;quot;:1, &amp;quot;wifiAccount&amp;quot;:&amp;quot;wifi名称”, &amp;quot;wifiPassword&amp;quot;:&amp;quot;Wifi密码&amp;quot;, } }</code></pre> <h4>cmd:20040 机器上传地图数据</h4> <pre><code>{ &amp;quot;cmd&amp;quot;: 20040, &amp;quot;data&amp;quot;: { &amp;quot;mapData&amp;quot;: &amp;quot;protobuf数据&amp;quot;, &amp;quot;mapId&amp;quot;:1, //地图id } }</code></pre> <h4>cmd:20042 房间轮廓</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:20042, &amp;quot;mapId&amp;quot;:0, “room”:[ { &amp;quot;id&amp;quot;:1,//房间ID &amp;quot;name&amp;quot;:&amp;quot;客厅&amp;quot; “contour”:&amp;quot;轮廓点世界坐标&amp;quot; //每个点x和分别存入float数组 }, { &amp;quot;id&amp;quot;:2,//房间ID &amp;quot;name&amp;quot;:&amp;quot;客厅&amp;quot; “contour”:&amp;quot;轮廓点世界坐标&amp;quot; //每个点x和分别存入float数组 } }</code></pre> <h4>cmd:11252 机器上传设备状态(变化慢的有变化才上传,实时清扫轨迹、面积、清扫时长等等可以每几秒传一次)</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:11252, &amp;quot;data&amp;quot;: { “robotStatus”:0, //0:离线 1:待机中 2:清洁中 3:回充中 4:充电中 5:建图中 &amp;quot;errorCode&amp;quot;:0, //故障码 1:低电 2:卡住了需要认为移动 3:。。 “battery”:0, //电池电量百分比 “cleanType”:0,//0:全局清扫; 1 指定房间清扫;2 指定区域清扫 &amp;quot;mapId&amp;quot;:0, //清扫的地图ID &amp;quot;usedPlanId&amp;quot;:0, //全局清扫使用方案时上报方案ID &amp;quot;cleanArea&amp;quot;: 0,//清扫面积 单位:㎡ &amp;quot;cleanTime&amp;quot;: 0,//清扫时间 默认区间为0min—9999分钟(没有小数点,整数表示) “cleanPath”:[x1,y1,x2,y2], //清扫路线float数组 &amp;quot;robotPosition&amp;quot;:[x,y,raw], //扫地机世界坐标x,y和方向 “baseStation”:[x,y], //基站世界坐标 } }</code></pre> <h4>cmd:11256 机器上传设备信息(每次开机连上服务器后上报一次,后面数据有变化再单独传变化的字段,比如WIfi信号强度)</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:11256, &amp;quot;data&amp;quot;: { “tzString”:&amp;quot;Asia/Shanghai&amp;quot; &amp;quot;language&amp;quot;:0, //0;英语 1:简体中文 2:繁体中文 3:日本语 4:西班牙 5:法语 6:德语 7:俄语 8:葡萄牙语 &amp;quot;serialNumber&amp;quot;: “系列号”, &amp;quot;version&amp;quot;: “固件版本”, &amp;quot;ip&amp;quot;: &amp;quot;IP地址&amp;quot;, &amp;quot;wifiId&amp;quot;:1, //WIFI ID &amp;quot;macAddr&amp;quot;: &amp;quot;wifi mac地址&amp;quot;, &amp;quot;wifiStrength&amp;quot;:0, &amp;quot;deviceModel&amp;quot;: 0, //0:S40 1:S40 Max等等 &amp;quot;bindTime&amp;quot;: &amp;quot;首次配网成功时间年月日时分秒&amp;quot; } }</code></pre> <h4>cmd:11257 机器上传单次清扫记录</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:11257, &amp;quot;data&amp;quot;: { “id”:0, //记录ID &amp;quot;startMode&amp;quot;:0, //启动方式:0 设备端启动 1:app启动 2:定时任务 &amp;quot;cleanArea&amp;quot;: 0,//清扫面积 单位:㎡ &amp;quot;cleanTime&amp;quot;: 0,//清扫时间 默认区间为0min—9999分钟(没有小数点,整数表示) &amp;quot;cleanCount&amp;quot;: 0,//清扫次数 1次或者2次 &amp;quot;mapId&amp;quot;:0, //清扫的地图ID “cleanPath”:[x1,y1,x2,y2], //清扫路线float数组 “cleanType”:0,//0:全局清扫; 1 指定房间清扫;2 指定区域清扫 “cleanMode”:0, //0:单扫 1:单洗 2:边扫边洗 &amp;quot;cleanStatus&amp;quot;:0, //0:清扫完成 1:有新任务终止此任务 2:电量不足停止 3:。。。 } }</code></pre> <h4>cmd:11258 机器上传耗材状态</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:11258, &amp;quot;data&amp;quot;: { “edgeBrush”:&amp;quot;80%,360&amp;quot;, //边刷 剩余百分比,剩余时间,单位小时 “rollBrush”:&amp;quot;80%,360&amp;quot;, //滚刷 剩余百分比,剩余时间,单位小时 “mainFilter”:&amp;quot;80%,360&amp;quot;, //主机滤网 剩余百分比,剩余时间,单位小时 “baseFilter”:&amp;quot;80%,360&amp;quot;, //基站滤网 剩余百分比,剩余时间,单位小时 “roller”:&amp;quot;80%,360&amp;quot;, //滚筒 剩余百分比,剩余时间,单位小时 } }</code></pre> <h4>cmd:11259 机器上报新固件通知</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:11259, &amp;quot;data&amp;quot;: { &amp;quot;hasNewVersion&amp;quot;:0, //1:有新版本 “versionCode”:1, “versionStr”:&amp;quot;1.0.1&amp;quot;, &amp;quot;currentVersion&amp;quot;: &amp;quot;1.0.0&amp;quot;, “content”:&amp;quot;更新清扫逻辑&amp;quot; } }</code></pre> <h4>cmd:11260 恢复出厂(按回充和开始按键配网的同时机器上报,服务端清楚绑定关系、记录等等)</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:11260 }</code></pre> <h3>APP下发消息</h3> <h4>cmd:111 回充</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:111, &amp;quot;action&amp;quot;:1 //0:停止回充;1 开始回充 2:继续回充; 3 暂停 }</code></pre> <h5>返回示例</h5> <pre><code>{ “cmd”:111, &amp;quot;code&amp;quot;:0, //0:成功 1:失败 }</code></pre> <h4>cmd:112 开始清扫</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:112, “mapId”:1,//地图id,type为1或者2时需要 &amp;quot;action&amp;quot;:1,//0:结束并返回; 1 开始清扫;2:继续 3 暂停 “type”:1,//0:全局清扫; 1 指定房间清扫;2 指定区域清扫 “room”: //指定房间,type为1才有此项 [{ &amp;quot;id&amp;quot;:1, //房间ID “material”:0, //0:瓷砖 1:大理石 2:木地板 3:地毯 “cleanMode”:0, //0:单扫 1:单洗 2:边扫边洗 “water”:0, //0:小 1:中 2:大 -1:地毯不能水洗 “cleanCnt”:0, //1:1次 2:2次 “order”:0, //0: 按序清扫, 1:自主清扫 }], “area”: //指定区域,type为2才有此项 [{ &amp;quot;id&amp;quot;:1, &amp;quot;type&amp;quot;:0, //0:矩形 1:圆形 2:5边形 &amp;quot;points&amp;quot;:&amp;quot;顶点世界坐标&amp;quot;, //矩形4个点; 圆形1个点;5边型5个点;//每个点x和y分别存入float数组 &amp;quot;radius:12, //圆形半径 “material”:0, //0:瓷砖 1:大理石 2:木地板 3:地毯 “cleanMode”:0, //0:单扫 1:单洗 2:边扫边洗 “water”:0, //0:小 1:中 2:大 -1:地毯不能水洗 “cleanCnt”:0, //1:1次 2:2次 “order”:0, //0: 按序清扫, 1:自主清扫 }], }</code></pre> <h5>返回示例</h5> <pre><code>{ “cmd”:112, &amp;quot;code&amp;quot;:0, //0:成功 1:失败 }</code></pre> <h4>cmd:113 基站操作</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:113, &amp;quot;action&amp;quot;:1 //0:集污;1 开始深度清洁 2:停止深度清洁; 3 开始烘干 4:停止烘干 }</code></pre> <h5>返回示例</h5> <pre><code>{ “cmd”:113, &amp;quot;code&amp;quot;:0, //0:成功 1:失败 }</code></pre> <h4>cmd:114 快速建图</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:114 }</code></pre> <h5>返回示例</h5> <pre><code>{ “cmd”:114, &amp;quot;code&amp;quot;:0, //0:成功 1:失败 &amp;quot;mapId&amp;quot;:123 //上报地图id }</code></pre> <h4>cmd:115 多地图开关</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:115, &amp;quot;action&amp;quot;:0, //1:开 0:关 }</code></pre> <h5>返回示例</h5> <pre><code>{ “cmd”:115, &amp;quot;code&amp;quot;:0, //0:成功 1:失败 }</code></pre> <h4>cmd:116 使用新地图/切换地图</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:116, &amp;quot;mapId&amp;quot;:0, }</code></pre> <h5>返回示例</h5> <pre><code>{ “cmd”:116, &amp;quot;code&amp;quot;:0, //0:成功 1:失败 }</code></pre> <h4>cmd:117 删除地图</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:117, &amp;quot;mapId&amp;quot;:0, }</code></pre> <h5>返回示例</h5> <pre><code>{ “cmd”:117, &amp;quot;code&amp;quot;:0, //0:成功 1:失败 }</code></pre> <h4>cmd:118 新增禁区</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:118, &amp;quot;mapId&amp;quot;:0, “shape”:0, //0:线型 1:矩形 “points”:“顶点世界坐标” //线型2个点,矩形4个点;//每个点x和y分别存入float数组 }</code></pre> <h5>返回示例</h5> <pre><code>{ “cmd”:118, &amp;quot;code&amp;quot;:0, //0:成功 1:失败 }</code></pre> <h4>cmd:119 房间划分</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:119, &amp;quot;mapId&amp;quot;:0, &amp;quot;roomId&amp;quot;:0, //房间Id “divideLine”:[x1,y1,x2,y2] //float点集 }</code></pre> <h5>返回示例</h5> <pre><code>{ “cmd”:119, &amp;quot;code&amp;quot;:0, //0:成功 1:失败 }</code></pre> <h4>cmd:120 房间重命名</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:120, &amp;quot;mapId&amp;quot;:0, “roomId”:1, &amp;quot;roomName&amp;quot;:&amp;quot;新名字&amp;quot; }</code></pre> <h5>返回示例</h5> <pre><code>{ “cmd”:120, &amp;quot;code&amp;quot;:0, //0:成功 1:失败 }</code></pre> <h4>cmd:121 合并房间</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:121, &amp;quot;mapId&amp;quot;:0, “roomIds”:[1,2], //int[] 合并房间ID为1和2的两个房间 }</code></pre> <h5>返回示例</h5> <pre><code>{ “cmd”:121, &amp;quot;code&amp;quot;:0, //0:成功 1:失败 }</code></pre> <h4>cmd:122 添加门槛条</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:122, &amp;quot;mapId&amp;quot;:0, “points”:[x1,y1,x2,y2,x3,y3,x4,y4...], //float[]矩形门槛条4个顶点世界坐标一组,支持多组 }</code></pre> <h5>返回示例</h5> <pre><code>{ “cmd”:122, &amp;quot;code&amp;quot;:0, //0:成功 1:失败 }</code></pre> <h4>cmd:123 添加地毯</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:123, &amp;quot;mapId&amp;quot;:0, “points”:[x1,y1,x2,y2,x3,y3,x4,y4...], //float[]矩形地毯4个顶点世界坐标一组,支持多组 &amp;quot;types&amp;quot;:[1,2] //int[]地毯属性数组 1:禁止进入 2:仅拖地 }</code></pre> <h5>返回示例</h5> <pre><code>{ “cmd”:123, &amp;quot;code&amp;quot;:0, //0:成功 1:失败 }</code></pre> <h4>cmd:124 设置房间材质</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:124, &amp;quot;mapId&amp;quot;:0, &amp;quot;roomIds&amp;quot;:[1,2], //int[]房间ID数组 “materials”:[1,2], //int[]材质数组,对应每个房间的材质 0:瓷砖 1:大理石 2:木地板 3:地毯 }</code></pre> <h5>返回示例</h5> <pre><code>{ “cmd”:124, &amp;quot;code&amp;quot;:0, //0:成功 1:失败 }</code></pre> <h4>cmd:125 新增/修改方案</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:125, &amp;quot;mapId&amp;quot;:0, &amp;quot;planId&amp;quot;:0, //新增方案app产生ID,修改方案传原方案ID “room”:[ { &amp;quot;id&amp;quot;:1, //房间ID &amp;quot;onOff&amp;quot;:0, //开关 1:开代表扫这个房间 “material”:0, //0:瓷砖 1:大理石 2:木地板 3:地毯 “cleanMode”:0, //0:单扫 1:单洗 2:边扫边洗 “water”:0, //0:小 1:中 2:大 -1:地毯不能水洗 “cleanCnt”:0, //1:1次 2:2次 } ] }</code></pre> <h5>返回示例</h5> <pre><code>{ “cmd”:125, &amp;quot;code&amp;quot;:0, //0:成功 1:失败 }</code></pre> <h4>cmd:126 使用方案</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:126, &amp;quot;planId&amp;quot;:0, &amp;quot;onOff&amp;quot;:0, //1:开启 &amp;quot;mapId&amp;quot;:0, }</code></pre> <h5>返回示例</h5> <pre><code>{ “cmd”:126, &amp;quot;code&amp;quot;:0, //0:成功 1:失败 }</code></pre> <h4>cmd:127 预约方案</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:127, “onOff”:1, //1:打开,0关闭 &amp;quot;mapId&amp;quot;:0, &amp;quot;planId&amp;quot;:0, “time”:&amp;quot;15:34&amp;quot;, //hh:mm格式时间 “repeat”:&amp;quot;1111111&amp;quot; //周日-周一...周六,每天代表一个字符,1代表重复 }</code></pre> <h5>返回示例</h5> <pre><code>{ “cmd”:127, &amp;quot;code&amp;quot;:0, //0:成功 1:失败 }</code></pre> <h4>cmd:128 删除方案</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:128, &amp;quot;mapId&amp;quot;:0, “planId”:0, //方案ID }</code></pre> <h5>返回示例</h5> <pre><code>{ “cmd”:128, &amp;quot;code&amp;quot;:0, //0:成功 1:失败 }</code></pre> <h4>cmd:129 耗材重置</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:129, “type”:0, //0:边刷 1:滚刷 2:主机滤网 3:基站滤网 4:滚筒 }</code></pre> <h5>返回示例</h5> <pre><code>{ “cmd”:129, &amp;quot;code&amp;quot;:0, //0:成功 1:失败 }</code></pre> <h4>cmd:130 固件升级</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:130, “action”:1, //1:立即升级 }</code></pre> <h5>返回示例</h5> <pre><code>{ “cmd”:130, &amp;quot;code&amp;quot;:0, //0:成功 1:失败 }</code></pre> <h4>cmd:131 AI进化开关</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:131, “action”:0, //0:关 1:开 }</code></pre> <h5>返回示例</h5> <pre><code>{ “cmd”:131, &amp;quot;code&amp;quot;:0, //0:成功 1:失败 }</code></pre> <h4>cmd:132 设置语音播报音量</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:132, “volum”:80, //百分比 80% }</code></pre> <h5>返回示例</h5> <pre><code>{ “cmd”:132, &amp;quot;code&amp;quot;:0, //0:成功 1:失败 }</code></pre> <h4>cmd:133 设置时区</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:133, “timezone”:8.0, “tzString”:&amp;quot;Asia/Shanghai&amp;quot; }</code></pre> <h5>返回示例</h5> <pre><code>{ “cmd”:133, &amp;quot;code&amp;quot;:0, //0:成功 1:失败 }</code></pre> <h4>cmd:134 定位洗地机</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:134, }</code></pre> <h5>返回示例</h5> <pre><code>{ “cmd”:134, &amp;quot;code&amp;quot;:0, //0:成功 1:失败 }</code></pre> <h4>cmd:135 设置扫地机语言</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:135, &amp;quot;language&amp;quot;:0, //0;英语 1:简体中文 2:繁体中文 3:日本语 4:西班牙 5:法语 6:德语 7:俄语 8:葡萄牙语 }</code></pre> <h5>返回示例</h5> <pre><code>{ “cmd”:135, &amp;quot;code&amp;quot;:0, //0:成功 1:失败 }</code></pre> <h4>cmd:136 查询固件是否有更新</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:136 }</code></pre> <h5>回复cmd:11259</h5> <h4>cmd:137 添加WIFI</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:137, &amp;quot;ack&amp;quot;:1,// 1:需上报原数据 “wifiAccount”:&amp;quot;wifi名&amp;quot;, “wifiPassword”:“wifi密码”, }</code></pre> <h5>返回示例</h5> <pre><code>{ “cmd”:137, &amp;quot;wifiId&amp;quot;:1, //WIFI ID &amp;quot;code&amp;quot;:0, //0:成功 1:失败 }</code></pre> <h4>cmd:138 删除WIFI</h4> <pre><code>{ &amp;quot;cmd&amp;quot;:138, “wifiId”:1 }</code></pre> <h5>返回示例</h5> <pre><code>{ “cmd”:138, &amp;quot;code&amp;quot;:0, //0:成功 1:失败 }</code></pre>

页面列表

ITEM_HTML