软件协议文档
终端设备协议文档
功能&协议池(所有功能协议)
MQTT协议文档
HTTP协议文档
微光TLV协议文档
微光卡&码协议
功能模块&UI文档
人脸机
VF105
门禁标品MQTT协议文档(DejaOS版本)
Access control standard MQTT protocol document
VF系列HTTP协议接口文档V1.0.28(Vbar版本)
VF系列MQTT协议文档V1.37.0(Vbar版本)
VF系列-协议模式下通讯协议文档V1.0.4(Vbar版本)
VF系列MQTT协议文档V1.37.3(Vbar版)
VF系列HTTP协议文档_V1.37.2(Vbar版本)
VF系列HTTP协议文档_V1.37.5(Vbar版本)
门禁标品配置项文档(DejaOS版本)
VF-MQTT 协议文档_V1.1.37.13(Vbar版本)
VF203
门禁标品MQTT协议文档(DejaOS版本)
VF系列HTTP协议接口文档V1.0.28(Vbar版本)
VF系列-协议模式下通讯协议文档V1.0.4(Vbar版本)
VF系列-MQTT协议文档V1.37.2(Vbar版本)
VF 系列 HTTP 协议接口文档-V1.37.1(Vbar版本)
VF系列-MQTT协议文档V1.37.11(Vbar版本)
VF106
门禁标品MQTT协议文档(Android版本)
Access control standard MQTT protocol document
VF114
门禁标品MQTT协议文档(DejaOS版本)
VF系列HTTP协议接口文档V1.0.28(Vbar版本)
VF系列-协议模式下通讯协议文档V1.0.4(Vbar版本)
VF205
门禁标品MQTT协议文档(DejaOS版本)
VF系列HTTP协议接口文档V1.0.28(Vbar版本)
VF系列-协议模式下通讯协议文档V1.0.4(Vbar版本)
VF202
门禁标品MQTT协议文档(DejaOS版)
门禁标品配置项文档(DejaOS版本)
VF107
MQTT Protocol Documentation(DejaOS Version)
门禁标品MQTT协议文档(DejaOS版)
门禁标品配置项文档(DejaOS版本)
VF124
门禁标品MQTT协议文档(DejaOS版)
门禁标品配置项文档(DejaOS版本)
读头
EE200
读头标品TLV通讯协议
Read header standard TLV communication protocol
读头标品TLV通讯协议V3.10(Vbar版本)
微光RS485一拖多协议V0.7(Vbar版)
TX200
读头标品TLV通讯协议
Read header standard TLV communication protocol
QT960
读头标品TLV通讯协议
Read header standard TLV communication protocol
QT660
读头标品TLV通讯协议
Read header standard TLV communication protocol
Q340
读头标品TLV通讯协议
Read header standard TLV communication protocol
M300
读头标品TLV通讯协议
Read header standard TLV communication protocol
读头标品TLV通讯协议V3.10(Vbar版本)
JL7000
读头标品TLV通讯协议
Read header standard TLV communication protocol
Q350
读头标品TLV通讯协议
Read header standard TLV communication protocol
MU86
读头标品TLV通讯协议
Read header standard TLV communication protocol
读头标品TLV通讯协议V3.10(Vbar版本)
MET
读头标品TLV通讯协议
Read header standard TLV communication protocol
扫码器TCP/HTT通讯协议V1.0(Vbar版本)
读头标品TLV通讯协议V3.10(Vbar版本)
M350
读头标品TLV通讯协议
Read header standard TLV communication protocol
读头标品TLV通讯协议V3.10(Vbar版本)
扫码器TCP/HTT通讯协议V1.0(Vbar版本)
DW200
读头标品TLV通讯协议(DejaOS版本)
Read header standard TLV communication protocol
读头标品HTTP&TCP协议文档(DejaOS版本)
读头标品HTTP&TCP协议文档(Vbar版本)
读头标品TLV通讯协议V3.10(Vbar版)
读头标品RS485一拖多协议V0.7(Vbar版本)
M340
读头标品TLV通讯协议
Read header standard TLV communication protocol
CR90
刷卡模块通信协议v3.0
CR90指令文档
微光指令:0x60 蓝牙设备控制
1.7/2.x扫码器配置字段说明文档
3.1 扫码器新配置字段说明
门禁
DW200
门禁标品MQTT协议文档-V1(DejaOS版本)
Access control standard MQTT protocol document
门禁扫码器MQTT协议文档(Vbar版本)
DW200 门禁系统配置项文档(DejaOS版本)
门禁标品MQTT协议文档-V2(DejaOS版本)
dw205配置项临时
MU86
门禁20180820 MQTT协议文档V1.0.2(Vbar版)
Q350
门禁20180820 MQTT协议文档V1.0.2(Vbar版)
MET
门禁20180820 MQTT协议文档V1.0.2(Vbar版)
M350
门禁标品MQTT协议文档
Access control standard MQTT protocol document
门禁20180820 MQTT协议V1.0.1(Vbar版本)
门禁20180820 MQTT协议文档V1.0.2(Vbar版本)
MP86
门禁20180820 MQTT协议文档V1.0.2(Vbar版本)
S450
MQTT协议V1.0.0
S430蓝牙透传协议V1.1
DW205
门禁标品MQTT协议文档-V2(DejaOS版本)
Access Standard Product MQTT Protocol-V2 (DejaOS Version)
DW205 门禁系统配置项文档(DejaOS版本)
读头功能介绍
控制板
CC104
控制板标品MQTT协议文档
Control board standard MQTT protocol documentation
CC101
控制板标品MQTT协议文档
CC101标品20211101MQTT协议V3.6(Vbar版本)
平台服务协议文档
网关服务接口定义
门禁应用接口定义
工具文档
多弦产品API签名安全规则
海外锁
app和后台的mqtt协议
凡汐应用接口定义
文档
-
+
首页
S430蓝牙透传协议V1.1
| 版本 | 日期 | 修改人 | 涉及接口 | 修改内容 | | ---- | --------- | ------ | -------- | -------- | | V1.0 | 2025.4.01 | 张归麟 | * | 初版 | | V1.1 | 2025.9.23 | 余成强 | * | 删除白名单查找接口 | # 一、透传数据格式 ## 1.1 通信数据格式 <table> <tr> <th style="background-color: lightyellow;" rowspan="2">APP->Device </th> <th style="background-color: lightblue;">HEAD(2Byte)</th> <th style="background-color: lightgreen;">CMD</th> <th >DLen(2Byte)</th> <th style="background-color: lightpink;">Data(N Byte)</th> <th style="background-color: lightcyan;">校验字</th> </tr> <tr> <td style="background-color: lightblue;">55 AA</td> <td style="background-color: lightgreen;"></td> <td >L(=V<sub>req</sub>的长度N)</td> <td style="background-color: lightpink;">V<sub>req</sub></td> <td style="background-color: lightcyan;">BCC</td> </tr> </table> <table> <tr> <th style="background-color: lightyellow;" rowspan="2">Device>APP </th> <th style="background-color: lightblue;">HEAD(2Byte)</th> <th style="background-color: lightgreen;">CMD</th> <th style="background-color: lightgreen;">标识字</th> <th >DLen(2Byte)</th> <th style="background-color: lightpink;">Data(N Byte)</th> <th style="background-color: lightcyan;">校验字</th> </tr> <tr> <td style="background-color: lightblue;">55 AA</td> <td style="background-color: lightgreen;"></td> <td style="background-color: lightgreen;"></td> <td >L(=V的长度N)</td> <td style="background-color: lightpink;">V<sub>ack</sub></td> <td style="background-color: lightcyan;">BCC</td> </tr> </table> # 二、CMD=0f,CMD<sub>sub</sub>命令字列表 V<sub>req</sub>的格式: <table> <tr> <th style="background-color: lightyellow;" rowspan="2">V<sub>req</sub> </th> <th style="background-color: lightblue;">P1</th> <th style="background-color: lightgreen;">P2</th> <th style="background-color: lightgreen;">P3</th> <th >CMD<sub>sub</sub></th> <th >SubDLen(2Byte)</th> <th style="background-color: lightpink;">Data<sub>sub</sub>(N Byte)</th> <th style="background-color: lightcyan;">校验字</th> </tr> <tr> <td style="background-color: lightblue;">00</td> <td style="background-color: lightgreen;">00</td> <td style="background-color: lightgreen;">30</td> <td ></td> <td >L(=V<sub>subreq</sub>的长度N)</td> <td style="background-color: lightpink;">V<sub>sub</sub></td> <td style="background-color: lightcyan;">BCC<sub>sub</sub></td> </tr> </table> V<sub>ack</sub>的格式 <table> <tr> <th style="background-color: lightyellow;" rowspan="2">V<sub>ack</sub> </th> <th style="background-color: lightblue;">P1</th> <th style="background-color: lightgreen;">P2</th> <th style="background-color: lightgreen;">P3</th> <th >CMD<sub>sub</sub></th> <th style="background-color: lightgreen;">标识字</th> <th >SubDLen(2Byte)</th> <th style="background-color: lightpink;">Data<sub>sub</sub>(N Byte)</th> <th style="background-color: lightcyan;">校验字</th> </tr> <tr> <td style="background-color: lightblue;">00</td> <td style="background-color: lightgreen;">00</td> <td style="background-color: lightgreen;">30</td> <td ></td> <td ></td> <td >L(=V<sub>sub</sub>的长度N)</td> <td style="background-color: lightpink;">V<sub>sub</sub></td> <td style="background-color: lightcyan;">BCC<sub>sub</sub></td> </tr> </table> - P1,P2参考[蓝牙透传协议](/embed/通信协议/蓝牙相关/蓝牙通信协议汇总v1)(指令0x0f)。 - BCC<sub>sub</sub>=从CMD<sub>sub</sub>到V<sub>sub</sub>最后一字节的逐字节异或值 - BCC=从命令头到V最后一字节的逐字节异或值 ## 2.1 CMD<sub>sub</sub>=0x01:设备信息查询 说明:设备信息查询 V<sub>sub</sub>: APP -> BLE(Send) | 项目 | 字节 | 说明 | | ---- | ---- | ---- | | 包头 | N Byte | [命令头说明](#14-特殊命令头说明) | | 命令字 | 1 Byte | 0x01 | | 数据域长度 | 2 Byte | N | | 数据域 | N Byte | <a href="#DEV_INFO_TLV数据">TLV数据</a> | | 校验字 | 1 Byte | BCC | BLE -> APP(Receive) | 项目 | 字节 | 说明 | | ---- | ---- | ---- | | 包头 | N Byte | [命令头说明](#14-特殊命令头说明) | | 命令字 | 1 Byte | 0x01 | | 标识字 | 1 Byte | 0x00 : 成功<br> <a href="#附录1">非0 : 参见附录1</a> | | 数据域长度 | 2 Byte | N | | 数据域 | N Byte | <a href="#DEV_INFO_TLV数据">TLV数据</a> | | 校验字 | 1 Byte | BCC | <span id=DEV_INFO_TLV数据></span> - **TLV数据** <table> <tr align="center"> <td>T(1 Byte)</td><td>L (1 Byte)</td> <td >V (L Byte)</td> <td >必填</td> <td >说明</td> </tr> <tr align="center"> <td>0x01</td><td>1</td><td> 0xAE: 设备等待升级中<br> 0xBE: 设备等待烧录中<br> 0x00: 正常状态 </td> <td >否</td> <td > 设备状态 </td> </tr> <tr align="center"> <td>0x02</td><td>N</td><td>RD2320_V10_V1.0.0</td> <td >否</td> <td > 设备版本</td> </tr> <tr align="center"> <td>0x04</td><td>21</td><td><a href="#网络状态码"> 1Byte网络状态码 </a>+<br>20Byte IP信息</td> <td >否</td> <td > 网络状态查询<br> 12Byte IP信息:4Bytes+4Bytes+4Bytes<br> IP + netmask + gateway <br> </td> </tr> </table> >查询设备版本号 > **APP->BLE:** 55AA 0F 0900 000030 <span style="color: red;">01 0200 0200 01</span> C9 > **BLE->APP:** 55AA 0F 00 1B00 000030 <span style="color: red;">01 00 1300 02115244323332305F5631305F56312E302E3024DB 24</span> DB(成功) ## 2.2 0x02:设备绑定 说明:此指令用于设备的绑定与解绑 V<sub>req</sub>中V<sub>sub</sub>的格式: <table> <tr> <th style="background-color: lightyellow;" rowspan="2">V<sub>sub</sub> </th> <th style="background-color: lightgreen;">T</th> <th style="background-color: lightgreen;">L</th> <th >V</th> </tr> <tr> <td style="background-color: lightgreen;">01</td> <td style="background-color: lightgreen;">01</td> <td >00: 解绑所有; 其他值见<a href="#绑定命令字说明">绑定命令字说明</a></td></td> </tr> </table> V<sub>ack</sub>中V<sub>sub</sub>的格式: 若存在,与V<sub>req</sub>中V<sub>sub</sub>相同 APP -> BLE(Send) | 项目 | 字节 | 说明 | | ---- | ---- | ---- | | 包头 | N Byte | [命令头说明](#14-特殊命令头说明) | | 命令字 | 1 Byte | 0x02 | | 数据域长度 | 2 Byte | N | | 数据域 | N Byte | <a href="#绑定TLV数据">TLV数据</a> | | 校验字 | 1 Byte | BCC | BLE -> APP(Receive) | 项目 | 字节 | 说明 | | ---- | ---- | ---- | | 包头 | N Byte | [命令头说明](#14-特殊命令头说明) | | 命令字 | 1 Byte | 0x02 | | 标识字 | 1 Byte | 0x00 : 成功<br> <a href="#附录1">非0 : 参见附录1</a> | | 数据域长度 | 2 Byte | N | | 数据域 | 0 Byte | - | | 校验字 | 1 Byte | BCC | <span id="绑定TLV数据"></span> - **TLV 数据** | T(1 Byte) | L (1 Byte) | V (L Byte) | 必填 | 说明 | | ---- | ---- | ---- | ---- | ---- | | 0x01 | 1 | 0x00: 解绑所有<br> 其他值见<a href="#绑定命令字说明">绑定命令字说明</a><br> | 否 | 绑定或解绑命令字 | | 0x02 | 6 | 313233343536 ("123456") | 否 | 本机(锁)设备 SN | <span id="绑定命令字说明"></span> - **绑定命令字说明** | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0 | | :----: | :----: | :----: | :----: | :----: | :----: | :----: | :----: | | - | - | - | 1: BIT0 使能 | - | - | - | 1: app 绑定<br>0: app 解绑 | 指令示例 > 绑定 APP: > **APP->BLE:** 55AA 0F 1200 000030 <span style="color: red;">02 0B00 010111 0206363636353535 1F</span> D2 > **BLE->APP:** > 解绑 APP: > **APP->BLE:** 55AA 0F 1200 000030 <span style="color: red;">02 0B00 010110 0206363636353535 1E</span> D2 > **BLE->APP:** > 解绑所有: > **APP->BLE:** 55AA 0F 1200 000030 <span style="color: red;">02 0B00 010100 0206363636353535 0E</span> D2 > **BLE->APP:** ## 2.3 0x03:设备配网 说明:此指令用于设备配置网络 APP -> BLE(Send) | 项目 | 字节 | 说明 | | ---- | ---- | ---- | | 包头 | N Byte | [命令头说明](#14-特殊命令头说明) | | 命令字 | 1 Byte | 0x03 | | 数据域长度 | 2 Byte | N | | 数据域 | N Byte | <a href="#网络TLV数据">TLV数据</a> | | 校验字 | 1 Byte | BCC | BLE -> APP(Receive) | 项目 | 字节 | 说明 | | ---- | ---- | ---- | | 包头 | N Byte | [命令头说明](#14-特殊命令头说明) | | 命令字 | 1 Byte | 0x03 | | 标识字 | 1 Byte | 0x00 : 成功<br> <a href="#附录1">非0 : 参见附录1</a> | | 数据域长度 | 2 Byte | N | | 数据域 | N Byte | <a href="#网络TLV数据">TLV数据</a> | | 校验字 | 1 Byte | BCC | <span id="网络TLV数据"></span> - **TLV 数据** | T(1 Byte) | L (1 Byte) | V (L Byte) | 必填 | 说明 | | ---- | ---- | ---- | ---- | ---- | | 0x01 | 1 | 0(WiFi)<br>1(以太网)<br>255(禁用网络) | 是 | 网络类型 | | 0x02 | N | ssid | 否 | WiFi 账号 | | 0x03 | N | pwd | 否 | WiFi 密码 | | 0x04(不支持) | 1 | 0 (OPEN)<br>1 (WPA2PSK_AES)<br>2 (WPA2PSK_TKIP)<br>3 (WPA2PSK_AES_TKIP)<br>4 (WPAPSK_AES)<br>5 (WPAPSK_TKIP)<br>6 (WPAPSK_AES_TKIP)<br>7 (WPA(2)PSK_AES)<br>8 (WPA(2)PSK_TKIP)<br>9 (WPA(2)PSK_AES_TKIP) | 否 | 安全协议和加密算法 | | 0x05(不支持) | 1 | 0 (未隐藏)<br>1 (隐藏) | 否 | 隐藏 | | 0x06 | 1 | 0 (STATIC IP)<br>1 (DHCP) | 是 | IP 分配模式 | | 0x07 | 12 | 4Bytes+4Bytes+4Bytes<br>IP + netmask + gateway | 否 | 静态 IP | 指令示例 > 配置网络: 动态WiFi:ssid:Vguang_RJ password:vguangrj_o0 dhcp:1 > **APP->BLE:** 55 aa 0f 2500 000030 <span style="color: red;">03 1e000101000209566775616e675f524a030b766775616e67726a5f6f3006010167</span> e5 > **BLE->APP:** 55 aa 0f 00 08 00 00 00 30<span style="color: red;"> 03 00 00 00 03</span> c8 (成功) 静态WiFi(不支持dns,待修改):ssid:Vguang_RJ password:vguangrj_o0 dhcp:0 IP:10.102.106.47 net mask:255.255.255.0 gateway:10.102.106.124 > **APP->BLE:** 55aa0f 3600 000030 <span style="color: red;">03 2f00 010100 060100 070c 0a666a2f ffffff00 0a666a7c 0209566775616e675f524a 030b766775616e67726a5f6f30060100f7 </span> f6 > **BLE->APP:** 55 aa 0f 00 08 00 00 00 30 <span style="color: red;">03 00 00 00 03 </span> c8(成功) > 查询: > **APP->BLE:** 55aa0f0700000030 <span style="color: red;">03000003</span>c7 > **BLE->APP:** 55 aa 0f 00 3e 00 00 00 30 <span style="color: red;">03 00 36 00 01 01 00 02 0a 56 67 75 61 6e 67 5f 52 4a 00 03 0c 76 67 75 61 6e 67 72 6a 5f 6f 30 00 06 01 00 07 14 0a 66 6a 2f ff ff ff 00 0a 66 6a 7c 00 00 00 00 00 00 00 00 f5 </span> fe (成功) ## 2.4 0x04:设备配置MQTT 说明:此指令用于设备的MQTT配置 SubDLen = 0时,表示获取 APP -> BLE(Send) | 项目 | 字节 | 说明 | | ---- | ---- | ---- | | 包头 | N Byte | [命令头说明](#14-特殊命令头说明) | | 命令字 | 1 Byte | 0x04 | | 数据域长度 | 2 Byte | N | | 数据域 | N Byte | <a href="#MQTTTLV数据">TLV数据</a> | | 校验字 | 1 Byte | BCC | BLE -> APP(Receive) | 项目 | 字节 | 说明 | | ---- | ---- | ---- | | 包头 | N Byte | [命令头说明](#14-特殊命令头说明) | | 命令字 | 1 Byte | 0x04 | | 标识字 | 1 Byte | 0x00 : 成功<br> <a href="#附录1">非0 : 参见附录1</a> | | 数据域长度 | 2 Byte | N | | 数据域 | N Byte | <a href="#MQTTTLV数据">TLV数据</a> | | 校验字 | 1 Byte | BCC | <span id="MQTTTLV数据"></span> - **TLV 数据** | T(1 Byte) | L (1 Byte) | V (L Byte) | 必填 | 说明 | | ---- | ---- | ---- | ---- | ---- | | 0x01 | N | Broker Address | 是 | MQTT 服务器 IP/URL | | 0x02 | 2 | Broker Port | 是 | MQTT 服务器端口,低位在前 | | 0x03 | N | Client ID | 否 | 客户端 ID | | 0x04 | N | User Name | 是 | 用户名 | | 0x05 | N | Password | 是 | 用户密码 | | 0x06 | 1 | Qos[0\1\2] | 是 | Qos | 指令示例 > 配置MQTT: Broker Address:101.200.139.97 Broker Port:51883 Client ID:123456 User Name:admin Password:password Qos:0 Keep-Alive Perio:60 TLS:0 > **APP->BLE:** 55 AA 0F 3E00 000030 <span style="color: red;">04 3700 010E3130312E3230302E3133392E3937 0202ABCA 0306313233343536 040561646D696E 050870617373776F7264 060100 07023C00 080100 0D</span> FE > **BLE->APP:** 55 AA 0F 00 0800 000030 <span style="color: red;">04 00 0000 04</span> C8 (成功) ## 2.6 0x06:设备远程控制 说明:此指令用于设备的远程开门,指令值为 0x02。 V<sub>req</sub>中V<sub>sub</sub>的格式,支持的TLV: <span id="DEV_CONTROL_TLV数据"></span> - **TLV 数据** | T(1 Byte) | L (1 Byte) | V (L Byte) | 必填 | 说明 | | ---- | ---- | ---- | ---- | ---- | | 0x01 | 1 | 1 (开锁)<br>| 否 | 控制类型 | 指令示例 > 远程开锁: > **APP->BLE:** 55 AA 0F 0A00 000030 <span style="color: red;">06 0300 010101 04</span> CA > **BLE->APP:** 55 AA 0F 00 0800 000030 <span style="color: red;">06 00 0000 06</span> C8 (成功) ## 2.7 0x07:设备配置\配置查询 说明:此指令用于设备配置\配置查询 V<sub>req</sub>中V<sub>sub</sub>的格式,支持的TLV: <span id="DEV_CONDFIG_TLV数据"></span> - **TLV 数据** | T(1 Byte) | L (1 Byte) | V (L Byte) | 必填 | 说明 | | ---- | ---- | ---- | ---- | ---- | | 0x01 | 0Byte/6Bytes | N = 0:查询 SN<br>N > 6:设置 SN | 否 | 设备 SN | | 0x05(不支持) | 0Byte/1Bytes | N = 0:查询触摸是否启用<br>0x00:键盘禁用<br>0x01:键盘启用 | 否 | 键盘开关 | | 0x06 | 5Bytes | 时间配置(时间戳)eg: 00C7A56500 (0x0065A5C700 2024-01-16 08:00:00 (1705363200)) | 否 | 时间配置(时间戳) | | 0x07 | 1Bytes | 时区配置(有符号整型范围[-24, +24])eg:0xF8:-8,0x08:+8,0xF0:-16,0x10:+16 | 否 | 时区配置 | | 0x0d | 1Bytes | | 否 | 0: 正序卡号,1: 反序卡号 | | 0x0E | 16Bytes | | 否 | 设备秘钥 | | 0x14 | 1Bytes | 0x01:开启, 0x00:关闭 | 否 | 报警开关 | | 0x16| 1Bytes | 0x01:开启, 0x00:关闭 | 否 | 防拆报警开关 | 指令示例 > 设置SN:"abcdef" > **APP->BLE:** 55 AA 0F 0F00 000030 <span style="color: red;">07 0800 0106616263646566 0F</span> CF > **BLE->APP:** 55 AA 0F 00 1000 000030 <span style="color: red;">07 00 0800 0106616263646566 0F</span> D0 > 查询SN: > **APP->BLE:** 55 AA 0F 0900 000030 <span style="color: red;">07 0200 0100 04</span> C9 > **BLE->APP:** 55 AA 0F 00 1000 000030 <span style="color: red;">07 00 0800 0106616263646566 0F</span> D0 <span id=设备新秘钥></span> <span style="color: red;">设备配置新秘钥</span> > 示例: > 旧秘钥:{0x01,0x23,0x45,0x67,0x89,0x01,0x23,0x45,0x67,0x89,0x01,0x23,0x45,0x67,0x89,0x01} > 新秘钥:{0xab,0xcd,0xef,0xab,0xcd,0xef,0xab,0xcd,0xef,0xab,0xcd,0xef,0xab,0xcd,0xef,0xab} > 配置0x0f对应的V=AES_128_Encryption(新秘钥(input), 旧秘钥(key));={0x2d,0xbd,0xcf,0x47,0xff,0x58,0x36,0x24,0xf9,0x4a,0x7d,0x84,0x5e,0x0f,0x4d,0x29} > 配置值:{0x2d,0xbd,0xcf,0x47,0xff,0x58,0x36,0x24,0xf9,0x4a,0x7d,0x84,0x5e,0x0f,0x4d,0x29} > **APP->BLE:** 55 AA 0F 0F00 000030 <span style="color: red;">07 1200 0f102dbdcf47ff583624f94a7d845e0f4d29 D8</span> CF > **BLE->APP:** 55 AA 0F 00 1000 000030 <span style="color: red;">07 00 1200 0f102dbdcf47ff583624f94a7d845e0f4d29 D8</span> D0 ## 2.8 0x10:添加白名单 说明:此指令用于添加白名单 APP -> BLE(Send) | 项目 | 字节 | 说明 | | ---- | ---- | ---- | | 包头 | N Byte | [命令头说明](#14-特殊命令头说明) | | 命令字 | 1 Byte | 0x10 | | 数据域长度 | 2 Byte | N | | 数据域 | N Byte | <a href="#白名单字节序">单条白名单</a> | | 校验字 | 1 Byte | BCC | BLE -> APP(Receive) | 项目 | 字节 | 说明 | | ---- | ---- | ---- | | 包头 | N Byte | [命令头说明](#14-特殊命令头说明) | | 命令字 | 1 Byte | 0x10 | | 标识字 | 1 Byte | 0x00 : 成功<br> <a href="#附录1">非0 : 参见附录1</a>| | 数据域长度 | 2 Byte | N | | 数据域 | 0 Byte | - | | 校验字 | 1 Byte | BCC | <span id=白名单字节序></span> ### 白名单字节序 |字段| 偏移量| 长度 |说明| |:-----------------:|:---:|:-------:|:-------:| |[生效时间](#生效时间) | 0 | 5Bytes | 说明 | |[失效时间](#失效时间) | 5 | 5Bytes | | |[时段1](#时段1) | 10 | 6Bytes | | |[时段2](#时段2) | 16 | 6Bytes | | |[时段3](#时段3) | 22 | 6Bytes | | |[时段使能](#循环使能) | 23 | 1Bytes | | |[凭证类型](#凭证类型) | 24 | 1Bytes | | |[凭证来源](#凭证来源) | 25 | 1Bytes | 0| |[凭证长度](#凭证长度) | 26 | 1Bytes | | |[凭证](#凭证) | 27 | -Bytes | 长度最大48 Bytes | |[标签(用户名)长度](#标签(用户名)长度) | - | 1Bytes | | |[标签(用户名)](#标签(用户名)) | - | -Bytes | 长度最大16 Bytes | - 示例: 00C7A56500 004C886700 2A 807000907E00 B09A00C0A800 20FD00300B01 0000 03 02 00 0A 31323334353637383930 06 E5BCA0E4B889 <span id=生效时间></span> ### 生效时间 - 生效时间 00C7A56500 (0x0065A5C700 2024-01-16 08:00:00 (1705363200)) 时间戳,单位秒。低位在前. 生效时间=0表示任意生效时间 <span id=失效时间></span> ### 失效时间 - 失效时间 004C886700 (0x0067884C00 2025-01-16 08:00:00 (1736985600)) 时间戳,单位秒。低位在前. 失效时间=0表示任意失效时间 <span id=时段1></span> ### 时段1 - 时段1 80700020FD00 (08:00:00 - 09:00:00) 3Bytes开始时间+3Bytes结束时间 时间范围 0~86400 时间为00:00:00 到 某时间的秒数,eg:08:00:00=28800=0x007080 开始时间=0表示任意开始时间, 结束时间=0表示任意结束时间 <span id=时段2></span> ### 时段2 - 时段2 B09A00C0A800 (11:00:00 - 12:00:00) 3Bytes开始时间+3Bytes结束时间 时间范围 0~86400 时间为00:00:00 到 某时间的秒数,eg:12:00:00=43200=0x00A8C0 开始时间=0表示任意开始时间, 结束时间=0表示任意结束时间 <span id=时段3></span> ### 时段3 - 时段3 20FD00300B01 (18:00:00 - 19:00:00) 3Bytes开始时间+3Bytes结束时间 时间范围 0~86400 时间为00:00:00 到 某时间的秒数,eg:19:00:00=68400=0x010B30 开始时间=0表示任意开始时间, 结束时间=0表示任意结束时间 <span id=时段使能></span> ### 时段使能 |BIT7|BIT6|BIT5|BIT4|BIT3|BIT2|BIT1|BIT0| |:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:| |x|x|x|z|时段3|时段2|时段1|x| - 时段使能 03 (00000011b) (是能周权限和时段1) 示例代表仅 周1、3、5的8点到9点有权限 循环使能=0表示不启用时间控制 <span id=凭证类型></span> ### 凭证类型 |凭证类型|密码|IC卡|蓝牙|指纹|ID卡| |:----:|:----:|:----:|:----:|:----:|:----:| |编号|0x00|0x01|0x02|0x03|0x04| - 凭证类型 02 蓝牙凭证 <span id=凭证来源></span> ### 凭证来源 - 凭证来源 00 表示上位机指令携带凭证(白名单长度=34+凭证长度+用户名长度) <span id=凭证长度></span> ### 凭证长度 - 凭证长度 0A 凭证长度为0x0A=10 凭证长度最大值为 0x30=48 <span id=凭证></span> ### 凭证 - 凭证 31323334353637383930 凭证31323334353637383930=“1234567890” 凭证最大长度支持 0x30=48 字符 <span id=标签(用户名)长度></span> ### 标签(用户名)长度 - 标签(用户名)长度 06 标签(用户名)长度为0x06=6 标签(用户名)长度最大值为 0x10=16 <span id=标签(用户名)></span> ### 标签(用户名) - 标签(用户名) E5BCA0E4B889 标签(用户名):张三(utf8编码:E5BCA0E4B889) 标签(用户名)最大长度支持 0x10=16 字符 指令示例 > 添加白名单:生效时间:2024/10/19 14:41:50(unix时间戳: 1729320110),失效时间:2025/11/12 0:00:00 (unix时间戳:1762876800) 使能时段1 时段1:07:00:00 - 11:00:00 凭证类型:密码,凭证来源:协议下发,凭证:123457 ,tag:test > **APP->BLE:** 55aa0f 3200 000030 <span style="color: red;">10 2b00 ae54136700 805d136900 706200 b09a00 ffffffffffffffffffffffff 02 000106313233343537 04746573743b</span>f2 > **BLE->APP:** 55aa0f 00 1000 000030 10 00 0800 0006313233343537 18 d0 ## 2.9 0x11:删除白名单 说明:此指令用于删除白名单 APP -> BLE(Send) | 项目 | 字节 | 说明 | | ---- | ---- | ---- | | 包头 | N Byte | [命令头说明](#14-特殊命令头说明) | | 命令字 | 1 Byte | 0x11 | | 数据域长度 | 2 Byte | N | | 数据域 | N Byte | <a href="#凭证类型">凭证类型(1byte)</a>+凭证长度n(1byte)+凭证(n bytes) | | 校验字 | 1 Byte | BCC | BLE -> APP(Receive) | 项目 | 字节 | 说明 | | ---- | ---- | ---- | | 包头 | N Byte | [命令头说明](#14-特殊命令头说明) | | 命令字 | 1 Byte | 0x11 | | 标识字 | 1 Byte | 0x00 : 成功<br> <a href="#附录1">非0 : 参见附录1</a> | | 数据域长度 | 2 Byte | N | | 数据域 | 0 Byte | - | | 校验字 | 1 Byte | BCC | 指令示例 > 删除白名单:凭证类型:密码,凭证:"123457" > **APP->BLE:** 55aa0f 0f00 000030 <span style="color: red;">11 0800 00 06 313233343537 19</span> cf > **BLE->APP:** 55aa 0f 00 1000 000030<span style="color: red;">11 00 0800 0006313233343537 19</span> d0 ## 2.10 0x13:查询白名单(不支持) 说明:此指令用于查询白名单 V<sub>req</sub>中V<sub>sub</sub>的格式: <table> <tr> <th style="background-color: lightyellow;" rowspan="2">V<sub>sub</sub> </th> <th style="background-color: lightgreen;">凭证类型</th> <th style="background-color: lightgreen;">凭证长度</th> <th >凭证</th> </tr> <tr> <td style="background-color: lightgreen;">xx</td> <td style="background-color: lightgreen;">xx</td> <td >xxxxxxxxx</td></td> </tr> </table> V<sub>ack</sub>V<sub>sub</sub>的格式: <table> <tr> <th style="background-color: lightyellow;" rowspan="2">V<sub>sub</sub> </th> <th style="background-color: lightblue;">单条白名单</th> </tr> <tr> <td style="background-color: lightblue;"><a href="#白名单字节序">单条白名单</a></td> </tr> </table> 指令示例 > 查询白名单:凭证类型:蓝牙凭证,凭证:1234567890 > **APP->BLE:** 55 AA 0F 1500 000030 <span style="color: red;">13 0E00 0000 020A31323334353637383930 14</span> D5 > **BLE->APP:** 55 AA 0F 00 4000 000030 <span style="color: red;">13 00 3800 01000100 00C7A5650000 4C8867002A80 7000907E00B0 9A00C0A80020 FD00300B0100 00000200 0A31323334353637383930 06E5BCA0E4B889 3D</span> 80 ## 2.12 CMDsub=0x14:查询通行记录 说明:此指令用于查询通行记录 V<sub>req</sub>中V<sub>sub</sub>的格式: <table> <tr> <th style="background-color: lightyellow;" rowspan="2">V<sub>sub</sub> </th> <th style="background-color: lightgreen;">任务标志</th> <th style="background-color: lightgreen;">起始块号(2Byte)</th> </tr> <tr> <td style="background-color: lightgreen;">0:任务中; 1:任务结束</td> <td style="background-color: lightgreen;"></td> </tr> </table> V<sub>ack</sub>V<sub>sub</sub>的格式: <table> <tr> <th style="background-color: lightyellow;" rowspan="2">V<sub>sub</sub> </th> <th style="background-color: lightblue;">通行记录总数</th> <th style="background-color: lightblue;">下一块号(2Byte)</th> <th style="background-color: lightblue;">TLV</th> <th style="background-color: lightblue;">TLV</th> <th style="background-color: lightblue;">....</th> </tr> <tr> <th style="background-color: lightblue;"></th> <th style="background-color: lightblue;"></th> <th style="background-color: lightblue;">0xFE + L + <a href="#通行记录字节序">通行记录</a></th> <th style="background-color: lightblue;">0xFE + L + <a href="#通行记录字节序">通行记录</a></th> <td style="background-color: lightblue;">...</td> </tr> </table> >任务标志的作用:由于s430支持mqtt主动上报通行记录,防止蓝牙查询期间,通行记录的重复上报,任务标志为0时,设备将停止主动上报, 直到任务结束 > > > 查询所有记录的逻辑: 起始块号(第一次为0xFFFFF (-1) ) = 上一个查询中的下一块号,以此构成循环查询,直到下一块号为0xFFFF, 循环结束(此时不用发送任务结束标志的请求) ## 2.13 CMDsub=0x15:删除通行记录 说明:此指令用于清空通行记录 V<sub>req</sub>中V<sub>sub</sub>为空: 指令示例 > 清空通行记录:(当前只支持清空) > 起始块号:0, 结束块号: 0xffff > **APP->Device:** 55aa 0f 0900 000030<span style="color: red;">01 0200 0100 02</span> c9 > **Device->APP:** 55aa 0f 00 0b00 000030 <span style="color: red;">01 00 0300 0101 00 02 </span> cb (状态为00) > > > 结合"查询通行记录" 分批删除: > # 三、 固件更新 使用[微光通信协议V3.x](http://wiki.koodle.cn:10086/doc/6/)固件升级指令 ## 3.1 0x59: 使设备进入升级模式 指令示例 > 获取设备状态: > **APP->Device:** 55aa 0f 0900 000030<span style="color: red;">01 0200 0100 02</span> c9 > **Device->APP:** 55aa 0f 00 0b00 000030 <span style="color: red;">01 00 0300 0101 00 02 </span> cb (状态为00) 2.进入升级模式 > **APP->Device:** 55aa590500<span style="color: red;">0000000000</span> a3 > **BLE->APP:** 55 aa 59 00 0000 a6 (成功) 然后等待设备重启(可通过监控此设备的广播数据中,设备状态描述) > 在升级模式中,发送获取设备状态的请求 > **APP->Device:** 55aa 0f 0900 000030<span style="color: red;">01 0200 0100 02</span> c9 > **Device->APP:** 55 aa 0f 00 0b00 000030 <span style="color: red;">01 01 00 0300 0101ae ac</span> cb (状态为ae) ## 3.1 固件包发送流程 1. 发送固件包大小 > **APP->BLE:** 55aa54 0400 <span style="color: red;">00360200</span> 9b > **BLE->APP:** 55 AA 0F 00 2A00 000030 <span style="color: red;">A0 00 2200 010100 020100 030436120000 0410BD86E9317897FD1F0194834B52370808 05022500 40</span> EA (成功) 2. 使用0x58指令分包发送固件包(注意蓝牙通道的MTU,指令包的大小不能大于 MTU - 10) > 固件包必须分块发送,s430支持的块是512. 发送一块的逻辑举例: > packSendLen = MTU - 15 > read(firmwareFile, buffer, 512) //读取一块 > send(buffer, packSendLen) sum += packSendLen > send(buffer + sum, packSendLen) sum += packSendLen > ....... > send(buffer + sum, 512 - sum) >> **APP->BLE:** 55 AA 0F 2500 000030 <span style="color: red;">A0 1E00 010100 020103 030436120000 0410BD86E9317897FD1F0194834B52370808 5F</span> E5 > **BLE->APP:** 55 AA 0F 00 2A00 000030 <span style="color: red;">A0 00 2200 010100 020100 030436120000 0410BD86E9317897FD1F0194834B52370808 05022500 41</span> EA (成功) # 五、设备恢复 ## 5.1 0xB0:恢复出厂设置 说明:此指令用于设备恢复出厂设置 APP -> BLE(Send) | 项目 | 字节 | 说明 | | ---- | ---- | ---- | | 包头 | N Byte | [命令头说明](#14-特殊命令头说明) | | 命令字 | 1 Byte | 0xB0 | | 数据域长度 | 2 Byte | N | | 数据域 | N Byte | <a href="#设备配置恢复出厂设置">TLV数据</a> | | 校验字 | 1 Byte | BCC | BLE -> APP(Receive) | 项目 | 字节 | 说明 | | ---- | ---- | ---- | | 包头 | N Byte | [命令头说明](#14-特殊命令头说明) | | 命令字 | 1 Byte | 0xB0 | | 标识字 | 1 Byte | 0x00 : 成功<br> <a href="#附录1">非0 : 参见附录1</a> | | 数据域长度 | 2 Byte | N | | 数据域 | 0 Byte | - | | 校验字 | 1 Byte | BCC | <span id="绑定TLV数据"></span> - **TLV 数据** | T(1 Byte) | L (1 Byte) | V (L Byte) | 必填 | 说明 | | ---- | ---- | ---- | ---- | ---- | | 0x01 | 1 | 0x01:设备配置恢复出厂设置<br> 0x02:设备重启 | 是 | 设备配置恢复出厂设置会触发设备重启 | | 0x02 | 6 | 313233343536 ("123456") | 是 | 设备 SN | 指令示例> 设备配置恢复出厂设置: > **APP->BLE:** 55AA 0F 1200 000030 <span style="color: red;">b0 0B00 010101 0206313233343536 B9</span> D2 > **BLE->APP:** 55AA 0F 00 1300 000030 <span style="color: red;">b0 00 0B00 010101 0206313233343536 B9</span> D3 (成功) > **BLE->APP:** 55AA 0F 00 0800 000030 <span style="color: red;">b0 01 0000 B1</span> c8 (失败) <span id=附录1></span> # 附录1 标识字2 | 状态码 | 说明 | |:----:|:----:| |0x00|正常状态| |0x01|绑定失败| |0x04|指令未支持| |0x0A|内存不足| |0x0C|校准失败| |0x0C|SN设置失败| |0x0F|无效的数据| |0x10|flash操作失败| |0x11|白名单已经存在| |0x12|白名单已满| |0x13|白名单不存在| |0x30|设备忙| |0x31|禁止操作| |0xFF|失败| <span id=附录2></span> # 附录2 通行凭证校验错误码 |结果|说明| |:-------:|:-------------:| | 0x00 | 成功| | 0x01 | 未在白名单| | 0x02 | 未在白名单白名单有效期内| | 0x06 | 不在权限时段内| | 0xFF | 未知错误| <span id=附录3></span> # 附录3 - 通行记录字节序 <span id=通行记录字节序></span> |字段| 偏移量| 长度 |说明| |:-----------------:|:---:|:-------:|:-------:| |[凭证类型](#凭证类型) | 0 | 1Bytes | 说明 | |[凭证长度](#凭证长度) | 1 | 1Bytes | 说明 | |[凭证](#凭证) | 2 | -Bytes | 说明 | |[标签(用户名)长度](#标签(用户名)长度) | - | 1Bytes | 说明 | |[标签(用户名)](#标签(用户名)) | - | -Bytes | 说明 | |[通行时间](#通行时间) | - | 5Bytes | 说明 | |[通行结果](#附录2) | - | 1Bytes | 说明 | <span id=附录4></span> # 附录3 - 网络状态码 | 状态码 | 说明 | |:----:|:----:| |0x00|未开启| |0x01|启动中| |0x02|启动成功| |0x03|连接中| |0x05已连接到AP| |0x6|连接mqtt服务中| |0x7|连接mqtt服务|
石磊
2026年8月25日 16:13
8
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
Markdown文件
Word文件
PDF文档
PDF文档(打印)
分享
链接
类型
密码
更新密码
有效期