Skip to content

Commit

Permalink
#1787 DMR capacity max group voice update handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
sheirerd committed Jan 14, 2024
1 parent 9d03c15 commit 147e579
Showing 1 changed file with 52 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,19 @@
import io.github.dsheirer.identifier.MutableIdentifierCollection;
import io.github.dsheirer.identifier.Role;
import io.github.dsheirer.identifier.integer.IntegerIdentifier;
import io.github.dsheirer.identifier.talkgroup.TalkgroupIdentifier;
import io.github.dsheirer.message.IMessage;
import io.github.dsheirer.module.decode.DecoderType;
import io.github.dsheirer.module.decode.dmr.channel.DMRChannel;
import io.github.dsheirer.module.decode.dmr.channel.DMRTier3Channel;
import io.github.dsheirer.module.decode.dmr.event.DMRDecodeEvent;
import io.github.dsheirer.module.decode.dmr.identifier.DMRTalkgroup;
import io.github.dsheirer.module.decode.dmr.message.DMRMessage;
import io.github.dsheirer.module.decode.dmr.message.data.DataMessage;
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
import io.github.dsheirer.module.decode.dmr.message.data.csbk.hytera.HyteraTrafficChannelTalkerStatus;
import io.github.dsheirer.module.decode.dmr.message.data.csbk.motorola.CapacityMaxAloha;
import io.github.dsheirer.module.decode.dmr.message.data.csbk.motorola.CapacityMaxGroupVoiceChannelUpdate;
import io.github.dsheirer.module.decode.dmr.message.data.csbk.motorola.CapacityPlusNeighbors;
import io.github.dsheirer.module.decode.dmr.message.data.csbk.motorola.CapacityPlusSiteStatus;
import io.github.dsheirer.module.decode.dmr.message.data.csbk.motorola.ConnectPlusDataChannelGrant;
Expand Down Expand Up @@ -877,6 +880,55 @@ private void processCSBK(CSBKMessage csbk)
}
broadcast(new DecoderStateEvent(this, Event.CONTINUATION, State.CONTROL, getTimeslot()));
break;
case MOTOROLA_CAPMAX_GROUP_VOICE_CHANNEL_UPDATE:
if(csbk instanceof CapacityMaxGroupVoiceChannelUpdate cmgvcu)
{
DMRTier3Channel channel = cmgvcu.getChannel();

if(hasTrafficChannelManager())
{
IdentifierCollection mergedIdentifiers = getMergedIdentifierCollection(csbk.getIdentifiers());
mTrafficChannelManager.processChannelGrant(channel, mergedIdentifiers, csbk.getOpcode(),
csbk.getTimestamp(), csbk.isEncrypted());
}
else
{
DecodeEvent event = mDetectedCallEventsMap.get(channel);

//This message doesn't have a good timeslot reference, so try to find an event in the map
if(event == null)
{
TalkgroupIdentifier talkgroupIdentifier = cmgvcu.getTalkgroup();
for(DecodeEvent decodeEvent: mDetectedCallEventsMap.values())
{
for(Identifier identifier: event.getIdentifierCollection().getIdentifiers(Role.TO))
{
if(identifier instanceof TalkgroupIdentifier ti && ti.getValue().equals(talkgroupIdentifier))
{
event = decodeEvent;
mDetectedCallEventsMap.put(channel, event);
break;
}
}
}
}

if(isStale(event, csbk.getTimestamp(), csbk.getIdentifiers()))
{
event = getDecodeEvent(csbk, DecodeEventType.CALL_GROUP, channel,
new IdentifierCollection(csbk.getIdentifiers()));
mDetectedCallEventsMap.put(channel, event);
}
else
{
//Update the ending timestamp for the event and rebroadcast
event.end(csbk.getTimestamp());
}

broadcast(event);
}
}
break;
case MOTOROLA_CONPLUS_DATA_CHANNEL_GRANT:
if(csbk instanceof ConnectPlusDataChannelGrant)
{
Expand Down

0 comments on commit 147e579

Please sign in to comment.