fix(nrf52): keep BLE active during reset cleanup (#10873)

This commit is contained in:
Benjamin Faershtein
2026-07-03 18:57:15 -05:00
committed by GitHub
co-authored by GitHub
parent babbac3308
commit 6085a4f003
3 changed files with 7 additions and 5 deletions
+4 -3
View File
@@ -418,22 +418,22 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
break;
}
case meshtastic_AdminMessage_factory_reset_config_tag: {
disableBluetooth();
LOG_INFO("Initiate factory config reset");
// Keep BLE active while reset cleanup performs nRF flash operations.
nodeDB->factoryReset();
LOG_INFO("Factory config reset finished, rebooting soon");
disableBluetooth();
reboot(DEFAULT_REBOOT_SECONDS);
break;
}
case meshtastic_AdminMessage_factory_reset_device_tag: {
disableBluetooth();
LOG_INFO("Initiate full factory reset");
nodeDB->factoryReset(true);
disableBluetooth();
reboot(DEFAULT_REBOOT_SECONDS);
break;
}
case meshtastic_AdminMessage_nodedb_reset_tag: {
disableBluetooth();
LOG_INFO("Initiate node-db reset");
// CLIENT_BASE, ROUTER and ROUTER_LATE are able to preserve the remaining hop count when relaying a packet via a
// favorited node, so ensure that their favorites are kept on reset
@@ -441,6 +441,7 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
isOneOf(config.device.role, meshtastic_Config_DeviceConfig_Role_CLIENT_BASE,
meshtastic_Config_DeviceConfig_Role_ROUTER, meshtastic_Config_DeviceConfig_Role_ROUTER_LATE);
nodeDB->resetNodes(rolePreference ? rolePreference : r->nodedb_reset);
disableBluetooth();
reboot(DEFAULT_REBOOT_SECONDS);
break;
}