mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-13 17:17:29 -05:00
Initial commit of redesigned internal processing and audio management.
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
This commit is contained in:
21
src/module/decode/p25/message/tdu/TDUMessage.java
Normal file
21
src/module/decode/p25/message/tdu/TDUMessage.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package module.decode.p25.message.tdu;
|
||||
|
||||
import module.decode.p25.message.P25Message;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import edac.CRC;
|
||||
|
||||
public class TDUMessage extends P25Message
|
||||
{
|
||||
public TDUMessage( BinaryMessage message, DataUnitID duid,
|
||||
AliasList aliasList )
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
|
||||
/* NID CRC is checked in the message framer, thus a constructed message
|
||||
* means it passed the CRC */
|
||||
mCRC = new CRC[ 1 ];
|
||||
mCRC[ 0 ] = CRC.PASSED;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.message.tsbk.osp.control.SystemService;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
import module.decode.p25.reference.Service;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class AdjacentSiteStatusBroadcast extends TDULinkControlMessage
|
||||
implements IdentifierReceiver
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( AdjacentSiteStatusBroadcast.class );
|
||||
|
||||
public static final int[] LRA = { 72,73,74,75,88,89,90,91 };
|
||||
public static final int[] SYSTEM_ID = { 96,97,98,99,112,113,114,115,
|
||||
116,117,118,119 };
|
||||
public static final int[] RFSS_ID = { 120,121,122,123,136,137,138,139 };
|
||||
public static final int[] SITE_ID = { 140,141,142,143,144,145,146,147 };
|
||||
public static final int[] IDENTIFIER = { 160,161,162,163 };
|
||||
public static final int[] CHANNEL = { 164,165,166,167,168,169,170,
|
||||
171,184,185,186,187 };
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = { 188,189,190,191,192,193,
|
||||
194,195 };
|
||||
|
||||
private IBandIdentifier mIdentifierUpdate;
|
||||
|
||||
public AdjacentSiteStatusBroadcast( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.ADJACENT_SITE_STATUS_BROADCAST.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " LRA:" + getLocationRegistrationArea() );
|
||||
|
||||
sb.append( " SYS:" + getSystemID() );
|
||||
|
||||
sb.append( " SITE:" + getRFSubsystemID() + "-" + getSiteID() );
|
||||
|
||||
sb.append( " CHAN:" + getChannel() );
|
||||
|
||||
sb.append( " " + Service.getServices( getSystemServiceClass() ).toString() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getLocationRegistrationArea()
|
||||
{
|
||||
return mMessage.getHex( LRA, 2 );
|
||||
}
|
||||
|
||||
public String getSystemID()
|
||||
{
|
||||
return mMessage.getHex( SYSTEM_ID, 3 );
|
||||
}
|
||||
|
||||
public String getRFSubsystemID()
|
||||
{
|
||||
return mMessage.getHex( RFSS_ID, 2 );
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex( SITE_ID, 2 );
|
||||
}
|
||||
|
||||
public int getIdentifier()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER );
|
||||
}
|
||||
|
||||
public String getChannel()
|
||||
{
|
||||
return getIdentifier() + "-" + getChannelNumber();
|
||||
}
|
||||
|
||||
public int getChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL );
|
||||
}
|
||||
|
||||
public int getSystemServiceClass()
|
||||
{
|
||||
return mMessage.getInt( SYSTEM_SERVICE_CLASS );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
{
|
||||
mIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 1 ];
|
||||
|
||||
identifiers[ 0 ] = getIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mIdentifierUpdate, getChannelNumber() );
|
||||
}
|
||||
|
||||
public long getUplinkFrequencyB()
|
||||
{
|
||||
return calculateUplink( mIdentifierUpdate, getChannelNumber() );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import module.decode.p25.message.tsbk.osp.control.SystemService;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class AdjacentSiteStatusBroadcastExplicit extends TDULinkControlMessage
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( AdjacentSiteStatusBroadcastExplicit.class );
|
||||
|
||||
public static final int[] LRA = { 72,73,74,75,88,89,90,91 };
|
||||
public static final int[] TRANSMIT_IDENTIFIER = { 92,93,94,95 };
|
||||
public static final int[] TRANSMIT_CHANNEL = { 96,97,98,99,112,113,114,115,
|
||||
116,117,118,119 };
|
||||
public static final int[] RFSS_ID = { 120,121,122,123,136,137,138,139 };
|
||||
public static final int[] SITE_ID = { 140,141,142,143,144,145,146,147 };
|
||||
|
||||
public static final int[] RECEIVE_IDENTIFIER = { 160,161,162,163 };
|
||||
public static final int[] RECEIVE_CHANNEL = { 164,165,166,167,168,169,170,
|
||||
171,184,185,186,187 };
|
||||
|
||||
public AdjacentSiteStatusBroadcastExplicit( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.ADJACENT_SITE_STATUS_BROADCAST_EXPLICIT.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " LRA:" + getLocationRegistrationArea() );
|
||||
|
||||
sb.append( " SITE:" + getRFSubsystemID() + "-" + getSiteID() );
|
||||
|
||||
sb.append( " DNLINK:" + getTransmitChannelNumber() );
|
||||
|
||||
sb.append( " UPLINK:" + getReceiveChannelNumber() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getLocationRegistrationArea()
|
||||
{
|
||||
return mMessage.getHex( LRA, 2 );
|
||||
}
|
||||
|
||||
public String getRFSubsystemID()
|
||||
{
|
||||
return mMessage.getHex( RFSS_ID, 2 );
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex( SITE_ID, 2 );
|
||||
}
|
||||
|
||||
public int getTransmitIdentifier()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getTransmitChannel()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_CHANNEL );
|
||||
}
|
||||
|
||||
public String getTransmitChannelNumber()
|
||||
{
|
||||
return getTransmitIdentifier() + "-" + getTransmitChannel();
|
||||
}
|
||||
|
||||
public int getReceiveIdentifier()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getReceiveChannel()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_CHANNEL );
|
||||
}
|
||||
|
||||
public String getReceiveChannelNumber()
|
||||
{
|
||||
return getReceiveIdentifier() + "-" + getReceiveChannel();
|
||||
}
|
||||
}
|
||||
49
src/module/decode/p25/message/tdu/lc/CallAlert.java
Normal file
49
src/module/decode/p25/message/tdu/lc/CallAlert.java
Normal file
@@ -0,0 +1,49 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class CallAlert extends TDULinkControlMessage
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( CallAlert.class );
|
||||
public static final int[] TARGET_ADDRESS = { 112,113,114,115,116,117,118,
|
||||
119,120,121,122,123,136,137,138,139,140,141,142,143,144,145,146,147 };
|
||||
public static final int[] SOURCE_ADDRESS = { 160,161,162,163,164,165,166,
|
||||
167,168,169,170,171,184,185,186,187,188,189,190,190,192,193,194,195 };
|
||||
|
||||
public CallAlert( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.CALL_ALERT.getDescription();
|
||||
}
|
||||
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " SRC ADDR: " + getSourceAddress() );
|
||||
sb.append( " TGT ADDR: " + getTargetAddress() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getTargetAddress()
|
||||
{
|
||||
return mMessage.getHex( TARGET_ADDRESS, 6 );
|
||||
}
|
||||
|
||||
public String getSourceAddress()
|
||||
{
|
||||
return mMessage.getHex( SOURCE_ADDRESS, 6 );
|
||||
}
|
||||
}
|
||||
42
src/module/decode/p25/message/tdu/lc/CallTermination.java
Normal file
42
src/module/decode/p25/message/tdu/lc/CallTermination.java
Normal file
@@ -0,0 +1,42 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class CallTermination extends TDULinkControlMessage
|
||||
{
|
||||
private final static Logger mLog = LoggerFactory.getLogger( CallTermination.class );
|
||||
|
||||
public static final int[] SOURCE_ADDRESS = { 160,161,162,163,164,165,166,
|
||||
167,168,169,170,171,184,185,186,187,188,189,190,191,192,193,194,195 };
|
||||
|
||||
public CallTermination( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.CALL_TERMINATION_OR_CANCELLATION.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " BY:" + getSourceAddress() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getSourceAddress()
|
||||
{
|
||||
return mMessage.getHex( SOURCE_ADDRESS, 6 );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class ChannelIdentifierUpdate extends TDULinkControlMessage
|
||||
implements IBandIdentifier
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( ChannelIdentifierUpdate.class );
|
||||
|
||||
public static final int[] IDENTIFIER = { 72,73,74,75 };
|
||||
public static final int[] BANDWIDTH = { 88,89,90,91,92,93,94,95,96 };
|
||||
public static final int[] TRANSMIT_OFFSET = { 97,98,99,112,113,114,115,116,
|
||||
117 };
|
||||
public static final int[] CHANNEL_SPACING = { 118,119,120,121,122,123,136,
|
||||
137,138,139 };
|
||||
public static final int[] BASE_FREQUENCY = { 140,141,142,143,144,145,146,
|
||||
147,160,161,162,163,164,165,166,167,168,169,170,171,184,185,186,
|
||||
187,188,189,190,191,192,193,194,195 };
|
||||
|
||||
public ChannelIdentifierUpdate( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.CHANNEL_IDENTIFIER_UPDATE.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " IDEN:" + getIdentifier() );
|
||||
|
||||
sb.append( " BASE:" + getBaseFrequency() );
|
||||
|
||||
sb.append( " BW:" + getBandwidth() );
|
||||
|
||||
sb.append( " SPACING:" + getChannelSpacing() );
|
||||
|
||||
sb.append( " OFFSET:" + getTransmitOffset() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIdentifier()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER );
|
||||
}
|
||||
|
||||
/**
|
||||
* Channel bandwidth in hertz
|
||||
*/
|
||||
@Override
|
||||
public int getBandwidth()
|
||||
{
|
||||
return mMessage.getInt( BANDWIDTH ) * 125;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getChannelSpacing()
|
||||
{
|
||||
return mMessage.getLong( CHANNEL_SPACING ) * 125l;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getBaseFrequency()
|
||||
{
|
||||
return mMessage.getLong( BASE_FREQUENCY ) * 5l;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getTransmitOffset()
|
||||
{
|
||||
return -1 * mMessage.getLong( TRANSMIT_OFFSET ) * 250000l;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class ChannelIdentifierUpdateExplicit extends TDULinkControlMessage
|
||||
implements IBandIdentifier
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( ChannelIdentifierUpdateExplicit.class );
|
||||
|
||||
public static final int[] IDENTIFIER = { 72,73,74,75 };
|
||||
public static final int[] BANDWIDTH = { 88,89,90,91 };
|
||||
public static final int[] TRANSMIT_OFFSET = { 92,93,94,95,96,97,98,99,112,
|
||||
113,114,115,116,117 };
|
||||
public static final int[] CHANNEL_SPACING = { 118,119,120,121,122,
|
||||
123,136,137,138,139 };
|
||||
public static final int[] BASE_FREQUENCY = { 140,141,142,143,144,145,146,
|
||||
147,160,161,162,163,164,165,166,167,168,169,170,171,184,185,186,
|
||||
187,188,189,190,191,192,193,194,195 };
|
||||
|
||||
public ChannelIdentifierUpdateExplicit( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.CHANNEL_IDENTIFIER_UPDATE_EXPLICIT.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " IDEN:" + getIdentifier() );
|
||||
|
||||
sb.append( " BASE:" + getBaseFrequency() );
|
||||
|
||||
sb.append( " BW:" + getBandwidth() );
|
||||
|
||||
sb.append( " SPACING:" + getChannelSpacing() );
|
||||
|
||||
sb.append( " OFFSET:" + getTransmitOffset() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIdentifier()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER );
|
||||
}
|
||||
|
||||
/**
|
||||
* Channel bandwidth in hertz
|
||||
*/
|
||||
@Override
|
||||
public int getBandwidth()
|
||||
{
|
||||
return mMessage.getInt( BANDWIDTH ) * 125;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getChannelSpacing()
|
||||
{
|
||||
return mMessage.getLong( CHANNEL_SPACING ) * 125l;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getBaseFrequency()
|
||||
{
|
||||
return mMessage.getLong( BASE_FREQUENCY ) * 5l;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getTransmitOffset()
|
||||
{
|
||||
return -1 * mMessage.getLong( TRANSMIT_OFFSET ) * 250000l;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import module.decode.p25.reference.ExtendedFunction;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class ExtendedFunctionCommand extends TDULinkControlMessage
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( ExtendedFunctionCommand.class );
|
||||
public static final int[] EXTENDED_FUNCTION = { 72,73,74,75,88,89,90,91,92,
|
||||
93,94,95,96,97,98,99 };
|
||||
public static final int[] ARGUMENT = { 112,113,114,115,116,117,118,119,120,
|
||||
121,122,123,136,137,138,139,140,141,142,143,144,145,145,147 };
|
||||
public static final int[] TARGET_ADDRESS = { 160,161,162,163,164,165,166,
|
||||
167,168,169,170,171,184,185,186,187,188,189,190,190,192,193,194,195 };
|
||||
|
||||
public ExtendedFunctionCommand( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.EXTENDED_FUNCTION_COMMAND.getDescription();
|
||||
}
|
||||
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " EXTENDED FUNCTION:" + getExtendedFunction().getLabel() );
|
||||
|
||||
sb.append( " ARGUMENT: " + getTargetAddress() );
|
||||
|
||||
sb.append( " TGT ADDR: " + getTargetAddress() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public ExtendedFunction getExtendedFunction()
|
||||
{
|
||||
return ExtendedFunction.fromValue( mMessage.getInt( EXTENDED_FUNCTION ) );
|
||||
}
|
||||
|
||||
public String getArgument()
|
||||
{
|
||||
return mMessage.getHex( ARGUMENT, 6 );
|
||||
}
|
||||
|
||||
public String getSourceAddress()
|
||||
{
|
||||
switch( getExtendedFunction() )
|
||||
{
|
||||
case RADIO_CHECK:
|
||||
case RADIO_CHECK_ACK:
|
||||
case RADIO_DETACH:
|
||||
case RADIO_DETACH_ACK:
|
||||
case RADIO_INHIBIT:
|
||||
case RADIO_INHIBIT_ACK:
|
||||
case RADIO_UNINHIBIT:
|
||||
case RADIO_UNINHIBIT_ACK:
|
||||
return getArgument();
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getTargetAddress()
|
||||
{
|
||||
return mMessage.getHex( TARGET_ADDRESS, 6 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getToID()
|
||||
{
|
||||
return getTargetAddress();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class GroupAffiliationQuery extends TDULinkControlMessage
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( GroupAffiliationQuery.class );
|
||||
public static final int[] TARGET_ADDRESS = { 112,113,114,115,116,117,118,
|
||||
119,120,121,122,123,136,137,138,139,140,141,142,143,144,145,146,147 };
|
||||
public static final int[] SOURCE_ADDRESS = { 160,161,162,163,164,165,166,
|
||||
167,168,169,170,171,184,185,186,187,188,189,190,191,192,193,194,195 };
|
||||
|
||||
public GroupAffiliationQuery( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.GROUP_AFFILIATION_QUERY.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " FROM:" + getSourceAddress() );
|
||||
|
||||
sb.append( " TO:" + getTargetAddress() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getTargetAddress()
|
||||
{
|
||||
return mMessage.getHex( TARGET_ADDRESS, 6 );
|
||||
}
|
||||
|
||||
public String getSourceAddress()
|
||||
{
|
||||
return mMessage.getHex( SOURCE_ADDRESS, 6 );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class GroupVoiceChannelUpdate extends TDULinkControlMessage
|
||||
implements IdentifierReceiver
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( GroupVoiceChannelUpdate.class );
|
||||
|
||||
public static final int[] IDENTIFIER_A = { 72,73,74,75 };
|
||||
public static final int[] CHANNEL_A = { 88,89,90,91,92,93,94,95,96,97,98,99 };
|
||||
public static final int[] GROUP_ADDRESS_A = { 112,113,114,115,116,117,118,
|
||||
119,120,121,122,123,136,137,138,139 };
|
||||
public static final int[] IDENTIFIER_B = { 140,141,142,143 };
|
||||
public static final int[] CHANNEL_B = { 144,145,146,147,160,161,162,163,164,
|
||||
165,166,167 };
|
||||
public static final int[] GROUP_ADDRESS_B = { 168,169,170,171,184,185,186,
|
||||
187,188,189,190,191,192,193,194,195 };
|
||||
|
||||
private IBandIdentifier mIdentifierUpdateA;
|
||||
private IBandIdentifier mIdentifierUpdateB;
|
||||
|
||||
public GroupVoiceChannelUpdate( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.GROUP_VOICE_CHANNEL_UPDATE.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " CHAN A:" + getChannelA() );
|
||||
|
||||
sb.append( " GRP A:" + getGroupAddressA() );
|
||||
|
||||
if( hasChannelB() )
|
||||
{
|
||||
sb.append( " CHAN B:" + getChannelA() );
|
||||
|
||||
sb.append( " GRP B:" + getGroupAddressA() );
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public int getChannelIdentifierA()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER_A );
|
||||
}
|
||||
|
||||
public int getChannelNumberA()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL_A );
|
||||
}
|
||||
|
||||
public String getChannelA()
|
||||
{
|
||||
return getChannelIdentifierA() + "-" + getChannelNumberA();
|
||||
}
|
||||
|
||||
public int getChannelIdentifierB()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER_B );
|
||||
}
|
||||
|
||||
public int getChannelNumberB()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL_B );
|
||||
}
|
||||
|
||||
public String getChannelB()
|
||||
{
|
||||
return getChannelIdentifierB() + "-" + getChannelNumberB();
|
||||
}
|
||||
|
||||
public boolean hasChannelB()
|
||||
{
|
||||
return getChannelNumberB() != 0;
|
||||
}
|
||||
|
||||
public String getGroupAddressA()
|
||||
{
|
||||
return mMessage.getHex( GROUP_ADDRESS_A, 4 );
|
||||
}
|
||||
|
||||
public String getGroupAddressB()
|
||||
{
|
||||
return mMessage.getHex( GROUP_ADDRESS_B, 4 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a sorted list of addresses contained in the A and B fields
|
||||
* @return
|
||||
*/
|
||||
public Set<String> getAddresses()
|
||||
{
|
||||
Set<String> addresses = new TreeSet<String>();
|
||||
|
||||
addresses.add( getGroupAddressA() );
|
||||
addresses.add( getGroupAddressB() );
|
||||
|
||||
return addresses;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
{
|
||||
if( identifier == getChannelIdentifierA() )
|
||||
{
|
||||
mIdentifierUpdateA = message;
|
||||
}
|
||||
if( identifier == getChannelIdentifierB() )
|
||||
{
|
||||
mIdentifierUpdateB = message;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
if( hasChannelB() )
|
||||
{
|
||||
int[] identifiers = new int[ 2 ];
|
||||
identifiers[ 0 ] = getChannelIdentifierA();
|
||||
identifiers[ 1 ] = getChannelIdentifierB();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
else
|
||||
{
|
||||
int[] identifiers = new int[ 1 ];
|
||||
identifiers[ 0 ] = getChannelIdentifierA();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
}
|
||||
|
||||
public long getDownlinkFrequencyA()
|
||||
{
|
||||
return calculateDownlink( mIdentifierUpdateA, getChannelNumberA() );
|
||||
}
|
||||
|
||||
public long getUplinkFrequencyA()
|
||||
{
|
||||
return calculateUplink( mIdentifierUpdateA, getChannelNumberA() );
|
||||
}
|
||||
|
||||
public long getDownlinkFrequencyB()
|
||||
{
|
||||
return calculateDownlink( mIdentifierUpdateB, getChannelNumberA() );
|
||||
}
|
||||
|
||||
public long getUplinkFrequencyB()
|
||||
{
|
||||
return calculateUplink( mIdentifierUpdateB, getChannelNumberA() );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.message.P25Message.DuplexMode;
|
||||
import module.decode.p25.message.P25Message.SessionMode;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class GroupVoiceChannelUpdateExplicit extends TDULinkControlMessage
|
||||
implements IdentifierReceiver
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( GroupVoiceChannelUpdateExplicit.class );
|
||||
|
||||
public static final int EMERGENCY_FLAG = 92;
|
||||
public static final int ENCRYPTED_CHANNEL_FLAG = 93;
|
||||
public static final int DUPLEX_MODE = 94;
|
||||
public static final int SESSION_MODE = 95;
|
||||
public static final int[] GROUP_ADDRESS = { 112,113,114,115,116,117,118,
|
||||
119,120,121,122,123,136,137,138,139 };
|
||||
public static final int[] TRANSMIT_IDENTIFIER = { 140,141,142,143 };
|
||||
public static final int[] TRANSMIT_CHANNEL = { 144,145,146,147,160,161,162,
|
||||
163,164,165,166,167 };
|
||||
public static final int[] RECEIVE_IDENTIFIER = { 168,169,170,171 };
|
||||
public static final int[] RECEIVE_CHANNEL = { 184,185,186,187,188,189,190,
|
||||
191,192,193,194,195,196,197,198,199 };
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public GroupVoiceChannelUpdateExplicit( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.GROUP_VOICE_CHANNEL_UPDATE_EXPLICIT.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
if( isEmergency() )
|
||||
{
|
||||
sb.append( " EMERGENCY" );
|
||||
}
|
||||
if( isEncryptedChannel() )
|
||||
{
|
||||
sb.append( " ENCRYPTED CHANNEL" );
|
||||
}
|
||||
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public boolean isEmergency()
|
||||
{
|
||||
return mMessage.get( EMERGENCY_FLAG );
|
||||
}
|
||||
|
||||
public boolean isEncryptedChannel()
|
||||
{
|
||||
return mMessage.get( ENCRYPTED_CHANNEL_FLAG );
|
||||
}
|
||||
|
||||
public DuplexMode getDuplexMode()
|
||||
{
|
||||
return mMessage.get( DUPLEX_MODE ) ? DuplexMode.FULL : DuplexMode.HALF;
|
||||
}
|
||||
|
||||
public SessionMode getSessionMode()
|
||||
{
|
||||
return mMessage.get( SESSION_MODE ) ?
|
||||
SessionMode.CIRCUIT : SessionMode.PACKET;
|
||||
}
|
||||
|
||||
public int getTransmitChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_CHANNEL );
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_CHANNEL );
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
public String getGroupAddress()
|
||||
{
|
||||
return mMessage.getHex( GROUP_ADDRESS, 4 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
{
|
||||
if( identifier == getTransmitChannelIdentifier() )
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
if( identifier == getReceiveChannelIdentifier() )
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 2 ];
|
||||
|
||||
identifiers[ 0 ] = getTransmitChannelIdentifier();
|
||||
identifiers[ 1 ] = getReceiveChannelIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mTransmitIdentifierUpdate,
|
||||
getTransmitChannelNumber() );
|
||||
}
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mReceiveIdentifierUpdate,
|
||||
getReceiveChannelNumber() );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class GroupVoiceChannelUser extends TDULinkControlMessage
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( GroupVoiceChannelUser.class );
|
||||
/* Service Options */
|
||||
public static final int EMERGENCY_FLAG = 92;
|
||||
public static final int ENCRYPTED_CHANNEL_FLAG = 93;
|
||||
public static final int DUPLEX_MODE = 94;
|
||||
public static final int SESSION_MODE = 95;
|
||||
public static final int[] GROUP_ADDRESS = { 120,121,122,123,136,137,138,139,
|
||||
140,141,142,143,144,145,146,147 };
|
||||
public static final int[] SOURCE_ADDRESS = { 160,161,162,163,164,165,166,
|
||||
167,168,169,170,171,184,185,186,187,188,189,190,191,192,193,194,195 };
|
||||
|
||||
public GroupVoiceChannelUser( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.GROUP_VOICE_CHANNEL_USER.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
if( isEmergency() )
|
||||
{
|
||||
sb.append( " EMERGENCY" );
|
||||
}
|
||||
if( isEncryptedChannel() )
|
||||
{
|
||||
sb.append( " ENCRYPTED CHANNEL" );
|
||||
}
|
||||
|
||||
sb.append( " FROM:" + getSourceAddress() );
|
||||
|
||||
sb.append( " TO:" + getGroupAddress() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public boolean isEmergency()
|
||||
{
|
||||
return mMessage.get( EMERGENCY_FLAG );
|
||||
}
|
||||
|
||||
public boolean isEncryptedChannel()
|
||||
{
|
||||
return mMessage.get( ENCRYPTED_CHANNEL_FLAG );
|
||||
}
|
||||
|
||||
public DuplexMode getDuplexMode()
|
||||
{
|
||||
return mMessage.get( DUPLEX_MODE ) ? DuplexMode.FULL : DuplexMode.HALF;
|
||||
}
|
||||
|
||||
public SessionMode getSessionMode()
|
||||
{
|
||||
return mMessage.get( SESSION_MODE ) ?
|
||||
SessionMode.CIRCUIT : SessionMode.PACKET;
|
||||
}
|
||||
|
||||
public String getGroupAddress()
|
||||
{
|
||||
return mMessage.getHex( GROUP_ADDRESS, 4 );
|
||||
}
|
||||
|
||||
public String getSourceAddress()
|
||||
{
|
||||
return mMessage.getHex( SOURCE_ADDRESS, 6 );
|
||||
}
|
||||
}
|
||||
57
src/module/decode/p25/message/tdu/lc/MessageUpdate.java
Normal file
57
src/module/decode/p25/message/tdu/lc/MessageUpdate.java
Normal file
@@ -0,0 +1,57 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class MessageUpdate extends TDULinkControlMessage
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( MessageUpdate.class );
|
||||
public static final int[] SHORT_DATA_MESSAGE = { 72,73,74,75,88,89,90,91,92,
|
||||
93,94,95,96,97,98,99 };
|
||||
public static final int[] TARGET_ADDRESS = { 112,113,114,115,116,117,118,
|
||||
119,120,121,122,123,136,137,138,139,140,141,142,143,144,145,146,147 };
|
||||
public static final int[] SOURCE_ADDRESS = { 160,161,162,163,164,165,166,
|
||||
167,168,169,170,171,184,185,186,187,188,189,190,190,192,193,194,195 };
|
||||
|
||||
public MessageUpdate( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.MESSAGE_UPDATE.getDescription();
|
||||
}
|
||||
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " MSG:" + getShortDataMessage() );
|
||||
sb.append( " SRC ADDR: " + getSourceAddress() );
|
||||
sb.append( " TGT ADDR: " + getTargetAddress() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getShortDataMessage()
|
||||
{
|
||||
return mMessage.getHex( SHORT_DATA_MESSAGE, 4 );
|
||||
}
|
||||
|
||||
public String getTargetAddress()
|
||||
{
|
||||
return mMessage.getHex( TARGET_ADDRESS, 6 );
|
||||
}
|
||||
|
||||
public String getSourceAddress()
|
||||
{
|
||||
return mMessage.getHex( SOURCE_ADDRESS, 6 );
|
||||
}
|
||||
}
|
||||
110
src/module/decode/p25/message/tdu/lc/NetworkStatusBroadcast.java
Normal file
110
src/module/decode/p25/message/tdu/lc/NetworkStatusBroadcast.java
Normal file
@@ -0,0 +1,110 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
import module.decode.p25.reference.Service;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class NetworkStatusBroadcast extends TDULinkControlMessage
|
||||
implements IdentifierReceiver
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( NetworkStatusBroadcast.class );
|
||||
|
||||
public static final int[] WACN = { 72,73,74,75,88,89,90,91,92,93,94,95,96,
|
||||
97,98,99,112,113,114,115,116,117,118,119,120,121,122,123 };
|
||||
public static final int[] SYSTEM = { 136,137,138,139,140,141,142,143,144,
|
||||
145,146,147 };
|
||||
public static final int[] IDENTIFIER = { 160,161,162,163 };
|
||||
public static final int[] CHANNEL = { 164,165,166,167,168,169,170,171,184,
|
||||
185,186,187 };
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = { 188,189,190,191,192,193,
|
||||
194,195 };
|
||||
|
||||
private IBandIdentifier mIdentifierUpdate;
|
||||
|
||||
public NetworkStatusBroadcast( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.NETWORK_STATUS_BROADCAST.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " NETWORK:" + getWACN() );
|
||||
sb.append( " SYS:" + getSystem() );
|
||||
sb.append( " CHAN:" + getChannel() );
|
||||
sb.append( " " + Service.getServices( getSystemServiceClass() ).toString() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getWACN()
|
||||
{
|
||||
return mMessage.getHex( WACN, 5 );
|
||||
}
|
||||
|
||||
public String getSystem()
|
||||
{
|
||||
return mMessage.getHex( SYSTEM, 3 );
|
||||
}
|
||||
|
||||
public int getIdentifier()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL );
|
||||
}
|
||||
|
||||
public String getChannel()
|
||||
{
|
||||
return getIdentifier() + "-" + getChannelNumber();
|
||||
}
|
||||
|
||||
public int getSystemServiceClass()
|
||||
{
|
||||
return mMessage.getInt( SYSTEM_SERVICE_CLASS );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
{
|
||||
mIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 1 ];
|
||||
|
||||
identifiers[ 0 ] = getIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mIdentifierUpdate, getChannelNumber() );
|
||||
}
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mIdentifierUpdate, getChannelNumber() );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
import module.decode.p25.reference.Service;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class NetworkStatusBroadcastExplicit extends TDULinkControlMessage
|
||||
implements IdentifierReceiver
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( NetworkStatusBroadcastExplicit.class );
|
||||
|
||||
public static final int[] WACN = { 72,73,74,75,88,89,90,91,92,93,94,95,96,
|
||||
97,98,99,112,113,114,115 };
|
||||
public static final int[] SYSTEM = { 116,117,118,119,120,121,122,123,136,
|
||||
137,138,139 };
|
||||
public static final int[] TRANSMIT_IDENTIFIER = { 140,141,142,143 };
|
||||
public static final int[] TRANSMIT_CHANNEL = { 144,145,146,147,160,161,162,
|
||||
163,164,165,166,167 };
|
||||
public static final int[] RECEIVE_IDENTIFIER = { 168,169,170,171 };
|
||||
public static final int[] RECEIVE_CHANNEL = { 184,185,186,187,188,189,190,
|
||||
191,192,193,194,195 };
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public NetworkStatusBroadcastExplicit( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.NETWORK_STATUS_BROADCAST_EXPLICIT.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " NETWORK:" + getWACN() );
|
||||
sb.append( " SYS:" + getSystem() );
|
||||
sb.append( " TRANSMIT:" + getTransmitChannel() );
|
||||
sb.append( " RECEIVE:" + getReceiveChannel() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getWACN()
|
||||
{
|
||||
return mMessage.getHex( WACN, 5 );
|
||||
}
|
||||
|
||||
public String getSystem()
|
||||
{
|
||||
return mMessage.getHex( SYSTEM, 3 );
|
||||
}
|
||||
|
||||
public int getTransmitIdentifier()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_CHANNEL );
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveIdentifier()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_CHANNEL );
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
{
|
||||
if( identifier == getTransmitIdentifier() )
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
if( identifier == getReceiveIdentifier() )
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 2 ];
|
||||
|
||||
identifiers[ 0 ] = getTransmitIdentifier();
|
||||
identifiers[ 1 ] = getReceiveIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mTransmitIdentifierUpdate,
|
||||
getTransmitChannelNumber() );
|
||||
}
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mReceiveIdentifierUpdate,
|
||||
getReceiveChannelNumber() );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import module.decode.p25.reference.Encryption;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class ProtectionParameterBroadcast extends TDULinkControlMessage
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( ProtectionParameterBroadcast.class );
|
||||
|
||||
public final static int[] ALGORITHM_ID = { 112,113,114,115,116,117,118,119 };
|
||||
public final static int[] KEY_ID = { 120,121,122,123,136,137,138,139,140,
|
||||
141,142,143,144,145,146,147 };
|
||||
public static final int[] TARGET_ADDRESS = { 160,161,162,163,164,165,166,
|
||||
167,168,169,170,171,184,185,186,187,188,189,190,190,192,193,194,195 };
|
||||
|
||||
public ProtectionParameterBroadcast( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.PROTECTION_PARAMETER_BROADCAST.getDescription();
|
||||
}
|
||||
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " ENCRYPTION:" + getEncryption().name() );
|
||||
sb.append( " KEY:" + getEncryptionKey() );
|
||||
sb.append( " ADDRESSS:" + getTargetAddress() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public Encryption getEncryption()
|
||||
{
|
||||
return Encryption.fromValue( mMessage.getInt( ALGORITHM_ID ) );
|
||||
}
|
||||
|
||||
public int getEncryptionKey()
|
||||
{
|
||||
return mMessage.getInt( KEY_ID );
|
||||
}
|
||||
|
||||
public String getTargetAddress()
|
||||
{
|
||||
return mMessage.getHex( TARGET_ADDRESS, 6 );
|
||||
}
|
||||
}
|
||||
132
src/module/decode/p25/message/tdu/lc/RFSSStatusBroadcast.java
Normal file
132
src/module/decode/p25/message/tdu/lc/RFSSStatusBroadcast.java
Normal file
@@ -0,0 +1,132 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.message.tsbk.osp.control.SystemService;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class RFSSStatusBroadcast extends TDULinkControlMessage
|
||||
implements IdentifierReceiver
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( RFSSStatusBroadcast.class );
|
||||
|
||||
public static final int[] LRA = { 72,73,74,75,88,89,
|
||||
90,91 };
|
||||
public static final int[] SYSTEM_ID = { 96,97,98,99,112,113,114,115,116,117,
|
||||
118,119 };
|
||||
public static final int[] RFSS_ID = { 120,121,122,123,136,137,138,
|
||||
139 };
|
||||
public static final int[] SITE_ID = { 140,141,142,143,144,145,146,147 };
|
||||
|
||||
public static final int[] IDENTIFIER = { 160,161,162,163 };
|
||||
public static final int[] CHANNEL = { 164,165,166,167,168,169,170,
|
||||
171,184,185,186,187 };
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = { 188,189,190,191,192,193,
|
||||
194,195 };
|
||||
|
||||
private IBandIdentifier mIdentifierUpdate;
|
||||
|
||||
public RFSSStatusBroadcast( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.RFSS_STATUS_BROADCAST.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " LRA:" + getLocationRegistrationArea() );
|
||||
|
||||
sb.append( " SYS:" + getSystem() );
|
||||
|
||||
sb.append( " SITE:" + getRFSubsystemID() + "-" + getSiteID() );
|
||||
|
||||
sb.append( " CHAN:" + getChannelNumber() );
|
||||
|
||||
sb.append( " " + SystemService.toString( getSystemServiceClass() ) );
|
||||
|
||||
sb.append( " " + mMessage.toString() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getLocationRegistrationArea()
|
||||
{
|
||||
return mMessage.getHex( LRA, 2 );
|
||||
}
|
||||
|
||||
public String getSystem()
|
||||
{
|
||||
return mMessage.getHex( SYSTEM_ID, 3 );
|
||||
}
|
||||
|
||||
public String getRFSubsystemID()
|
||||
{
|
||||
return mMessage.getHex( RFSS_ID, 2 );
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex( SITE_ID, 2 );
|
||||
}
|
||||
|
||||
public int getIdentifier()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER );
|
||||
}
|
||||
|
||||
public String getChannel()
|
||||
{
|
||||
return getIdentifier() + "-" + getChannelNumber();
|
||||
}
|
||||
|
||||
public int getChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL );
|
||||
}
|
||||
|
||||
public int getSystemServiceClass()
|
||||
{
|
||||
return mMessage.getInt( SYSTEM_SERVICE_CLASS );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
{
|
||||
mIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 1 ];
|
||||
|
||||
identifiers[ 0 ] = getIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mIdentifierUpdate, getChannelNumber() );
|
||||
}
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mIdentifierUpdate, getChannelNumber() );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.message.tsbk.osp.control.SystemService;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class RFSSStatusBroadcastExplicit extends TDULinkControlMessage
|
||||
implements IdentifierReceiver
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( RFSSStatusBroadcastExplicit.class );
|
||||
|
||||
public static final int[] LRA = { 72,73,74,75,88,89,90,91 };
|
||||
public static final int[] RECEIVE_IDENTIFIER = { 92,93,94,95 };
|
||||
public static final int[] RECEIVE_CHANNEL = { 96,97,98,99,112,113,114,115,
|
||||
116,117,118,119 };
|
||||
public static final int[] RFSS_ID = { 120,121,122,123,136,137,138,
|
||||
139 };
|
||||
public static final int[] SITE_ID = { 140,141,142,143,144,145,146,147 };
|
||||
|
||||
public static final int[] TRANSMIT_IDENTIFIER = { 160,161,162,163 };
|
||||
public static final int[] TRANSMIT_CHANNEL = { 164,165,166,167,168,169,170,
|
||||
171,184,185,186,187 };
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = { 188,189,190,191,192,193,
|
||||
194,195 };
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public RFSSStatusBroadcastExplicit( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.RFSS_STATUS_BROADCAST_EXPLICIT.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " LRA:" + getLocationRegistrationArea() );
|
||||
|
||||
sb.append( " SITE:" + getRFSubsystemID() + "-" + getSiteID() );
|
||||
|
||||
sb.append( " TRANSMIT:" + getTransmitChannelNumber() );
|
||||
|
||||
sb.append( " RECEIVE:" + getReceiveChannelNumber() );
|
||||
|
||||
sb.append( " " + SystemService.toString( getSystemServiceClass() ) );
|
||||
|
||||
sb.append( " " + mMessage.toString() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getLocationRegistrationArea()
|
||||
{
|
||||
return mMessage.getHex( LRA, 2 );
|
||||
}
|
||||
|
||||
public String getRFSubsystemID()
|
||||
{
|
||||
return mMessage.getHex( RFSS_ID, 2 );
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex( SITE_ID, 2 );
|
||||
}
|
||||
|
||||
public int getTransmitIdentifier()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_IDENTIFIER );
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_CHANNEL );
|
||||
}
|
||||
|
||||
public int getReceiveIdentifier()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_IDENTIFIER );
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_CHANNEL );
|
||||
}
|
||||
|
||||
public int getSystemServiceClass()
|
||||
{
|
||||
return mMessage.getInt( SYSTEM_SERVICE_CLASS );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
{
|
||||
if( identifier == getTransmitIdentifier() )
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
if( identifier == getReceiveIdentifier() )
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 2 ];
|
||||
|
||||
identifiers[ 0 ] = getTransmitIdentifier();
|
||||
identifiers[ 1 ] = getReceiveIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mTransmitIdentifierUpdate, getTransmitChannelNumber() );
|
||||
}
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mReceiveIdentifierUpdate, getReceiveChannelNumber() );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.message.tsbk.osp.control.SystemService;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class SecondaryControlChannelBroadcast extends TDULinkControlMessage
|
||||
implements IdentifierReceiver
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( SecondaryControlChannelBroadcast.class );
|
||||
|
||||
public static final int[] RFSS_ID = { 72,73,74,75,88,89,90,91 };
|
||||
public static final int[] SITE_ID = { 92,93,94,95,96,97,98,99 };
|
||||
public static final int[] IDENTIFIER_A = { 112,113,114,115 };
|
||||
public static final int[] CHANNEL_A = { 116,117,118,119,120,121,122,
|
||||
123,136,137,138,139 };
|
||||
|
||||
public static final int[] SYSTEM_SERVICE_CLASS_A = { 140,141,142,143,144,
|
||||
145,146,147 };
|
||||
|
||||
public static final int[] IDENTIFIER_B = { 160,161,162,163 };
|
||||
public static final int[] CHANNEL_B = { 164,165,166,167,168,169,170,
|
||||
171,184,185,186,187 };
|
||||
public static final int[] SYSTEM_SERVICE_CLASS_B = { 188,189,190,191,192,
|
||||
193,194,195 };
|
||||
|
||||
private IBandIdentifier mIdentifierProviderA;
|
||||
private IBandIdentifier mIdentifierProviderB;
|
||||
|
||||
public SecondaryControlChannelBroadcast( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.SECONDARY_CONTROL_CHANNEL_BROADCAST.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " SITE:" + getRFSubsystemID() + "-" + getSiteID() );
|
||||
|
||||
sb.append( " CHAN A:" + getChannelA() );
|
||||
|
||||
sb.append( " " + SystemService.toString( getSystemServiceClassA() ) );
|
||||
|
||||
sb.append( " CHAN B:" + getChannelB() );
|
||||
|
||||
sb.append( " " + SystemService.toString( getSystemServiceClassB() ) );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getRFSubsystemID()
|
||||
{
|
||||
return mMessage.getHex( RFSS_ID, 2 );
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex( SITE_ID, 2 );
|
||||
}
|
||||
|
||||
public int getIdentifierA()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER_A );
|
||||
}
|
||||
|
||||
public int getChannelA()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL_A );
|
||||
}
|
||||
|
||||
public String getChannelNumberA()
|
||||
{
|
||||
return getIdentifierA() + "-" + getChannelA();
|
||||
}
|
||||
|
||||
public int getIdentifierB()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER_B );
|
||||
}
|
||||
|
||||
public int getChannelB()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL_B );
|
||||
}
|
||||
|
||||
public String getChannelNumberB()
|
||||
{
|
||||
return getIdentifierB() + "-" + getChannelB();
|
||||
}
|
||||
|
||||
public int getSystemServiceClassA()
|
||||
{
|
||||
return mMessage.getInt( SYSTEM_SERVICE_CLASS_A );
|
||||
}
|
||||
|
||||
public int getSystemServiceClassB()
|
||||
{
|
||||
return mMessage.getInt( SYSTEM_SERVICE_CLASS_B );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
{
|
||||
if( identifier == getIdentifierA() )
|
||||
{
|
||||
mIdentifierProviderA = message;
|
||||
}
|
||||
if( identifier == getIdentifierB() )
|
||||
{
|
||||
mIdentifierProviderB = message;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 2 ];
|
||||
|
||||
identifiers[ 0 ] = getIdentifierA();
|
||||
identifiers[ 1 ] = getIdentifierB();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
public long getDownlinkFrequencyA()
|
||||
{
|
||||
return calculateDownlink( mIdentifierProviderA, getChannelA() );
|
||||
}
|
||||
|
||||
public long getUplinkFrequencyA()
|
||||
{
|
||||
return calculateUplink( mIdentifierProviderA, getChannelA() );
|
||||
}
|
||||
|
||||
public long getDownlinkFrequencyB()
|
||||
{
|
||||
return calculateDownlink( mIdentifierProviderB, getChannelB() );
|
||||
}
|
||||
|
||||
public long getUplinkFrequencyB()
|
||||
{
|
||||
return calculateUplink( mIdentifierProviderB, getChannelB() );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.message.tsbk.osp.control.SystemService;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class SecondaryControlChannelBroadcastExplicit
|
||||
extends TDULinkControlMessage implements IdentifierReceiver
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( SecondaryControlChannelBroadcastExplicit.class );
|
||||
|
||||
public static final int[] RFSS_ID = { 72,73,74,75,88,89,90,91 };
|
||||
public static final int[] SITE_ID = { 92,93,94,95,96,97,98,99 };
|
||||
public static final int[] TRANSMIT_IDENTIFIER = { 112,113,114,115 };
|
||||
public static final int[] TRANSMIT_CHANNEL = { 116,117,118,119,120,121,122,
|
||||
123,136,137,138,139 };
|
||||
public static final int[] RECEIVE_IDENTIFIER = { 140,141,142,143 };
|
||||
public static final int[] RECEIVE_CHANNEL = { 144,145,146,147,160,161,162,
|
||||
163,164,165,166,167 };
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = { 168,169,170,171,184,
|
||||
185,186,187 };
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierProvider;
|
||||
private IBandIdentifier mReceiveIdentifierProvider;
|
||||
|
||||
public SecondaryControlChannelBroadcastExplicit( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.SECONDARY_CONTROL_CHANNEL_BROADCAST_EXPLICIT.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " SITE:" + getRFSubsystemID() + "-" + getSiteID() );
|
||||
|
||||
sb.append( " TRANSMIT:" + getTransmitChannel() );
|
||||
|
||||
sb.append( " RECEIVE:" + getReceiveChannel() );
|
||||
|
||||
sb.append( " " + SystemService.toString( getSystemServiceClass() ) );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getRFSubsystemID()
|
||||
{
|
||||
return mMessage.getHex( RFSS_ID, 2 );
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex( SITE_ID, 2 );
|
||||
}
|
||||
|
||||
public int getTransmitIdentifier()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_CHANNEL );
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveIdentifier()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_CHANNEL );
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
public int getSystemServiceClass()
|
||||
{
|
||||
return mMessage.getInt( SYSTEM_SERVICE_CLASS );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
{
|
||||
if( identifier == getTransmitIdentifier() )
|
||||
{
|
||||
mTransmitIdentifierProvider = message;
|
||||
}
|
||||
if( identifier == getReceiveIdentifier() )
|
||||
{
|
||||
mReceiveIdentifierProvider = message;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 2 ];
|
||||
|
||||
identifiers[ 0 ] = getTransmitIdentifier();
|
||||
identifiers[ 1 ] = getReceiveIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mTransmitIdentifierProvider,
|
||||
getTransmitChannelNumber() );
|
||||
}
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mReceiveIdentifierProvider,
|
||||
getReceiveChannelNumber() );
|
||||
}
|
||||
}
|
||||
51
src/module/decode/p25/message/tdu/lc/StatusQuery.java
Normal file
51
src/module/decode/p25/message/tdu/lc/StatusQuery.java
Normal file
@@ -0,0 +1,51 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class StatusQuery extends TDULinkControlMessage
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( StatusQuery.class );
|
||||
public static final int[] TARGET_ADDRESS = { 112,113,114,115,116,117,118,
|
||||
119,120,121,122,123,136,137,138,139,140,141,142,143,144,145,146,147 };
|
||||
public static final int[] SOURCE_ADDRESS = { 160,161,162,163,164,165,166,
|
||||
167,168,169,170,171,184,185,186,187,188,189,190,191,192,193,194,195 };
|
||||
|
||||
public StatusQuery( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.STATUS_QUERY.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " FROM:" + getSourceAddress() );
|
||||
|
||||
sb.append( " TO:" + getTargetAddress() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getTargetAddress()
|
||||
{
|
||||
return mMessage.getHex( TARGET_ADDRESS, 6 );
|
||||
}
|
||||
|
||||
public String getSourceAddress()
|
||||
{
|
||||
return mMessage.getHex( SOURCE_ADDRESS, 6 );
|
||||
}
|
||||
}
|
||||
64
src/module/decode/p25/message/tdu/lc/StatusUpdate.java
Normal file
64
src/module/decode/p25/message/tdu/lc/StatusUpdate.java
Normal file
@@ -0,0 +1,64 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class StatusUpdate extends TDULinkControlMessage
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( StatusUpdate.class );
|
||||
public static final int[] USER_STATUS = { 80,81,82,83,84,85,86,87 };
|
||||
public static final int[] UNIT_STATUS = { 88,89,90,91,92,93,94,95 };
|
||||
public static final int[] TARGET_ADDRESS = { 112,113,114,115,116,117,118,
|
||||
119,120,121,122,123,136,137,138,139,140,141,142,143,144,145,146,147 };
|
||||
public static final int[] SOURCE_ADDRESS = { 160,161,162,163,164,165,166,
|
||||
167,168,169,170,171,184,185,186,187,188,189,190,191,192,193,194,195 };
|
||||
|
||||
public StatusUpdate( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.STATUS_UPDATE.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " STATUS USER:" + getUserStatus() );
|
||||
sb.append( " UNIT:" + getUnitStatus() );
|
||||
sb.append( " FROM:" + getSourceAddress() );
|
||||
sb.append( " TO:" + getTargetAddress() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getUserStatus()
|
||||
{
|
||||
return mMessage.getHex( USER_STATUS, 2 );
|
||||
}
|
||||
|
||||
public String getUnitStatus()
|
||||
{
|
||||
return mMessage.getHex( UNIT_STATUS, 2 );
|
||||
}
|
||||
|
||||
public String getTargetAddress()
|
||||
{
|
||||
return mMessage.getHex( TARGET_ADDRESS, 6 );
|
||||
}
|
||||
|
||||
public String getSourceAddress()
|
||||
{
|
||||
return mMessage.getHex( SOURCE_ADDRESS, 6 );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
import module.decode.p25.reference.Service;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class SystemServiceBroadcast extends TDULinkControlMessage
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( SystemServiceBroadcast.class );
|
||||
public static final int[] REQUEST_PRIORITY_LEVEL = { 96,97,98,99 };
|
||||
public static final int[] AVAILABLE_SERVICES = { 112,113,114,115,116,117,118,
|
||||
119,120,121,122,123,136,137,138,139,140,141,142,143,144,145,146,147 };
|
||||
public static final int[] SUPPORTED_SERVICES = { 160,161,162,163,164,165,
|
||||
166,167,168,169,170,171,184,185,186,187,188,189,190,191,192,193,194,195 };
|
||||
|
||||
public SystemServiceBroadcast( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.SYSTEM_SERVICE_BROADCAST.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " SERVICES AVAILABLE " );
|
||||
|
||||
sb.append( getAvailableServices() );
|
||||
|
||||
sb.append( " SUPPORTED " );
|
||||
|
||||
sb.append( getSupportedServices() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public List<Service> getAvailableServices()
|
||||
{
|
||||
long bitmap = mMessage.getLong( AVAILABLE_SERVICES );
|
||||
|
||||
return Service.getServices( bitmap );
|
||||
}
|
||||
|
||||
public List<Service> getSupportedServices()
|
||||
{
|
||||
long bitmap = mMessage.getLong( SUPPORTED_SERVICES );
|
||||
|
||||
return Service.getServices( bitmap );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import module.decode.p25.reference.Vendor;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
public class TDULCMessageFactory
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( TDULCMessageFactory.class );
|
||||
|
||||
/**
|
||||
* Constructs a new sub-class of the TDULC message if the opcode is recognized
|
||||
* or returns the original message.
|
||||
*/
|
||||
public static TDULinkControlMessage getMessage( TDULinkControlMessage message )
|
||||
{
|
||||
if( message.isImplicitFormat() || message.getVendor() == Vendor.STANDARD )
|
||||
{
|
||||
switch( message.getOpcode() )
|
||||
{
|
||||
case ADJACENT_SITE_STATUS_BROADCAST:
|
||||
return new AdjacentSiteStatusBroadcast( message );
|
||||
case ADJACENT_SITE_STATUS_BROADCAST_EXPLICIT:
|
||||
return new AdjacentSiteStatusBroadcastExplicit( message );
|
||||
case CALL_ALERT:
|
||||
return new CallAlert( message );
|
||||
case CALL_TERMINATION_OR_CANCELLATION:
|
||||
return new CallTermination( message );
|
||||
case CHANNEL_IDENTIFIER_UPDATE:
|
||||
return new ChannelIdentifierUpdate( message );
|
||||
case CHANNEL_IDENTIFIER_UPDATE_EXPLICIT:
|
||||
return new ChannelIdentifierUpdateExplicit( message );
|
||||
case EXTENDED_FUNCTION_COMMAND:
|
||||
return new ExtendedFunctionCommand( message );
|
||||
case GROUP_AFFILIATION_QUERY:
|
||||
return new GroupAffiliationQuery( message );
|
||||
case GROUP_VOICE_CHANNEL_UPDATE:
|
||||
return new GroupVoiceChannelUpdate( message );
|
||||
case GROUP_VOICE_CHANNEL_UPDATE_EXPLICIT:
|
||||
return new GroupVoiceChannelUpdateExplicit( message );
|
||||
case GROUP_VOICE_CHANNEL_USER:
|
||||
return new GroupVoiceChannelUser( message );
|
||||
case MESSAGE_UPDATE:
|
||||
return new MessageUpdate( message );
|
||||
case NETWORK_STATUS_BROADCAST:
|
||||
return new NetworkStatusBroadcast( message );
|
||||
case NETWORK_STATUS_BROADCAST_EXPLICIT:
|
||||
return new NetworkStatusBroadcastExplicit( message );
|
||||
case PROTECTION_PARAMETER_BROADCAST:
|
||||
return new ProtectionParameterBroadcast( message );
|
||||
case RFSS_STATUS_BROADCAST:
|
||||
return new RFSSStatusBroadcast( message );
|
||||
case RFSS_STATUS_BROADCAST_EXPLICIT:
|
||||
return new RFSSStatusBroadcastExplicit( message );
|
||||
case SECONDARY_CONTROL_CHANNEL_BROADCAST:
|
||||
return new SecondaryControlChannelBroadcast( message );
|
||||
case SECONDARY_CONTROL_CHANNEL_BROADCAST_EXPLICIT:
|
||||
return new SecondaryControlChannelBroadcastExplicit( message );
|
||||
case STATUS_QUERY:
|
||||
return new StatusQuery( message );
|
||||
case STATUS_UPDATE:
|
||||
return new StatusUpdate( message );
|
||||
case SYSTEM_SERVICE_BROADCAST:
|
||||
return new SystemServiceBroadcast( message );
|
||||
case TELEPHONE_INTERCONNECT_ANSWER_REQUEST:
|
||||
return new TelephoneInterconnectAnswerRequest( message );
|
||||
case TELEPHONE_INTERCONNECT_VOICE_CHANNEL_USER:
|
||||
return new TelephoneInterconnectVoiceChannelUser( message );
|
||||
case UNIT_AUTHENTICATION_COMMAND:
|
||||
return new UnitAuthenticationCommand( message );
|
||||
case UNIT_REGISTRATION_COMMAND:
|
||||
return new UnitRegistrationCommand( message );
|
||||
case UNIT_TO_UNIT_ANSWER_REQUEST:
|
||||
return new UnitToUnitAnswerRequest( message );
|
||||
case UNIT_TO_UNIT_VOICE_CHANNEL_USER:
|
||||
return new UnitToUnitVoiceChannelUser( message );
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch( message.getVendor() )
|
||||
{
|
||||
case MOTOROLA:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return message;
|
||||
}
|
||||
}
|
||||
284
src/module/decode/p25/message/tdu/lc/TDULinkControlMessage.java
Normal file
284
src/module/decode/p25/message/tdu/lc/TDULinkControlMessage.java
Normal file
@@ -0,0 +1,284 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import module.decode.p25.message.P25Message;
|
||||
import module.decode.p25.message.tsbk.motorola.MotorolaOpcode;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
import module.decode.p25.reference.Vendor;
|
||||
import module.decode.p25.reference.VendorLinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import edac.CRC;
|
||||
import edac.Golay24;
|
||||
import edac.ReedSolomon_63_47_17;
|
||||
|
||||
public class TDULinkControlMessage extends P25Message
|
||||
{
|
||||
public final static Logger mLog = LoggerFactory.getLogger( TDULinkControlMessage.class );
|
||||
|
||||
public static final int[] LC_HEX_0 = { 64,65,66,67,68,69 };
|
||||
public static final int[] LC_HEX_1 = { 70,71,72,73,74,75 };
|
||||
public static final int[] LC_HEX_2 = { 88,89,90,91,92,93 };
|
||||
public static final int[] LC_HEX_3 = { 94,95,96,97,98,99 };
|
||||
public static final int[] LC_HEX_4 = { 112,113,114,115,116,117 };
|
||||
public static final int[] LC_HEX_5 = { 118,119,120,121,122,123 };
|
||||
public static final int[] LC_HEX_6 = { 136,137,138,139,140,141 };
|
||||
public static final int[] LC_HEX_7 = { 142,143,144,145,146,147 };
|
||||
public static final int[] LC_HEX_8 = { 160,161,162,163,164,165 };
|
||||
public static final int[] LC_HEX_9 = { 166,167,168,169,170,171 };
|
||||
public static final int[] LC_HEX_10 = { 184,185,186,187,188,189 };
|
||||
public static final int[] LC_HEX_11 = { 190,191,192,193,194,195 };
|
||||
public static final int[] RS_HEX_0 = { 208,209,210,211,212,213 };
|
||||
public static final int[] RS_HEX_1 = { 214,215,216,217,218,219 };
|
||||
public static final int[] RS_HEX_2 = { 232,233,234,235,236,237 };
|
||||
public static final int[] RS_HEX_3 = { 238,239,240,241,242,243 };
|
||||
public static final int[] RS_HEX_4 = { 256,257,258,259,260,261 };
|
||||
public static final int[] RS_HEX_5 = { 262,263,264,265,266,267 };
|
||||
public static final int[] RS_HEX_6 = { 280,281,282,283,284,285 };
|
||||
public static final int[] RS_HEX_7 = { 286,287,288,289,290,291 };
|
||||
public static final int[] RS_HEX_8 = { 304,305,306,307,308,309 };
|
||||
public static final int[] RS_HEX_9 = { 310,311,312,313,314,315 };
|
||||
public static final int[] RS_HEX_10 = { 328,329,330,331,332,333 };
|
||||
public static final int[] RS_HEX_11 = { 334,335,336,337,338,339 };
|
||||
|
||||
public static final int ENCRYPTION_FLAG = 64;
|
||||
public static final int IMPLICIT_VENDOR_FLAG = 65;
|
||||
public static final int[] OPCODE = { 66,67,68,69,70,71 };
|
||||
public static final int[] VENDOR = { 72,73,74,75,88,89,90,91 };
|
||||
|
||||
/* Reed-Solomon(24,12,13) code protects the link control word. Maximum
|
||||
* correctable errors are: Hamming Distance(13) / 2 = 6 */
|
||||
public static final ReedSolomon_63_47_17 mReedSolomonDecoder =
|
||||
new ReedSolomon_63_47_17( 6 );
|
||||
|
||||
public TDULinkControlMessage( BinaryMessage message, DataUnitID duid,
|
||||
AliasList aliasList )
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
|
||||
/* NID CRC is checked in the message framer so a constructed message
|
||||
* means it passed the CRC */
|
||||
mCRC = new CRC[ 3 ];
|
||||
mCRC[ 0 ] = CRC.PASSED;
|
||||
|
||||
checkCRC();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a TDULinkControl message from an existing message and bypasses
|
||||
* the CRC calculation.
|
||||
*/
|
||||
protected TDULinkControlMessage( TDULinkControlMessage message )
|
||||
{
|
||||
super( message.getSourceMessage(), DataUnitID.TDULC, message.getAliasList() );
|
||||
|
||||
mCRC = message.getCRC();
|
||||
}
|
||||
|
||||
public CRC[] getCRC()
|
||||
{
|
||||
return mCRC;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
sb.append( " " );
|
||||
sb.append( mMessage.toString() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getMessageStub()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( "NAC:" );
|
||||
sb.append( getNAC() );
|
||||
sb.append( " " );
|
||||
sb.append( getDUID().getLabel() );
|
||||
sb.append( " " );
|
||||
|
||||
if( isEncrypted() )
|
||||
{
|
||||
sb.append( "ENCRYPTED" );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( isImplicitFormat() || getVendor() == Vendor.STANDARD )
|
||||
{
|
||||
sb.append( getOpcode().getLabel() );
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.append( "VENDOR:" + getVendor().getLabel() + " " );
|
||||
sb.append( getVendorOpcode().getLabel() );
|
||||
}
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public boolean isEncrypted()
|
||||
{
|
||||
return mMessage.get( ENCRYPTION_FLAG );
|
||||
}
|
||||
|
||||
public boolean isImplicitFormat()
|
||||
{
|
||||
return mMessage.get( IMPLICIT_VENDOR_FLAG );
|
||||
}
|
||||
|
||||
/**
|
||||
* Standard opcodes when the Vendor is STANDARD
|
||||
*/
|
||||
public LinkControlOpcode getOpcode()
|
||||
{
|
||||
return LinkControlOpcode.fromValue( mMessage.getInt( OPCODE ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a generic vendor-neutral opcode. Use this when there is a non
|
||||
* standard vendor code.
|
||||
*/
|
||||
public VendorLinkControlOpcode getVendorOpcode()
|
||||
{
|
||||
return VendorLinkControlOpcode.fromValue( mMessage.getInt( OPCODE ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* If the vendor is motorola, returns the Motorola OPCODE for this message
|
||||
*/
|
||||
public MotorolaOpcode getMotorolaOpcode()
|
||||
{
|
||||
return MotorolaOpcode.fromValue( mMessage.getInt( OPCODE ) );
|
||||
}
|
||||
|
||||
public Vendor getVendor()
|
||||
{
|
||||
if( isImplicitFormat() )
|
||||
{
|
||||
return Vendor.STANDARD;
|
||||
}
|
||||
|
||||
return Vendor.fromValue( mMessage.getInt( VENDOR ) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks and repairs the 12 x 24-bit golay(24,12,8) codewords and then
|
||||
* checks and repairs the 24 x 6-bit link control and reed-solomon
|
||||
* RS(24,12,13) parity codewords
|
||||
*/
|
||||
private void checkCRC()
|
||||
{
|
||||
/* Check the Golay codewords */
|
||||
int x = 64;
|
||||
|
||||
mCRC[ 1 ] = CRC.PASSED;
|
||||
|
||||
while( x < mMessage.size() )
|
||||
{
|
||||
mMessage = Golay24.checkAndCorrect( mMessage, x );
|
||||
|
||||
if( !( mMessage.getCRC() == CRC.PASSED ) )
|
||||
{
|
||||
mCRC[ 1 ] = CRC.FAILED_CRC;
|
||||
}
|
||||
|
||||
x += 24;
|
||||
}
|
||||
|
||||
/* Check the Reed-Solomon parity bits. The RS decoder expects the link
|
||||
* control data and reed solomon parity hex codewords in reverse order.
|
||||
* The RS(24,12,13) code used by P25 removes the left-hand 47 data hex
|
||||
* words, so we replace them with zeros. */
|
||||
int[] input = new int [63];
|
||||
int[] output = new int [63];
|
||||
|
||||
input[ 0 ] = mMessage.getInt( RS_HEX_11 );
|
||||
input[ 1 ] = mMessage.getInt( RS_HEX_10 );
|
||||
input[ 2 ] = mMessage.getInt( RS_HEX_9 );
|
||||
input[ 3 ] = mMessage.getInt( RS_HEX_8 );
|
||||
input[ 4 ] = mMessage.getInt( RS_HEX_7 );
|
||||
input[ 5 ] = mMessage.getInt( RS_HEX_6 );
|
||||
input[ 6 ] = mMessage.getInt( RS_HEX_5 );
|
||||
input[ 7 ] = mMessage.getInt( RS_HEX_4 );
|
||||
input[ 8 ] = mMessage.getInt( RS_HEX_3 );
|
||||
input[ 9 ] = mMessage.getInt( RS_HEX_2 );
|
||||
input[ 10 ] = mMessage.getInt( RS_HEX_1 );
|
||||
input[ 11 ] = mMessage.getInt( RS_HEX_0 );
|
||||
input[ 12 ] = mMessage.getInt( LC_HEX_11 );
|
||||
input[ 13 ] = mMessage.getInt( LC_HEX_10 );
|
||||
input[ 14 ] = mMessage.getInt( LC_HEX_9 );
|
||||
input[ 15 ] = mMessage.getInt( LC_HEX_8 );
|
||||
input[ 16 ] = mMessage.getInt( LC_HEX_7 );
|
||||
input[ 17 ] = mMessage.getInt( LC_HEX_6 );
|
||||
input[ 18 ] = mMessage.getInt( LC_HEX_5 );
|
||||
input[ 19 ] = mMessage.getInt( LC_HEX_4 );
|
||||
input[ 20 ] = mMessage.getInt( LC_HEX_3 );
|
||||
input[ 21 ] = mMessage.getInt( LC_HEX_2 );
|
||||
input[ 22 ] = mMessage.getInt( LC_HEX_1 );
|
||||
input[ 23 ] = mMessage.getInt( LC_HEX_0 );
|
||||
/* indexes 24 - 62 are defaulted to zero */
|
||||
|
||||
boolean irrecoverableErrors = mReedSolomonDecoder.decode( input, output );
|
||||
|
||||
if( irrecoverableErrors )
|
||||
{
|
||||
mCRC[ 2 ] = CRC.FAILED_CRC;
|
||||
}
|
||||
else
|
||||
{
|
||||
mCRC[ 2 ] = CRC.PASSED;
|
||||
|
||||
/* Only fix the link control data hex codewords */
|
||||
repairHexCodeword( input, output, 12, LC_HEX_11 );
|
||||
repairHexCodeword( input, output, 13, LC_HEX_10 );
|
||||
repairHexCodeword( input, output, 14, LC_HEX_9 );
|
||||
repairHexCodeword( input, output, 15, LC_HEX_8 );
|
||||
repairHexCodeword( input, output, 16, LC_HEX_7 );
|
||||
repairHexCodeword( input, output, 17, LC_HEX_6 );
|
||||
repairHexCodeword( input, output, 18, LC_HEX_5 );
|
||||
repairHexCodeword( input, output, 19, LC_HEX_4 );
|
||||
repairHexCodeword( input, output, 20, LC_HEX_3 );
|
||||
repairHexCodeword( input, output, 21, LC_HEX_2 );
|
||||
repairHexCodeword( input, output, 22, LC_HEX_1 );
|
||||
repairHexCodeword( input, output, 23, LC_HEX_0 );
|
||||
|
||||
/* If the golay check failed, mark it as corrected too */
|
||||
if( mCRC[ 1 ] == CRC.FAILED_CRC )
|
||||
{
|
||||
mCRC[ 1 ] = CRC.CORRECTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void repairHexCodeword( int[] input, int[] output, int index, int[] indexSet )
|
||||
{
|
||||
if( input[ index ] != output[ index ] )
|
||||
{
|
||||
mMessage.load( indexSet[ 0 ], 6, output[ index ] );
|
||||
mCRC[ 2 ] = CRC.CORRECTED;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if the message passed the golay and reed-solomon parity checks
|
||||
* or was corrected.
|
||||
*/
|
||||
public boolean isValid()
|
||||
{
|
||||
// mCRC[ 0 ] - always passes (otherwise message wouldn't be constructed )
|
||||
// mCRC[ 1 ] - golay - always passes or corrected if mCRC[2] is valid
|
||||
|
||||
return mCRC[ 2 ] == CRC.PASSED || mCRC[ 2 ] == CRC.CORRECTED;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import module.decode.p25.reference.Digit;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TelephoneInterconnectAnswerRequest extends TDULinkControlMessage
|
||||
{
|
||||
private final static Logger mLog = LoggerFactory.getLogger( TelephoneInterconnectAnswerRequest.class );
|
||||
|
||||
public static final int[] DIGIT_1 = { 72,73,74,75 };
|
||||
public static final int[] DIGIT_2 = { 88,89,90,91 };
|
||||
public static final int[] DIGIT_3 = { 92,93,94,95 };
|
||||
public static final int[] DIGIT_4 = { 96,97,98,99 };
|
||||
public static final int[] DIGIT_5 = { 112,113,114,115 };
|
||||
public static final int[] DIGIT_6 = { 116,117,118,119 };
|
||||
public static final int[] DIGIT_7 = { 120,121,122,123 };
|
||||
public static final int[] DIGIT_8 = { 136,137,138,139 };
|
||||
public static final int[] DIGIT_9 = { 140,141,142,143 };
|
||||
public static final int[] DIGIT_10 = { 144,145,146,147 };
|
||||
|
||||
public static final int[] TARGET_ADDRESS = { 160,161,162,163,164,165,166,
|
||||
167,168,169,170,171,184,185,186,187,188,189,190,191,192,193,194,195 };
|
||||
|
||||
public TelephoneInterconnectAnswerRequest( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.TELEPHONE_INTERCONNECT_ANSWER_REQUEST.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " TO:" );
|
||||
sb.append( getTargetAddress() );
|
||||
|
||||
sb.append( " TEL:" );
|
||||
sb.append( getTelephoneNumber() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getTargetAddress()
|
||||
{
|
||||
return mMessage.getHex( TARGET_ADDRESS, 6 );
|
||||
}
|
||||
|
||||
public String getTelephoneNumber()
|
||||
{
|
||||
List<Integer> digits = new ArrayList<Integer>();
|
||||
|
||||
digits.add( mMessage.getInt( DIGIT_1 ) );
|
||||
digits.add( mMessage.getInt( DIGIT_2 ) );
|
||||
digits.add( mMessage.getInt( DIGIT_3 ) );
|
||||
digits.add( mMessage.getInt( DIGIT_4 ) );
|
||||
digits.add( mMessage.getInt( DIGIT_5 ) );
|
||||
digits.add( mMessage.getInt( DIGIT_6 ) );
|
||||
digits.add( mMessage.getInt( DIGIT_7 ) );
|
||||
digits.add( mMessage.getInt( DIGIT_8 ) );
|
||||
digits.add( mMessage.getInt( DIGIT_9 ) );
|
||||
digits.add( mMessage.getInt( DIGIT_10 ) );
|
||||
|
||||
return Digit.decode( digits );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TelephoneInterconnectVoiceChannelUser extends TDULinkControlMessage
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( TelephoneInterconnectVoiceChannelUser.class );
|
||||
/* Service Options */
|
||||
public static final int EMERGENCY_FLAG = 92;
|
||||
public static final int ENCRYPTED_CHANNEL_FLAG = 93;
|
||||
public static final int DUPLEX_MODE = 94;
|
||||
public static final int SESSION_MODE = 95;
|
||||
|
||||
public static final int[] CALL_TIMER = { 120,121,122,123,136,137,138,139,
|
||||
140,141,142,143,144,145,146,147 };
|
||||
public static final int[] ADDRESS = { 160,161,162,163,164,165,166,
|
||||
167,168,169,170,171,184,185,186,187,188,189,190,191,192,193,194,195 };
|
||||
|
||||
public TelephoneInterconnectVoiceChannelUser( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.TELEPHONE_INTERCONNECT_VOICE_CHANNEL_USER.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
if( isEmergency() )
|
||||
{
|
||||
sb.append( " EMERGENCY" );
|
||||
}
|
||||
if( isEncryptedChannel() )
|
||||
{
|
||||
sb.append( " ENCRYPTED CHANNEL" );
|
||||
}
|
||||
|
||||
sb.append( " TIMER:" + getCallTimer() + " SECS" );
|
||||
|
||||
sb.append( " ADDR:" + getAddress() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public boolean isEmergency()
|
||||
{
|
||||
return mMessage.get( EMERGENCY_FLAG );
|
||||
}
|
||||
|
||||
public boolean isEncryptedChannel()
|
||||
{
|
||||
return mMessage.get( ENCRYPTED_CHANNEL_FLAG );
|
||||
}
|
||||
|
||||
public DuplexMode getDuplexMode()
|
||||
{
|
||||
return mMessage.get( DUPLEX_MODE ) ? DuplexMode.FULL : DuplexMode.HALF;
|
||||
}
|
||||
|
||||
public SessionMode getSessionMode()
|
||||
{
|
||||
return mMessage.get( SESSION_MODE ) ?
|
||||
SessionMode.CIRCUIT : SessionMode.PACKET;
|
||||
}
|
||||
|
||||
public String getAddress()
|
||||
{
|
||||
return mMessage.getHex( ADDRESS, 6 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Call timer in seconds
|
||||
*/
|
||||
public int getCallTimer()
|
||||
{
|
||||
int units = mMessage.getInt( CALL_TIMER );
|
||||
|
||||
return (int)( units / 10 );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class UnitAuthenticationCommand extends TDULinkControlMessage
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( UnitAuthenticationCommand.class );
|
||||
public static final int[] NETWORK_ID = { 72,73,74,75,88,89,90,91,92,93,94,
|
||||
95,96,97,98,99,112,113,114,115 };
|
||||
public static final int[] SYSTEM_ID = { 116,117,118,119,120,121,122,123,
|
||||
136,137,138,139 };
|
||||
/* ICD says this is a source id, but this is a command messages, so this
|
||||
* must be a target id */
|
||||
public static final int[] TARGET_ID = { 140,141,142,143,144,145,146,147,
|
||||
160,161,162,163,164,165,166,167,168,169,170,171,184,185,186,187 };
|
||||
|
||||
public UnitAuthenticationCommand( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.UNIT_AUTHENTICATION_COMMAND.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " ADDRESS:" + getCompleteTargetAddress() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getCompleteTargetAddress()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getNetworkID() );
|
||||
sb.append( ":" );
|
||||
sb.append( getSystemID() );
|
||||
sb.append( ":" );
|
||||
sb.append( getTargetID() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getNetworkID()
|
||||
{
|
||||
return mMessage.getHex( NETWORK_ID, 5 );
|
||||
}
|
||||
|
||||
public String getSystemID()
|
||||
{
|
||||
return mMessage.getHex( SYSTEM_ID, 3 );
|
||||
}
|
||||
|
||||
public String getTargetID()
|
||||
{
|
||||
return mMessage.getHex( TARGET_ID, 6 );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class UnitRegistrationCommand extends TDULinkControlMessage
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( UnitRegistrationCommand.class );
|
||||
public static final int[] NETWORK_ID = { 72,73,74,75,88,89,90,91,92,93,94,
|
||||
95,96,97,98,99,112,113,114,115 };
|
||||
public static final int[] SYSTEM_ID = { 116,117,118,119,120,121,122,123,
|
||||
136,137,138,139 };
|
||||
/* ICD calls this source, but should be target address */
|
||||
public static final int[] TARGET_ID = { 140,141,142,143,144,145,146,147,
|
||||
160,161,162,163,164,165,166,167,168,169,170,171,184,185,186,187 };
|
||||
|
||||
public UnitRegistrationCommand( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.UNIT_REGISTRATION_COMMAND.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " ADDRESS:" + getCompleteTargetAddress() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getCompleteTargetAddress()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getNetworkID() );
|
||||
sb.append( ":" );
|
||||
sb.append( getSystemID() );
|
||||
sb.append( ":" );
|
||||
sb.append( getTargetID() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getNetworkID()
|
||||
{
|
||||
return mMessage.getHex( NETWORK_ID, 5 );
|
||||
}
|
||||
|
||||
public String getSystemID()
|
||||
{
|
||||
return mMessage.getHex( SYSTEM_ID, 3 );
|
||||
}
|
||||
|
||||
public String getTargetID()
|
||||
{
|
||||
return mMessage.getHex( TARGET_ID, 6 );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class UnitToUnitAnswerRequest extends TDULinkControlMessage
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( UnitToUnitAnswerRequest.class );
|
||||
/* Service Options */
|
||||
public static final int EMERGENCY_FLAG = 92;
|
||||
public static final int ENCRYPTED_CHANNEL_FLAG = 93;
|
||||
public static final int DUPLEX_MODE = 94;
|
||||
public static final int SESSION_MODE = 95;
|
||||
public static final int[] TARGET_ADDRESS = { 112,113,114,115,116,117,118,
|
||||
119,120,121,122,123,136,137,138,139,140,141,142,143,144,145,146,147 };
|
||||
public static final int[] SOURCE_ADDRESS = { 160,161,162,163,164,165,166,
|
||||
167,168,169,170,171,184,185,186,187,188,189,190,191,192,193,194,195 };
|
||||
|
||||
public UnitToUnitAnswerRequest( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.UNIT_TO_UNIT_ANSWER_REQUEST.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
if( isEmergency() )
|
||||
{
|
||||
sb.append( " EMERGENCY" );
|
||||
}
|
||||
if( isEncryptedChannel() )
|
||||
{
|
||||
sb.append( " ENCRYPTED CHANNEL" );
|
||||
}
|
||||
|
||||
sb.append( " FROM:" + getSourceAddress() );
|
||||
|
||||
sb.append( " TO:" + getTargetAddress() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public boolean isEmergency()
|
||||
{
|
||||
return mMessage.get( EMERGENCY_FLAG );
|
||||
}
|
||||
|
||||
public boolean isEncryptedChannel()
|
||||
{
|
||||
return mMessage.get( ENCRYPTED_CHANNEL_FLAG );
|
||||
}
|
||||
|
||||
public DuplexMode getDuplexMode()
|
||||
{
|
||||
return mMessage.get( DUPLEX_MODE ) ? DuplexMode.FULL : DuplexMode.HALF;
|
||||
}
|
||||
|
||||
public SessionMode getSessionMode()
|
||||
{
|
||||
return mMessage.get( SESSION_MODE ) ?
|
||||
SessionMode.CIRCUIT : SessionMode.PACKET;
|
||||
}
|
||||
|
||||
public String getTargetAddress()
|
||||
{
|
||||
return mMessage.getHex( TARGET_ADDRESS, 6 );
|
||||
}
|
||||
|
||||
public String getSourceAddress()
|
||||
{
|
||||
return mMessage.getHex( SOURCE_ADDRESS, 6 );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package module.decode.p25.message.tdu.lc;
|
||||
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class UnitToUnitVoiceChannelUser extends TDULinkControlMessage
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( UnitToUnitVoiceChannelUser.class );
|
||||
/* Service Options */
|
||||
public static final int EMERGENCY_FLAG = 92;
|
||||
public static final int ENCRYPTED_CHANNEL_FLAG = 93;
|
||||
public static final int DUPLEX_MODE = 94;
|
||||
public static final int SESSION_MODE = 95;
|
||||
public static final int[] TARGET_ADDRESS = { 112,113,114,115,116,117,118,
|
||||
119,120,121,122,123,136,137,138,139,140,141,142,143,144,145,146,147 };
|
||||
public static final int[] SOURCE_ADDRESS = { 160,161,162,163,164,165,166,
|
||||
167,168,169,170,171,184,185,186,187,188,189,190,191,192,193,194,195 };
|
||||
|
||||
public UnitToUnitVoiceChannelUser( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.UNIT_TO_UNIT_VOICE_CHANNEL_USER.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
if( isEmergency() )
|
||||
{
|
||||
sb.append( " EMERGENCY" );
|
||||
}
|
||||
if( isEncryptedChannel() )
|
||||
{
|
||||
sb.append( " ENCRYPTED CHANNEL" );
|
||||
}
|
||||
|
||||
sb.append( " FROM:" + getSourceAddress() );
|
||||
|
||||
sb.append( " TO:" + getTargetAddress() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public boolean isEmergency()
|
||||
{
|
||||
return mMessage.get( EMERGENCY_FLAG );
|
||||
}
|
||||
|
||||
public boolean isEncryptedChannel()
|
||||
{
|
||||
return mMessage.get( ENCRYPTED_CHANNEL_FLAG );
|
||||
}
|
||||
|
||||
public DuplexMode getDuplexMode()
|
||||
{
|
||||
return mMessage.get( DUPLEX_MODE ) ? DuplexMode.FULL : DuplexMode.HALF;
|
||||
}
|
||||
|
||||
public SessionMode getSessionMode()
|
||||
{
|
||||
return mMessage.get( SESSION_MODE ) ?
|
||||
SessionMode.CIRCUIT : SessionMode.PACKET;
|
||||
}
|
||||
|
||||
public String getTargetAddress()
|
||||
{
|
||||
return mMessage.getHex( TARGET_ADDRESS, 6 );
|
||||
}
|
||||
|
||||
public String getSourceAddress()
|
||||
{
|
||||
return mMessage.getHex( SOURCE_ADDRESS, 6 );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user