#1565 updates LTR, LTRNet and Passport decoders with new slope decoder. Resolves issue with LTR Standard decoder state that was combining individual calls to the same talkgroup and causing excessively long calls. (#1567)

Co-authored-by: Dennis Sheirer <dsheirer@github.com>
This commit is contained in:
Denny Sheirer
2023-06-05 06:13:12 -04:00
committed by GitHub
parent 5b6377cc11
commit 19f7a5171b
34 changed files with 707 additions and 463 deletions

View File

@@ -98,12 +98,13 @@ import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Factory for creating decoder modules to use in a processing chain for any supported protocols.
*/
public class DecoderFactory
{
private final static Logger mLog = LoggerFactory.getLogger(DecoderFactory.class);
private static final double FM_CHANNEL_BANDWIDTH = 12500.0;
private static final double DEMODULATED_AUDIO_SAMPLE_RATE = 8000.0;
/**
* Returns a list of one primary decoder and any auxiliary decoders, as
@@ -179,6 +180,13 @@ public class DecoderFactory
return modules;
}
/**
* Creates decoder modules for APCO-25 Phase 2 decoder
* @param channel configuration
* @param userPreferences reference
* @param modules collection to add to
* @param aliasList for the channel
*/
private static void processP25Phase2(Channel channel, UserPreferences userPreferences, List<Module> modules, AliasList aliasList) {
modules.add(new P25P2DecoderHDQPSK((DecodeConfigP25Phase2)channel.getDecodeConfiguration()));
@@ -188,6 +196,13 @@ public class DecoderFactory
modules.add(new P25P2AudioModule(userPreferences, 1, aliasList));
}
/**
* Creates decoder modules for APCO-25 Phase 1 decoder
* @param channel configuration
* @param userPreferences reference
* @param modules collection to add to
* @param aliasList for the channel
*/
private static void processP25Phase1(Channel channel, UserPreferences userPreferences, List<Module> modules, AliasList aliasList, ChannelType channelType, DecodeConfigP25Phase1 decodeConfig) {
DecodeConfigP25Phase1 p25Config = decodeConfig;
@@ -228,16 +243,30 @@ public class DecoderFactory
}
}
/**
* Creates decoder modules for Passport decoder
* @param channel configuration
* @param userPreferences reference
* @param modules collection to add to
* @param aliasList for the channel
*/
private static void processPassport(Channel channel, List<Module> modules, AliasList aliasList, DecodeConfiguration decodeConfig) {
modules.add(new PassportDecoder(decodeConfig));
modules.add(new PassportDecoderState());
modules.add(new AudioModule(aliasList));
if(channel.getSourceConfiguration().getSourceType() == SourceType.TUNER)
{
modules.add(new FMDemodulatorModule(FM_CHANNEL_BANDWIDTH, DEMODULATED_AUDIO_SAMPLE_RATE));
modules.add(new FMDemodulatorModule(FM_CHANNEL_BANDWIDTH));
}
}
/**
* Creates decoder modules for MPT-1327 decoder
* @param channel configuration
* @param userPreferences reference
* @param modules collection to add to
* @param aliasList for the channel
*/
private static void processMPT1327(ChannelMapModel channelMapModel, Channel channel, List<Module> modules, AliasList aliasList, ChannelType channelType, DecodeConfigMPT1327 decodeConfig) {
DecodeConfigMPT1327 mptConfig = decodeConfig;
ChannelMap channelMap = channelMapModel.getChannelMap(mptConfig.getChannelMapName());
@@ -255,7 +284,7 @@ public class DecoderFactory
SourceType sourceType = channel.getSourceConfiguration().getSourceType();
if(sourceType == SourceType.TUNER || sourceType == SourceType.TUNER_MULTIPLE_FREQUENCIES)
{
modules.add(new FMDemodulatorModule(FM_CHANNEL_BANDWIDTH, DEMODULATED_AUDIO_SAMPLE_RATE));
modules.add(new FMDemodulatorModule(FM_CHANNEL_BANDWIDTH));
}
if(channelType == ChannelType.STANDARD)
@@ -280,27 +309,48 @@ public class DecoderFactory
}
}
/**
* Creates decoder modules for LTR-Net decoder
* @param channel configuration
* @param userPreferences reference
* @param modules collection to add to
* @param aliasList for the channel
*/
private static void processLTRNet(Channel channel, List<Module> modules, AliasList aliasList, DecodeConfigLTRNet decodeConfig) {
modules.add(new LTRNetDecoder(decodeConfig));
modules.add(new LTRNetDecoderState());
modules.add(new AudioModule(aliasList));
if(channel.getSourceConfiguration().getSourceType() == SourceType.TUNER)
{
modules.add(new FMDemodulatorModule(FM_CHANNEL_BANDWIDTH, DEMODULATED_AUDIO_SAMPLE_RATE));
modules.add(new FMDemodulatorModule(FM_CHANNEL_BANDWIDTH));
}
}
/**
* Creates decoder modules for LTR decoder
* @param channel configuration
* @param userPreferences reference
* @param modules collection to add to
* @param aliasList for the channel
*/
private static void processLTRStandard(Channel channel, List<Module> modules, AliasList aliasList, DecodeConfigLTRStandard decodeConfig) {
MessageDirection direction = decodeConfig.getMessageDirection();
modules.add(new LTRStandardDecoder(null, direction));
modules.add(new LTRStandardDecoder(direction));
modules.add(new LTRStandardDecoderState());
modules.add(new AudioModule(aliasList));
if(channel.getSourceConfiguration().getSourceType() == SourceType.TUNER)
{
modules.add(new FMDemodulatorModule(FM_CHANNEL_BANDWIDTH, DEMODULATED_AUDIO_SAMPLE_RATE));
modules.add(new FMDemodulatorModule(FM_CHANNEL_BANDWIDTH));
}
}
/**
* Creates decoder modules for Narrow Band FM decoder
* @param channel configuration
* @param userPreferences reference
* @param modules collection to add to
* @param aliasList for the channel
*/
private static void processNBFM(Channel channel, List<Module> modules, AliasList aliasList, DecodeConfiguration decodeConfig)
{
if(!(decodeConfig instanceof DecodeConfigNBFM))
@@ -312,9 +362,16 @@ public class DecoderFactory
DecodeConfigNBFM decodeConfigNBFM = (DecodeConfigNBFM)decodeConfig;
modules.add(new NBFMDecoder(decodeConfigNBFM));
modules.add(new NBFMDecoderState(channel.getName(), decodeConfigNBFM));
modules.add(new AudioModule(aliasList));
modules.add(new AudioModule(aliasList, 0, 60000));
}
/**
* Creates decoder modules for AM decoder
* @param channel configuration
* @param userPreferences reference
* @param modules collection to add to
* @param aliasList for the channel
*/
private static void processAM(Channel channel, List<Module> modules, AliasList aliasList, DecodeConfiguration decodeConfig) {
if(!(decodeConfig instanceof DecodeConfigAM))
@@ -326,7 +383,7 @@ public class DecoderFactory
DecodeConfigAM decodeConfigAM = (DecodeConfigAM) decodeConfig;
modules.add(new AMDecoder(decodeConfigAM));
modules.add(new AMDecoderState(channel.getName(), decodeConfigAM));
modules.add(new AudioModule(aliasList));
modules.add(new AudioModule(aliasList, 0, 60000));
}
/**
@@ -381,7 +438,7 @@ public class DecoderFactory
}
/**
* Constructs a list of auxiliary decoders, as specified in the configuration
* Constructs a list of auxiliary decoders, as specified in the channel configuration
*
* @param config - auxiliary configuration
* @return - list of auxiliary decoders

View File

@@ -1,6 +1,6 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2022 Dennis Sheirer
* Copyright (C) 2014-2023 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,15 +20,21 @@ package io.github.dsheirer.module.decode.ltrnet;
import io.github.dsheirer.bits.MessageFramer;
import io.github.dsheirer.bits.SyncPattern;
import io.github.dsheirer.dsp.fsk.LTRDecoder;
import io.github.dsheirer.message.MessageDirection;
import io.github.dsheirer.module.decode.Decoder;
import io.github.dsheirer.module.decode.DecoderType;
import io.github.dsheirer.dsp.fsk.LTRDecoder;
import io.github.dsheirer.sample.Listener;
import io.github.dsheirer.sample.real.IRealBufferListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* LTR-Net decoder
*/
public class LTRNetDecoder extends Decoder implements IRealBufferListener, Listener<float[]>
{
private static final Logger mLog = LoggerFactory.getLogger(LTRNetDecoder.class);
public static final int LTR_NET_MESSAGE_LENGTH = 40;
protected LTRDecoder mLTRDecoder;
private MessageFramer mLTRMessageFramer;
@@ -51,8 +57,12 @@ public class LTRNetDecoder extends Decoder implements IRealBufferListener, Liste
mLTRMessageFramer = new MessageFramer(SyncPattern.LTR_STANDARD_ISW.getPattern(), LTR_NET_MESSAGE_LENGTH);
}
mLTRDecoder.setMessageFramer(mLTRMessageFramer);
mLTRMessageFramer.setSyncDetectListener(mLTRDecoder);
mLTRDecoder.setListener(bits -> {
for(boolean bit: bits)
{
mLTRMessageFramer.process(bit);
}
});
mLTRMessageProcessor = new LTRNetMessageProcessor(config.getMessageDirection());
mLTRMessageFramer.addMessageListener(mLTRMessageProcessor);
mLTRMessageProcessor.setMessageListener(getMessageListener());
@@ -64,7 +74,7 @@ public class LTRNetDecoder extends Decoder implements IRealBufferListener, Liste
*/
public LTRNetDecoder(DecodeConfigLTRNet config)
{
this(config, new LTRDecoder(LTR_NET_MESSAGE_LENGTH));
this(config, new LTRDecoder());
}
@Override
@@ -80,9 +90,9 @@ public class LTRNetDecoder extends Decoder implements IRealBufferListener, Liste
}
@Override
public void receive(float[] reusableFloatBuffer)
public void receive(float[] demodulatedSamples)
{
mLTRDecoder.receive(reusableFloatBuffer);
mLTRDecoder.receive(demodulatedSamples);
}
@Override

