Whenever the device advertises, there is an interval where you send advertisement packets, followed by a period of blanking. The Chip can go into deepsleep at the time of this blanking alone. The chip will be automatically waken up during the next adv interval. This has been implemented in all our example projects in PSoC Creator.
- Madhu Sudhan
Thanks so much. I really appreciate for your help. I found that explanation in AN92584 - Designing for Low Power and Estimating Battery Life for BLE Applications (http://www.cypress.com/file/140991/download). Looks like BLESS wakes up the CPU twice every time it advertises. First when BLESS enter the active mode and again at end-of-event.
Suppose I want my BLE to advertise continuously without timeout and I want my program to perform a specific task after BLE advertises 10 times. Is there a reliable way to count the number of advertising? Or should I set the timeout and restart advertising after CPU finishes a specific task?
In your BLE component, you can go to Gap Settings -> Advertising settings. Once there, you'd want to set the Minimum and Maximum advertising intervals to the same value, say 100ms. This isn't perfect, but each interval will be close to the same duration.
You could use the API CyBle_GappSetNumOfAdvPkts() for transmitting a fixed number of ADV packets.
Please note that at every ADV event , we are transmitting 3 ADV packets through the ADV channel 37/38/39.
Please refer the BLE component datasheet for more details on the API.