Proper use of resetAsync()

I had been using the subject method reset the sensor wanting to make sure loggers are all cleared, accelerometers stopped; basically wanting to make sure the next round of testing is done with a 'clean' board.  It's overkill and teardown() seems to suit the task better.  That said, my question is: what does it mean that the resetAsync() method "issues a firmware reset to the board" eg. is there a reboot process that takes place and so a time interval before the board can be connected to again?  When is it appropriate to use that method?


  • That depends on whether want to preserve the current board configurations or not.  If you don't care and want to nuke the board, use resetAsync, otherwise, call tearDown.
  • Okay so: 

    tearDown - for clearing routing, loggers, stopping accel
    resetAsync -  for clearing accel configuration, zeroing registers eg. stepcounter resets (?)

    When resetAsync is called is there a reboot period ie. does the reset take time?  If so, how much time eg. if I do a remote resetAsync what is the delay before I can reconnect?
  • edited December 2017
    tearDown does exactly what it says in its comment, which does not mention anything about sensors.

    Whether there is a reboot period or not is irrelevant from the app's perspective, not to mention the host device's BLE stack has to register that the connection was lost.  Your app can attempt to reconnect when the resetAsync task is completed.
This discussion has been closed.