mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-27 18:31:37 +00:00
Merge remote-tracking branch 'origin/master' into 2.5-changes
This commit is contained in:
commit
1be635a797
@ -606,18 +606,26 @@ void Router::perhapsHandleReceived(meshtastic_MeshPacket *p)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// assert(radioConfig.has_preferences);
|
// assert(radioConfig.has_preferences);
|
||||||
bool ignore = is_in_repeated(config.lora.ignore_incoming, p->from) || (config.lora.ignore_mqtt && p->via_mqtt);
|
if (is_in_repeated(config.lora.ignore_incoming, p->from)) {
|
||||||
|
LOG_DEBUG("Ignoring incoming message, 0x%x is in our ignore list\n", p->from);
|
||||||
|
packetPool.release(p);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (ignore) {
|
if (config.lora.ignore_mqtt && p->via_mqtt) {
|
||||||
LOG_DEBUG("Ignoring incoming message, 0x%x is in our ignore list or came via MQTT\n", p->from);
|
LOG_DEBUG("Message came in via MQTT from 0x%x\n", p->from);
|
||||||
} else if (ignore |= shouldFilterReceived(p)) {
|
packetPool.release(p);
|
||||||
LOG_DEBUG("Incoming message was filtered 0x%x\n", p->from);
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (shouldFilterReceived(p)) {
|
||||||
|
LOG_DEBUG("Incoming message was filtered from 0x%x\n", p->from);
|
||||||
|
packetPool.release(p);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: we avoid calling shouldFilterReceived if we are supposed to ignore certain nodes - because some overrides might
|
// Note: we avoid calling shouldFilterReceived if we are supposed to ignore certain nodes - because some overrides might
|
||||||
// cache/learn of the existence of nodes (i.e. FloodRouter) that they should not
|
// cache/learn of the existence of nodes (i.e. FloodRouter) that they should not
|
||||||
if (!ignore)
|
handleReceived(p);
|
||||||
handleReceived(p);
|
|
||||||
|
|
||||||
packetPool.release(p);
|
packetPool.release(p);
|
||||||
}
|
}
|
@ -186,7 +186,7 @@ meshtastic_MeshPacket *PositionModule::allocReply()
|
|||||||
p.longitude_i = localPosition.longitude_i;
|
p.longitude_i = localPosition.longitude_i;
|
||||||
}
|
}
|
||||||
p.precision_bits = precision;
|
p.precision_bits = precision;
|
||||||
p.time = localPosition.time;
|
p.time = getValidTime(RTCQualityNTP) > 0 ? getValidTime(RTCQualityNTP) : localPosition.time;
|
||||||
|
|
||||||
if (pos_flags & meshtastic_Config_PositionConfig_PositionFlags_ALTITUDE) {
|
if (pos_flags & meshtastic_Config_PositionConfig_PositionFlags_ALTITUDE) {
|
||||||
if (pos_flags & meshtastic_Config_PositionConfig_PositionFlags_ALTITUDE_MSL)
|
if (pos_flags & meshtastic_Config_PositionConfig_PositionFlags_ALTITUDE_MSL)
|
||||||
|
@ -80,9 +80,8 @@ meshtastic_MeshPacket *DeviceTelemetryModule::allocReply()
|
|||||||
meshtastic_Telemetry DeviceTelemetryModule::getDeviceTelemetry()
|
meshtastic_Telemetry DeviceTelemetryModule::getDeviceTelemetry()
|
||||||
{
|
{
|
||||||
meshtastic_Telemetry t = meshtastic_Telemetry_init_zero;
|
meshtastic_Telemetry t = meshtastic_Telemetry_init_zero;
|
||||||
|
|
||||||
t.time = getTime();
|
|
||||||
t.which_variant = meshtastic_Telemetry_device_metrics_tag;
|
t.which_variant = meshtastic_Telemetry_device_metrics_tag;
|
||||||
|
t.time = getTime();
|
||||||
t.variant.device_metrics.air_util_tx = airTime->utilizationTXPercent();
|
t.variant.device_metrics.air_util_tx = airTime->utilizationTXPercent();
|
||||||
#if ARCH_PORTDUINO
|
#if ARCH_PORTDUINO
|
||||||
t.variant.device_metrics.battery_level = MAGIC_USB_BATTERY_LEVEL;
|
t.variant.device_metrics.battery_level = MAGIC_USB_BATTERY_LEVEL;
|
||||||
|
@ -418,6 +418,8 @@ meshtastic_MeshPacket *EnvironmentTelemetryModule::allocReply()
|
|||||||
bool EnvironmentTelemetryModule::sendTelemetry(NodeNum dest, bool phoneOnly)
|
bool EnvironmentTelemetryModule::sendTelemetry(NodeNum dest, bool phoneOnly)
|
||||||
{
|
{
|
||||||
meshtastic_Telemetry m = meshtastic_Telemetry_init_zero;
|
meshtastic_Telemetry m = meshtastic_Telemetry_init_zero;
|
||||||
|
m.which_variant = meshtastic_Telemetry_environment_metrics_tag;
|
||||||
|
m.time = getTime();
|
||||||
#ifdef T1000X_SENSOR_EN
|
#ifdef T1000X_SENSOR_EN
|
||||||
if (t1000xSensor.getMetrics(&m)) {
|
if (t1000xSensor.getMetrics(&m)) {
|
||||||
#else
|
#else
|
||||||
|
@ -222,6 +222,8 @@ meshtastic_MeshPacket *PowerTelemetryModule::allocReply()
|
|||||||
bool PowerTelemetryModule::sendTelemetry(NodeNum dest, bool phoneOnly)
|
bool PowerTelemetryModule::sendTelemetry(NodeNum dest, bool phoneOnly)
|
||||||
{
|
{
|
||||||
meshtastic_Telemetry m = meshtastic_Telemetry_init_zero;
|
meshtastic_Telemetry m = meshtastic_Telemetry_init_zero;
|
||||||
|
m.which_variant = meshtastic_Telemetry_power_metrics_tag;
|
||||||
|
m.time = getTime();
|
||||||
if (getPowerTelemetry(&m)) {
|
if (getPowerTelemetry(&m)) {
|
||||||
LOG_INFO("(Sending): ch1_voltage=%f, ch1_current=%f, ch2_voltage=%f, ch2_current=%f, "
|
LOG_INFO("(Sending): ch1_voltage=%f, ch1_current=%f, ch2_voltage=%f, ch2_current=%f, "
|
||||||
"ch3_voltage=%f, ch3_current=%f\n",
|
"ch3_voltage=%f, ch3_current=%f\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user