Quantcast
Viewing all articles
Browse latest Browse all 116964

Forum Post: How do I turn advertising completely & immediately off

I am developing a device using the CC2541 and the BLE 1.3 stack. It has a button to enable or disable advertising. I have linked the button press to call GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, 1, trueOrFalse), however when I disable advertising (trueOrFalse = false), the device seem to continue advertising and/or be discoverable for some time (perhaps 2-3 minutes). As well, after a connection has been terminated, I am able to discover and connect (using LightBlue app) for another 2-3 minutes without re-initiating advertising.

My goals are the following:

  1. Pressing advertising button initiates advertising until the sooner of: a connection being made, the advertise button is again pressed to cancel advertising, or a 30 second timeout is reached (the latter 2 options will force a call to SetParameter GAPROLE_ADVERT_ENABLED = FALSE).
  2. If advertising is cancelled, the device should no longer be discoverable and this should happen immediately.
  3. After a connection has been made and then disconnected, the device should no longer be discoverable until the advertising button is pressed to initiate advertising.
Can someone tell me if my above goals are achievable and if so, what API calls or parameter settings must I use to accomplish these.
Thanks much,
Mark

Viewing all articles
Browse latest Browse all 116964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>