P25 work in progress.

This commit is contained in:
dennis.sheirer
2014-11-26 03:42:22 +00:00
parent 23901c7a2f
commit 86899e8a77
19 changed files with 907 additions and 214 deletions

View File

@@ -5,6 +5,7 @@ import message.Message;
import alias.Alias;
import alias.AliasList;
import bits.BitSetBuffer;
import decode.p25.message.tsbk.osp.control.IdentifierUpdate;
import decode.p25.reference.DataUnitID;
public class P25Message extends Message
@@ -128,4 +129,44 @@ public class P25Message extends Message
{
return true;
}
/**
* Calculates the frequency of the uplink channel using the channel number
* and the IdentifierUpdate message.
*
* @param iden - Identifier Update message
* @param channel - channel number
* @return - frequency in Hertz
*/
protected static long calculateUplink( IdentifierUpdate iden, int channel )
{
long downlink = calculateDownlink( iden, channel );
if( downlink > 0 && iden != null )
{
return downlink + iden.getTransmitOffset();
}
return 0;
}
/**
* Calculates the frequency of the downlink channel using the channel number
* and the IdentifierUpdate message.
*
* @param iden - Identifier Update message
* @param channel - channel number
* @return - frequency in Hertz
*/
protected static long calculateDownlink( IdentifierUpdate iden, int channel )
{
if( iden != null )
{
return iden.getBaseFrequency() +
( channel * iden.getChannelSpacing() );
}
return 0;
}
}

View File

@@ -0,0 +1,146 @@
package decode.p25.message.pdu;
import alias.AliasList;
import bits.BitSetBuffer;
import decode.p25.message.tsbk.osp.control.IdentifierUpdate;
import decode.p25.message.tsbk.osp.control.IdentifierUpdateReceiver;
import decode.p25.message.tsbk.osp.control.SystemService;
import decode.p25.reference.DataUnitID;
import decode.p25.reference.Opcode;
public class NetworkStatusBroadcastExtended extends PDUMessage
implements IdentifierUpdateReceiver
{
public static final int[] LRA = { 88,89,90,91,92,93,94,95 };
public static final int[] SYSTEM_ID = { 100,101,102,103,104,105,106,107,108,
109,110,111 };
public static final int[] WACN = { 160,161,162,163,164,165,166,167,168,169,
170,171,172,173,174,175,176,177,178,179 };
public static final int[] TRANSMIT_IDENTIFIER = { 184,185,186,187 };
public static final int[] TRANSMIT_CHANNEL = { 188,189,190,191,192,193,194,
195,196,197,198,199 };
public static final int[] RECEIVE_IDENTIFIER = { 200,201,202,203 };
public static final int[] RECEIVE_CHANNEL = { 204,205,206,207,208,209,210,
211,212,213,214,215 };
public static final int[] SYSTEM_SERVICE_CLASS = { 216,217,218,219,220,221,
222,223 };
public static final int[] MULTIPLE_BLOCK_CRC = { 224,225,226,227,228,229,
230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,
248,249,250,251,252,253,254,255 };
private IdentifierUpdate mTransmitIdentifierUpdate;
private IdentifierUpdate mReceiveIdentifierUpdate;
public NetworkStatusBroadcastExtended( BitSetBuffer message,
DataUnitID duid, AliasList aliasList )
{
super( message, duid, aliasList );
}
@Override
public String getEventType()
{
return Opcode.NETWORK_STATUS_BROADCAST.getDescription();
}
public String getMessage()
{
StringBuilder sb = new StringBuilder();
sb.append( getMessageStub() );
sb.append( " LRA:" + getLocationRegistrationArea() );
sb.append( " WACN:" + getWACN() );
sb.append( " SYS:" + getSystemID() );
sb.append( " CTRL CHAN:" + getReceiveIdentifier() + "-" + getReceiveChannel() );
sb.append( " DN:" + getDownlinkFrequency() );
sb.append( " " + getTransmitIdentifier() + "-" + getTransmitChannel() );
sb.append( " UP:" + getUplinkFrequency() );
sb.append( " SYS SVC CLASS:" +
SystemService.toString( getSystemServiceClass() ) );
return sb.toString();
}
public String getLocationRegistrationArea()
{
return mMessage.getHex( LRA, 2 );
}
public String getSystemID()
{
return mMessage.getHex( SYSTEM_ID, 3 );
}
public String getWACN()
{
return mMessage.getHex( WACN, 6 );
}
public int getTransmitIdentifier()
{
return mMessage.getInt( TRANSMIT_IDENTIFIER );
}
public int getTransmitChannel()
{
return mMessage.getInt( TRANSMIT_CHANNEL );
}
public int getReceiveIdentifier()
{
return mMessage.getInt( RECEIVE_IDENTIFIER );
}
public int getReceiveChannel()
{
return mMessage.getInt( RECEIVE_CHANNEL );
}
public int getSystemServiceClass()
{
return mMessage.getInt( SYSTEM_SERVICE_CLASS );
}
public long getDownlinkFrequency()
{
return calculateDownlink( mTransmitIdentifierUpdate, getTransmitChannel() );
}
public long getUplinkFrequency()
{
return calculateUplink( mReceiveIdentifierUpdate, getReceiveChannel() );
}
@Override
public void setIdentifierMessage( int identifier, IdentifierUpdate message )
{
if( identifier == getTransmitIdentifier() )
{
mTransmitIdentifierUpdate = message;
}
if( identifier == getReceiveIdentifier() )
{
mReceiveIdentifierUpdate = message;
}
}
public int[] getIdentifiers()
{
int[] idens = new int[ 2 ];
idens[ 0 ] = getTransmitIdentifier();
idens[ 1 ] = getReceiveIdentifier();
return idens;
}
}

