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

ble_evt_dispatch sdk14

Hi,

I am confused with the migration document regarding the dispatch function being removed.

In the previous uart example the dispatch function included:

ble_conn_params_on_ble_evt(p_ble_evt);
nrf_ble_gatt_on_ble_evt(&m_gatt, p_ble_evt);
ble_nus_on_ble_evt(&m_nus, p_ble_evt);
on_ble_evt(p_ble_evt);
ble_advertising_on_ble_evt(p_ble_evt);
bsp_btn_ble_on_ble_evt(p_ble_evt);

now there is the OBSERVER definition:

NRF_SDH_BLE_OBSERVER(m_ble_observer, APP_BLE_OBSERVER_PRIO, ble_evt_handler, NULL);

and instances:

BLE_NUS_DEF(m_nus); /**< BLE NUS service instance. */

NRF_BLE_GATT_DEF(m_gatt); /**< GATT module instance. */

BLE_ADVERTISING_DEF(m_advertising); /**< Advertising module instance. */

where are (the equal functions) ble_conn_params_on_ble_evt(p_ble_evt); nrf_ble_gatt_on_ble_evt(&m_gatt, p_ble_evt); ble_nus_on_ble_evt(&m_nus, p_ble_evt); on_ble_evt(p_ble_evt); ble_advertising_on_ble_evt(p_ble_evt); bsp_btn_ble_on_ble_evt(p_ble_evt);

called?

And what about the sys_event_handler?

BR

Parents
  • Hi Bjarke,

    You don't need to register the equivalent observers for 'ble_conn_params_on_ble_evt', 'ble_conn_state_on_ble_evt', 'pm_on_ble_evt' and many others, since they all are registered in the respective source files - ble_conn_params.c, ble_conn_state.c, peer_manager.c and so on.

    If you'd search for their respective priorities you'll easily be able to locate the piece of code where the observers are registered.

    But as far as I know, you still need to register the observers for your custom service, ble events in your application and if you're using any other ble_services - NUS, HRS, etc. I hope this helps!

    Regards,

    Abe

  • Hi,

    I have done all that and can find the Observer registrations in the SDK files. And I can compile the program, but when I run it on my board, it wont work(no advertise). I dont know if it has something to do with the memory location, even though I have increased the softdevice space to 0x00023000 before the app begins. And it looks ok when I use the nrf-intel-hex-viewer.

    It does complain about APP_BLE_OBSERVER_PRIO 3 as in the uart example, when I set it to 2 it will compile BR

Reply
  • Hi,

    I have done all that and can find the Observer registrations in the SDK files. And I can compile the program, but when I run it on my board, it wont work(no advertise). I dont know if it has something to do with the memory location, even though I have increased the softdevice space to 0x00023000 before the app begins. And it looks ok when I use the nrf-intel-hex-viewer.

    It does complain about APP_BLE_OBSERVER_PRIO 3 as in the uart example, when I set it to 2 it will compile BR

Children
No Data
Related