View File

@@ -1,6 +1,6 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2022 Dennis Sheirer
* Copyright (C) 2014-2023 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@ public class LTRNetDecoderInstrumented extends LTRNetDecoder
public LTRNetDecoderInstrumented(DecodeConfigLTRNet config)
{
super(config, new LTRDecoderInstrumented(LTR_NET_MESSAGE_LENGTH));
super(config, new LTRDecoderInstrumented());
}
public LTRDecoderInstrumented getLTRDecoder()
@@ -36,9 +36,9 @@ public class LTRNetDecoderInstrumented extends LTRNetDecoder
}
@Override
public void receive(float[] realBuffer)
public void receive(float[] demodulatedSamples)
{
super.receive(realBuffer);
super.receive(demodulatedSamples);
bufferCount.setValue(bufferCount.intValue() + 1);
}

View File

@@ -1,7 +1,6 @@
/*
* ******************************************************************************
* sdrtrunk
* Copyright (C) 2014-2018 Dennis Sheirer
* *****************************************************************************
* Copyright (C) 2014-2023 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
* *****************************************************************************
* ****************************************************************************
*/
package io.github.dsheirer.module.decode.ltrnet.message;
@@ -42,14 +41,25 @@ public abstract class LtrNetMessage extends Message
protected CorrectedBinaryMessage mMessage;
protected CRC mCRC;
private LTRTalkgroup mTalkgroup;
private MessageDirection mMessageDirection;
public LtrNetMessage(CorrectedBinaryMessage message, MessageDirection direction, long timestamp)
{
super(timestamp);
mMessage = message;
mMessageDirection = direction;
mCRC = CRCLTR.check(message, direction);
}
/**
* Message direction: outbound (OSW) from the repeater or inbound (ISW) to the repeater
* @return message direction
*/
public MessageDirection getMessageDirection()
{
return mMessageDirection;
}
/**
* Underlying binary message
*/

