android - 蓝牙低功耗 (BLE) 设备与华为手机的连接问题

标签 android bluetooth bluetooth-lowenergy android-bluetooth huawei-mobile-services

<分区>

我们有一个应用程序使用低功耗蓝牙 (BLE) 技术与硬件设备(例如 Activity 跟踪器)进行通信。

所有支持 BLE 的手机都可以通信,但是当我们尝试将跟踪器连接到华为手机时,它根本无法工作。

流程如下:

  • Activity 跟踪器的应用搜索
  • 当应用程序找到跟踪器时,它会调用蓝牙 Gatt 服务的连接方法。
  • 跟踪器应该连接成功,它应该在状态 0 和状态 2(成功)的“OnConnectionStateChanged()”方法中给出响应 .但问题是,它没有成功连接到跟踪器。当应用程序发起连接调用时,它会立即给出状态为 133(蓝牙 Gatt 失败)的断开连接回调。

以下是显示问题的日志:

I/Bluetooth: BtGatt.GattService:onConnected() - clientIf=6, connId=0, address=E6:4F:92:69:B7:95
I/Bluetooth: BluetoothProfileService:isAvailable(), mStartError=false, mCleaningUp=false
BluetoothGatt Check Status and NewState: 133|0
I/Bluetooth: BtGatt.GattService:clientDisconnect() - address=E6:4F:92:69:B7:95, connId=null

我们还使用“nRF Connect”应用程序进行了测试,在此应用程序中,它也提供状态为 133(蓝牙 Gatt 故障)的断开连接回调。请找到随附的屏幕截图。

enter image description here

如果有人遇到同样的情况,你能帮帮我们吗?

最佳答案

华为手机因 BLE 设备的蓝牙错误而臭名昭著。 Garmin、FitBit 和诺基亚/Withings Activity 追踪器也遇到同样的问题。在华为工程师的帮助下,Garmin 开发人员设法以某种方式解决了这个华为漏洞。 https://support.garmin.com/en-US/?faq=3qBFoCgeH428IUUfc0SpZ7

Fitbit 和 Withings 的工程师还没有抽出时间与华为商谈解决问题。客户端似乎需要做一些不同的事情(BT 握手期间的一些超时调整?忽略错误消息?)

特别是 P8Lite、P9Lite 和 P10Lite 在 Android 6.x 和 7.x 版本中遇到这个问题。可能是华为在这些 Android 版本中搞砸了。

关于android - 蓝牙低功耗 (BLE) 设备与华为手机的连接问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51203419/

相关文章:

ubuntu - hcitool lescan 在 ubuntu 上失败

Android In App Billing v3 - 错误的订阅试用期

android - 如何在 Android 上测试打瞌睡模式?

android - 如何通过蓝牙列出来自 Android 的远程文件?

iPhone 蓝牙 SDK - 发现 Android/Windows phone 7 设备和后台发现

android - 我们能否像监控信标(进入区域、退出区域)一样监控 BLE 服务?

bluetooth-lowenergy - 禁用 LE Set Scan Enable 命令的 "Filter duplicates"设置

android - 从 GeoPoints 创建 GPX 文件

android - Android:Imagebutton,onclick播放声音

c++ - 将特征用户描述添加到自定义 C++ BLE GATT 服务