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

Questions – orders of event reported to the app?

Dear sirs/madams

I am using SDK 17.0.2

Situation:

One Central unit (nRF52840) and one Peripheral unit (nRF52840) have established a connection (NUS service).

When Central unit is switched off, I get the following events in peripheral unit in the following order:

  • on_adv_evt(….) with the event BLE_ADV_FAST
  • ble_evt_handler(….) with the event BLE_GAP_EVT_DISCONNECTED

 

Why do I get these events in this order? To my understanding these events should come in the opposite order.

 

Kind regards

Svein

Parents Reply Children
  • Hi Vidar,

    Thanks a lot for your feedback.

    On the peripheral device we have an OLED screen where various information is printed. Our customer also wants to know the status of the connection between the peripheral and central unit, hence we want to display advertising when advertising, connect when connected, disconnect when disconnected, and so on. As it is now with the order of reporting of these events to the APP the sequence printed to the OLED become wrong. Sometimes the advertising event is received after that the connect event is received and sometimes, I get the advertising event before the disconnect event. This behaviour led to that the information written to the display does not always match the actual state.

    I will take a closer look at the links you pointed to and hopefully I will be able to solve this minor problem.  Blush

     

    Kind regards,

    Svein

Related