View File

@@ -4,156 +4,157 @@ import alias.AliasList;
import bits.BitSetBuffer;
import decode.p25.message.P25Message;
import decode.p25.reference.DataUnitID;
import decode.p25.reference.Opcode;
import decode.p25.reference.PDUFormat;
import decode.p25.reference.ServiceAccessPoint;
import decode.p25.reference.Vendor;
public class PDUMessage extends P25Message
{
public static final int PDU_HEADER_DUMMY1 = 66; //Always 0
public static final int PDU_HEADER_CONFIRMATION_REQUIRED = 67;
public static final int PDU_HEADER_DIRECTION_FLAG = 68;
public static final int[] PDU_HEADER_FORMAT = { 69,70,71,72,73 };
public static final int PDU_HEADER_DUMMY2 = 74; //Always 1
public static final int PDU_HEADER_DUMMY3 = 75; //Always 1
public static final int[] PDU_HEADER_SAP_ID = { 76,77,78,79,80 };
public static final int[] PDU_HEADER_VENDOR_ID = { 81,82,83,84,85,86,87,88 };
public static final int[] PDU_HEADER_LOGICAL_LINK_ID = { 89,90,91,92,93,94,
97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114 };
public static final int PDU_HEADER_FULL_MESSAGE_FLAG = 115;
public static final int[] PDU_HEADER_BLOCKS_TO_FOLLOW = { 116,117,118,119,
120,121,122 };
public static final int PDU_HEADER_DUMMY4 = 123; //Always 0
public static final int PDU_HEADER_DUMMY5 = 124; //Always 0
public static final int PDU_HEADER_DUMMY6 = 125; //Always 0
public static final int[] PDU_HEADER_PAD_BLOCKS = { 126,127,128,129,130 };
public static final int PDU_HEADER_RESYNCHRONIZE_FLAG = 131;
public static final int[] PDU_HEADER_SEQUENCE_NUMBER = { 132,133,134 };
public static final int[] PDU_HEADER_FRAGMENT_SEQUENCE_NUMBER = { 135,136,
137,138 };
public static final int PDU_HEADER_DUMMY7 = 139; //Always 0
public static final int PDU_HEADER_DUMMY8 = 140; //Always 0
public static final int[] PDU_HEADER_DATA_HEADER_OFFSET = { 141,142,143,
144,145,146 };
public static final int[] PDU_HEADER_CRC = { 147,148,149,150,151,152,153,154,
155,156,157,158,159,160,161,162 };
public static final int CONFIRMATION_REQUIRED_INDICATOR = 65;
public static final int PACKET_DIRECTION_INDICATOR = 66;
public static final int[] FORMAT = { 67,68,69,70,71 };
public static final int[] SAP_ID = { 74,75,76,77,78,79 };
public static final int[] VENDOR_ID = { 80,81,82,83,84,85,86,87 };
public static final int[] LOGICAL_LINK_ID = { 88,89,90,91,92,93,94,95,96,97,
98,99,100,101,102,103,104,105,106,107,108,109,110,111 };
public static final int[] BLOCKS_TO_FOLLOW = { 113,114,115,116,117,118,119 };
public static final int[] PAD_OCTET_COUNT = { 123,124,125,126,127 };
public static final int[] OPCODE = { 122,123,124,125,126,127 };
public static final int[] DATA_HEADER_OFFSET = { 138,139,140,141,142,143 };
public static final int[] PDU_CRC = { 144,145,146,147,148,149,150,151,152,
153,154,155,156,157,158,159 };
//status 166,167
public PDUMessage( BitSetBuffer message, DataUnitID duid, AliasList aliasList )
{
super( message, duid, aliasList );
}
public String getConfirmation()
protected String getMessageStub()
{
return mMessage.get( PDU_HEADER_CONFIRMATION_REQUIRED ) ? "CON" : "UNC";
}
public String getDirection()
{
return mMessage.get( PDU_HEADER_DIRECTION_FLAG ) ? "OSP" : "ISP";
}
public PDUFormat getFormat()
{
return PDUFormat.fromValue( mMessage.getInt( PDU_HEADER_FORMAT ) );
}
public ServiceAccessPoint getServiceAccessPoint()
{
return ServiceAccessPoint.fromValue( mMessage.getInt( PDU_HEADER_SAP_ID ) );
}
public Vendor getVendor()
{
return Vendor.fromValue( mMessage.getInt( PDU_HEADER_VENDOR_ID ) );
}
public String getLogicalLinkID()
{
return mMessage.getHex( PDU_HEADER_LOGICAL_LINK_ID, 6 );
}
public boolean isFullMessage()
{
return mMessage.get( PDU_HEADER_FULL_MESSAGE_FLAG );
}
public int getBlockCount()
{
return mMessage.getInt( PDU_HEADER_BLOCKS_TO_FOLLOW );
}
public int getPadBlockCount()
{
return mMessage.getInt( PDU_HEADER_PAD_BLOCKS );
}
public boolean isResync()
{
return mMessage.get( PDU_HEADER_RESYNCHRONIZE_FLAG );
}
public int getSequenceNumber()
{
return mMessage.getInt( PDU_HEADER_SEQUENCE_NUMBER );
}
public int getFragmentSequenceNumber()
{
return mMessage.getInt( PDU_HEADER_FRAGMENT_SEQUENCE_NUMBER );
}
public int getDataHeaderOffset()
{
return mMessage.getInt( PDU_HEADER_DATA_HEADER_OFFSET );
}
@Override
public String getMessage()
{
StringBuilder sb = new StringBuilder();
Vendor vendor = getVendor();
sb.append( "NAC:" );
sb.append( getNAC() );
sb.append( " " );
sb.append( getDUID().getLabel() );
if( vendor == Vendor.STANDARD )
{
sb.append( " " );
sb.append( getOpcode().getLabel() );
}
else
{
sb.append( " " );
sb.append( vendor.getLabel() );
sb.append( " OPCD:" );
sb.append( mMessage.getHex( OPCODE, 2 ) );
}
return sb.toString();
}
@Override
public String getMessage()
{
StringBuilder sb = new StringBuilder();
sb.append( getMessageStub() );
switch( getFormat() )
{
case ALTERNATE_MULTI_BLOCK_TRUNKING_CONTROL:
break;
case UNCONFIRMED_MULTI_BLOCK_TRUNKING_CONTROL:
sb.append( " PAD OCTETS:" + getPadOctetCount() );
sb.append( " DATA HDR OFFSET:" + getDataHeaderOffset() );
break;
default:
}
sb.append( " " );
sb.append( getConfirmation() );
sb.append( " " );
sb.append( getDirection() );
sb.append( " FMT:" );
sb.append( getFormat().getLabel() );
switch( getFormat() )
{
case ALTERNATE_MULTI_BLOCK_TRUNKING_CONTROL:
case UNCONFIRMED_MULTI_BLOCK_TRUNKING_CONTROL:
sb.append( " SAP:" );
sb.append( getServiceAccessPoint().getLabel() );
sb.append( " VEND:" );
sb.append( getVendor().getLabel() );
sb.append( " LLID:" );
sb.append( getLogicalLinkID() );
sb.append( " FMF:" );
sb.append( isFullMessage() ? "1" : "0" );
sb.append( " BLKS:" );
sb.append( getBlockCount() );
sb.append( " PAD:" );
sb.append( getPadBlockCount() );
sb.append( " RESYNC:" );
sb.append( isResync() ? "1" : "0" );
sb.append( " SEQ:" );
sb.append( getSequenceNumber() );
sb.append( " FRAG:" );
sb.append( getFragmentSequenceNumber() );
sb.append( " DHO:" );
sb.append( getDataHeaderOffset() );
break;
default:
}
sb.append( " SAP:" );
sb.append( getServiceAccessPoint().getLabel() );
sb.append( " VEND:" );
sb.append( getVendor().getLabel() );
sb.append( " LLID:" );
sb.append( getLogicalLinkID() );
sb.append( " BLKS TO FOLLOW:" );
sb.append( getBlocksToFollowCount() );
return sb.toString();
}
public String getConfirmation()
{
return mMessage.get( CONFIRMATION_REQUIRED_INDICATOR ) ? "CON" : "UNC";
}
public String getDirection()
{
return mMessage.get( PACKET_DIRECTION_INDICATOR ) ? "OSP" : "ISP";
}
public PDUFormat getFormat()
{
return PDUFormat.fromValue( mMessage.getInt( FORMAT ) );
}
public ServiceAccessPoint getServiceAccessPoint()
{
return ServiceAccessPoint.fromValue( mMessage.getInt( SAP_ID ) );
}
public Vendor getVendor()
{
return Vendor.fromValue( mMessage.getInt( VENDOR_ID ) );
}
public String getLogicalLinkID()
{
return mMessage.getHex( LOGICAL_LINK_ID, 6 );
}
public int getBlocksToFollowCount()
{
return mMessage.getInt( BLOCKS_TO_FOLLOW );
}
public int getPadOctetCount()
{
if( getFormat() == PDUFormat.UNCONFIRMED_MULTI_BLOCK_TRUNKING_CONTROL )
{
return mMessage.getInt( PAD_OCTET_COUNT );
}
return 0;
}
public Opcode getOpcode()
{
if( getFormat() == PDUFormat.ALTERNATE_MULTI_BLOCK_TRUNKING_CONTROL )
{
return Opcode.fromValue( mMessage.getInt( OPCODE ) );
}
return Opcode.UNKNOWN;
}
public int getDataHeaderOffset()
{
if( getFormat() == PDUFormat.UNCONFIRMED_MULTI_BLOCK_TRUNKING_CONTROL )
{
return mMessage.getInt( DATA_HEADER_OFFSET );
}
return 0;
}
}

