mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-19 20:17:25 -05:00
#1787 Resolves issue with channel rotation and rest channel reallocation for Capacity Plus systems. (#1798)
Co-authored-by: sheirerd <sheirerd@ainfosec.com>
This commit is contained in:
@@ -1361,10 +1361,11 @@ public class DMRDecoderState extends TimeslotDecoderState
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NOTIFICATION_SOURCE_FREQUENCY:
|
case NOTIFICATION_SOURCE_FREQUENCY:
|
||||||
|
long previous = mCurrentFrequency;
|
||||||
mCurrentFrequency = event.getFrequency();
|
mCurrentFrequency = event.getFrequency();
|
||||||
if(hasTrafficChannelManager())
|
if(hasTrafficChannelManager())
|
||||||
{
|
{
|
||||||
mTrafficChannelManager.setCurrentControlFrequency(mCurrentFrequency, mChannel);
|
mTrafficChannelManager.setCurrentControlFrequency(previous, mCurrentFrequency, mChannel);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import io.github.dsheirer.module.decode.dmr.channel.TimeslotFrequency;
|
|||||||
import io.github.dsheirer.module.decode.dmr.identifier.DMRTalkgroup;
|
import io.github.dsheirer.module.decode.dmr.identifier.DMRTalkgroup;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.DMRBurst;
|
import io.github.dsheirer.module.decode.dmr.message.DMRBurst;
|
||||||
|
import io.github.dsheirer.module.decode.dmr.message.data.DataMessageWithLinkControl;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.IDLEMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.IDLEMessage;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.block.DataBlock;
|
import io.github.dsheirer.module.decode.dmr.message.data.block.DataBlock;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
@@ -48,12 +49,13 @@ import io.github.dsheirer.module.decode.dmr.message.voice.VoiceEMBMessage;
|
|||||||
import io.github.dsheirer.module.decode.dmr.message.voice.VoiceMessage;
|
import io.github.dsheirer.module.decode.dmr.message.voice.VoiceMessage;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.voice.VoiceSuperFrameProcessor;
|
import io.github.dsheirer.module.decode.dmr.message.voice.VoiceSuperFrameProcessor;
|
||||||
import io.github.dsheirer.sample.Listener;
|
import io.github.dsheirer.sample.Listener;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Processes DMR messages and performs re-assembly of link control fragments
|
* Processes DMR messages and performs re-assembly of link control fragments
|
||||||
@@ -154,6 +156,12 @@ public class DMRMessageProcessor implements Listener<IMessage>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Process data messages carrying a link control payload so that the LC payload can be processed/enriched
|
||||||
|
if(message instanceof DataMessageWithLinkControl linkControlCarrier)
|
||||||
|
{
|
||||||
|
receive(linkControlCarrier.getLCMessage());
|
||||||
|
}
|
||||||
|
|
||||||
//Enrich messages that carry DMR Logical Channel Numbers with LCN to frequency mappings
|
//Enrich messages that carry DMR Logical Channel Numbers with LCN to frequency mappings
|
||||||
if(message instanceof ITimeslotFrequencyReceiver)
|
if(message instanceof ITimeslotFrequencyReceiver)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -134,12 +134,38 @@ public class DMRTrafficChannelManager extends TrafficChannelManager implements I
|
|||||||
/**
|
/**
|
||||||
* Sets the current parent control channel frequency so that channel grants for the current frequency do not
|
* Sets the current parent control channel frequency so that channel grants for the current frequency do not
|
||||||
* produce an additional traffic channel allocation.
|
* produce an additional traffic channel allocation.
|
||||||
* @param currentControlFrequency for current control channel.
|
* @param previousControlFrequency for the current control channel (to remove from allocated channels)
|
||||||
|
* @param currentControlFrequency for current control channel (to add to allocated channels)
|
||||||
* @param channel for the current control channel
|
* @param channel for the current control channel
|
||||||
*/
|
*/
|
||||||
public void setCurrentControlFrequency(long currentControlFrequency, Channel channel)
|
public void setCurrentControlFrequency(long previousControlFrequency, long currentControlFrequency, Channel channel)
|
||||||
{
|
{
|
||||||
mAllocatedChannelFrequencyMap.put(currentControlFrequency, channel);
|
if(previousControlFrequency == currentControlFrequency)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mLock.lock();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Channel existing = mAllocatedChannelFrequencyMap.get(previousControlFrequency);
|
||||||
|
|
||||||
|
//Only remove the channel if it is non-null and it matches the current control channel.
|
||||||
|
if(channel.equals(existing))
|
||||||
|
{
|
||||||
|
//Unlock the frequency in the channel rotation monitor
|
||||||
|
getInterModuleEventBus().post(FrequencyLockChangeRequest.unlock(previousControlFrequency));
|
||||||
|
mAllocatedChannelFrequencyMap.remove(previousControlFrequency);
|
||||||
|
}
|
||||||
|
|
||||||
|
mAllocatedChannelFrequencyMap.put(currentControlFrequency, channel);
|
||||||
|
getInterModuleEventBus().post(FrequencyLockChangeRequest.lock(currentControlFrequency));
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
mLock.unlock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user