I can't get BLE_GAP_EVT_DISCONNECTED event

Hi!

S132, SDK17.1, nRF52832

Very strange behavior, I connected my central to the bonded peripherial success and got an BLE_GAP_EVT_CONNECTED event, but when I disconnected peripherial, I didn't get BLE_GAP_EVT_DISCONNECTED  event.

On this project I got recently this event, but I just added some code and now I have this behavior.

What possible reason? What should I check?

Thanks.

Parents Reply
  • Hi! 
    Similar tickets- it is good. I used SDK7.2.0 In this ticket pointed that this known bug and fixed it it SDK 7.3.0

    I have tested with simple SDK and it works. I made project on central example. And It worked. But I added some code, in the config.h I have changed cmt of UUID services, changed memory size in Keil project and after that I can't receive this event.

    But event BLE_GAP_EVT_CONNECTED I got successfully. But WO BLE_GAP_EVT_DISCONNECTED  evnt.  

Children
  • Hi Tomas, 
    Changing UUID shouldn't be a problem, but changing memory size could be an issue. Could you show what you changed ? 
    Can you try changing step by step to see at which step you see the problem ? 

  • Hi Hung,

    I found out that when I got BLE_GAP_EVT_CONNECTED event, but in this event I didn't do 

                        //err_code = ble_db_discovery_start(&m_db_disc, p_ble_evt->evt.gap_evt.conn_handle);
                        //APP_ERROR_CHECK(err_code);

    all works properly. I gon an event BLE_GAP_EVT_DISCONNECTED like expected.

    But with this string

                        err_code = ble_db_discovery_start(&m_db_disc, p_ble_evt->evt.gap_evt.conn_handle);
                        APP_ERROR_CHECK(err_code);


    I didn't get any messages in the RTT like:
            case BLE_NUS_C_EVT_DISCOVERY_COMPLETE:
                NRF_LOG_INFO("Discovery complete.");

    And I din't get BLE_GAP_EVT_DISCONNECTED . 

    But before Keil's memories changed, it worked properly (also discovery nus_c worked).
    Now I have Keil's settings here:


    Seems, all services in the config.h are enabled. I don't know the reason of this behavior.

  • Hi ,
    If you comment out ble_db_discovery_start(&m_db_disc, p_ble_evt->evt.gap_evt.conn_handle);, then there will be no BLE_NUS_C_EVT_DISCOVERY_COMPLETE event. So it's as expected. 

    So you observed that you only see the issue after you change the memory configuration. What did you change and why you changed ? 
    Could yo

  •  BLE_NUS_C_EVT_DISCOVERY_COMPLETE event. So it's as expected. 

    Hi!

    After I commented:

    ble_db_discovery_start

    , ofcourse I didn't get event BLE_NUS_C_EVT_DISCOVERY_COMPLETE . 
    But I got event BLE_GAP_EVT_DISCONNECTED . And it seems works.

    But when I added again uncommented
    ble_db_discovery_start

    I can't get BLE_GAP_EVT_DISCONNECTED event and also there is no any event
    BLE_NUS_C_EVT_DISCOVERY_COMPLETE after I got BLE_GAP_EVT_CONNECTED event.

    2nd- I have changed because RTT terminal prints me that I should change memory due to I have changed BLE cnt services in the config.h file.

Related