mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-16 15:52:34 +00:00
Fix MQTT config bugs (#7446)
* Fix mqtt config bugs
* Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Add client notification
* Verbiage
* Update src/mqtt/MQTT.cpp
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/mqtt/MQTT.cpp
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/mqtt/MQTT.cpp
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/mqtt/MQTT.cpp
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Remove test that is no longer true
* This test no longer exists
* Fix client notification crap
* Suppress false positive
* Revert "Suppress false positive"
This reverts commit bead96eaee.
* Try macro exclusion
* Derp
* Fix
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Jason P <applewiz@mac.com>
This commit is contained in:
@@ -798,8 +798,11 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c)
|
||||
|
||||
bool AdminModule::handleSetModuleConfig(const meshtastic_ModuleConfig &c)
|
||||
{
|
||||
if (!hasOpenEditTransaction)
|
||||
// If we are in an open transaction or configuring MQTT, defer disabling Bluetooth
|
||||
// Otherwise, disable Bluetooth to prevent the phone from interfering with the config
|
||||
if (!hasOpenEditTransaction && c.which_payload_variant != meshtastic_ModuleConfig_mqtt_tag)
|
||||
disableBluetooth();
|
||||
|
||||
switch (c.which_payload_variant) {
|
||||
case meshtastic_ModuleConfig_mqtt_tag:
|
||||
#if MESHTASTIC_EXCLUDE_MQTT
|
||||
@@ -810,6 +813,8 @@ bool AdminModule::handleSetModuleConfig(const meshtastic_ModuleConfig &c)
|
||||
if (!MQTT::isValidConfig(c.payload_variant.mqtt)) {
|
||||
return false;
|
||||
}
|
||||
// Disable Bluetooth to prevent interference during MQTT configuration
|
||||
disableBluetooth();
|
||||
moduleConfig.has_mqtt = true;
|
||||
moduleConfig.mqtt = c.payload_variant.mqtt;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user