小程序蓝牙控制设备
小程序低功耗蓝牙控制设备
小程序控制蓝牙的过程&api
初始化蓝牙适配器wx,openBluetoothAdapter()
获取本机蓝牙链接状态wx.getBluetoothAdapterState()
开启搜索蓝牙wx.startBluetoothDevicesDiscovery()
获取所有蓝牙列表wx.getBluetoothDevices()
根据蓝牙列表匹配自己需要的广播蓝牙(厂商会给自己的设备规则),获取广播数据
把上一步匹配的到的蓝牙设备,进行连接wx.createBLEConnec
原创
2022-02-07 15:04:33 ·
2973 阅读 ·
0 评论