mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 08:37:25 -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,23 +1,20 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2022 Dennis Sheirer
|
||||
*
|
||||
* * ******************************************************************************
|
||||
* * Copyright (C) 2014-2019 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/>
|
||||
* * *****************************************************************************
|
||||
* 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.module.decode.p25;
|
||||
|
||||
@@ -32,6 +29,7 @@ import io.github.dsheirer.identifier.Identifier;
|
||||
import io.github.dsheirer.identifier.IdentifierCollection;
|
||||
import io.github.dsheirer.identifier.MutableIdentifierCollection;
|
||||
import io.github.dsheirer.identifier.Role;
|
||||
import io.github.dsheirer.identifier.patch.PatchGroupPreLoadDataContent;
|
||||
import io.github.dsheirer.identifier.scramble.ScrambleParameterIdentifier;
|
||||
import io.github.dsheirer.message.IMessage;
|
||||
import io.github.dsheirer.message.IMessageListener;
|
||||
@@ -315,7 +313,11 @@ public class P25TrafficChannelManager extends TrafficChannelManager implements I
|
||||
sourceConfig.setFrequency(frequency);
|
||||
trafficChannel.setSourceConfiguration(sourceConfig);
|
||||
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);
|
||||
trafficChannel.setSourceConfiguration(sourceConfig);
|
||||
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);
|
||||
@@ -465,7 +471,10 @@ public class P25TrafficChannelManager extends TrafficChannelManager implements I
|
||||
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);
|
||||
trafficChannel.setSourceConfiguration(sourceConfig);
|
||||
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);
|
||||
|
||||
@@ -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
|
||||
* 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;
|
||||
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import io.github.dsheirer.channel.state.ChangeChannelTimeoutEvent;
|
||||
import io.github.dsheirer.channel.state.DecoderState;
|
||||
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.MutableIdentifierCollection;
|
||||
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.PatchGroupPreLoadDataContent;
|
||||
import io.github.dsheirer.message.IMessage;
|
||||
import io.github.dsheirer.module.decode.DecoderType;
|
||||
import io.github.dsheirer.module.decode.event.DecodeEvent;
|
||||
@@ -229,7 +232,7 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
||||
resetState();
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Resets any temporal state details
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
@@ -2161,6 +2180,8 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
||||
@Override
|
||||
public void start()
|
||||
{
|
||||
mPatchGroupManager.clear();
|
||||
|
||||
//Change the default (45-second) traffic channel timeout to 1 second
|
||||
if(mChannelType == ChannelType.TRAFFIC)
|
||||
{
|
||||
@@ -2176,5 +2197,6 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
||||
@Override
|
||||
public void stop()
|
||||
{
|
||||
mPatchGroupManager.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +1,24 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2022 Dennis Sheirer
|
||||
*
|
||||
* * ******************************************************************************
|
||||
* * Copyright (C) 2014-2019 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/>
|
||||
* * *****************************************************************************
|
||||
* 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.module.decode.p25.phase2;
|
||||
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import io.github.dsheirer.channel.IChannelDescriptor;
|
||||
import io.github.dsheirer.channel.state.ChangeChannelTimeoutEvent;
|
||||
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.Role;
|
||||
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.PatchGroupPreLoadDataContent;
|
||||
import io.github.dsheirer.message.IMessage;
|
||||
import io.github.dsheirer.module.decode.DecoderType;
|
||||
import io.github.dsheirer.module.decode.event.DecodeEvent;
|
||||
@@ -145,6 +145,22 @@ public class P25P2DecoderState extends TimeslotDecoderState implements Identifie
|
||||
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.
|
||||
*/
|
||||
@@ -1242,6 +1258,8 @@ public class P25P2DecoderState extends TimeslotDecoderState implements Identifie
|
||||
@Override
|
||||
public void start()
|
||||
{
|
||||
mPatchGroupManager.clear();
|
||||
|
||||
//Change the default (45-second) traffic channel timeout to 1 second
|
||||
if(mChannelType == ChannelType.TRAFFIC)
|
||||
{
|
||||
@@ -1257,5 +1275,6 @@ public class P25P2DecoderState extends TimeslotDecoderState implements Identifie
|
||||
@Override
|
||||
public void stop()
|
||||
{
|
||||
mPatchGroupManager.clear();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user