Adds P25 ability to ignore/follow data channel grants (defaults to

ignore)
This commit is contained in:
denny
2015-12-26 08:43:34 -05:00
parent b8aacc6d6b
commit e41f2b0148
4 changed files with 68 additions and 21 deletions

View File

@@ -66,7 +66,7 @@ import module.decode.p25.DecodeConfigP25Phase1;
import module.decode.p25.P25Decoder.Modulation; import module.decode.p25.P25Decoder.Modulation;
import module.decode.p25.P25DecoderPanel; import module.decode.p25.P25DecoderPanel;
import module.decode.p25.P25DecoderState; import module.decode.p25.P25DecoderState;
import module.decode.p25.P25Editor; import module.decode.p25.P25DecodeEditor;
import module.decode.p25.P25_C4FMDecoder; import module.decode.p25.P25_C4FMDecoder;
import module.decode.p25.P25_LSMDecoder; import module.decode.p25.P25_LSMDecoder;
import module.decode.p25.audio.P25AudioModule; import module.decode.p25.audio.P25AudioModule;
@@ -236,7 +236,7 @@ public class DecoderFactory
modules.add( new TrafficChannelManager( resourceManager, modules.add( new TrafficChannelManager( resourceManager,
decodeConfig, recordConfig, system, site, decodeConfig, recordConfig, system, site,
aliasList.getName(), timeout, ( aliasList != null ? aliasList.getName() : null ), timeout,
mptConfig.getTrafficChannelPoolSize() ) ); mptConfig.getTrafficChannelPoolSize() ) );
} }
@@ -258,11 +258,13 @@ public class DecoderFactory
case C4FM: case C4FM:
modules.add( getFMDemodulator( decodeConfig, 6750, 7500, REMOVE_DC ) ); modules.add( getFMDemodulator( decodeConfig, 6750, 7500, REMOVE_DC ) );
modules.add( new P25_C4FMDecoder( aliasList ) ); modules.add( new P25_C4FMDecoder( aliasList ) );
modules.add( new P25DecoderState( aliasList, channelType, Modulation.C4FM ) ); modules.add( new P25DecoderState( aliasList, channelType,
Modulation.C4FM, p25Config.getIgnoreDataCalls() ) );
break; break;
case CQPSK: case CQPSK:
modules.add( new P25_LSMDecoder( aliasList ) ); modules.add( new P25_LSMDecoder( aliasList ) );
modules.add( new P25DecoderState( aliasList, channelType, Modulation.CQPSK ) ); modules.add( new P25DecoderState( aliasList, channelType,
Modulation.CQPSK, p25Config.getIgnoreDataCalls() ) );
break; break;
default: default:
throw new IllegalArgumentException( "Unrecognized P25 " throw new IllegalArgumentException( "Unrecognized P25 "
@@ -276,7 +278,7 @@ public class DecoderFactory
modules.add( new TrafficChannelManager( resourceManager, modules.add( new TrafficChannelManager( resourceManager,
decodeConfig, recordConfig, system, site, decodeConfig, recordConfig, system, site,
aliasList.getName(), timeout, ( aliasList != null ? aliasList.getName() : null ), timeout,
p25Config.getTrafficChannelPoolSize() ) ); p25Config.getTrafficChannelPoolSize() ) );
} }
@@ -469,7 +471,7 @@ public class DecoderFactory
configuredPanel = new PassportEditor( config ); configuredPanel = new PassportEditor( config );
break; break;
case P25_PHASE1: case P25_PHASE1:
configuredPanel = new P25Editor( config ); configuredPanel = new P25DecodeEditor( config );
break; break;
default: default:
configuredPanel = new DecodeEditor( config ); configuredPanel = new DecodeEditor( config );

View File

