Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/helpers/CommonCLI_Observer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ bool CommonCLI::handleObserverSetCmd(uint32_t sender_timestamp, const char* conf
// Opt-in publish of the node config to the `config` topic. Accepts 1/on.
_mqtt_prefs.mqtt_config_enabled =
(config[12] == '1' || memcmp(&config[12], "on", 2) == 0) ? 1 : 0;
savePrefs();
if (!persistObserverPrefs(reply)) return true;
strcpy(reply, "OK");
} else if (memcmp(config, "mqtt.tx ", 8) == 0) {
if (memcmp(&config[8], "advert", 6) == 0) {
Expand Down Expand Up @@ -392,15 +392,15 @@ bool CommonCLI::handleObserverSetCmd(uint32_t sender_timestamp, const char* conf
uint32_t secs = _atoi(&config[21]);
if (secs == 0) {
_mqtt_prefs.mqtt_filter_interval = 0;
savePrefs();
if (!persistObserverPrefs(reply)) return true;
_callbacks->restartBridge();
strcpy(reply, "OK - filter stats publishing disabled, bridge restarted");
} else {
uint32_t ms = secs * 1000UL;
if (ms < MQTT_FILTER_STATS_MIN_INTERVAL_MS) ms = MQTT_FILTER_STATS_MIN_INTERVAL_MS;
if (ms > MQTT_FILTER_STATS_MAX_INTERVAL_MS) ms = MQTT_FILTER_STATS_MAX_INTERVAL_MS;
_mqtt_prefs.mqtt_filter_interval = ms;
savePrefs();
if (!persistObserverPrefs(reply)) return true;
_callbacks->restartBridge();
sprintf(reply, "OK - filter interval set to %lu s (%lu ms), bridge restarted",
(unsigned long)(ms / 1000), (unsigned long)ms);
Expand Down Expand Up @@ -693,7 +693,7 @@ bool CommonCLI::handleObserverSetCmd(uint32_t sender_timestamp, const char* conf
return true;
}
_mqtt_prefs.mqtt_slot_extras[slot] = mask;
savePrefs();
if (!persistObserverPrefs(reply)) return true;
sprintf(reply, "OK - slot %d extras %s", slot + 1, v);
} else {
sprintf(reply, "unknown config: %s", config);
Expand Down
Loading