mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-16 18:47:33 -05:00
#1152 Resolves issue where patch groups were not being properly formatted when uploading to broadcastify calls api. (#1153)
Co-authored-by: Dennis Sheirer <dsheirer@github.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2022 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -417,38 +417,48 @@ public class BroadcastifyCallBroadcaster extends AbstractAudioBroadcaster<Broadc
|
|||||||
{
|
{
|
||||||
List<Identifier> toIdentifiers = audioRecording.getIdentifierCollection().getIdentifiers(Role.TO);
|
List<Identifier> toIdentifiers = audioRecording.getIdentifierCollection().getIdentifiers(Role.TO);
|
||||||
|
|
||||||
if(toIdentifiers.size() >= 1)
|
//Format a patch group first, if there are multiples
|
||||||
|
for(Identifier identifier: toIdentifiers)
|
||||||
{
|
{
|
||||||
Identifier to = toIdentifiers.get(0);
|
if(identifier instanceof PatchGroupIdentifier patchGroupIdentifier)
|
||||||
|
{
|
||||||
if(to instanceof TalkgroupIdentifier)
|
return format(patchGroupIdentifier);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(Identifier identifier: toIdentifiers)
|
||||||
|
{
|
||||||
|
if(identifier instanceof TalkgroupIdentifier talkgroupIdentifier)
|
||||||
{
|
{
|
||||||
TalkgroupIdentifier talkgroupIdentifier = (TalkgroupIdentifier)to;
|
|
||||||
return String.valueOf(RadioReferenceDecoder.convertToRadioReferenceTalkgroup(talkgroupIdentifier.getValue(),
|
return String.valueOf(RadioReferenceDecoder.convertToRadioReferenceTalkgroup(talkgroupIdentifier.getValue(),
|
||||||
talkgroupIdentifier.getProtocol()));
|
talkgroupIdentifier.getProtocol()));
|
||||||
}
|
}
|
||||||
else if(to instanceof PatchGroupIdentifier)
|
else if(identifier instanceof RadioIdentifier radioIdentifier)
|
||||||
{
|
{
|
||||||
PatchGroup patchGroup = ((PatchGroupIdentifier)to).getValue();
|
return radioIdentifier.getValue().toString();
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append(patchGroup.getPatchGroup().getValue().toString());
|
|
||||||
for(TalkgroupIdentifier patched: patchGroup.getPatchedGroupIdentifiers())
|
|
||||||
{
|
|
||||||
sb.append(",").append(patched.getValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
else if(to instanceof RadioIdentifier)
|
|
||||||
{
|
|
||||||
return ((RadioIdentifier)to).getValue().toString();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return "0";
|
return "0";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Formats a patch group
|
||||||
|
*/
|
||||||
|
public static String format(PatchGroupIdentifier patchGroupIdentifier)
|
||||||
|
{
|
||||||
|
PatchGroup patchGroup = patchGroupIdentifier.getValue();
|
||||||
|
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append(patchGroup.getPatchGroup().getValue().toString());
|
||||||
|
for(TalkgroupIdentifier patched: patchGroup.getPatchedGroupIdentifiers())
|
||||||
|
{
|
||||||
|
sb.append(",").append(patched.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests both the connection and configuration against the Broadcastify Call API service
|
* Tests both the connection and configuration against the Broadcastify Call API service
|
||||||
* @param configuration containing API key and system id
|
* @param configuration containing API key and system id
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* ******************************************************************************
|
* *****************************************************************************
|
||||||
* sdrtrunk
|
* Copyright (C) 2014-2022 Dennis Sheirer
|
||||||
* Copyright (C) 2014-2019 Dennis Sheirer
|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -15,7 +14,7 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
* *****************************************************************************
|
* ****************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package io.github.dsheirer.identifier.patch;
|
package io.github.dsheirer.identifier.patch;
|
||||||
@@ -46,10 +45,22 @@ public class PatchGroupManager
|
|||||||
private Map<Integer,Long> mPatchGroupLastUpdatedMap = new HashMap<>();
|
private Map<Integer,Long> mPatchGroupLastUpdatedMap = new HashMap<>();
|
||||||
private Map<Integer,PatchGroupIdentifier> mPatchGroupMap = new HashMap<>();
|
private Map<Integer,PatchGroupIdentifier> mPatchGroupMap = new HashMap<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs an instance
|
||||||
|
*/
|
||||||
public PatchGroupManager()
|
public PatchGroupManager()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears any existing patch groups
|
||||||
|
*/
|
||||||
|
public void clear()
|
||||||
|
{
|
||||||
|
mPatchGroupMap.clear();
|
||||||
|
mPatchGroupLastUpdatedMap.clear();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the patch group identifier to the set of managed patch groups. If the patch group is already being
|
* Adds the patch group identifier to the set of managed patch groups. If the patch group is already being
|
||||||
* managed, the new identifier is checked for additional patched talkgroups and they are added to the existing
|
* managed, the new identifier is checked for additional patched talkgroups and they are added to the existing
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* *****************************************************************************
|
||||||
|
* Copyright (C) 2014-2022 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
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* ****************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.github.dsheirer.identifier.patch;
|
||||||
|
|
||||||
|
import io.github.dsheirer.controller.channel.event.PreloadDataContent;
|
||||||
|
import io.github.dsheirer.identifier.IdentifierCollection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Preload patch group data content carrying the current list of identifiers in an identifier collection.
|
||||||
|
*/
|
||||||
|
public class PatchGroupPreLoadDataContent extends PreloadDataContent<IdentifierCollection>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Constructs an instance
|
||||||
|
*
|
||||||
|
* @param data to preload
|
||||||
|
*/
|
||||||
|
public PatchGroupPreLoadDataContent(IdentifierCollection data)
|
||||||
|
{
|
||||||
|
super(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,23 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
|
* *****************************************************************************
|
||||||
|
* Copyright (C) 2014-2022 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* * ******************************************************************************
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* * Copyright (C) 2014-2019 Dennis Sheirer
|
* it under the terms of the GNU General Public License as published by
|
||||||
* *
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* * This program is free software: you can redistribute it and/or modify
|
* (at your option) any later version.
|
||||||
* * it under the terms of the GNU General Public License as published by
|
|
||||||
* * the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* * (at your option) any later version.
|
|
||||||
* *
|
|
||||||
* * This program is distributed in the hope that it will be useful,
|
|
||||||
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* * GNU General Public License for more details.
|
|
||||||
* *
|
|
||||||
* * You should have received a copy of the GNU General Public License
|
|
||||||
* * along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
* * *****************************************************************************
|
|
||||||
*
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* ****************************************************************************
|
||||||
*/
|
*/
|
||||||
package io.github.dsheirer.module.decode.p25;
|
package io.github.dsheirer.module.decode.p25;
|
||||||
|
|
||||||
@@ -32,6 +29,7 @@ import io.github.dsheirer.identifier.Identifier;
|
|||||||
import io.github.dsheirer.identifier.IdentifierCollection;
|
import io.github.dsheirer.identifier.IdentifierCollection;
|
||||||
import io.github.dsheirer.identifier.MutableIdentifierCollection;
|
import io.github.dsheirer.identifier.MutableIdentifierCollection;
|
||||||
import io.github.dsheirer.identifier.Role;
|
import io.github.dsheirer.identifier.Role;
|
||||||
|
import io.github.dsheirer.identifier.patch.PatchGroupPreLoadDataContent;
|
||||||
import io.github.dsheirer.identifier.scramble.ScrambleParameterIdentifier;
|
import io.github.dsheirer.identifier.scramble.ScrambleParameterIdentifier;
|
||||||
import io.github.dsheirer.message.IMessage;
|
import io.github.dsheirer.message.IMessage;
|
||||||
import io.github.dsheirer.message.IMessageListener;
|
import io.github.dsheirer.message.IMessageListener;
|
||||||
@@ -315,7 +313,11 @@ public class P25TrafficChannelManager extends TrafficChannelManager implements I
|
|||||||
sourceConfig.setFrequency(frequency);
|
sourceConfig.setFrequency(frequency);
|
||||||
trafficChannel.setSourceConfiguration(sourceConfig);
|
trafficChannel.setSourceConfiguration(sourceConfig);
|
||||||
mAllocatedTrafficChannelMap.put(frequency, trafficChannel);
|
mAllocatedTrafficChannelMap.put(frequency, trafficChannel);
|
||||||
getInterModuleEventBus().post(new ChannelStartProcessingRequest(trafficChannel, apco25Channel, identifierCollection));
|
|
||||||
|
ChannelStartProcessingRequest startChannelRequest =
|
||||||
|
new ChannelStartProcessingRequest(trafficChannel, apco25Channel, identifierCollection);
|
||||||
|
startChannelRequest.addPreloadDataContent(new PatchGroupPreLoadDataContent(identifierCollection));
|
||||||
|
getInterModuleEventBus().post(startChannelRequest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -361,7 +363,11 @@ public class P25TrafficChannelManager extends TrafficChannelManager implements I
|
|||||||
sourceConfig.setFrequency(frequency);
|
sourceConfig.setFrequency(frequency);
|
||||||
trafficChannel.setSourceConfiguration(sourceConfig);
|
trafficChannel.setSourceConfiguration(sourceConfig);
|
||||||
mAllocatedTrafficChannelMap.put(frequency, trafficChannel);
|
mAllocatedTrafficChannelMap.put(frequency, trafficChannel);
|
||||||
getInterModuleEventBus().post(new ChannelStartProcessingRequest(trafficChannel, apco25Channel, identifierCollection));
|
|
||||||
|
ChannelStartProcessingRequest startChannelRequest =
|
||||||
|
new ChannelStartProcessingRequest(trafficChannel, apco25Channel, identifierCollection);
|
||||||
|
startChannelRequest.addPreloadDataContent(new PatchGroupPreLoadDataContent(identifierCollection));
|
||||||
|
getInterModuleEventBus().post(startChannelRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
broadcast(channelGrantEvent);
|
broadcast(channelGrantEvent);
|
||||||
@@ -465,7 +471,10 @@ public class P25TrafficChannelManager extends TrafficChannelManager implements I
|
|||||||
decodeConfig.setScrambleParameters(mPhase2ScrambleParameters.copy());
|
decodeConfig.setScrambleParameters(mPhase2ScrambleParameters.copy());
|
||||||
}
|
}
|
||||||
|
|
||||||
getInterModuleEventBus().post(new ChannelStartProcessingRequest(trafficChannel, apco25Channel, identifierCollection));
|
ChannelStartProcessingRequest startChannelRequest =
|
||||||
|
new ChannelStartProcessingRequest(trafficChannel, apco25Channel, identifierCollection);
|
||||||
|
startChannelRequest.addPreloadDataContent(new PatchGroupPreLoadDataContent(identifierCollection));
|
||||||
|
getInterModuleEventBus().post(startChannelRequest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -519,7 +528,11 @@ public class P25TrafficChannelManager extends TrafficChannelManager implements I
|
|||||||
sourceConfig.setFrequency(frequency);
|
sourceConfig.setFrequency(frequency);
|
||||||
trafficChannel.setSourceConfiguration(sourceConfig);
|
trafficChannel.setSourceConfiguration(sourceConfig);
|
||||||
mAllocatedTrafficChannelMap.put(frequency, trafficChannel);
|
mAllocatedTrafficChannelMap.put(frequency, trafficChannel);
|
||||||
getInterModuleEventBus().post(new ChannelStartProcessingRequest(trafficChannel, apco25Channel, identifierCollection));
|
|
||||||
|
ChannelStartProcessingRequest startChannelRequest =
|
||||||
|
new ChannelStartProcessingRequest(trafficChannel, apco25Channel, identifierCollection);
|
||||||
|
startChannelRequest.addPreloadDataContent(new PatchGroupPreLoadDataContent(identifierCollection));
|
||||||
|
getInterModuleEventBus().post(startChannelRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
broadcast(channelGrantEvent);
|
broadcast(channelGrantEvent);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2021 Dennis Sheirer
|
* Copyright (C) 2014-2022 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -18,6 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package io.github.dsheirer.module.decode.p25.phase1;
|
package io.github.dsheirer.module.decode.p25.phase1;
|
||||||
|
|
||||||
|
import com.google.common.eventbus.Subscribe;
|
||||||
import io.github.dsheirer.channel.state.ChangeChannelTimeoutEvent;
|
import io.github.dsheirer.channel.state.ChangeChannelTimeoutEvent;
|
||||||
import io.github.dsheirer.channel.state.DecoderState;
|
import io.github.dsheirer.channel.state.DecoderState;
|
||||||
import io.github.dsheirer.channel.state.DecoderStateEvent;
|
import io.github.dsheirer.channel.state.DecoderStateEvent;
|
||||||
@@ -33,7 +34,9 @@ import io.github.dsheirer.identifier.IdentifierClass;
|
|||||||
import io.github.dsheirer.identifier.IdentifierCollection;
|
import io.github.dsheirer.identifier.IdentifierCollection;
|
||||||
import io.github.dsheirer.identifier.MutableIdentifierCollection;
|
import io.github.dsheirer.identifier.MutableIdentifierCollection;
|
||||||
import io.github.dsheirer.identifier.Role;
|
import io.github.dsheirer.identifier.Role;
|
||||||
|
import io.github.dsheirer.identifier.patch.PatchGroupIdentifier;
|
||||||
import io.github.dsheirer.identifier.patch.PatchGroupManager;
|
import io.github.dsheirer.identifier.patch.PatchGroupManager;
|
||||||
|
import io.github.dsheirer.identifier.patch.PatchGroupPreLoadDataContent;
|
||||||
import io.github.dsheirer.message.IMessage;
|
import io.github.dsheirer.message.IMessage;
|
||||||
import io.github.dsheirer.module.decode.DecoderType;
|
import io.github.dsheirer.module.decode.DecoderType;
|
||||||
import io.github.dsheirer.module.decode.event.DecodeEvent;
|
import io.github.dsheirer.module.decode.event.DecodeEvent;
|
||||||
@@ -229,7 +232,7 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
resetState();
|
resetState();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resets any temporal state details
|
* Resets any temporal state details
|
||||||
*/
|
*/
|
||||||
protected void resetState()
|
protected void resetState()
|
||||||
@@ -244,6 +247,22 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Processes an identifier collection to harvest Patch Groups to preload when this channel is first starting up.
|
||||||
|
* @param preLoadDataContent containing an identifier collection with optional patch group identifier(s).
|
||||||
|
*/
|
||||||
|
@Subscribe
|
||||||
|
public void process(PatchGroupPreLoadDataContent preLoadDataContent)
|
||||||
|
{
|
||||||
|
for(Identifier identifier: preLoadDataContent.getData().getIdentifiers(Role.TO))
|
||||||
|
{
|
||||||
|
if(identifier instanceof PatchGroupIdentifier patchGroupIdentifier)
|
||||||
|
{
|
||||||
|
mPatchGroupManager.addPatchGroup(patchGroupIdentifier);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Primary message processing method.
|
* Primary message processing method.
|
||||||
*/
|
*/
|
||||||
@@ -2161,6 +2180,8 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
@Override
|
@Override
|
||||||
public void start()
|
public void start()
|
||||||
{
|
{
|
||||||
|
mPatchGroupManager.clear();
|
||||||
|
|
||||||
//Change the default (45-second) traffic channel timeout to 1 second
|
//Change the default (45-second) traffic channel timeout to 1 second
|
||||||
if(mChannelType == ChannelType.TRAFFIC)
|
if(mChannelType == ChannelType.TRAFFIC)
|
||||||
{
|
{
|
||||||
@@ -2176,5 +2197,6 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
@Override
|
@Override
|
||||||
public void stop()
|
public void stop()
|
||||||
{
|
{
|
||||||
|
mPatchGroupManager.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,26 +1,24 @@
|
|||||||
/*
|
/*
|
||||||
|
* *****************************************************************************
|
||||||
|
* Copyright (C) 2014-2022 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* * ******************************************************************************
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* * Copyright (C) 2014-2019 Dennis Sheirer
|
* it under the terms of the GNU General Public License as published by
|
||||||
* *
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* * This program is free software: you can redistribute it and/or modify
|
* (at your option) any later version.
|
||||||
* * it under the terms of the GNU General Public License as published by
|
|
||||||
* * the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* * (at your option) any later version.
|
|
||||||
* *
|
|
||||||
* * This program is distributed in the hope that it will be useful,
|
|
||||||
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* * GNU General Public License for more details.
|
|
||||||
* *
|
|
||||||
* * You should have received a copy of the GNU General Public License
|
|
||||||
* * along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
* * *****************************************************************************
|
|
||||||
*
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* ****************************************************************************
|
||||||
*/
|
*/
|
||||||
package io.github.dsheirer.module.decode.p25.phase2;
|
package io.github.dsheirer.module.decode.p25.phase2;
|
||||||
|
|
||||||
|
import com.google.common.eventbus.Subscribe;
|
||||||
import io.github.dsheirer.channel.IChannelDescriptor;
|
import io.github.dsheirer.channel.IChannelDescriptor;
|
||||||
import io.github.dsheirer.channel.state.ChangeChannelTimeoutEvent;
|
import io.github.dsheirer.channel.state.ChangeChannelTimeoutEvent;
|
||||||
import io.github.dsheirer.channel.state.DecoderStateEvent;
|
import io.github.dsheirer.channel.state.DecoderStateEvent;
|
||||||
@@ -36,7 +34,9 @@ import io.github.dsheirer.identifier.IdentifierUpdateListener;
|
|||||||
import io.github.dsheirer.identifier.MutableIdentifierCollection;
|
import io.github.dsheirer.identifier.MutableIdentifierCollection;
|
||||||
import io.github.dsheirer.identifier.Role;
|
import io.github.dsheirer.identifier.Role;
|
||||||
import io.github.dsheirer.identifier.encryption.EncryptionKey;
|
import io.github.dsheirer.identifier.encryption.EncryptionKey;
|
||||||
|
import io.github.dsheirer.identifier.patch.PatchGroupIdentifier;
|
||||||
import io.github.dsheirer.identifier.patch.PatchGroupManager;
|
import io.github.dsheirer.identifier.patch.PatchGroupManager;
|
||||||
|
import io.github.dsheirer.identifier.patch.PatchGroupPreLoadDataContent;
|
||||||
import io.github.dsheirer.message.IMessage;
|
import io.github.dsheirer.message.IMessage;
|
||||||
import io.github.dsheirer.module.decode.DecoderType;
|
import io.github.dsheirer.module.decode.DecoderType;
|
||||||
import io.github.dsheirer.module.decode.event.DecodeEvent;
|
import io.github.dsheirer.module.decode.event.DecodeEvent;
|
||||||
@@ -145,6 +145,22 @@ public class P25P2DecoderState extends TimeslotDecoderState implements Identifie
|
|||||||
mEndPttOnFacchCounter = 0;
|
mEndPttOnFacchCounter = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Processes an identifier collection to harvest Patch Groups to preload when this channel is first starting up.
|
||||||
|
* @param preLoadDataContent containing an identifier collection with optional patch group identifier(s).
|
||||||
|
*/
|
||||||
|
@Subscribe
|
||||||
|
public void process(PatchGroupPreLoadDataContent preLoadDataContent)
|
||||||
|
{
|
||||||
|
for(Identifier identifier: preLoadDataContent.getData().getIdentifiers(Role.TO))
|
||||||
|
{
|
||||||
|
if(identifier instanceof PatchGroupIdentifier patchGroupIdentifier)
|
||||||
|
{
|
||||||
|
mPatchGroupManager.addPatchGroup(patchGroupIdentifier);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Primary message processing method.
|
* Primary message processing method.
|
||||||
*/
|
*/
|
||||||
@@ -1242,6 +1258,8 @@ public class P25P2DecoderState extends TimeslotDecoderState implements Identifie
|
|||||||
@Override
|
@Override
|
||||||
public void start()
|
public void start()
|
||||||
{
|
{
|
||||||
|
mPatchGroupManager.clear();
|
||||||
|
|
||||||
//Change the default (45-second) traffic channel timeout to 1 second
|
//Change the default (45-second) traffic channel timeout to 1 second
|
||||||
if(mChannelType == ChannelType.TRAFFIC)
|
if(mChannelType == ChannelType.TRAFFIC)
|
||||||
{
|
{
|
||||||
@@ -1257,5 +1275,6 @@ public class P25P2DecoderState extends TimeslotDecoderState implements Identifie
|
|||||||
@Override
|
@Override
|
||||||
public void stop()
|
public void stop()
|
||||||
{
|
{
|
||||||
|
mPatchGroupManager.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user