From d41d4c930e9b8af4f3045d3b32702a8278c988f3 Mon Sep 17 00:00:00 2001 From: dahanc Date: Sun, 29 Sep 2024 07:30:10 -0500 Subject: [PATCH] =?UTF-8?q?When=20importing=20config,=20keep=20Bluetooth?= =?UTF-8?q?=20on=20and=20defer=20rebooting=20until=20co=E2=80=A6=20(#4898)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * When importing config, keep Bluetooth on and defer rebooting until config is committed * One more place that was prematurely disabling Bluetooth --------- Co-authored-by: Ben Meadors --- src/modules/AdminModule.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 09311abda..8c354b6c8 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -583,7 +583,7 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c) break; } - if (requiresReboot) { + if (requiresReboot && !hasOpenEditTransaction) { disableBluetooth(); } @@ -592,7 +592,8 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c) void AdminModule::handleSetModuleConfig(const meshtastic_ModuleConfig &c) { - disableBluetooth(); + if (!hasOpenEditTransaction) + disableBluetooth(); switch (c.which_payload_variant) { case meshtastic_ModuleConfig_mqtt_tag: LOG_INFO("Setting module config: MQTT\n"); @@ -966,7 +967,7 @@ void AdminModule::saveChanges(int saveWhat, bool shouldReboot) } else { LOG_INFO("Delaying save of changes to disk until the open transaction is committed\n"); } - if (shouldReboot) { + if (shouldReboot && !hasOpenEditTransaction) { reboot(DEFAULT_REBOOT_SECONDS); } }