cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 6 MCU

zhji_4006061
New Contributor

我们基于CE222046_BLE_Throughput_Measurement 的demo程序调试蓝牙连接的时候,出现以下log:

[17:14:32.844] CY_BLE_EVT_GATT_CONNECT_IND: 0, 10

[17:14:32.854] CY_BLE_EVT_GAP_ENHANCE_CONN_COMPLETE

[17:14:32.854] Connected to Device xxxxx

[17:14:32.864]

[17:14:32.864]

[17:14:32.864] BDhandle : 0x10

[17:14:32.870] CY_BLE_EVT_DATA_LENGTH_CHANGE

[17:14:32.993] Setting PHY.[bdHandle 0x10]

[17:14:32.993] Updating the Phy.....

[17:14:33.000] SET PHY updated to 2 Mbps

[17:14:33.000] UPDATE PHY parameters

[17:14:33.189] ****** BLE   is busy ******

[17:14:33.381] CY_BLE_EVT_GAP_CONNECTION_UPDATE_COMPLETE

[17:14:33.542] CY_BLE_EVT_GATT_DISCONNECT_IND

[17:14:37.844] Disconnected.

[17:14:37.844]

收到CY_BLE_EVT_GAP_CONNECTION_UPDATE_COMPLETE 消息后,蓝牙连接就会断掉。我们用iphone手机没有这个问题,用andorid手机概率性出现这个问题.

这是什么原因呢?

0 Likes
Reply
8 Replies
zhji_4006061
New Contributor

iphone手机连接的时候没有CY_BLE_EVT_GAP_CONNECTION_UPDATE_COMPLETE这个消息

0 Likes
Reply
Owen_Zhang123
Moderator
Moderator

有可能是安卓手机不支持2M feature导致的。请在BLE component配置页面的Link Layer Settings中,将Enable LE 2 Mbps取消掉看是否可以正常连接。

0 Likes
Reply
zhji_4006061
New Contributor

把Enable LE 2 Mbps取消掉,也有同样的问题, log如下:

[16:23:47.155] Connected to Device XXXXX

[16:23:47.167]

[16:23:47.167]

[16:23:47.167] BDhandle : 0x10

[16:23:47.171] ****** BLE is busy ******

[16:23:47.196] CY_BLE_EVT_DATA_LENGTH_CHANGE

[16:23:47.297] Setting PHY.[bdHandle 0x10]

[16:23:47.302] Updating the Phy.....

[16:23:47.302] SET PHY Could not update to 2 Mbps

[16:23:47.302] CY_BLE_EVT_GAP_CONNECTION_UPDATE_COMPLETE

[16:23:47.746] CY_BLE_EVT_GATT_DISCONNECT_IND

[16:23:52.048] Disconnected.

[16:23:52.048]

[16:23:52.048] CY_BLE_EVT_GAP_DEVICE_DISCONNECTED 0

[16:23:52.058] CY_BLE_EVT_GAPP_UPDATE_ADV_SCAN_DATA_COMPLETE: 0

[16:23:52.058] CY_BLE_EVT_GAPP_ADVERTISEMENT_START_STOP: <Restart ADV>

[16:23:52.068] Advertising...

0 Likes
Reply
zhji_4006061
New Contributor

android手机端的log如下:

========================================

13:56:26.185 Connecting to 00:A0:50:F4:BA:89...

D 13:56:26.186 gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)

D 13:56:26.213 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2)

I 13:56:26.213 Connected to 00:A0:50:F4:BA:89

V 13:56:26.224 Discovering services...

D 13:56:26.224 gatt.discoverServices()

I 13:56:26.367 Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)

D 13:56:36.351 [Callback] Connection state changed with status: 8 and new state: DISCONNECTED (0)

E 13:56:36.351 Error 8 (0x8): GATT CONN TIMEOUT

I 13:56:36.351 Disconnected

D 13:56:36.368 [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED

D 13:56:40.611 [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED

D 13:56:40.611 gatt.close()

==========================================

手机端出现了 Error 8 (0x8): GATT CONN TIMEOUT 错误

0 Likes
Reply
Owen_Zhang123
Moderator
Moderator

手机端使用的什么app连接的?CySmart吗?

我这边测试没有出现问题。具体怎样复现问题?对demo程序不做修改可以复现问题吗?

0 Likes
Reply
zhji_4006061
New Contributor

手机端用的nRF Connect,  Ble 4.2/4.0 的手机容易出现这个问题。

我们在demo程序的基础上加了几个service,但应该不影响连接吧。

0 Likes
Reply
Owen_Zhang123
Moderator
Moderator

你不要修改demo,然后使用CYSmart测试下看是否还有问题?我这边没有复现你说的问题。

0 Likes
Reply
zhji_4006061
New Contributor

现在情况是:华为Android 7.0系统的手机不能正确调用,比如说华为Mate8,V8。表现的具体情况就是能连接上蓝牙设备,但是去发现服务时很难走 onServicesDiscovered 回调,有时候可以,有时候不可以,不稳定

0 Likes
Reply
Top labels