View File

@@ -1,7 +1,6 @@
/*
* ******************************************************************************
* sdrtrunk
* Copyright (C) 2014-2018 Dennis Sheirer
* *****************************************************************************
* Copyright (C) 2014-2023 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,14 +14,14 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
* *****************************************************************************
* ****************************************************************************
*/
package io.github.dsheirer.module.decode.ltrnet.message.osw;
import io.github.dsheirer.bits.CorrectedBinaryMessage;
import io.github.dsheirer.edac.CRCLTR;
import io.github.dsheirer.identifier.Identifier;
import io.github.dsheirer.module.decode.ltrnet.LtrNetMessageType;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -50,7 +49,12 @@ public class ChannelMapHigh extends LtrNetOswMessage
public String toString()
{
StringBuilder sb = new StringBuilder();
if(!isValid())
{
sb.append("[CRC FAIL: ").append(CRCLTR.getCRCReason(mMessage, getMessageDirection())).append("] ");
}
sb.append("CHANNEL MAP HIGH ").append(getChannels());
sb.append(" MSG:").append(getMessage().toString());
return sb.toString();
}

View File

@@ -1,7 +1,6 @@
/*
* ******************************************************************************
* sdrtrunk
* Copyright (C) 2014-2018 Dennis Sheirer
* *****************************************************************************
* Copyright (C) 2014-2023 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,14 +14,14 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
* *****************************************************************************
* ****************************************************************************
*/
package io.github.dsheirer.module.decode.ltrnet.message.osw;
import io.github.dsheirer.bits.CorrectedBinaryMessage;
import io.github.dsheirer.edac.CRCLTR;
import io.github.dsheirer.identifier.Identifier;
import io.github.dsheirer.module.decode.ltrnet.LtrNetMessageType;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -50,7 +49,12 @@ public class ChannelMapLow extends LtrNetOswMessage
public String toString()
{
StringBuilder sb = new StringBuilder();
if(!isValid())
{
sb.append("[CRC FAIL: ").append(CRCLTR.getCRCReason(mMessage, getMessageDirection())).append("] ");
}
sb.append("CHANNEL MAP LOW ").append(getChannels());
sb.append(" MSG:").append(getMessage().toString());
return sb.toString();
}

