1 of 1 people found this helpful
You will need to write software to handle the operation, but if you set the BLE component to timeout the advertising after 30 seconds, and just stop then start the advertisement whenever you receive a button press, then it should be feasible to do this without any timing components besides the BLE component's internal timing.
(You can always write a timer in software with interrupts if you are okay with a software abstraction of the timer component).
- Setup the BLE component to do a fast + slow timeout total of 30 seconds.
- Upon button press, check if BLE advertising already
- If yes, then restart advertisement (stop, then start); I don't know for sure if there is a way to reset the advertisement timeout count?
- If no, then start advertisement
- After 30 seconds handle the timeout event on the advertisement and turn off the BLE advertisement (might automatically turn off the advertisement on its own)
Thanks for your guidance.
I dig some deep & get to know that there is pre-defined library function CYBLE_API_RESULT_T CyBle_SoftReset (void) To Software reset BLE stack.
And after any BLE timeout(GAP limited discoverable mode,GAP pairing process,GATT response) CYBLE_EVT_TIMEOUT event will occur to be handled by event handler & consequences Advertisement will restart .
We can change this order by a block of logic.
It seems you have good experience in playing with BLE @ epr_1639216
Huh; I missed the CyBle_SoftReset() function, but that is useful to know
That is correct, the CYBLE_EVT_TIMEOUT is the event you will want to do logic on based on the 30s timeout window
I spent a decent amount of time on a project for work, so I had to learn both the BLE and PSoC simultaneously; Sink or swim is a great way to learn stuff well
Thanks for the compliment; Good luck with finishing the project jamec_2673086