Skip to content

Commit

Permalink
#1996 P25P1 traffic channel monitor now clears allocated traffic chan…
Browse files Browse the repository at this point in the history
…nels each time the control frequency changes, which should be after a lose-sync event. This ensures that none of the traffic channel frequencies get blocked when the monitor thinks that a channel is already allocated. (#1997)

Co-authored-by: Dennis Sheirer <[email protected]>
  • Loading branch information
DSheirer and Dennis Sheirer authored Oct 1, 2024
1 parent 0ecdf4d commit 161595e
Showing 1 changed file with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.LinkedTransferQueue;
import java.util.concurrent.locks.ReentrantLock;
import java.util.function.BiConsumer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -169,12 +170,22 @@ protected void processControlFrequencyUpdate(long previous, long current, Channe

try
{
Channel channel = mAllocatedTrafficChannelMap.get(current);

if(!parentChannel.equals(channel))
//Shutdown all existing traffic channels and clear the maps.
mAllocatedTrafficChannelMap.forEach(new BiConsumer<Long, Channel>()
{
broadcast(new ChannelEvent(mAllocatedTrafficChannelMap.get(current), Event.REQUEST_DISABLE));
}
@Override
public void accept(Long aLong, Channel channel)
{
if(!parentChannel.equals(channel))
{
broadcast(new ChannelEvent(channel, Event.REQUEST_DISABLE));
}
}
});

mAllocatedTrafficChannelMap.clear();
mTS1ChannelGrantEventMap.clear();
mTS2ChannelGrantEventMap.clear();

//Store the control channel in the allocated channel map so that we don't allocate a traffic channel against it
mAllocatedTrafficChannelMap.put(current, parentChannel);
Expand Down

0 comments on commit 161595e

Please sign in to comment.