mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-09 06:32:06 +00:00
Don't spam logs if no position with map reporting (#3378)
This commit is contained in:
parent
6a27e62bcf
commit
5f47ca1f32
@ -552,14 +552,14 @@ void MQTT::perhapsReportToMap()
|
|||||||
if (!moduleConfig.mqtt.map_reporting_enabled || !(moduleConfig.mqtt.proxy_to_client_enabled || isConnectedDirectly()))
|
if (!moduleConfig.mqtt.map_reporting_enabled || !(moduleConfig.mqtt.proxy_to_client_enabled || isConnectedDirectly()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (map_position_precision == 0 || (localPosition.latitude_i == 0 && localPosition.longitude_i == 0)) {
|
|
||||||
LOG_WARN("MQTT Map reporting is enabled, but precision is 0 or no position available.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (millis() - last_report_to_map < map_publish_interval_secs * 1000) {
|
if (millis() - last_report_to_map < map_publish_interval_secs * 1000) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
if (map_position_precision == 0 || (localPosition.latitude_i == 0 && localPosition.longitude_i == 0)) {
|
||||||
|
LOG_WARN("MQTT Map reporting is enabled, but precision is 0 or no position available.\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Allocate ServiceEnvelope and fill it
|
// Allocate ServiceEnvelope and fill it
|
||||||
meshtastic_ServiceEnvelope *se = mqttPool.allocZeroed();
|
meshtastic_ServiceEnvelope *se = mqttPool.allocZeroed();
|
||||||
se->channel_id = (char *)channels.getGlobalId(channels.getPrimaryIndex()); // Use primary channel as the channel_id
|
se->channel_id = (char *)channels.getGlobalId(channels.getPrimaryIndex()); // Use primary channel as the channel_id
|
||||||
|
Loading…
Reference in New Issue
Block a user