View File

@@ -0,0 +1,57 @@
package decode.p25.message.pdu;
import alias.AliasList;
import bits.BitSetBuffer;
import decode.p25.reference.DataUnitID;
import decode.p25.reference.Opcode;
import decode.p25.reference.PDUFormat;
import decode.p25.reference.Vendor;
public class PDUMessageFactory
{
public static PDUMessage getMessage( BitSetBuffer message,
DataUnitID duid,
AliasList aliasList )
{
PDUFormat format = PDUFormat.fromValue(
message.getInt( PDUMessage.FORMAT ) );
switch( format )
{
case ALTERNATE_MULTI_BLOCK_TRUNKING_CONTROL:
Vendor vendor = Vendor.fromValue(
message.getInt( PDUMessage.VENDOR_ID ) );
switch( vendor )
{
case STANDARD:
Opcode opcode = Opcode.fromValue(
message.getInt( PDUMessage.OPCODE ) );
switch( opcode )
{
case NETWORK_STATUS_BROADCAST:
return new NetworkStatusBroadcastExtended(
message, duid, aliasList );
case RFSS_STATUS_BROADCAST:
return new RFSSStatusBroadcastExtended( message,
duid, aliasList );
default:
break;
}
case MOTOROLA:
break;
default:
break;
}
return new PDUMessage( message, duid, aliasList );
case UNCONFIRMED_MULTI_BLOCK_TRUNKING_CONTROL:
return new PDUMessage( message, duid, aliasList );
default:
return new PDUMessage( message, duid, aliasList );
}
}
}

