mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-25 09:42:35 +00:00
Merge branch 'master' into ESPIDF-Rollup
This commit is contained in:
commit
52e4f93760
@ -157,9 +157,9 @@ void NodeDB::installDefaultConfig()
|
|||||||
config.has_power = true;
|
config.has_power = true;
|
||||||
config.has_network = true;
|
config.has_network = true;
|
||||||
config.has_bluetooth = true;
|
config.has_bluetooth = true;
|
||||||
|
|
||||||
config.lora.region = Config_LoRaConfig_RegionCode_UNSET;
|
config.lora.region = Config_LoRaConfig_RegionCode_UNSET;
|
||||||
config.lora.modem_preset = Config_LoRaConfig_ModemPreset_LONG_FAST;
|
config.lora.modem_preset = Config_LoRaConfig_ModemPreset_LONG_FAST;
|
||||||
|
config.lora.hop_limit = HOP_RELIABLE;
|
||||||
resetRadioConfig();
|
resetRadioConfig();
|
||||||
strncpy(config.network.ntp_server, "0.pool.ntp.org", 32);
|
strncpy(config.network.ntp_server, "0.pool.ntp.org", 32);
|
||||||
// FIXME: Default to bluetooth capability of platform as default
|
// FIXME: Default to bluetooth capability of platform as default
|
||||||
|
@ -17,11 +17,7 @@ ErrorCode ReliableRouter::send(MeshPacket *p)
|
|||||||
// message will rebroadcast. But asking for hop_limit 0 in that context means the client app has no preference on hop
|
// message will rebroadcast. But asking for hop_limit 0 in that context means the client app has no preference on hop
|
||||||
// counts and we want this message to get through the whole mesh, so use the default.
|
// counts and we want this message to get through the whole mesh, so use the default.
|
||||||
if (p->hop_limit == 0) {
|
if (p->hop_limit == 0) {
|
||||||
if (config.lora.hop_limit && config.lora.hop_limit <= HOP_MAX) {
|
p->hop_limit = (config.lora.hop_limit >= HOP_MAX) ? HOP_MAX : config.lora.hop_limit;
|
||||||
p->hop_limit = (config.lora.hop_limit >= HOP_MAX) ? HOP_MAX : config.lora.hop_limit;
|
|
||||||
} else {
|
|
||||||
p->hop_limit = HOP_RELIABLE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto copy = packetPool.allocCopy(*p);
|
auto copy = packetPool.allocCopy(*p);
|
||||||
|
@ -118,11 +118,7 @@ MeshPacket *Router::allocForSending()
|
|||||||
p->which_payload_variant = MeshPacket_decoded_tag; // Assume payload is decoded at start.
|
p->which_payload_variant = MeshPacket_decoded_tag; // Assume payload is decoded at start.
|
||||||
p->from = nodeDB.getNodeNum();
|
p->from = nodeDB.getNodeNum();
|
||||||
p->to = NODENUM_BROADCAST;
|
p->to = NODENUM_BROADCAST;
|
||||||
if (config.lora.hop_limit && config.lora.hop_limit <= HOP_MAX) {
|
p->hop_limit = (config.lora.hop_limit >= HOP_MAX) ? HOP_MAX : config.lora.hop_limit;
|
||||||
p->hop_limit = (config.lora.hop_limit >= HOP_MAX) ? HOP_MAX : config.lora.hop_limit;
|
|
||||||
} else {
|
|
||||||
p->hop_limit = HOP_RELIABLE;
|
|
||||||
}
|
|
||||||
p->id = generatePacketId();
|
p->id = generatePacketId();
|
||||||
p->rx_time =
|
p->rx_time =
|
||||||
getValidTime(RTCQualityFromNet); // Just in case we process the packet locally - make sure it has a valid timestamp
|
getValidTime(RTCQualityFromNet); // Just in case we process the packet locally - make sure it has a valid timestamp
|
||||||
|
Loading…
Reference in New Issue
Block a user