Skip to content

Commit

Permalink
Reboot if BLE update interrupted.
Browse files Browse the repository at this point in the history
  • Loading branch information
doudar committed Mar 16, 2024
1 parent 15538a4 commit 12d27ff
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/BLE_Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,9 @@ void MyServerCallbacks::onConnect(BLEServer *pServer, ble_gap_conn_desc *desc) {
void MyServerCallbacks::onDisconnect(BLEServer *pServer) {
SS2K_LOG(BLE_SERVER_LOG_TAG, "Bluetooth Remote Client Disconnected. Remaining Clients: %d", pServer->getConnectedCount());
BLEDevice::startAdvertising();
//client disconnected while trying to write fw - reboot to clear the faulty upload.
if (ss2k->isUpdating) {SS2K_LOG(BLE_SERVER_LOG_TAG, "Rebooting because of update interruption.", pServer->getConnectedCount());
ss2k->rebootFlag = true;}
}

bool MyServerCallbacks::onConnParamsUpdateRequest(NimBLEClient *pClient, const ble_gap_upd_params *params) {
Expand Down

0 comments on commit 12d27ff

Please sign in to comment.