Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to receive an event after advertising timeout in SDK 15.0.0 S132v6.0

Hi everyone,

I'm using SDK 15.0.0 S132v6.0 and looking for a way to get an event when the advertising times out. I discovered the softdevice_ble_evt_handler_set() in this post but was not able to find it in the SDK 15.0.0 documentation.

Do you have any pointers on where to look for / how to define an event handler to deal with the advertising timeout event?

Best,

lhochstetter

Parents
  • Hi.

    If we take a look at the GAP advertising parameters - Duration
    "Advertising duration in 10 ms units. When timeout is reached, an event of type BLE_GAP_EVT_ADV_SET_TERMINATED is raised."

    It might be easier for you to look at how this is handled in one of the examples in the SDK;
    If we look at the ble_app_uart:

    The advertisement duration is defined at the top of main. c (#define APP_ADV_DURATION 18000).

    When the timeout is reached after 180s, the BLE_GAP_EVT_ADV_SET_TERMINATED event is raised.
    This event is handled in ble_advertising_on_ble_evt() in the ble_advertising.c file.
    However, you could also add this event to the to the ble_evt_handler() in main.c.

    If something is unclear, or you have further questions, please let me know.

    Best regards,
    Joakim.

     

Reply
  • Hi.

    If we take a look at the GAP advertising parameters - Duration
    "Advertising duration in 10 ms units. When timeout is reached, an event of type BLE_GAP_EVT_ADV_SET_TERMINATED is raised."

    It might be easier for you to look at how this is handled in one of the examples in the SDK;
    If we look at the ble_app_uart:

    The advertisement duration is defined at the top of main. c (#define APP_ADV_DURATION 18000).

    When the timeout is reached after 180s, the BLE_GAP_EVT_ADV_SET_TERMINATED event is raised.
    This event is handled in ble_advertising_on_ble_evt() in the ble_advertising.c file.
    However, you could also add this event to the to the ble_evt_handler() in main.c.

    If something is unclear, or you have further questions, please let me know.

    Best regards,
    Joakim.

     

Children
Related