You are here

Disconnect | Cypress Semiconductor


Summary: 4 Replies, Latest post by Anjana Muralidharan on 07 Sep 2016 12:04 AM PDT
Verified Answers: 1
Last post
Log in to post new comments.
Phateee_1677816's picture
15 posts


can me somebody help?

I have problem with disconnecting:

I call the function: CyBle_GapDisconnect(connHandle_Server01.bdHandle);

and then I look at: CyBle_GetState() ,  the device is still CYBLE_STATE_CONNECTED.

When I recieve new data,  I want to terminate the connection....but this function doesnt work....


Thak you 


kwagjj_1632506's picture
12 posts

From BLE4.2 component datasheet this is what I get:

CYBLE_API_RESULT_TCyBle_GapDisconnect (uint8 bdHandle)
This function disconnects the peer device. It is to be used by the device in GAP Central mode and may be used
by a GAP Peripheral device to send a disconnect request. This is a non-blocking function. On disconnection, the
following events are generated, in order.


if your device is the peripheral, then maybe the problem could be the central which do not process the disconnect request sent from your device(the peripheral)?

If so, some suggestion would be to change the central device which you are testing with. For example, in my case I usually download the cysmart app in my android phone to act as the central. I think these apps would properly process any disconnect request.



Just guessing here.

Phateee_1677816's picture
15 posts

I try catch these events and these events arent start. I read the return value of  CyBle_GapDisconnect() and it is  CYBLE_ERROR_INVALID_PARAMETER....

kwagjj_1632506's picture
12 posts

again, the BLE component datasheet says that return value means

No device to be disconnected. The specified
device handle does not map to any device
entry in the BLE Stack.

I guess your input(peer device handle) is somehow corrupt or wrong. You'll have to dig in deeper..


Anjana Muralidharan's picture
Cypress Employee
33 posts


Please use the below code for sending disconnect request:



If you are still the issue is persisting, please share the project.



Log in to post new comments.