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

ble advertising handler

hello Nordic

i am working with nrf52840, SDK16.0, s140 (maybe i will change softdevice later)

i build a project on the peripheral blinky example, i change the advertising durition from forever to 15 seconds

#define APP_ADV_DURATION (1500)                                                                                                                  \
    //BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED /**< The advertising time-out (in units of seconds). When set to 0, we will never time out. */

but i want to get some indication through some handler which is not clear to me how to implement, this looks like the handler for the advertising:

static uint8_t m_adv_handle = BLE_GAP_ADV_SET_HANDLE_NOT_SET;           /**< Advertising handle used to identify an advertising set. */

but what type of event do i get how can i know if advertising timed out or some other issue happened ?

hope to read from you soon 

best regards

Ziv

Parents Reply Children
  • The SoftDevice only support a single advertising set (even though the API suggests otherwise) so there can only ever be one advertiser. And when you get this event, you know it is terminated. The SoftDevice only separates between BLE events and SoC events, so you will get this event in any event handler that subscribes to BLE events (for instance in the ble_evt_handler() function that you see in most BLE examples in the nRF5 SDK).

Related