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

Can I remove restarting process after bluetooth disconnect?

Hi, I'm using nRF52832 with my external board.

I'm recently working ble uart example.

I control motions with tx message such as LED, motor and so on.

Now, I want to make random password so that if someone want to control motions, they have to send correct password through UART tx.

So my idea goes like this.

1. Generate random password.

2. Send password through uart in my phone app.

3. Activate motor.

4. Turn off motor

5. Generate random password ( change password )

However, I found that if I disconnect bluetooth, the program has to restart and because of this, the password is changing.

So my question is, if i disconnect bluetooth, can I just do advertise init or ble stack init instead of restart whole system?

Thanks.

Related