View File

@@ -0,0 +1,157 @@
package decode.p25.message.pdu;
import alias.AliasList;
import bits.BitSetBuffer;
import decode.p25.message.tsbk.osp.control.IdentifierUpdate;
import decode.p25.message.tsbk.osp.control.IdentifierUpdateReceiver;
import decode.p25.message.tsbk.osp.control.SystemService;
import decode.p25.reference.DataUnitID;
import decode.p25.reference.Opcode;
public class RFSSStatusBroadcastExtended extends PDUMessage
implements IdentifierUpdateReceiver
{
public static final int[] LRA = { 88,89,90,91,92,93,94,95 };
public static final int ACTIVE_NETWORK_CONNECTION_INDICATOR = 99;
public static final int[] SYSTEM_ID = { 100,101,102,103,104,105,106,107,108,
109,110,111 };
public static final int[] RFSS_ID = { 160,161,162,163,164,165,166,167 };
public static final int[] SITE_ID = { 168,169,170,171,172,173,174,175 };
public static final int[] TRANSMIT_IDENTIFIER = { 184,185,186,187 };
public static final int[] TRANSMIT_CHANNEL = { 188,189,190,191,192,193,194,
195,196,197,198,199 };
public static final int[] RECEIVE_IDENTIFIER = { 200,201,202,203 };
public static final int[] RECEIVE_CHANNEL = { 204,205,206,207,208,209,210,
211,212,213,214,215 };
public static final int[] SYSTEM_SERVICE_CLASS = { 216,217,218,219,220,221,
222,223 };
public static final int[] MULTIPLE_BLOCK_CRC = { 224,225,226,227,228,229,
230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,
248,249,250,251,252,253,254,255 };
private IdentifierUpdate mTransmitIdentifierUpdate;
private IdentifierUpdate mReceiveIdentifierUpdate;
public RFSSStatusBroadcastExtended( BitSetBuffer message,
DataUnitID duid, AliasList aliasList )
{
super( message, duid, aliasList );
}
@Override
public String getEventType()
{
return Opcode.NETWORK_STATUS_BROADCAST.getDescription();
}
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( " CTRL CHAN:" + getReceiveIdentifier() + "-" + getReceiveChannel() );
sb.append( " DN:" + getDownlinkFrequency() );
sb.append( " " + getTransmitIdentifier() + "-" + getTransmitChannel() );
sb.append( " UP:" + getUplinkFrequency() );
sb.append( " SYS SVC CLASS:" +
SystemService.toString( getSystemServiceClass() ) );
return sb.toString();
}
public String getLocationRegistrationArea()
{
return mMessage.getHex( LRA, 2 );
}
public boolean hasActiveNetworkConnection()
{
return mMessage.get( ACTIVE_NETWORK_CONNECTION_INDICATOR );
}
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 getTransmitIdentifier()
{
return mMessage.getInt( TRANSMIT_IDENTIFIER );
}
public int getTransmitChannel()
{
return mMessage.getInt( TRANSMIT_CHANNEL );
}
public int getReceiveIdentifier()
{
return mMessage.getInt( RECEIVE_IDENTIFIER );
}
public int getReceiveChannel()
{
return mMessage.getInt( RECEIVE_CHANNEL );
}
public int getSystemServiceClass()
{
return mMessage.getInt( SYSTEM_SERVICE_CLASS );
}
public long getDownlinkFrequency()
{
return calculateDownlink( mTransmitIdentifierUpdate, getTransmitChannel() );
}
public long getUplinkFrequency()
{
return calculateUplink( mReceiveIdentifierUpdate, getReceiveChannel() );
}
@Override
public void setIdentifierMessage( int identifier, IdentifierUpdate message )
{
if( identifier == getTransmitIdentifier() )
{
mTransmitIdentifierUpdate = message;
}
if( identifier == getReceiveIdentifier() )
{
mReceiveIdentifierUpdate = message;
}
}
public int[] getIdentifiers()
{
int[] idens = new int[ 2 ];
idens[ 0 ] = getTransmitIdentifier();
idens[ 1 ] = getReceiveIdentifier();
return idens;
}
}