@@ -30,6 +30,7 @@ public class DecodeConfigP25Phase1 extends DecodeConfiguration
private int mCallTimeout = 1; private int mCallTimeout = 1;
private int mTrafficChannelPoolSize = TRAFFIC_CHANNEL_LIMIT_DEFAULT; private int mTrafficChannelPoolSize = TRAFFIC_CHANNEL_LIMIT_DEFAULT;
private boolean mIgnoreDataCalls = true;
public DecodeConfigP25Phase1() public DecodeConfigP25Phase1()
{ {
@@ -54,6 +55,17 @@ public class DecodeConfigP25Phase1 extends DecodeConfiguration
mModulation = modulation; mModulation = modulation;
} }
@XmlAttribute( name = "ignore_data_calls" )
public boolean getIgnoreDataCalls()
{
return mIgnoreDataCalls;
}
public void setIgnoreDataCalls( boolean ignore )
{
mIgnoreDataCalls = ignore;
}
/** /**
* Note: this field is now deprecated. * Note: this field is now deprecated.
* @return * @return

View File

@@ -18,6 +18,7 @@
package module.decode.p25; package module.decode.p25;
import javax.swing.DefaultComboBoxModel; import javax.swing.DefaultComboBoxModel;
import javax.swing.JCheckBox;
import javax.swing.JComboBox; import javax.swing.JComboBox;
import javax.swing.JLabel; import javax.swing.JLabel;
import javax.swing.JSlider; import javax.swing.JSlider;
@@ -36,17 +37,18 @@ import source.tuner.TunerEditor;
import controller.Editor; import controller.Editor;
import controller.channel.ChannelValidationException; import controller.channel.ChannelValidationException;
public class P25Editor extends DecodeEditor public class P25DecodeEditor extends DecodeEditor
{ {
private final static Logger mLog = LoggerFactory.getLogger( P25Editor.class ); private final static Logger mLog = LoggerFactory.getLogger( P25DecodeEditor.class );
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private JComboBox<P25_LSMDecoder.Modulation> mComboModulation; private JComboBox<P25_LSMDecoder.Modulation> mComboModulation;
private JCheckBox mIgnoreDataCalls;
private JLabel mTrafficChannelPoolSizeLabel; private JLabel mTrafficChannelPoolSizeLabel;
private JSlider mTrafficChannelPoolSize; private JSlider mTrafficChannelPoolSize;
public P25Editor( DecodeConfiguration config ) public P25DecodeEditor( DecodeConfiguration config )
{ {
super( config ); super( config );
@@ -55,12 +57,14 @@ public class P25Editor extends DecodeEditor
private void initGUI() private void initGUI()
{ {
final DecodeConfigP25Phase1 config = (DecodeConfigP25Phase1)mConfig;
mComboModulation = new JComboBox<P25_LSMDecoder.Modulation>(); mComboModulation = new JComboBox<P25_LSMDecoder.Modulation>();
mComboModulation.setModel( new DefaultComboBoxModel<P25_LSMDecoder.Modulation>( mComboModulation.setModel( new DefaultComboBoxModel<P25_LSMDecoder.Modulation>(
P25_LSMDecoder.Modulation.values() ) ); P25_LSMDecoder.Modulation.values() ) );
mComboModulation.setSelectedItem( ((DecodeConfigP25Phase1)mConfig).getModulation() ); mComboModulation.setSelectedItem( config.getModulation() );
add( new JLabel( "Modulation:" ) ); add( new JLabel( "Modulation:" ) );
add( mComboModulation, "wrap" ); add( mComboModulation, "wrap" );
@@ -68,7 +72,7 @@ public class P25Editor extends DecodeEditor
mTrafficChannelPoolSize = new JSlider( JSlider.HORIZONTAL, mTrafficChannelPoolSize = new JSlider( JSlider.HORIZONTAL,
DecodeConfiguration.TRAFFIC_CHANNEL_LIMIT_MINIMUM, DecodeConfiguration.TRAFFIC_CHANNEL_LIMIT_MINIMUM,
DecodeConfiguration.TRAFFIC_CHANNEL_LIMIT_MAXIMUM, DecodeConfiguration.TRAFFIC_CHANNEL_LIMIT_MAXIMUM,
DecodeConfiguration.TRAFFIC_CHANNEL_LIMIT_DEFAULT ); config.getTrafficChannelPoolSize() );
mTrafficChannelPoolSize.setMajorTickSpacing( 10 ); mTrafficChannelPoolSize.setMajorTickSpacing( 10 );
mTrafficChannelPoolSize.setMinorTickSpacing( 1 ); mTrafficChannelPoolSize.setMinorTickSpacing( 1 );
@@ -91,6 +95,12 @@ public class P25Editor extends DecodeEditor
add( mTrafficChannelPoolSizeLabel ); add( mTrafficChannelPoolSizeLabel );
add( mTrafficChannelPoolSize, "wrap,grow" ); add( mTrafficChannelPoolSize, "wrap,grow" );
mIgnoreDataCalls = new JCheckBox();
mIgnoreDataCalls.setSelected( config.getIgnoreDataCalls() );
add( new JLabel( "Ignore Data Calls" ) );
add( mIgnoreDataCalls, "wrap,grow" );
reset(); reset();
} }
@@ -121,7 +131,7 @@ public class P25Editor extends DecodeEditor
DecodeConfigP25Phase1 config = (DecodeConfigP25Phase1)mConfig; DecodeConfigP25Phase1 config = (DecodeConfigP25Phase1)mConfig;
config.setModulation( (Modulation)mComboModulation.getSelectedItem() ); config.setModulation( (Modulation)mComboModulation.getSelectedItem() );
config.setIgnoreDataCalls( mIgnoreDataCalls.isSelected() );
config.setTrafficChannelPoolSize( mTrafficChannelPoolSize.getValue() ); config.setTrafficChannelPoolSize( mTrafficChannelPoolSize.getValue() );
} }
@@ -131,7 +141,7 @@ public class P25Editor extends DecodeEditor
DecodeConfigP25Phase1 config = (DecodeConfigP25Phase1)mConfig; DecodeConfigP25Phase1 config = (DecodeConfigP25Phase1)mConfig;
mComboModulation.setSelectedItem( config.getModulation() ); mComboModulation.setSelectedItem( config.getModulation() );
mIgnoreDataCalls.setSelected( config.getIgnoreDataCalls() );
mTrafficChannelPoolSize.setValue( config.getTrafficChannelPoolSize() ); mTrafficChannelPoolSize.setValue( config.getTrafficChannelPoolSize() );
} }
} }

View File

@@ -175,6 +175,7 @@ public class P25DecoderState extends DecoderState
private ChannelType mChannelType; private ChannelType mChannelType;
private Modulation mModulation; private Modulation mModulation;
private boolean mIgnoreDataCalls;
private P25CallEvent mCurrentCallEvent; private P25CallEvent mCurrentCallEvent;
private List<String> mCallDetectTalkgroups = new ArrayList<>(); private List<String> mCallDetectTalkgroups = new ArrayList<>();
@@ -182,11 +183,13 @@ public class P25DecoderState extends DecoderState
public P25DecoderState( AliasList aliasList, public P25DecoderState( AliasList aliasList,
ChannelType channelType, ChannelType channelType,
Modulation modulation ) Modulation modulation,
boolean ignoreDataCalls )
{ {
super( aliasList ); super( aliasList );
mChannelType = channelType; mChannelType = channelType;
mModulation = modulation; mModulation = modulation;
mIgnoreDataCalls = ignoreDataCalls;
} }
public Modulation getModulation() public Modulation getModulation()
@@ -2099,7 +2102,11 @@ public class P25DecoderState extends DecoderState
logAlternateVendorMessage( pdu ); logAlternateVendorMessage( pdu );
} }
/* We don't allocate traffic channels for data */ if( !mIgnoreDataCalls )
{
broadcast( new TrafficChannelAllocationEvent( this,
mChannelCallMap.get( channel ) ) );
}
break; break;
case GROUP_VOICE_CHANNEL_GRANT: case GROUP_VOICE_CHANNEL_GRANT:
if( pdu instanceof GroupVoiceChannelGrantExplicit ) if( pdu instanceof GroupVoiceChannelGrantExplicit )
@@ -2171,7 +2178,11 @@ public class P25DecoderState extends DecoderState
broadcast( callEvent ); broadcast( callEvent );
} }
//We don't allocate traffic channels for data if( !mIgnoreDataCalls )
{
broadcast( new TrafficChannelAllocationEvent( this,
mChannelCallMap.get( channel ) ) );
}
} }
else else
{ {
@@ -2742,7 +2753,11 @@ public class P25DecoderState extends DecoderState
broadcast( event ); broadcast( event );
} }
/* We don't allocate traffic channels for data */ if( !mIgnoreDataCalls )
{
broadcast( new TrafficChannelAllocationEvent( this,
mChannelCallMap.get( channel ) ) );
}
break; break;
case GROUP_VOICE_CHANNEL_GRANT: case GROUP_VOICE_CHANNEL_GRANT:
GroupVoiceChannelGrant gvcg = (GroupVoiceChannelGrant)message; GroupVoiceChannelGrant gvcg = (GroupVoiceChannelGrant)message;
@@ -2893,7 +2908,11 @@ public class P25DecoderState extends DecoderState
broadcast( event ); broadcast( event );
} }
/* We don't allocate a traffic channel for data */ if( !mIgnoreDataCalls )
{
broadcast( new TrafficChannelAllocationEvent( this,
mChannelCallMap.get( channel ) ) );
}
break; break;
case SNDCP_DATA_CHANNEL_GRANT: case SNDCP_DATA_CHANNEL_GRANT:
SNDCPDataChannelGrant sdcg = (SNDCPDataChannelGrant)message; SNDCPDataChannelGrant sdcg = (SNDCPDataChannelGrant)message;
@@ -2922,7 +2941,11 @@ public class P25DecoderState extends DecoderState
broadcast( event ); broadcast( event );
} }
/* We don't allocate a traffic channel for data */ if( !mIgnoreDataCalls )
{
broadcast( new TrafficChannelAllocationEvent( this,
mChannelCallMap.get( channel ) ) );
}
break; break;
case TELEPHONE_INTERCONNECT_VOICE_CHANNEL_GRANT: case TELEPHONE_INTERCONNECT_VOICE_CHANNEL_GRANT:
TelephoneInterconnectVoiceChannelGrant tivcg = TelephoneInterconnectVoiceChannelGrant tivcg =