From e86120969a707c60972c48104d433f06aec803ba Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 20 Jun 2018 09:15:17 +0200 Subject: [PATCH] DSD decoder: NXDN implementation --- plugins/channelrx/demoddsd/dsddecoder.h | 1 + plugins/channelrx/demoddsd/dsddemod.cpp | 43 +++++++++++++++++++++++++ plugins/channelrx/demoddsd/dsddemod.h | 3 +- 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/plugins/channelrx/demoddsd/dsddecoder.h b/plugins/channelrx/demoddsd/dsddecoder.h index b135a653c..9f7343169 100644 --- a/plugins/channelrx/demoddsd/dsddecoder.h +++ b/plugins/channelrx/demoddsd/dsddecoder.h @@ -65,6 +65,7 @@ public: const DSDcc::DSDDstar& getDStarDecoder() const { return m_decoder.getDStarDecoder(); } const DSDcc::DSDdPMR& getDPMRDecoder() const { return m_decoder.getDPMRDecoder(); } const DSDcc::DSDYSF& getYSFDecoder() const { return m_decoder.getYSFDecoder(); } + const DSDcc::DSDNXDN& getNXDNDecoder() const { return m_decoder.getNXDNDecoder(); } void setMyPoint(float lat, float lon) { m_decoder.setMyPoint(lat, lon); } void setAudioGain(float gain) { m_decoder.setAudioGain(gain); } diff --git a/plugins/channelrx/demoddsd/dsddemod.cpp b/plugins/channelrx/demoddsd/dsddemod.cpp index 806d5c4ee..117eeb09c 100644 --- a/plugins/channelrx/demoddsd/dsddemod.cpp +++ b/plugins/channelrx/demoddsd/dsddemod.cpp @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -659,6 +660,48 @@ void DSDDemod::formatStatusText() getDecoder().getDPMRDecoder().getCalledId()); m_signalFormat = signalFormatDPMR; break; + case DSDcc::DSDDecoder::DSDSyncNXDNP: + case DSDcc::DSDDecoder::DSDSyncNXDNN: + if (getDecoder().getNXDNDecoder().getRFChannel() == DSDcc::DSDNXDN::NXDNRCCH) + { + // 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 + // 0....5....0....5....0....5....0....5....0....5....0....5....0....5....0....5....0.. + // RC cc mm llllll ssss + snprintf(m_formatStatusText, 82, "RC %02d %02X %06X %02X", + getDecoder().getNXDNDecoder().getRAN(), + getDecoder().getNXDNDecoder().getMessageType(), + getDecoder().getNXDNDecoder().getLocationId(), + getDecoder().getNXDNDecoder().getServicesFlag()); + } + else if ((getDecoder().getNXDNDecoder().getRFChannel() == DSDcc::DSDNXDN::NXDNRTCH) + || (getDecoder().getNXDNDecoder().getRFChannel() == DSDcc::DSDNXDN::NXDNRDCH)) + { + if (getDecoder().getNXDNDecoder().isIdle()) { + snprintf(m_formatStatusText, 82, "%s IDLE", getDecoder().getNXDNDecoder().getRFChannelStr()); + } + else + { + // 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 + // 0....5....0....5....0....5....0....5....0....5....0....5....0....5....0....5....0.. + // Rx cc mm sssss>gddddd + snprintf(m_formatStatusText, 82, "%s %02d %02X %05d>%c%05d", + getDecoder().getNXDNDecoder().getRFChannelStr(), + getDecoder().getNXDNDecoder().getRAN(), + getDecoder().getNXDNDecoder().getMessageType(), + getDecoder().getNXDNDecoder().getSourceId(), + getDecoder().getNXDNDecoder().isGroupCall() ? 'G' : 'I', + getDecoder().getNXDNDecoder().getDestinationId()); + } + } + else + { + // 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 + // 0....5....0....5....0....5....0....5....0....5....0....5....0....5....0....5....0.. + // RU + snprintf(m_formatStatusText, 82, "RU"); + } + m_signalFormat = signalFormatNXDN; + break; case DSDcc::DSDDecoder::DSDSyncYSF: // 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 // 0....5....0....5....0....5....0....5....0....5....0....5....0....5....0....5....0.. diff --git a/plugins/channelrx/demoddsd/dsddemod.h b/plugins/channelrx/demoddsd/dsddemod.h index d426746f0..9ffeef680 100644 --- a/plugins/channelrx/demoddsd/dsddemod.h +++ b/plugins/channelrx/demoddsd/dsddemod.h @@ -152,7 +152,8 @@ private: signalFormatDMR, signalFormatDStar, signalFormatDPMR, - signalFormatYSF + signalFormatYSF, + signalFormatNXDN } SignalFormat; //!< Used for status text formatting class MsgConfigureMyPosition : public Message {