Re-use channel Uplink / Downlink for UDP controls - #8134
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds channel-specific uplink and downlink control for UDP multicast communication by leveraging the existing channel configuration settings.
Key changes:
- Adds channel validation for both UDP uplink and downlink operations
- Modifies the
onSendmethod signature to include channel index parameter - Updates Router.cpp to pass channel information to UDP handler
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/mesh/udp/UdpMulticastHandler.h | Adds channel downlink/uplink validation and updates onSend method signature |
| src/mesh/Router.cpp | Updates UDP handler calls to pass channel index and reorganizes UDP handling logic |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This reverts commit 2b590d2.
|
Only thing to consider is whether we would eventually want to control the UDP uplink separately from the MQTT. |
|
Agreed. I think in the long term we can split this control out into it's own levers
|
This reverts commit 359a4db.
|
@GUVWAF added the default key fallback to this one |
| udpHandler->onSend(const_cast<meshtastic_MeshPacket *>(p)); | ||
| // For packets that are already encrypted, we need to determine the channel from packet info | ||
| else if (udpHandler && config.network.enabled_protocols & meshtastic_Config_NetworkConfig_ProtocolFlags_UDP_BROADCAST && | ||
| isFromUs(p)) { |
| else if (udpHandler && config.network.enabled_protocols & meshtastic_Config_NetworkConfig_ProtocolFlags_UDP_BROADCAST && | ||
| isFromUs(p)) { | ||
| // Check if any channel has uplink enabled (for PKI support) | ||
| bool uplinkEnabled = false; |
There was a problem hiding this comment.
Maybe instead of this bool we can use an int8_t to store the channel index where uplink is enabled, and -1 if none was found such that we can eliminate the same loop hereafter.
|
We are using this on the moment to connect MF en LF. |
As per the notes on the 2.7.11 release Important Due to feedback received from users, UDP has been disabled by default and the default PSK decryption bridging logic has been removed for now until channel level controls can be added to a future release. 2.7.10 will be the release you can use to continue the bridging at this time. |
For consideration