微信小程序低功耗蓝牙获取设备MAC地址(非UUID)
onBluetoothDeviceFound() { wx.onBluetoothDeviceFound((res) = { res.devices.forEach(device = { if (!device.name && !device.localName) { return } const foundDevices = this.data.devices const idx = inArray(foundDevices, 'deviceId', device.deviceId) const data = {} device.macAddr = ab2hex(device.advertisData) if (idx === -1) { data[`devices[${foundDevices.length}]`] = device } else { data[`devices[${idx}]`] = device } this.setData(data) }) }) }
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。

