• Taro.onBLEConnectionStateChange(CALLBACK)
    • 示例代码

    Taro.onBLEConnectionStateChange(CALLBACK)

    使用方式同 wx.onBLEConnectionStateChange

    示例代码

    1. import Taro from '@tarojs/taro'
    2. Taro.onBLEConnectionStateChange(res => {
    3. // 该方法回调中可以用于处理连接意外断开等异常情况
    4. console.log(`device ${res.deviceId} state has changed, connected: ${res.connected}`)
    5. })