三星Galaxy S7上的connectGatt通过Bluetooth Classic而不是BLE创建连接 [英] connectGatt on Samsung Galaxy S7 creates connection over Bluetooth Classic instead of BLE

查看:109
本文介绍了三星Galaxy S7上的connectGatt通过Bluetooth Classic而不是BLE创建连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个运行GATT服务器的双模(BR/EDR + BLE)设备.该地址是公共的,并且与BLE和BD/EDR相同.
当我使用Android 6.0.1(API级别23)在Galaxy S7上调用connectGatt并将传输参数设置为"TRANSPORT_LE"时,手机仍然尝试通过BD/EDR建立连接.看起来问题似乎与BLE的公共地址有关,因为如果我将其设置为private,则连接将按预期通过BLE完成.

I have a dual-mode (BR/EDR + BLE) device running a GATT server. The address is public and same for BLE and BD/EDR.
When I call connectGatt on Galaxy S7 with Android 6.0.1 (API level 23) and set the transport parameter as "TRANSPORT_LE" the phone still tries to establish connection over BD/EDR. It looks like the problem is related to the public address of the BLE because if I set it to private the connection is done over BLE, as expected.

仅在Galaxy S7上观察到此问题,在其他手机(即Nexus 6P)上,始终可以通过BLE正确完成连接.

This problem was observed only on Galaxy S7, on other phones (i.e Nexus 6P) the connection is always correctly done over BLE.

这是Android的错误还是我遗漏了一些东西?

Is this an Android bug or am I missing something?

推荐答案

一个老问题,但没有得到回答...

An old question, but not answered...

您可能在GATT设备上的广告包上有错误的标志.另外,您的实现的经典"部分发送的EIR(扩展查询响应)数据包.

You might have wrong FLAGS on the Advertising packet on the GATT device. Additionally the EIR (Extended Inquiry Response) packet transmitted by the Classic part of your implementation.

在这两种情况下,都有一个标志"BR/EDR NOT SUPPORTED"可能对您有帮助.

There is a flag "BR/EDR NOT SUPPORTED" that might help you in both of these cases.

由于CSR提供的ADK代码中的默认设置,因此此问题在CSR芯片组上很常见.您是否有可能使用CSR芯片?您的问题可能不在android设备上?

This problem is common on the CSR chipsets, due to the default setup in the ADK code provided by CSR. Is there any chance you are using a CSR chip? your problem might not be on the android device?

这篇关于三星Galaxy S7上的connectGatt通过Bluetooth Classic而不是BLE创建连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