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

Smallest amount of advertising time?

Hi,

I would like to misuse the SDK by creating an communications systems based on advertising. From several Q&A posts, e.g. this one), I understand that the current S130 softdevice (1.0.0) does not support simultaneous advertising and scanning. If I understand that post correctly, it suggests using:

  ble_gap_adv_start(), 
  ble_gap_adv_stop(), 
  sd_ble_gap_scan_start() and
  sd_ble_gap_scan_stop()

to control the advertising.

Now, how do I create the minimum advertising/non-scanning time? I would like to send exactly one BLE Advertisement Event (i.e one advertisement on each of the three advertisement channels.)

Could I do like this: After a ble_gap_adv_start(), start a timer, set to maybe 20ms, after which I call ble_gap_adv_stop()?

Or, is there any Softdevice event that I can use to catch when the BLE Advertising Event is over?

any help appreciated.

regards, Elm

Parents
  • The conclusion of the question you linked to is not that you cannot scan and advertise at the same time. It is that you can't start to advertise if you are scanning, but you can start to scan if you are advertising. The workaround was to stop scanning, then start advertising, then start scanning again.

    However, I believed this bug is fixed in S130 v1.0.0, and the version they were talking about was 0.5.0.

    Anyways, the best solution to your question is the one shibshab has given you, but a timer would also probably work, since advertising would start quickly as long as you are not doing anything else, like scanning.

    You will not get an event every time there is an advertising event. You will get an advertising timeout event, as you already know.

  • I consider my original question out of date, but this is the best answer I got. Elm

Reply Children
No Data
Related