lancaster-university / codal-microbit-v2

CODAL target for the micro:bit v2.x series of devices
MIT License
43 stars 52 forks source link

Cancel Bluetooth pairing mode reset timeouts for partial flash and fetch MY_DATA? #433

Open martinwork opened 4 months ago

martinwork commented 4 months ago

After Bluetooth pairing shows a tick. there is a reset after a 15 second timeout, https://github.com/lancaster-university/codal-microbit-v2/blob/master/source/bluetooth/MicroBitBLEManager.cpp#L895 https://github.com/lancaster-university/microbit-dal/blob/master/source/bluetooth/MicroBitBLEManager.cpp#L744

There also seems to be a 30 90 100ms (4.5mins) timeout regardless of pairing.

Could we block the reset when a call is made to start partial flashing or fetching MY_DATA, to avoid the reset triggering in the middle?

The new UI flow in the mobile apps may take the user through pairing on the way to flashing or fetching MY_DATA, and we would like to avoid asking the user to reset to Bluetooth mode again before continuing to flash or fetch. The partial flashing protocol includes a call to reset, but using it adds a delay to the process.

I guess I can set a flag variable to block the reset easily enough, but I can't remember the original motivation for the timeouts.

Am I forgetting something @finneyj ?

microbit-carlos commented 2 months ago

@microbit-matt-hillsdon @jaustin is this something that needs prioritising for the mobile apps?

jaustin commented 1 month ago

We have a workaround for this in the app, but it's bad Ux (we make the user reset again after pairing). I'd like to fix this, and it would also need a fix in CODAL. It seems pretty straightforward unless we've missed some important reason to do it @finneyj.