Initial NODENUM_BROADCAST_NO_LORA implementation with NeighborInfo module (#5087)

* Initial NODENUM_BROADCAST_NO_LORA implementation with NeighborInfo module

* isBroadcast

* Trunkt
This commit is contained in:
Ben Meadors
2024-10-19 12:48:00 -05:00
committed by GitHub
parent b1b6bce6b7
commit 4575352d8c
9 changed files with 23 additions and 14 deletions

View File

@@ -122,7 +122,7 @@ Will be used for broadcast.
int32_t NeighborInfoModule::runOnce()
{
if (airTime->isTxAllowedChannelUtil(true) && airTime->isTxAllowedAirUtil()) {
sendNeighborInfo(NODENUM_BROADCAST, false);
sendNeighborInfo(NODENUM_BROADCAST_NO_LORA, false);
}
return Default::getConfiguredOrDefaultMs(moduleConfig.neighbor_info.update_interval, default_neighbor_info_broadcast_secs);
}

View File

@@ -16,7 +16,7 @@ bool NodeInfoModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, mes
bool hasChanged = nodeDB->updateUser(getFrom(&mp), p, mp.channel);
bool wasBroadcast = mp.to == NODENUM_BROADCAST;
bool wasBroadcast = isBroadcast(mp.to);
// Show new nodes on LCD screen
if (wasBroadcast) {

View File

@@ -13,8 +13,7 @@ bool RoutingModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, mesh
printPacket("Routing sniffing", &mp);
router->sniffReceived(&mp, r);
bool maybePKI =
mp.which_payload_variant == meshtastic_MeshPacket_encrypted_tag && mp.channel == 0 && mp.to != NODENUM_BROADCAST;
bool maybePKI = mp.which_payload_variant == meshtastic_MeshPacket_encrypted_tag && mp.channel == 0 && !isBroadcast(mp.to);
// Beginning of logic whether to drop the packet based on Rebroadcast mode
if (mp.which_payload_variant == meshtastic_MeshPacket_encrypted_tag &&
(config.device.rebroadcast_mode == meshtastic_Config_DeviceConfig_RebroadcastMode_LOCAL_ONLY ||
@@ -28,7 +27,7 @@ bool RoutingModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, mesh
// FIXME - move this to a non promsicious PhoneAPI module?
// Note: we are careful not to send back packets that started with the phone back to the phone
if ((mp.to == NODENUM_BROADCAST || isToUs(&mp)) && (mp.from != 0)) {
if ((isBroadcast(mp.to) || isToUs(&mp)) && (mp.from != 0)) {
printPacket("Delivering rx packet", &mp);
service->handleFromRadio(&mp);
}