HarmonyOS GattClientDevice.connect出现Error: BussinessError 2900099: Operation failed错误

操作步骤:

1、

let gattClientDevice = ble.createGattClientDevice(mac) 
  • 1.

2、

gattClientDevice.on('BLEConnectionStateChange', this.connectStateChangeCallback) 
  • 1.

3、this.gattClientDevice.connect()调用connect之后出现就报Error: BussinessError 2900099: Operation failed错误,重新扫描设备再走connect流程就可以正常连接,怀疑是不是蓝牙缓存的问题。

HarmonyOS
2024-12-23 16:55:40
3175浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
zbw_apple

使用的mac地址不是真实的mac地址,而是扫描方法回调的mac,设备未配对时,每次扫描的mac都会变化,所以所有蓝牙流程都要基于前置扫描方案实现。

分享
微博
QQ
微信
回复
2024-12-23 20:18:58


相关问题