- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I have a device running on a battery, and want it to stop advertising if it is not connected for a long time (to save the battery power), and restart advertising if a button is pressed. What is the correct way of doing it? Can you point me to the BLE API functions that should be used to stop a and start advertising?
Thanks in advance!
Fernando
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
CyBle_EnterDiscoveryMode()
and
CyBle_ExitDiscoveryMode()
are the two functions you would need. You will also need to handle the time out cyble event in the BLESS event application callback function.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Take a look at the BLE FindMe examples. On the button side, a button click starts scanning (because its a Central) and goes in and out of deep sleep. You can switch a couple of options around, but essentially, you can make it into a peripheral that advertises on button click, then goes into deep sleep after it times out, and only wakes up/advertises after a click.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
CyBle_EnterDiscoveryMode()
and
CyBle_ExitDiscoveryMode()
are the two functions you would need. You will also need to handle the time out cyble event in the BLESS event application callback function.