-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Re-use channel Uplink / Downlink for UDP controls #8134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
onSend
method 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 <[email protected]>
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)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isFromUs(p)
is here still.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
For consideration