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

Stop advertising

Hi how to power off the ble after one advertising event ? i.e i want to stop advertising after one advertising event!

Parents
  • Why not set the advertising timeout to a value less than your advertising interval. Then when the stack returns the BLE_GAP_EVT_TIMEOUT event with a source of BLE_GAP_TIMEOUT_SRC_ADVERTISEMENT you can then do your power off work.

    It is possible that sd_ble_gap_adv_start may check to ensure that the timeout is longer than the interval and return an error in which case this won't work. Otherwise I think it is a simple solution.

Reply
  • Why not set the advertising timeout to a value less than your advertising interval. Then when the stack returns the BLE_GAP_EVT_TIMEOUT event with a source of BLE_GAP_TIMEOUT_SRC_ADVERTISEMENT you can then do your power off work.

    It is possible that sd_ble_gap_adv_start may check to ensure that the timeout is longer than the interval and return an error in which case this won't work. Otherwise I think it is a simple solution.

Children
No Data
Related