android ble 连接请求,每个连接请求都被视为直接连接请求android ble

我们正在编写一个可以与我们想要连接的外围设备建立持久连接的应用程序.出于同样的目的,我们希望在松开现有连接时重新连接外围设备.所以我们的android应用程序作为一个中心只是尝试通过调用bluetoothdevice.connectgatt与autoconnect为true来创建新的bluetoothgatt对象来重新连接.

但每当我们尝试这样做时,我们的重新连接就会失败

12-02 21:47:11.865: D/BluetoothGatt(31963): onClientConnectionState() - status=133 clientIf=6 device=******** callback.

因为我们的连接请求被视为nexus 5棒棒糖的直接连接请求

这是日志

12-03 11:46:12.804: D/BluetoothGatt(6902): connect() - device: 58:EB:14:3D:2A:38, auto: true

12-03 11:46:12.804: D/BluetoothGatt(6902): registerApp()

12-03 11:46:12.804: D/BluetoothGatt(6902): registerApp() - UUID=b8f9298b-4a95-41be-80d6-22d82c498c5c

12-03 11:46:12.807: D/BtGatt.GattService(31817): registerClient() - UUID=b8f9298b-4a95-41be-80d6-22d82c498c5c

12-03 11:46:12.808: D/BtGatt.GattService(31817): onClientRegistered() - UUID=b8f9298b-4a95-41be-80d6-22d82c498c5c, clientIf=6

12-03 11:46:12.808: D/BluetoothGatt(6902): onClientRegistered() - status=0 clientIf=6

12-03 11:46:12.808: D/BtGatt.GattService(31817): clientConnect() - address=58:EB:14:3D:2A:38, isDirect=true

12-03 11:46:12.809: D/BtGatt.btif(31817): btif_get_device_type: Device [58:eb:14:3d:2a:38] type 2, addr. type 0

12-03 11:46:12.811: D/BLEManager(6902): Trying to create a new connection.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值