View File

@@ -74,8 +74,8 @@ public class TSBKMessage extends P25Message
Vendor vendor = getVendor();
sb.append( "SYS:" );
sb.append( getNAC() ); /* NAC is the system id for TSBK messages */
sb.append( "NAC:" );
sb.append( getNAC() );
sb.append( " " );
sb.append( getDUID().getLabel() );
@@ -129,27 +129,4 @@ public class TSBKMessage extends P25Message
return sb.toString();
}
protected static long calculateUplink( IdentifierUpdate iden, int channel )
{
long downlink = calculateDownlink( iden, channel );
if( downlink > 0 && iden != null )
{
return downlink + iden.getTransmitOffset();
}
return 0;
}
protected static long calculateDownlink( IdentifierUpdate iden, int channel )
{
if( iden != null )
{
return iden.getBaseFrequency() +
( channel * iden.getChannelSpacing() );
}
return 0;
}
}

View File

@@ -47,11 +47,9 @@ public class AdjacentStatusBroadcast extends TSBKMessage implements IdentifierUp
sb.append( " LRA:" + getLocationRegistrationArea() );
sb.append( " SYSID:" + getSystemID() );
sb.append( " SYS:" + getSystemID() );
sb.append( " RFSS:" + getRFSS() );
sb.append( " SITE:" + getSiteID() );
sb.append( " SITE:" + getRFSS() + "-" + getSiteID() );
sb.append( " CHAN:" + getIdentifier() + "-" + getChannel() );
@@ -109,6 +107,19 @@ public class AdjacentStatusBroadcast extends TSBKMessage implements IdentifierUp
return mMessage.get( ACTIVE_NETWORK_CONNECTION_FLAG );
}
public String getUniqueID()
{
StringBuilder sb = new StringBuilder();
sb.append( getSystemID() );
sb.append( ":" );
sb.append( getRFSS() );
sb.append( ":" );
sb.append( getSiteID() );
return sb.toString();
}
public String getSystemID()
{
return mMessage.getHex( SYSTEM_ID, 3 );

View File

@@ -46,7 +46,7 @@ public class RFSSStatusBroadcast extends TSBKMessage implements IdentifierUpdate
sb.append( " SYSID:" + getSystemID() );
sb.append( " RFSS:" + getRFSS() );
sb.append( " RFSS:" + getRFSubsystemID() );
sb.append( " SITE:" + getSiteID() );
@@ -81,7 +81,7 @@ public class RFSSStatusBroadcast extends TSBKMessage implements IdentifierUpdate
return mMessage.getHex( SYSTEM_ID, 3 );
}
public String getRFSS()
public String getRFSubsystemID()
{
return mMessage.getHex( RFSS_ID, 2 );
}