View File

@@ -1,7 +1,6 @@
/*
* ******************************************************************************
* sdrtrunk
* Copyright (C) 2014-2018 Dennis Sheirer
* *****************************************************************************
* Copyright (C) 2014-2023 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,15 +14,15 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
* *****************************************************************************
* ****************************************************************************
*/
package io.github.dsheirer.module.decode.ltrnet.message.osw;
import io.github.dsheirer.bits.CorrectedBinaryMessage;
import io.github.dsheirer.edac.CRCLTR;
import io.github.dsheirer.identifier.Identifier;
import io.github.dsheirer.module.decode.ltrnet.LtrNetMessageType;
import io.github.dsheirer.module.decode.ltrnet.identifier.NeighborIdentifier;
import java.util.ArrayList;
import java.util.List;
@@ -53,8 +52,13 @@ public class NeighborId extends LtrNetOswMessage
public String toString()
{
StringBuilder sb = new StringBuilder();
if(!isValid())
{
sb.append("[CRC FAIL: ").append(CRCLTR.getCRCReason(mMessage, getMessageDirection())).append("] ");
}
sb.append("NEIGHBOR:").append(getNeighborID());
sb.append(" RANK:").append(getNeighborRank());
sb.append(" MSG:").append(getMessage().toString());
return sb.toString();
}

View File

@@ -1,7 +1,6 @@
/*
* ******************************************************************************
* sdrtrunk
* Copyright (C) 2014-2018 Dennis Sheirer
* *****************************************************************************
* Copyright (C) 2014-2023 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,14 +14,14 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
* *****************************************************************************
* ****************************************************************************
*/
package io.github.dsheirer.module.decode.ltrnet.message.osw;
import io.github.dsheirer.bits.CorrectedBinaryMessage;
import io.github.dsheirer.edac.CRCLTR;
import io.github.dsheirer.identifier.Identifier;
import io.github.dsheirer.module.decode.ltrnet.LtrNetMessageType;
import java.util.ArrayList;
import java.util.List;
@@ -51,10 +50,15 @@ public class OswCallEnd extends LtrNetOswMessage
public String toString()
{
StringBuilder sb = new StringBuilder();
if(!isValid())
{
sb.append("[CRC FAIL: ").append(CRCLTR.getCRCReason(mMessage, getMessageDirection())).append("] ");
}
sb.append("CALL END TALKGROUP:").append(getTalkgroup().formatted());
sb.append(" AREA:").append(getArea(getMessage()));
sb.append(" LCN:").append(getChannel(getMessage()));
sb.append(" FREE:").append(getFree(getMessage()));
sb.append(" MSG:").append(getMessage().toString());
return sb.toString();
}

View File

@@ -1,7 +1,6 @@
/*
* ******************************************************************************
* sdrtrunk
* Copyright (C) 2014-2018 Dennis Sheirer
* *****************************************************************************
* Copyright (C) 2014-2023 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,14 +14,14 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
* *****************************************************************************
* ****************************************************************************
*/
package io.github.dsheirer.module.decode.ltrnet.message.osw;
import io.github.dsheirer.bits.CorrectedBinaryMessage;
import io.github.dsheirer.edac.CRCLTR;
import io.github.dsheirer.identifier.Identifier;
import io.github.dsheirer.module.decode.ltrnet.LtrNetMessageType;
import java.util.ArrayList;
import java.util.List;
@@ -51,10 +50,15 @@ public class OswCallStart extends LtrNetOswMessage
public String toString()
{
StringBuilder sb = new StringBuilder();
if(!isValid())
{
sb.append("[CRC FAIL: ").append(CRCLTR.getCRCReason(mMessage, getMessageDirection())).append("] ");
}
sb.append("CALL START TALKGROUP:").append(getTalkgroup().formatted());
sb.append(" AREA:").append(getArea(getMessage()));
sb.append(" LCN:").append(getChannel(getMessage()));
sb.append(" FREE:").append(getFree(getMessage()));
sb.append(" MSG:").append(getMessage().toString());
return sb.toString();
}

