mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
Note: Several of the decoders are currently non-functioning in this commit. If you want the latest functioning codebase, please checkout the commit prior to this one. All decoders will eventually be updated with this new architecture. Currently broken: - Logging and recording - Aux decoders (Fleetsync/MDC/LoJack/Tait) - LTR/Passport decoders Changes in this commit: - Module architecture for decoders and components with central provisioning by the DecoderFactory - Transition from Complex sample stream processing to float buffer processing for improved memory management - Redesigned filter structures - to support buffers and streams - Resolved several memory leak issues - Universal sharing of the thread pool manager - Added centralized audio management with call/user prioritization and new gui with mute/volume controls - Embedded audio metadata for eventual streaming support - Redesigned ProcessingChain to support independent re-use - Added new TrafficChannelManager to handle traffic channel allocations - Traffic Channel pool size and Call timeout available in P25 and MPT1327 configs - Redesigned channel and decoder gui components
150 lines
3.5 KiB
Java
150 lines
3.5 KiB
Java
package module.decode.p25.message.pdu.confirmed;
|
|
|
|
import module.decode.p25.reference.MDPConfigurationOption;
|
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
public class SNDCPActivateTDSContextRequest extends PDUConfirmedMessage
|
|
{
|
|
public final static Logger mLog =
|
|
LoggerFactory.getLogger( SNDCPActivateTDSContextRequest.class );
|
|
|
|
public static final int[] SNDCP_VERSION = { 180,181,182,183 };
|
|
public static final int[] NSAPI = { 184,185,186,187 };
|
|
public static final int[] NAT = { 188,189,190,191 };
|
|
public static final int[] IP_1 = { 192,193,194,195,196,197,198,199 };
|
|
public static final int[] IP_2 = { 200,201,202,203,204,205,206,207 };
|
|
public static final int[] IP_3 = { 208,209,210,211,212,213,214,215 };
|
|
public static final int[] IP_4 = { 216,217,218,219,220,221,222,223 };
|
|
public static final int[] DSUT = { 224,225,226,227 };
|
|
public static final int[] UDPC = { 228,229,230,231 };
|
|
public static final int[] IPHC = { 232,233,234,235,236,237,238,239 };
|
|
public static final int[] TCPSS = { 240,241,242,243 };
|
|
public static final int[] UDPSS = { 244,245,246,247 };
|
|
public static final int[] MDPCO = { 248,249,250,251,252,253,254,255 };
|
|
|
|
public SNDCPActivateTDSContextRequest( PDUConfirmedMessage message )
|
|
{
|
|
super( message );
|
|
}
|
|
|
|
@Override
|
|
public String getMessage()
|
|
{
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
sb.append( "NAC:" );
|
|
sb.append( getNAC() );
|
|
sb.append( " PDUC LLID:" );
|
|
sb.append( getLogicalLinkID() );
|
|
sb.append( " REQUEST SNDCP PACKET DATA ACTIVATE " );
|
|
sb.append( getNetworkAddressType() );
|
|
sb.append( " " );
|
|
sb.append( getIPAddress() );
|
|
sb.append( " NSAPI:" );
|
|
sb.append( getNSAPI() );
|
|
sb.append( " CRC[" );
|
|
sb.append( getErrorStatus() );
|
|
sb.append( "]" );
|
|
|
|
sb.append( " PACKET #" );
|
|
sb.append( getPacketSequenceNumber() );
|
|
|
|
if( isFinalFragment() && getFragmentSequenceNumber() == 0 )
|
|
{
|
|
sb.append( ".C" );
|
|
}
|
|
else
|
|
{
|
|
sb.append( "." );
|
|
sb.append( getFragmentSequenceNumber() );
|
|
|
|
if( isFinalFragment() )
|
|
{
|
|
sb.append( "C" );
|
|
}
|
|
}
|
|
|
|
sb.append( " " );
|
|
|
|
return sb.toString();
|
|
}
|
|
|
|
/**
|
|
* SNDCP Version: 1 = P25 SNDCP Version 1
|
|
*/
|
|
public int getSNDCPVersion()
|
|
{
|
|
return mMessage.getInt( SNDCP_VERSION );
|
|
}
|
|
|
|
/**
|
|
* Network Service Access Point Identifier - up to 14 NSAPI's can be
|
|
* allocated to the mobile with each NSAPI to be used for a specific
|
|
* protocol layer.
|
|
*/
|
|
public int getNSAPI()
|
|
{
|
|
return mMessage.getInt( NSAPI );
|
|
}
|
|
|
|
public String getNetworkAddressType()
|
|
{
|
|
return mMessage.getInt( NAT ) == 0 ? "IPV4 STATIC" : "IPV4 DYNAMIC";
|
|
}
|
|
|
|
public String getIPAddress()
|
|
{
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
sb.append( mMessage.getInt( IP_1 ) );
|
|
sb.append( "." );
|
|
sb.append( mMessage.getInt( IP_2 ) );
|
|
sb.append( "." );
|
|
sb.append( mMessage.getInt( IP_3 ) );
|
|
sb.append( "." );
|
|
sb.append( mMessage.getInt( IP_4 ) );
|
|
|
|
return sb.toString();
|
|
}
|
|
|
|
public String getDataSubscriberUnitType()
|
|
{
|
|
switch( mMessage.getInt( DSUT ) )
|
|
{
|
|
case 0:
|
|
return "DATA ONLY MRC";
|
|
case 1:
|
|
return "DATA AND VOICE MRC";
|
|
}
|
|
|
|
return "UNKNOWN";
|
|
}
|
|
|
|
public boolean hasIPHeaderCompression()
|
|
{
|
|
return mMessage.getInt( IPHC ) == 1;
|
|
}
|
|
|
|
public boolean hasUserDataPayloadCompression()
|
|
{
|
|
return mMessage.getInt( UDPC ) == 1;
|
|
}
|
|
|
|
public int getTCPStateSlots()
|
|
{
|
|
return mMessage.getInt( TCPSS );
|
|
}
|
|
|
|
public int getUDPStateSlots()
|
|
{
|
|
return mMessage.getInt( UDPSS );
|
|
}
|
|
|
|
public MDPConfigurationOption getMDPConfigurationOption()
|
|
{
|
|
return MDPConfigurationOption.fromValue( mMessage.getInt( MDPCO ) );
|
|
}
|
|
}
|