#1584 Updates DMR & P25 decoders to stop processing residual samples from the current buffer after a traffic channel shutdown has been signalled. (#1585)

Co-authored-by: Dennis Sheirer <dsheirer@github.com>
This commit is contained in:
Denny Sheirer
2023-06-25 03:56:08 -04:00
committed by GitHub
parent e5f5df74ad
commit bac38a5bd8
8 changed files with 122 additions and 81 deletions

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
@@ -30,6 +30,7 @@ public abstract class PSKDemodulator<T> implements ComplexSampleListener
private IPhaseLockedLoop mPLL;
private Complex mReceivedSample = new Complex(0, 0);
private Listener<T> mSymbolListener;
private boolean mRunning;
/**
* Abstract Phase Shift Keyed (PSK) demodulator
@@ -42,6 +43,31 @@ public abstract class PSKDemodulator<T> implements ComplexSampleListener
mPLL = phaseLockedLoop;
}
/**
* Starts this decoder and sets the running flag to true
*/
public void start()
{
mRunning = true;
}
/**
* Stops this decoder and sets the running flag to false.
*/
public void stop()
{
mRunning = false;
}
/**
* Indicates if this demodulator is running and capable of processing samples
* @return true if running
*/
public boolean isRunning()
{
return mRunning;
}
/**
* Registers the listener to receive symbol decisions from this demodulator
*/
@@ -90,7 +116,10 @@ public abstract class PSKDemodulator<T> implements ComplexSampleListener
for(int x = 0; x < i.length; x++)
{
receive(i[x], q[x]);
if(isRunning())
{
receive(i[x], q[x]);
}
}
}