View File

@@ -1,7 +1,6 @@
/*
* ******************************************************************************
* sdrtrunk
* Copyright (C) 2014-2018 Dennis Sheirer
* *****************************************************************************
* Copyright (C) 2014-2023 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,14 +14,14 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
* *****************************************************************************
* ****************************************************************************
*/
package io.github.dsheirer.module.decode.ltrnet.message.osw;
import io.github.dsheirer.bits.CorrectedBinaryMessage;
import io.github.dsheirer.edac.CRCLTR;
import io.github.dsheirer.identifier.Identifier;
import io.github.dsheirer.module.decode.ltrnet.LtrNetMessageType;
import java.util.Collections;
import java.util.List;
@@ -49,11 +48,16 @@ public class OswUnknown extends LtrNetOswMessage
public String toString()
{
StringBuilder sb = new StringBuilder();
if(!isValid())
{
sb.append("[CRC FAIL: ").append(CRCLTR.getCRCReason(mMessage, getMessageDirection())).append("] ");
}
sb.append("OSW UNKNOWN MESSAGE - AREA:").append(getArea(getMessage()));
sb.append(" LCN:").append(getChannel(getMessage()));
sb.append(" HOME:").append(getHomeRepeater(getMessage()));
sb.append(" GROUP").append(getGroup(getMessage()));
sb.append(" FREE:").append(getFree(getMessage()));
sb.append(" MSG:").append(getMessage().toString());
return sb.toString();
}

View File

@@ -1,7 +1,6 @@
/*
* ******************************************************************************
* sdrtrunk
* Copyright (C) 2014-2018 Dennis Sheirer
* *****************************************************************************
* Copyright (C) 2014-2023 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,15 +14,15 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
* *****************************************************************************
* ****************************************************************************
*/
package io.github.dsheirer.module.decode.ltrnet.message.osw;
import io.github.dsheirer.bits.CorrectedBinaryMessage;
import io.github.dsheirer.edac.CRCLTR;
import io.github.dsheirer.identifier.Identifier;
import io.github.dsheirer.module.decode.ltrnet.LtrNetMessageType;
import java.util.Collections;
import java.util.List;
@@ -50,8 +49,13 @@ public class ReceiveFrequencyHigh extends FrequencyHigh
public String toString()
{
StringBuilder sb = new StringBuilder();
if(!isValid())
{
sb.append("[CRC FAIL: ").append(CRCLTR.getCRCReason(mMessage, getMessageDirection())).append("] ");
}
sb.append("LCN:").append(getChannel());
sb.append(" RECEIVE FREQUENCY:").append(getFrequency()).append(" - HIGH");
sb.append(" MSG:").append(getMessage().toString());
return sb.toString();
}

View File

@@ -1,7 +1,6 @@
/*
* ******************************************************************************
* sdrtrunk
* Copyright (C) 2014-2018 Dennis Sheirer
* *****************************************************************************
* Copyright (C) 2014-2023 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,15 +14,15 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
* *****************************************************************************
* ****************************************************************************
*/
package io.github.dsheirer.module.decode.ltrnet.message.osw;
import io.github.dsheirer.bits.CorrectedBinaryMessage;
import io.github.dsheirer.edac.CRCLTR;
import io.github.dsheirer.identifier.Identifier;
import io.github.dsheirer.module.decode.ltrnet.LtrNetMessageType;
import java.util.Collections;
import java.util.List;
@@ -47,8 +46,13 @@ public class ReceiveFrequencyLow extends FrequencyLow
public String toString()
{
StringBuilder sb = new StringBuilder();
if(!isValid())
{
sb.append("[CRC FAIL: ").append(CRCLTR.getCRCReason(mMessage, getMessageDirection())).append("] ");
}
sb.append("LCN:").append(getChannel());
sb.append(" RECEIVE FREQUENCY:").append(getFrequency()).append(" - LOW");
sb.append(" MSG:").append(getMessage().toString());
return sb.toString();
}

View File

