From 788df1eda3fba006382175dcf08157ff9aa31121 Mon Sep 17 00:00:00 2001 From: f4exb Date: Fri, 5 Apr 2024 02:00:35 +0200 Subject: [PATCH] ChirpChat demod: auto message length for FT messages --- .../channelrx/demodchirpchat/chirpchatdemod.cpp | 15 +++++++++++++++ .../channelrx/demodchirpchat/chirpchatdemodgui.ui | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/plugins/channelrx/demodchirpchat/chirpchatdemod.cpp b/plugins/channelrx/demodchirpchat/chirpchatdemod.cpp index cea13d828..387cb0601 100644 --- a/plugins/channelrx/demodchirpchat/chirpchatdemod.cpp +++ b/plugins/channelrx/demodchirpchat/chirpchatdemod.cpp @@ -327,6 +327,21 @@ bool ChirpChatDemod::handleMessage(const Message& cmd) m_lastMsgSyncWord = msg.getSyncWord(); m_lastMsgTimestamp = msg.getMsgTimestamp(); m_lastMsgString = msg.getMessage(); // for now we do not handle message components (call1, ...) + int nbSymbolBits = m_settings.m_spreadFactor - m_settings.m_deBits; + m_lastMsgNbSymbols = (174 / nbSymbolBits) + ((174 % nbSymbolBits) == 0 ? 0 : 1); + + if (m_settings.m_autoNbSymbolsMax) + { + ChirpChatDemodSettings settings = m_settings; + settings.m_nbSymbolsMax = m_lastMsgNbSymbols; + applySettings(settings); + + if (getMessageQueueToGUI()) // forward to GUI if any + { + MsgConfigureChirpChatDemod *msgToGUI = MsgConfigureChirpChatDemod::create(settings, false); + getMessageQueueToGUI()->push(msgToGUI); + } + } if (m_settings.m_sendViaUDP) { diff --git a/plugins/channelrx/demodchirpchat/chirpchatdemodgui.ui b/plugins/channelrx/demodchirpchat/chirpchatdemodgui.ui index 39d5ba3d3..b127dc8c4 100644 --- a/plugins/channelrx/demodchirpchat/chirpchatdemodgui.ui +++ b/plugins/channelrx/demodchirpchat/chirpchatdemodgui.ui @@ -723,7 +723,7 @@ - Set message length in symbols automatically to provided message length (LoRa only) + Set message length in symbols automatically to provided message length (LoRa and FT only) Auto