mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-20 04:27:48 -05:00
MPT1327: Fix decoding of calls to past talkgroups (#824)
* MPT1327: Fix decoding of calls to past talkgroups * Fixed updating event in case of teardown. Other improvements.
This commit is contained in:
committed by
GitHub
parent
e1194d26bd
commit
3d816c3570
@@ -325,23 +325,14 @@ public class MPT1327TrafficChannelManager extends Module implements IDecodeEvent
|
|||||||
switch(channelEvent.getEvent())
|
switch(channelEvent.getEvent())
|
||||||
{
|
{
|
||||||
case NOTIFICATION_PROCESSING_STOP:
|
case NOTIFICATION_PROCESSING_STOP:
|
||||||
MPT1327Channel toRemove = null;
|
final var toRemove = mptChannelForChannel(channel);
|
||||||
|
|
||||||
for(Map.Entry<MPT1327Channel,Channel> entry : mAllocatedTrafficChannelMap.entrySet())
|
|
||||||
{
|
|
||||||
if(entry.getValue() == channel)
|
|
||||||
{
|
|
||||||
toRemove = entry.getKey();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(toRemove != null)
|
if(toRemove != null)
|
||||||
{
|
{
|
||||||
mAllocatedTrafficChannelMap.remove(toRemove);
|
mAllocatedTrafficChannelMap.remove(toRemove);
|
||||||
mAvailableTrafficChannelQueue.add(channel);
|
mAvailableTrafficChannelQueue.add(channel);
|
||||||
|
|
||||||
MPT1327ChannelGrantEvent event = mChannelGrantEventMap.get(toRemove);
|
final var event = mChannelGrantEventMap.remove(toRemove);
|
||||||
|
|
||||||
if(event != null)
|
if(event != null)
|
||||||
{
|
{
|
||||||
@@ -351,23 +342,14 @@ public class MPT1327TrafficChannelManager extends Module implements IDecodeEvent
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NOTIFICATION_PROCESSING_START_REJECTED:
|
case NOTIFICATION_PROCESSING_START_REJECTED:
|
||||||
MPT1327Channel rejected = null;
|
final var rejected = mptChannelForChannel(channel);
|
||||||
|
|
||||||
for(Map.Entry<MPT1327Channel,Channel> entry : mAllocatedTrafficChannelMap.entrySet())
|
|
||||||
{
|
|
||||||
if(entry.getValue() == channel)
|
|
||||||
{
|
|
||||||
rejected = entry.getKey();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(rejected != null)
|
if(rejected != null)
|
||||||
{
|
{
|
||||||
mAllocatedTrafficChannelMap.remove(rejected);
|
mAllocatedTrafficChannelMap.remove(rejected);
|
||||||
mAvailableTrafficChannelQueue.add(channel);
|
mAvailableTrafficChannelQueue.add(channel);
|
||||||
|
|
||||||
MPT1327ChannelGrantEvent event = mChannelGrantEventMap.get(rejected);
|
final var event = mChannelGrantEventMap.remove(rejected);
|
||||||
|
|
||||||
if(event != null)
|
if(event != null)
|
||||||
{
|
{
|
||||||
@@ -386,5 +368,17 @@ public class MPT1327TrafficChannelManager extends Module implements IDecodeEvent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private MPT1327Channel mptChannelForChannel(final Channel channel)
|
||||||
|
{
|
||||||
|
for (final var entry : mAllocatedTrafficChannelMap.entrySet())
|
||||||
|
{
|
||||||
|
if (entry.getValue() == channel)
|
||||||
|
{
|
||||||
|
return entry.getKey();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user