@@ -1,7 +1,6 @@
/*
* ******************************************************************************
* sdrtrunk
* Copyright (C) 2014-2018 Dennis Sheirer
* *****************************************************************************
* Copyright (C) 2014-2023 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,15 +14,15 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
* *****************************************************************************
* ****************************************************************************
*/
package io.github.dsheirer.module.decode.ltrnet.message.osw;
import io.github.dsheirer.bits.CorrectedBinaryMessage;
import io.github.dsheirer.edac.CRCLTR;
import io.github.dsheirer.identifier.Identifier;
import io.github.dsheirer.module.decode.ltrnet.LtrNetMessageType;
import io.github.dsheirer.module.decode.ltrnet.identifier.LtrNetRadioIdentifier;
import java.util.ArrayList;
import java.util.List;
@@ -64,7 +63,12 @@ public class RegistrationAccept extends LtrNetOswMessage
public String toString()
{
StringBuilder sb = new StringBuilder();
if(!isValid())
{
sb.append("[CRC FAIL: ").append(CRCLTR.getCRCReason(mMessage, getMessageDirection())).append("] ");
}
sb.append("REGISTRATION ACCEPT - RADIO UNIQUE ID: ").append(getUniqueID());
sb.append(" MSG:").append(getMessage().toString());
return sb.toString();
}

View File

@@ -1,7 +1,6 @@
/*
* ******************************************************************************
* sdrtrunk
* Copyright (C) 2014-2018 Dennis Sheirer
* *****************************************************************************
* Copyright (C) 2014-2023 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,15 +14,15 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
* *****************************************************************************
* ****************************************************************************
*/
package io.github.dsheirer.module.decode.ltrnet.message.osw;
import io.github.dsheirer.bits.CorrectedBinaryMessage;
import io.github.dsheirer.edac.CRCLTR;
import io.github.dsheirer.identifier.Identifier;
import io.github.dsheirer.module.decode.ltrnet.LtrNetMessageType;
import io.github.dsheirer.module.decode.ltrnet.identifier.LtrSiteIdentifier;
import java.util.ArrayList;
import java.util.List;
@@ -53,7 +52,12 @@ public class SiteId extends LtrNetOswMessage
public String toString()
{
StringBuilder sb = new StringBuilder();
if(!isValid())
{
sb.append("[CRC FAIL: ").append(CRCLTR.getCRCReason(mMessage, getMessageDirection())).append("] ");
}
sb.append("SITE:").append(getSiteID());
sb.append(" MSG:").append(getMessage().toString());
return sb.toString();
}

View File

@@ -1,7 +1,6 @@
/*
* ******************************************************************************
* sdrtrunk
* Copyright (C) 2014-2018 Dennis Sheirer
* *****************************************************************************
* Copyright (C) 2014-2023 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,14 +14,14 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
* *****************************************************************************
* ****************************************************************************
*/
package io.github.dsheirer.module.decode.ltrnet.message.osw;
import io.github.dsheirer.bits.CorrectedBinaryMessage;
import io.github.dsheirer.edac.CRCLTR;
import io.github.dsheirer.identifier.Identifier;
import io.github.dsheirer.module.decode.ltrnet.LtrNetMessageType;
import java.util.Collections;
import java.util.List;
@@ -43,11 +42,16 @@ public class SystemIdle extends LtrNetOswMessage
public String toString()
{
StringBuilder sb = new StringBuilder();
if(!isValid())
{
sb.append("[CRC FAIL: ").append(CRCLTR.getCRCReason(mMessage, getMessageDirection())).append("] ");
}
sb.append("IDLE - AREA:").append(getArea(getMessage()));
sb.append(" LCN:").append(getChannel(getMessage()));
sb.append(" HOME:").append(getHomeRepeater(getMessage()));
sb.append(" GROUP:").append(getGroup(getMessage()));
sb.append(" FREE:").append(getFree(getMessage()));
sb.append(" MSG:").append(getMessage().toString());
return sb.toString();
}

View File

