From 73a90c5ba767ce79b5a36e3216c93a50757c7110 Mon Sep 17 00:00:00 2001 From: jvn314 Date: Fri, 23 Oct 2026 23:35:14 -0500 Subject: [PATCH] demodmeshtastic: try unmodified header values first Search header symbol-value deltas in the order 0, -1, 1, -2, 2. Prefer an unmodified valid header before testing shifted candidates. --- plugins/channelrx/demodmeshtastic/meshtasticdemodsink.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/channelrx/demodmeshtastic/meshtasticdemodsink.cpp b/plugins/channelrx/demodmeshtastic/meshtasticdemodsink.cpp index e8ba15013..5b7da761d 100644 --- a/plugins/channelrx/demodmeshtastic/meshtasticdemodsink.cpp +++ b/plugins/channelrx/demodmeshtastic/meshtasticdemodsink.cpp @@ -348,7 +348,8 @@ void MeshtasticDemodSink::tryHeaderLock() { const std::vector baseHeaderSlice(symbols.begin() + offset, symbols.begin() + offset + 8U); - for (int delta = -2; delta <= 2; delta++) + // Prefer the unmodified header, then try progressively larger value shifts. + for (int delta : {0, -1, 1, -2, 2}) { std::vector headerSlice(baseHeaderSlice);