4 Replies Latest reply on Sep 7, 2016 12:04 AM by AnjanaM_61




      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 

        • 1. Re: Disconnect

          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.

          • 2. Re: Disconnect

            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....

            • 3. Re: Disconnect

              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..

              • 4. Re: Disconnect



                Please use the below code for sending disconnect request:


                if(CyBle_GetState() == CYBLE_STATE_CONNECTED)




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