View File

@@ -10,7 +10,7 @@ import decode.p25.reference.DataUnitID;
import decode.p25.reference.Opcode;
public class SecondaryControlChannelBroadcast extends TSBKMessage
implements IdentifierUpdateReceiver
implements IdentifierUpdateReceiver, Comparable<SecondaryControlChannelBroadcast>
{
private final static Logger mLog =
LoggerFactory.getLogger( SecondaryControlChannelBroadcast.class );
@@ -50,9 +50,7 @@ public class SecondaryControlChannelBroadcast extends TSBKMessage
sb.append( getMessageStub() );
sb.append( " RFSS:" + getRFSS() );
sb.append( " SITE:" + getSiteID() );
sb.append( " SITE:" + getRFSS() + "-" + getSiteID() );
sb.append( " CHAN1:" + getIdentifier1() + "-" + getChannel1() );
@@ -151,15 +149,11 @@ public class SecondaryControlChannelBroadcast extends TSBKMessage
{
mIdentifierUpdate1 = message;
}
else if( identifier == getIdentifier2() )
if( identifier == getIdentifier2() )
{
mIdentifierUpdate2 = message;
}
else
{
throw new IllegalArgumentException( "Unexpected identifier update "
+ "message for identifier [" + identifier + "]" );
}
}
public int[] getIdentifiers()
@@ -182,4 +176,29 @@ public class SecondaryControlChannelBroadcast extends TSBKMessage
return idens;
}
@Override
public int compareTo( SecondaryControlChannelBroadcast other )
{
if( other.getSiteID().contentEquals( getSiteID() ) &&
other.getIdentifier1() == getIdentifier1() &&
other.getChannel1() == getChannel1() &&
other.getChannel2() == getChannel2() &&
other.getIdentifier2() == getIdentifier2() &&
other.getDownlinkFrequency1() == getDownlinkFrequency1() &&
other.getUplinkFrequency1() == getUplinkFrequency1() &&
other.getDownlinkFrequency2() == getDownlinkFrequency2() &&
other.getUplinkFrequency2() == getUplinkFrequency2() )
{
return 0;
}
else if( other.getIdentifier1() < getIdentifier1() )
{
return -1;
}
else
{
return 1;
}
}
}

View File

@@ -32,9 +32,7 @@ public class SecondaryControlChannelBroadcastExplicit
sb.append( getMessageStub() );
sb.append( " RFSS:" + getRFSS() );
sb.append( " SITE:" + getSiteID() );
sb.append( " SITE:" + getRFSS() + "-" + getSiteID() );
sb.append( " DOWNLINK:" + getIdentifier1() + "-" + getChannel1() );

View File

@@ -41,7 +41,7 @@ public class SystemService
{
StringBuilder sb = new StringBuilder();
sb.append( "CONTROL CHAN:" );
sb.append( "CONTROL CHAN[" );
if( isCompositeControlChannel( service ) )
{
@@ -58,7 +58,7 @@ public class SystemService
sb.append( " BACKUP" );
}
sb.append( " SERVICES:" );
sb.append( " ] SERVICES[" );
if( providesAuthenticationServices( service ) )
{
@@ -79,6 +79,8 @@ public class SystemService
{
sb.append( " VOICE" );
}
sb.append( " ]" );
return sb.toString();
}