This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Disconnect and stop advertising after transaction

Hi - In the examples provided, a peripheral will go to power off after completing its transactions.This means the the application does not have to "clean up" afterwards.

I have an application that requires the peripheral to stay on Power On mode all the time due to transactions on an accelerometer. When an event is detected the application must start advertising, and when connected to, it sends a transaction to the central application and receives a response from the central application.

After that, the application must clean up and go back to monitoring the accelerometer until the next event is detected.

My question is, how do I clean up to ensure that I can start the process all over again without powering off.

My application works fine, but I have the following issues:

After receiving the response from the central, I do a disconnect. When I receive the disconnect event, then I stop scanning else the central will simply try and connect again. When I call start advertising again thereafter I get errors.

Please can you advise as to how to gracefully achieve my objective.

Thank you

Parents Reply Children
No Data
Related