File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -172,12 +172,25 @@ sequenceDiagram
172172
173173### 2.2 设备识别
174174
175- ** 设备名称规则** : 设备名称应匹配以下模式之一 :
175+ ** 设备名称规则** : 设备名称name应匹配以下模式之一 :
176176
177177- ` DTXZ* `
178178- ` BLUFI_DEVICE* `
179179- ` ESP_* `
180180
181+ ** 设备MAC地址获取** : 设备在广播时发送,客户端与设备连接前获取:
182+
183+ 1 . 通常可以直接通过广播发现设备时的数据包的deviceId获取
184+ 2 . 由于一些[ 安全机制] ( https://developers.weixin.qq.com/miniprogram/dev/framework/device/bluetooth.html ) ,IOS不适用第一条(无法正常获取设备MAC地址)
185+
186+ 解决方案:约定将设备MAC地址设置在` localName ` 中,参考[ 微信小程序文档] ( https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.onBluetoothDeviceFound.html )
187+
188+ mac地址格式可以是
189+ - AA:BB:CC:DD:EE: FF
190+ - AA-BB-CC-DD-EE-FF
191+ - AABBCCDDEEFF
192+ 满足正则` /[0-9A-Fa-f]{2}([-:]?)[0-9A-Fa-f]{2}(?:\1[0-9A-Fa-f]{2}){4}$/ ` 即可,建议直接使用第一种,设备与智能体绑定所使用的mac地址格式也为第一种。
193+
181194** 连接模式** :
182195
183196- 设备作为外围设备(Peripheral)进行广播
You can’t perform that action at this time.
0 commit comments