mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-02 11:55:56 +00:00
Try macro exclusion
This commit is contained in:
parent
be4696e238
commit
fa5e053e30
@ -627,12 +627,14 @@ bool MQTT::isValidConfig(const meshtastic_ModuleConfig_MQTTConfig &config, MQTTC
|
|||||||
#else
|
#else
|
||||||
const char *warning = "Invalid MQTT config: proxy_to_client_enabled must be enabled on nodes that do not have a network";
|
const char *warning = "Invalid MQTT config: proxy_to_client_enabled must be enabled on nodes that do not have a network";
|
||||||
LOG_ERROR(warning);
|
LOG_ERROR(warning);
|
||||||
|
#if !IS_RUNNING_TESTS
|
||||||
meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed();
|
meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed();
|
||||||
cn->level = meshtastic_LogRecord_Level_ERROR;
|
cn->level = meshtastic_LogRecord_Level_ERROR;
|
||||||
cn->time = getValidTime(RTCQualityFromNet);
|
cn->time = getValidTime(RTCQualityFromNet);
|
||||||
strncpy(cn->message, warning, sizeof(cn->message) - 1);
|
strncpy(cn->message, warning, sizeof(cn->message) - 1);
|
||||||
cn->message[sizeof(cn->message) - 1] = '\0'; // Ensure null termination
|
cn->message[sizeof(cn->message) - 1] = '\0'; // Ensure null termination
|
||||||
service->sendClientNotification(cn);
|
service->sendClientNotification(cn);
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -641,12 +643,14 @@ bool MQTT::isValidConfig(const meshtastic_ModuleConfig_MQTTConfig &config, MQTTC
|
|||||||
if (defaultServer && parsed.serverPort != PubSubConfig::defaultPort) {
|
if (defaultServer && parsed.serverPort != PubSubConfig::defaultPort) {
|
||||||
const char *warning = "Invalid MQTT config: default server address must not have a port specified";
|
const char *warning = "Invalid MQTT config: default server address must not have a port specified";
|
||||||
LOG_ERROR(warning);
|
LOG_ERROR(warning);
|
||||||
|
#if !IS_RUNNING_TESTS
|
||||||
meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed();
|
meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed();
|
||||||
cn->level = meshtastic_LogRecord_Level_ERROR;
|
cn->level = meshtastic_LogRecord_Level_ERROR;
|
||||||
cn->time = getValidTime(RTCQualityFromNet);
|
cn->time = getValidTime(RTCQualityFromNet);
|
||||||
strncpy(cn->message, warning, sizeof(cn->message) - 1);
|
strncpy(cn->message, warning, sizeof(cn->message) - 1);
|
||||||
cn->message[sizeof(cn->message) - 1] = '\0'; // Ensure null termination
|
cn->message[sizeof(cn->message) - 1] = '\0'; // Ensure null termination
|
||||||
service->sendClientNotification(cn);
|
service->sendClientNotification(cn);
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -27,6 +27,11 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include <variant>
|
#include <variant>
|
||||||
|
|
||||||
|
#define IS_RUNNING_TESTS 1
|
||||||
|
#else
|
||||||
|
#define IS_RUNNING_TESTS 0
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
// Minimal router needed to receive messages from MQTT.
|
// Minimal router needed to receive messages from MQTT.
|
||||||
|
Loading…
Reference in New Issue
Block a user