上一篇 微信小程序蓝牙相关API
const Bluetooth = Bluetooth || {}
/**
* 蓝牙状态改变回调事件
*/
Bluetooth.onBluetoothAdapterStateChangeCallback = null
/**
* 搜索到新设备的事件的全部监听
*/
Bluetooth.onBluetoothDeviceFoundCallback = null
/**
* 蓝牙低功耗连接状态改变事件的监听
*/
Bluetooth.onBLEConnectionStateChangeCallback = null
/**
* 监听蓝牙低功耗设备的特征值变化事件。必须先调用 wx.notifyBLECharacteristicValueChange 接口才能接收到设备推送的 notification。
*/
Bluetooth.onBLECharacteristicValueChangeCallback = null;
/**
* 初始化蓝牙模块。iOS 上开启主机/从机(外围设备)模式时需分别调用一次,并指定对应的 mode。
*/
Bluetooth.openBluetoothAdapter = function(){
return new Promise((resolve, reject) => {