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

Stop Advertising on nrf52832

Hi! What is the proper use of sd_ble_gap_adv_stop in SDK 15? I'm using nrf52832 in my application but can't seen to find a corret way to stop advertising.

Looking on ble_gap.h I've seen that this function requires a adv_handle as a parameter but what exactly is it expecting?

Parents
  • Oh, thank You! I've been looking at the documentation you provided and it says that the parameter  adv_handle is "The advertising handle that should stop advertising.".I've tried to set this parameter as the same I used in  my Advertising start function, but now I'm getting the error: ERROR 8 [NRF_ERROR_INVALID_STATE] .

    On advertising start I'm using an instance defined by BLE_ADVERTISING_DEF,  but I realized that the instance create doesn't have a adv_handle on it.How can I know if I'm defining the proper instance and treat this error?

    As for your suggestion, from what I understood that would be a timed event to stop advertising right? Is it possible to stop it after a particular condition is met?

    In my application i'm trying to stop the advertising after a certain variable is set, this would be like after pressing a button or something similar. Thanks in advance for your time.

  • On advertising start I'm using an instance defined by BLE_ADVERTISING_DEF,  but I realized that the instance create doesn't have a adv_handle on it.How can I know if I'm defining the proper instance and treat this error?

    The BLE_ADVERTISING_DEF is defined at ble_advertising.h. Can you help me check again that: the ble_advertising.h is included your project? If not please add this library and in sdk_config.h file, please certainly the BLE_ADVERTISING_ENABLED sets 1.

Reply
  • On advertising start I'm using an instance defined by BLE_ADVERTISING_DEF,  but I realized that the instance create doesn't have a adv_handle on it.How can I know if I'm defining the proper instance and treat this error?

    The BLE_ADVERTISING_DEF is defined at ble_advertising.h. Can you help me check again that: the ble_advertising.h is included your project? If not please add this library and in sdk_config.h file, please certainly the BLE_ADVERTISING_ENABLED sets 1.

Children
Related