Skip to main content
Version: 1.x

Taro.onBLEConnectionStateChange(CALLBACK)

使用方式同 wx.onBLEConnectionStateChange

示例代码#

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