@@ -1,7 +1,6 @@
/*
* ******************************************************************************
* sdrtrunk
* Copyright (C) 2014-2018 Dennis Sheirer
* *****************************************************************************
* Copyright (C) 2014-2023 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,15 +14,15 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
* *****************************************************************************
* ****************************************************************************
*/
package io.github.dsheirer.module.decode.ltrnet.message.osw;
import io.github.dsheirer.bits.CorrectedBinaryMessage;
import io.github.dsheirer.edac.CRCLTR;
import io.github.dsheirer.identifier.Identifier;
import io.github.dsheirer.module.decode.ltrnet.LtrNetMessageType;
import java.util.Collections;
import java.util.List;
@@ -47,8 +46,13 @@ public class TransmitFrequencyHigh extends FrequencyHigh
public String toString()
{
StringBuilder sb = new StringBuilder();
if(!isValid())
{
sb.append("[CRC FAIL: ").append(CRCLTR.getCRCReason(mMessage, getMessageDirection())).append("] ");
}
sb.append("LCN:").append(getChannel());
sb.append(" TRANSMIT FREQUENCY:").append(getFrequency()).append(" - HIGH");
sb.append(" MSG:").append(getMessage().toString());
return sb.toString();
}

View File

@@ -1,7 +1,6 @@
/*
* ******************************************************************************
* sdrtrunk
* Copyright (C) 2014-2018 Dennis Sheirer
* *****************************************************************************
* Copyright (C) 2014-2023 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,15 +14,15 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
* *****************************************************************************
* ****************************************************************************
*/
package io.github.dsheirer.module.decode.ltrnet.message.osw;
import io.github.dsheirer.bits.CorrectedBinaryMessage;
import io.github.dsheirer.edac.CRCLTR;
import io.github.dsheirer.identifier.Identifier;
import io.github.dsheirer.module.decode.ltrnet.LtrNetMessageType;
import java.util.Collections;
import java.util.List;
@@ -47,8 +46,13 @@ public class TransmitFrequencyLow extends FrequencyLow
public String toString()
{
StringBuilder sb = new StringBuilder();
if(!isValid())
{
sb.append("[CRC FAIL: ").append(CRCLTR.getCRCReason(mMessage, getMessageDirection())).append("] ");
}
sb.append("LCN:").append(getChannel());
sb.append(" TRANSMIT FREQUENCY:").append(getFrequency()).append(" - LOW");
sb.append(" MSG:").append(getMessage().toString());
return sb.toString();
}

View File

@@ -1,6 +1,6 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2022 Dennis Sheirer
* Copyright (C) 2014-2023 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,7 +18,6 @@
*/
package io.github.dsheirer.module.decode.ltrstandard;
import io.github.dsheirer.alias.AliasList;
import io.github.dsheirer.bits.MessageFramer;
import io.github.dsheirer.bits.SyncPattern;
import io.github.dsheirer.dsp.fsk.LTRDecoder;
@@ -27,11 +26,16 @@ import io.github.dsheirer.module.decode.Decoder;
import io.github.dsheirer.module.decode.DecoderType;
import io.github.dsheirer.sample.Listener;
import io.github.dsheirer.sample.real.IRealBufferListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* LTR Decoder
*/
public class LTRStandardDecoder extends Decoder implements IRealBufferListener, Listener<float[]>
{
public static final int LTR_STANDARD_MESSAGE_LENGTH = 40;
private static final Logger mLog = LoggerFactory.getLogger(LTRStandardDecoder.class);
private LTRDecoder mLTRDecoder;
private MessageFramer mLTRMessageFramer;
private LTRStandardMessageProcessor mLTRMessageProcessor;
@@ -40,9 +44,9 @@ public class LTRStandardDecoder extends Decoder implements IRealBufferListener,
* LTR Decoder. Decodes unfiltered (e.g. demodulated but with no DC or
* audio filtering) samples and produces LTR Standard messages.
*/
public LTRStandardDecoder(AliasList aliasList, MessageDirection direction)
public LTRStandardDecoder(MessageDirection direction)
{
mLTRDecoder = new LTRDecoder(LTR_STANDARD_MESSAGE_LENGTH);
mLTRDecoder = new LTRDecoder();
if(direction == MessageDirection.OSW)
{
@@ -53,11 +57,17 @@ public class LTRStandardDecoder extends Decoder implements IRealBufferListener,
mLTRMessageFramer = new MessageFramer(SyncPattern.LTR_STANDARD_ISW.getPattern(), LTR_STANDARD_MESSAGE_LENGTH);
}
mLTRDecoder.setMessageFramer(mLTRMessageFramer);
mLTRMessageFramer.setSyncDetectListener(mLTRDecoder);
mLTRDecoder.setListener(symbols -> {
for(boolean symbol: symbols)
{
mLTRMessageFramer.process(symbol);
}
});
mLTRMessageProcessor = new LTRStandardMessageProcessor(direction);
mLTRMessageFramer.addMessageListener(mLTRMessageProcessor);
mLTRMessageProcessor.setMessageListener(getMessageListener());
mLTRMessageProcessor.setMessageListener(message -> {
getMessageListener().receive(message);
});
}
@Override

View File

@@ -118,6 +118,8 @@ public class LTRStandardDecoderState extends DecoderState
{
CallEnd end = (CallEnd)message;
mCurrentTalkgroup = null;
//Home channel is 31 for call end -- use the free channel as the call end channel
int repeater = end.getFree();
setChannelNumber(repeater);
@@ -128,13 +130,14 @@ public class LTRStandardDecoderState extends DecoderState
mCurrentCallEvent.end(end.getTimestamp());
}
broadcast(new DecoderStateEvent(this, Event.END, State.FADE));
broadcast(new DecoderStateEvent(this, Event.END, State.IDLE));
}
}
break;
case IDLE:
if(message instanceof Idle)
{
mCurrentTalkgroup = null;
mLCNTracker.processCallChannel(((Idle)message).getChannel());
}
break;

