Enable and Disable BLE advertising

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

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

0 Likes
1 Solution
Anonymous
Not applicable

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.

View solution in original post

0 Likes
2 Replies
Anonymous
Not applicable

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.

0 Likes
Anonymous
Not applicable

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.

0 Likes