This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

calling sd_ble_gap_disconnect () from function ble_evt_handler()

Dear Sir,

I am calling the function sd_ble_gap_disconnect() to disconnect the peripheral  from the App.

This is called inside  ble_evt_handler() function and under 

switch (p_ble_evt->header.evt_id)
    {
        case BLE_GAP_EVT_CONNECTED:

 Under the case statement  BLE_GAP_EVT_CONNECTED: I am calling a  function which in turn calls  sd_ble_gap_disconnect().

I was using nRFCOnnect to test the working.

When the connect - disconnect happens I am getting the following error from the App.

Do I need to take care of anything while calling  sd_ble_gap_disconnect() after establishing connection.

Or the fix for this to be done on the App side?

In the peripheral side I checked the error codes and all of them returns NRF_SUCCESS only.

Thanking you in advance.

with regards,

Geetha

Parents Reply
  • Hi haakonsh,

    Thank you for your reply. I am very happy to hear from you.

    Yes what you told is correct.

    For the initial 45secs/60 secs I will do a looping. where the device will connect and disconnect. It is the behaviour I am expecting. THis is done to know about the phones who are all trying to connect to the device.The connect-disconnect pattern is repeated for this purpose.

    But my question is about the error coming on App. i.e. the GATT-ERROR 133 . Is that something expected?.

    Do I need to worry about this error on App side?

    Or something to be done on App side to fix this, like i mentioned.

    "Or is it to be fixed on the App side?( On the peripheral side none of the APIs return errors)(like this....  https://github.com/NordicSemiconductor/Android-nRF-Toolbox/issues/9)?"( Because none of the API returns an error on peripheral side).

    Please share your valuable suggestions.

    with regards,

    Geetha

Children
Related