View File

@@ -69,7 +69,7 @@ public class LTRStandardMessageProcessor implements Listener<CorrectedBinaryMess
int free = binaryMessage.getInt(LTRMessage.FREE);
int group = binaryMessage.getInt(LTRMessage.GROUP);
if(isValidChannel(channel) && isValidChannel(home) && isValidChannel(free))
if(isValidChannel(channel) && isValidChannel(home) && isValidFreeChannel(free))
{
if(channel == free && group == 255)
{
@@ -80,7 +80,7 @@ public class LTRStandardMessageProcessor implements Listener<CorrectedBinaryMess
message = new Call(binaryMessage, mDirection, crc);
}
}
else if(channel == 31 && isValidChannel(home) && isValidChannel(free))
else if(channel == 31 && isValidChannel(home) && isValidFreeChannel(free))
{
message = new CallEnd(binaryMessage, mDirection, crc);
}
@@ -102,6 +102,14 @@ public class LTRStandardMessageProcessor implements Listener<CorrectedBinaryMess
return (1 <= channel && channel <= 20);
}
/**
* Checks the channel (LCN) number to ensure it is in the range 1 -20
*/
private boolean isValidFreeChannel(int channel)
{
return (0 <= channel && channel <= 20);
}
public void setMessageListener(Listener<IMessage> listener)
{
mMessageListener = listener;

View File

@@ -1,6 +1,6 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2022 Dennis Sheirer
* Copyright (C) 2014-2023 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,17 +20,19 @@ package io.github.dsheirer.module.decode.passport;
import io.github.dsheirer.bits.MessageFramer;
import io.github.dsheirer.bits.SyncPattern;
import io.github.dsheirer.dsp.fsk.LTRDecoder;
import io.github.dsheirer.module.decode.Decoder;
import io.github.dsheirer.module.decode.DecoderType;
import io.github.dsheirer.module.decode.config.DecodeConfiguration;
import io.github.dsheirer.dsp.fsk.LTRDecoder;
import io.github.dsheirer.sample.Listener;
import io.github.dsheirer.sample.real.IRealBufferListener;
/**
* LTR Passport decoder
*/
public class PassportDecoder extends Decoder implements IRealBufferListener, Listener<float[]>
{
public static final int PASSPORT_MESSAGE_LENGTH = 68;
private LTRDecoder mLTRDecoder;
private MessageFramer mPassportMessageFramer;
private PassportMessageProcessor mPassportMessageProcessor;
@@ -41,12 +43,16 @@ public class PassportDecoder extends Decoder implements IRealBufferListener, Lis
*/
public PassportDecoder(DecodeConfiguration config)
{
mLTRDecoder = new LTRDecoder(PASSPORT_MESSAGE_LENGTH);
mLTRDecoder = new LTRDecoder();
mPassportMessageFramer = new MessageFramer(SyncPattern.PASSPORT.getPattern(), PASSPORT_MESSAGE_LENGTH);
mLTRDecoder.setMessageFramer(mPassportMessageFramer);
mPassportMessageFramer.setSyncDetectListener(mLTRDecoder);
mLTRDecoder.setListener(bits -> {
for(boolean bit: bits)
{
mPassportMessageFramer.process(bit);
}
});
mPassportMessageProcessor = new PassportMessageProcessor();
mPassportMessageFramer.addMessageListener(mPassportMessageProcessor);
mPassportMessageProcessor.setMessageListener(getMessageListener());

View File

@@ -352,6 +352,8 @@ public class PassportMessage extends Message
break;
}
sb.append(" MSG:").append(getMessage().toString());
return sb.toString();
}