Cy_BLE_GAP_Disconnect only works with some disconnect reasons

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
user_1669321
Level 5
Level 5
100 replies posted 50 replies posted 25 replies posted

Hi,

I'm trying to do a routine to clear the bonded device list after disconnecting from a peer device if there is an active connection. I haven't tried all error codes from section 2D of the Bluetooth Spec 4.2 for the disconnect reason, but among the codes I've tried, only 0x14 (Remote Device Terminated Connection due to Low Resources) and 0x15 (Remote Device Terminated Connection due to Power Off) work.

The error code I'd like to use is 0x16 (Connection Terminated By Local Host). The function returns CY_BLE_SUCCESS, so I'm assuming it accepts any error code, but my connection in CySmart doesn't get disconnected unless I use the codes 0x14 or 0x15. Is there a check for the error code in the function?

Thank you,

Fred

0 Likes
1 Solution
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello Fred,

Please refer to Bluetooth Specification Core_v5.0, Volume 2, Part E, Section 7.1.6 for the acceptable reason codes which can be sent along with the HCI_disconnect command. For these reason codes only disconnection is processed in the stack.
The CY_BLE_EVT_GAP_DEVICE_DISCONNECTED event indicates the device has disconnected from the remote device and the parameter of type struct cy_stc_ble_gap_disconnect_param_t will give the reason of disconnection.

Please let me know if you have any questions.

Thanks,

P Yugandhar.

View solution in original post

0 Likes
2 Replies
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello Fred,

I'm also replicating the problem, in the API Cy_Ble_Gap_Disconnect() if I give the disconnect reason 0x16(connection terminated by local host) connection in CySmart doesn't get disconnected. We have forwarded your query to our product development team, who will evaluate your query. 

Thank you for your interest in Cypress products

Thanks,

P Yugandhar.

0 Likes
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello Fred,

Please refer to Bluetooth Specification Core_v5.0, Volume 2, Part E, Section 7.1.6 for the acceptable reason codes which can be sent along with the HCI_disconnect command. For these reason codes only disconnection is processed in the stack.
The CY_BLE_EVT_GAP_DEVICE_DISCONNECTED event indicates the device has disconnected from the remote device and the parameter of type struct cy_stc_ble_gap_disconnect_param_t will give the reason of disconnection.

Please let me know if you have any questions.

Thanks,

P Yugandhar.

0 Likes