public async Task SystemResetAsync(bool toDFUMode = false) { // Must reconstruct this api lib after this command to continue use const int RESET_WAIT_MS = 3000; var cmd = _bglib.BLECommandSystemReset((byte)(toDFUMode ? 0x01 : 0x00)); await _bglib.SendCommandAsync(cmd).ConfigureAwait(false); //_serialDevice.Dispose(); // TODO: replace this with a state reset command, then I can keep using this instance; await Task.Delay(RESET_WAIT_MS).ConfigureAwait(false); }
private void btnReset_Click(object sender, EventArgs e) { // reset to normal mode SendCommand(bglib.BLECommandSystemReset(0)); }