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

softdevice handler.h is missing

I want to use 

softdevice_sys_evt_handler_set()
  it should be implemented in sofdevice_handler.h but this file does not exist in any of my directories. I am using sdk 14.2.0

However, i have nrf_sdh.h which has  equivalent functions to those in the missing file.

How can I substitute softdevice_sys_evt_handler_set() I have went through the file but I can#t understand how can I do so.

Any help 

Parents
  • Hi,

    sys_evt_dispatch is removed and deprecated starting from SDK 14, it's replaced with observers. See this link.

  • can you show an example of how to change this to fit in sdk 14.2.0

    static void sys_evt_dispatch(uint32_t sys_evt)  
    {nrf_evt_signal_handler(sys_evt);}
    int main(void)
    {
        softdevice_sys_evt_handler_set(sys_evt_dispatch);
        ...
    }

    I have did this

    NRF_SDH_SOC_OBSERVER(Timeslot_SOC_observer,1,nrf_evt_signal_handler,NULL);

    and I have this warning :

    initialization of 'void (*)(uint32_t, void *)' {aka 'void (*)(unsigned int, void *)'} from incompatible pointer type 'void (*)(uint32_t)' {aka 'void (*)(unsigned int)'} [-Wincompatible-pointer-types]
    2> ../../../../../../components/softdevice/common/nrf_sdh_soc.h:80:18: note: in definition of macro 'NRF_SDH_SOC_OBSERVER'
    2> C:\svn\Abyr_Barhoumi\trunk\source code\nordic_project_folder\examples\ble_peripheral\ble_app_beacon\main.c:70:46: note: (near initialization for 'Timeslot_SOC_observer.handler')
    2> ../../../../../../components/softdevice/common/nrf_sdh_soc.h:80:18: note: in definition of macro 'NRF_SDH_SOC_OBSERVER'

Reply
  • can you show an example of how to change this to fit in sdk 14.2.0

    static void sys_evt_dispatch(uint32_t sys_evt)  
    {nrf_evt_signal_handler(sys_evt);}
    int main(void)
    {
        softdevice_sys_evt_handler_set(sys_evt_dispatch);
        ...
    }

    I have did this

    NRF_SDH_SOC_OBSERVER(Timeslot_SOC_observer,1,nrf_evt_signal_handler,NULL);

    and I have this warning :

    initialization of 'void (*)(uint32_t, void *)' {aka 'void (*)(unsigned int, void *)'} from incompatible pointer type 'void (*)(uint32_t)' {aka 'void (*)(unsigned int)'} [-Wincompatible-pointer-types]
    2> ../../../../../../components/softdevice/common/nrf_sdh_soc.h:80:18: note: in definition of macro 'NRF_SDH_SOC_OBSERVER'
    2> C:\svn\Abyr_Barhoumi\trunk\source code\nordic_project_folder\examples\ble_peripheral\ble_app_beacon\main.c:70:46: note: (near initialization for 'Timeslot_SOC_observer.handler')
    2> ../../../../../../components/softdevice/common/nrf_sdh_soc.h:80:18: note: in definition of macro 'NRF_SDH_SOC_OBSERVER'

Children
Related