Skip to content

Conversation

@thatSFguy
Copy link

Fixes an issue where automatic replies generated by the --reply flag were incorrectly routed and unfiltered.

Changes

  1. Channel Routing: Responses are now explicitly sent back on the same channel index the message was received on, rather than defaulting to the primary channel (0).

  2. Channel Filtering: The --reply action now respects the --ch-index flag. It will only trigger a response if the incoming message matches the user-specified channel.

Behavior Comparison

Command: meshtastic --ch-index 1 --reply

Scenario Previous Behavior New Behavior
Msg received on Ch 0 Sent reply on Ch 0 Ignored (No match)
Msg received on Ch 1 Sent reply on Ch 0 Sent reply on Ch 1
Msg received on Ch 2 Sent reply on Ch 0 Ignored (No match)

Technical Implementation

The onReceive handler now casts args.ch_index to an integer and performs a comparison against the channel field in the incoming packet before calling interface.sendText().

Ensures that automatic replies are sent back on the same channel index the message was received on. Previously, all replies defaulted to the primary channel (0), even if the incoming message arrived on a secondary channel. Additionally it ensures incoming messages match the specified channel index.

E.g:  meshtastic --ch-index 1 --reply .

Modified the `onReceive` handler to extract the `channel` index from received packets. This ensures `interface.sendText` targets the originating channel rather than always defaulting to the primary channel. Added a filter to ensure that only the specified channel index is being replied to.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant