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:
denny
2015-09-01 07:10:26 -04:00
parent 538a299246
commit f4d8ea281d
570 changed files with 21578 additions and 17012 deletions

View File

@@ -0,0 +1,161 @@
package module.decode.p25.message.pdu.osp.control;
import module.decode.p25.message.IBandIdentifier;
import module.decode.p25.message.IdentifierReceiver;
import module.decode.p25.message.pdu.PDUMessage;
import module.decode.p25.message.tsbk.osp.control.SystemService;
import module.decode.p25.reference.DataUnitID;
import module.decode.p25.reference.Opcode;
import alias.AliasList;
import bits.BinaryMessage;
import edac.CRCP25;
public class AdjacentStatusBroadcastExtended extends PDUMessage
implements IdentifierReceiver
{
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[] RF_SUBSYSTEM_ID = { 128,129,130,131,132,133,134,
135 };
public static final int[] SITE_ID = { 136,137,138,139,140,141,142,143 };
public static final int[] TRANSMIT_IDENTIFIER = { 160,161,162,163 };
public static final int[] TRANSMIT_CHANNEL = { 164,165,166,167,168,169,170,
171,172,173,174,175 };
public static final int[] RECEIVE_IDENTIFIER = { 176,177,178,179 };
public static final int[] RECEIVE_CHANNEL = { 180,181,182,183,184,185,186,
187,188,189,190,191 };
public static final int[] SYSTEM_SERVICE_CLASS = { 192,193,194,195,196,197,
198,199 };
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 IBandIdentifier mTransmitIdentifierProvider;
private IBandIdentifier mReceiveIdentifierProvider;
public AdjacentStatusBroadcastExtended( BinaryMessage message,
DataUnitID duid, AliasList aliasList )
{
super( message, duid, aliasList );
/* Header block is already error detected/corrected - perform error
* detection correction on the intermediate and final data blocks */
mMessage = CRCP25.correctPDU1( mMessage );
mCRC[ 1 ] = mMessage.getCRC();
}
@Override
public String getEventType()
{
return Opcode.ADJACENT_STATUS_BROADCAST.getDescription();
}
public String getMessage()
{
StringBuilder sb = new StringBuilder();
sb.append( getMessageStub() );
sb.append( " LRA:" + getLocationRegistrationArea() );
sb.append( " SYS:" + getSystemID() );
sb.append( " RFSS:" + getRFSubsystemID() );
sb.append( " SITE:" + 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 String getSystemID()
{
return mMessage.getHex( SYSTEM_ID, 3 );
}
public String getRFSubsystemID()
{
return mMessage.getHex( RF_SUBSYSTEM_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( mTransmitIdentifierProvider, getTransmitChannel() );
}
public long getUplinkFrequency()
{
return calculateUplink( mReceiveIdentifierProvider, getReceiveChannel() );
}
@Override
public void setIdentifierMessage( int identifier, IBandIdentifier message )
{
if( identifier == getTransmitIdentifier() )
{
mTransmitIdentifierProvider = message;
}
if( identifier == getReceiveIdentifier() )
{
mReceiveIdentifierProvider = message;
}
}
public int[] getIdentifiers()
{
int[] idens = new int[ 2 ];
idens[ 0 ] = getTransmitIdentifier();
idens[ 1 ] = getReceiveIdentifier();
return idens;
}
}

View File

@@ -0,0 +1,81 @@
package module.decode.p25.message.pdu.osp.control;
import module.decode.p25.message.pdu.PDUMessage;
import module.decode.p25.reference.DataUnitID;
import module.decode.p25.reference.Opcode;
import alias.AliasList;
import bits.BinaryMessage;
import edac.CRCP25;
public class CallAlertExtended extends PDUMessage
{
public static final int[] TARGET_ADDRESS = { 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[] WACN = { 128,129,130,131,132,133,134,135,136,137,
138,139,140,141,142,143,160,161,162,163 };
public static final int[] SYSTEM_ID = { 164,165,166,167,168,169,170,171,172,
173,174,175 };
public static final int[] SOURCE_ID = { 176,177,178,179,180,181,182,183,184,
185,186,187,188,189,190,191,192,193,194,195,196,197,198,199 };
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 };
public CallAlertExtended( BinaryMessage message,
DataUnitID duid, AliasList aliasList )
{
super( message, duid, aliasList );
/* Header block is already error detected/corrected - perform error
* detection correction on the intermediate and final data blocks */
mMessage = CRCP25.correctPDU1( mMessage );
mCRC[ 1 ] = mMessage.getCRC();
}
@Override
public String getEventType()
{
return Opcode.CALL_ALERT.getDescription();
}
public String getMessage()
{
StringBuilder sb = new StringBuilder();
sb.append( getMessageStub() );
sb.append( " FROM:" );
sb.append( getSourceID() );
sb.append( " TO:" );
sb.append( getTargetAddress() );
sb.append( " WACN:" );
sb.append( getWACN() );
sb.append( " SYS:" );
sb.append( getSystemID() );
return sb.toString();
}
public String getTargetAddress()
{
return mMessage.getHex( TARGET_ADDRESS, 6 );
}
public String getWACN()
{
return mMessage.getHex( WACN, 5 );
}
public String getSystemID()
{
return mMessage.getHex( SYSTEM_ID, 3 );
}
public String getSourceID()
{
return mMessage.getHex( SOURCE_ID, 6 );
}
}

View File

@@ -0,0 +1,81 @@
package module.decode.p25.message.pdu.osp.control;
import module.decode.p25.message.pdu.PDUMessage;
import module.decode.p25.reference.DataUnitID;
import module.decode.p25.reference.Opcode;
import alias.AliasList;
import bits.BinaryMessage;
import edac.CRCP25;
public class GroupAffiliationQueryExtended extends PDUMessage
{
public static final int[] TARGET_ADDRESS = { 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[] WACN = { 128,129,130,131,132,133,134,135,136,137,
138,139,140,141,142,143,160,161,162,163 };
public static final int[] SYSTEM_ID = { 164,165,166,167,168,169,170,171,172,
173,174,175 };
public static final int[] SOURCE_ID = { 176,177,178,179,180,181,182,183,184,
185,186,187,188,189,190,191,192,193,194,195,196,197,198,199 };
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 };
public GroupAffiliationQueryExtended( BinaryMessage message,
DataUnitID duid, AliasList aliasList )
{
super( message, duid, aliasList );
/* Header block is already error detected/corrected - perform error
* detection correction on the intermediate and final data blocks */
mMessage = CRCP25.correctPDU1( mMessage );
mCRC[ 1 ] = mMessage.getCRC();
}
@Override
public String getEventType()
{
return Opcode.GROUP_AFFILIATION_QUERY.getDescription();
}
public String getMessage()
{
StringBuilder sb = new StringBuilder();
sb.append( getMessageStub() );
sb.append( " FROM:" );
sb.append( getSourceID() );
sb.append( " TO:" );
sb.append( getTargetAddress() );
sb.append( " WACN:" );
sb.append( getWACN() );
sb.append( " SYS:" );
sb.append( getSystemID() );
return sb.toString();
}
public String getTargetAddress()
{
return mMessage.getHex( TARGET_ADDRESS, 6 );
}
public String getWACN()
{
return mMessage.getHex( WACN, 5 );
}
public String getSystemID()
{
return mMessage.getHex( SYSTEM_ID, 3 );
}
public String getSourceID()
{
return mMessage.getHex( SOURCE_ID, 6 );
}
}

View File

@@ -0,0 +1,132 @@
package module.decode.p25.message.pdu.osp.control;
import module.decode.p25.message.pdu.PDUMessage;
import module.decode.p25.reference.DataUnitID;
import module.decode.p25.reference.Opcode;
import module.decode.p25.reference.Response;
import alias.AliasList;
import bits.BinaryMessage;
import edac.CRCP25;
public class GroupAffiliationResponseExtended extends PDUMessage
{
public static final int[] TARGET_ADDRESS = { 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[] SOURCE_WACN = { 128,129,130,131,132,133,134,135,
136,137,138,139,140,141,142,143,160,161,162,163 };
public static final int[] SOURCE_SYSTEM_ID = { 164,165,166,167,168,169,170,
171,172,173,174,175 };
public static final int[] SOURCE_ID = { 176,177,178,179,180,181,182,183,184,
185,186,187,188,189,190,191,192,193,194,195,196,197,198,199 };
public static final int[] GROUP_WACN = { 200,201,202,203,204,205,206,207,
208,209,210,211,212,213,214,215,216,217,218,219 };
public static final int[] GROUP_SYSTEM_ID = { 220,221,222,223,224,225,226,
227,228,229,230,231 };
public static final int[] GROUP_ID = { 232,233,234,235,236,237,238,239,240,
241,242,243,244,245,246,247 };
public static final int[] ANNOUNCEMENT_GROUP_ID = { 248,249,250,251,252,253,
254,255,256,257,258,259,260,261,262,263 };
public static final int[] GROUP_AFFILIATION_RESPONSE_VALUE = { 270,271 };
public static final int[] MULTIPLE_BLOCK_CRC = { 320,321,322,323,324,325,
326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,
343,344,345,346,347,348,349,350,351 };
public GroupAffiliationResponseExtended( BinaryMessage message,
DataUnitID duid, AliasList aliasList )
{
super( message, duid, aliasList );
/* Header block is already error detected/corrected - perform error
* detection correction on the intermediate and final data blocks */
mMessage = CRCP25.correctPDU1( mMessage );
mCRC[ 1 ] = mMessage.getCRC();
}
@Override
public String getEventType()
{
return Opcode.GROUP_AFFILIATION_RESPONSE.getDescription();
}
public String getMessage()
{
StringBuilder sb = new StringBuilder();
sb.append( getMessageStub() );
sb.append( "AFFILIATION:" );
sb.append( getResponse().name() );
sb.append( " TO:" );
sb.append( getTargetAddress() );
sb.append( " FROM:" );
sb.append( getSourceID() );
sb.append( " WACN:" );
sb.append( getSourceWACN() );
sb.append( " SYS:" );
sb.append( getSourceSystemID() );
sb.append( " GROUP:" );
sb.append( getGroupID() );
sb.append( " WACN:" );
sb.append( getGroupWACN() );
sb.append( " SYS:" );
sb.append( getGroupSystemID() );
sb.append( " ANNOUNCEMENT GROUP:" );
sb.append( getAnnouncementGroupID() );
return sb.toString();
}
public String getTargetAddress()
{
return mMessage.getHex( TARGET_ADDRESS, 6 );
}
public String getSourceWACN()
{
return mMessage.getHex( SOURCE_WACN, 5 );
}
public String getSourceSystemID()
{
return mMessage.getHex( SOURCE_SYSTEM_ID, 3 );
}
public String getSourceID()
{
return mMessage.getHex( SOURCE_ID, 6 );
}
public String getGroupWACN()
{
return mMessage.getHex( GROUP_WACN, 5 );
}
public String getGroupSystemID()
{
return mMessage.getHex( GROUP_SYSTEM_ID, 3 );
}
public String getGroupID()
{
return mMessage.getHex( GROUP_ID, 4 );
}
public String getAnnouncementGroupID()
{
return mMessage.getHex( GROUP_ID, 4 );
}
public Response getResponse()
{
return Response.fromValue(
mMessage.getInt( GROUP_AFFILIATION_RESPONSE_VALUE ) );
}
}

View File

@@ -0,0 +1,91 @@
package module.decode.p25.message.pdu.osp.control;
import module.decode.p25.message.pdu.PDUMessage;
import module.decode.p25.reference.DataUnitID;
import module.decode.p25.reference.Opcode;
import alias.AliasList;
import bits.BinaryMessage;
import edac.CRCP25;
public class MessageUpdateExtended extends PDUMessage
{
public static final int[] TARGET_ADDRESS = { 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[] SOURCE_WACN = { 128,129,130,131,132,133,134,135,136,137,
138,139,140,141,142,143,160,161,162,163 };
public static final int[] SOURCE_SYSTEM_ID = { 164,165,166,167,168,169,170,171,172,
173,174,175 };
public static final int[] SOURCE_ID = { 176,177,178,179,180,181,182,183,184,
185,186,187,188,189,190,191,192,193,194,195,196,197,198,199 };
public static final int[] SHORT_DATA_MESSAGE = { 200,201,202,203,204,205,
206,207,208,209,210,211,212,213,214,215 };
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 };
public MessageUpdateExtended( BinaryMessage message,
DataUnitID duid, AliasList aliasList )
{
super( message, duid, aliasList );
/* Header block is already error detected/corrected - perform error
* detection correction on the intermediate and final data blocks */
mMessage = CRCP25.correctPDU1( mMessage );
mCRC[ 1 ] = mMessage.getCRC();
}
@Override
public String getEventType()
{
return Opcode.CALL_ALERT.getDescription();
}
public String getMessage()
{
StringBuilder sb = new StringBuilder();
sb.append( getMessageStub() );
sb.append( " TO:" );
sb.append( getTargetAddress() );
sb.append( " MSG:" );
sb.append( getShortDataMessage() );
sb.append( " FROM:" );
sb.append( getSourceID() );
sb.append( " WACN:" );
sb.append( getSourceWACN() );
sb.append( " SYS:" );
sb.append( getSourceSystemID() );
return sb.toString();
}
public String getTargetAddress()
{
return mMessage.getHex( TARGET_ADDRESS, 6 );
}
public String getSourceWACN()
{
return mMessage.getHex( SOURCE_WACN, 5 );
}
public String getSourceSystemID()
{
return mMessage.getHex( SOURCE_SYSTEM_ID, 3 );
}
public String getSourceID()
{
return mMessage.getHex( SOURCE_ID, 6 );
}
public String getShortDataMessage()
{
return mMessage.getHex( SHORT_DATA_MESSAGE, 4 );
}
}

View File

@@ -0,0 +1,160 @@
package module.decode.p25.message.pdu.osp.control;
import module.decode.p25.message.IBandIdentifier;
import module.decode.p25.message.IdentifierReceiver;
import module.decode.p25.message.pdu.PDUMessage;
import module.decode.p25.message.tsbk.osp.control.SystemService;
import module.decode.p25.reference.DataUnitID;
import module.decode.p25.reference.Opcode;
import module.decode.p25.reference.P25NetworkCallsign;
import alias.AliasList;
import bits.BinaryMessage;
import edac.CRCP25;
public class NetworkStatusBroadcastExtended extends PDUMessage
implements IdentifierReceiver
{
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 IBandIdentifier mTransmitIdentifierUpdate;
private IBandIdentifier mReceiveIdentifierUpdate;
public NetworkStatusBroadcastExtended( BinaryMessage message,
DataUnitID duid, AliasList aliasList )
{
super( message, duid, aliasList );
/* Header block is already error detected/corrected - perform error
* detection correction on the intermediate and final data blocks */
mMessage = CRCP25.correctPDU1( mMessage );
mCRC[ 1 ] = mMessage.getCRC();
}
@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, 5 );
}
public String getNetworkCallsign()
{
return P25NetworkCallsign.getCallsign( mMessage.getInt( WACN ),
mMessage.getInt( SYSTEM_ID ) );
}
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, IBandIdentifier 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

@@ -0,0 +1,113 @@
package module.decode.p25.message.pdu.osp.control;
import module.decode.p25.message.pdu.PDUMessage;
import module.decode.p25.reference.DataUnitID;
import module.decode.p25.reference.Encryption;
import module.decode.p25.reference.Opcode;
import alias.AliasList;
import bits.BinaryMessage;
import edac.CRCP25;
public class ProtectionParameterBroadcast extends PDUMessage
{
public static final int[] TARGET_ADDRESS = { 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[] ENCRYPTION_TYPE = { 128,129,130,131,132,133,134,
135 };
public static final int[] ALGORITHM_ID = { 136,137,138,139,140,141,142,143 };
public static final int[] KEY_ID = { 160,161,162,163,164,165,166,167,168,
169,170,171,172,173,174,175 };
public static final int[] INBOUND_INITIALIZATION_VECTOR_A = { 176,177,178,
179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,
197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,
215 };
public static final int[] INBOUND_INITIALIZATION_VECTOR_B = { 216,217,218,
219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,
237,238,239,240,241,242,243,244,245,246,247 };
public static final int[] OUTBOUND_INITIALIZATION_VECTOR_A = { 248,249,250,
251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,
269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,
287 };
public static final int[] OUTBOUND_INITIALIZATION_VECTOR_B = { 288,289,290,
291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,
309,310,311,312,313,314,315,316,317,318,319 };
public static final int[] MULTIPLE_BLOCK_CRC = { 320,321,322,323,324,325,
326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,
343,344,345,346,347,348,349,350,351 };
public ProtectionParameterBroadcast( BinaryMessage message,
DataUnitID duid, AliasList aliasList )
{
super( message, duid, aliasList );
/* Header block is already error detected/corrected - perform error
* detection correction on the intermediate and final data blocks */
mMessage = CRCP25.correctPDU1( mMessage );
mCRC[ 1 ] = mMessage.getCRC();
}
@Override
public String getEventType()
{
return Opcode.PROTECTION_PARAMETER_BROADCAST.getDescription();
}
public String getMessage()
{
StringBuilder sb = new StringBuilder();
sb.append( getMessageStub() );
sb.append( " TO:" );
sb.append( getTargetAddress() );
sb.append( " ENCRYPTION:" );
sb.append( getEncryptionType().name() );
sb.append( " ALGORITHM ID:" );
sb.append( getAlgorithmID() );
sb.append( " KEY ID:" );
sb.append( getKeyID() );
sb.append( " INBOUND IV:" );
sb.append( getInboundInitializationVector() );
sb.append( " OUTBOUND IV:" );
sb.append( getOutboundInitializationVector() );
return sb.toString();
}
public String getTargetAddress()
{
return mMessage.getHex( TARGET_ADDRESS, 6 );
}
public Encryption getEncryptionType()
{
return Encryption.fromValue( mMessage.getInt( ENCRYPTION_TYPE ) );
}
public String getAlgorithmID()
{
return mMessage.getHex( ALGORITHM_ID, 2 );
}
public String getKeyID()
{
return mMessage.getHex( KEY_ID, 4 );
}
public String getInboundInitializationVector()
{
return mMessage.getHex( INBOUND_INITIALIZATION_VECTOR_A, 10 ) +
mMessage.getHex( INBOUND_INITIALIZATION_VECTOR_B, 8 );
}
public String getOutboundInitializationVector()
{
return mMessage.getHex( OUTBOUND_INITIALIZATION_VECTOR_A, 10 ) +
mMessage.getHex( OUTBOUND_INITIALIZATION_VECTOR_B, 8 );
}
}

View File

@@ -0,0 +1,164 @@
package module.decode.p25.message.pdu.osp.control;
import module.decode.p25.message.IBandIdentifier;
import module.decode.p25.message.IdentifierReceiver;
import module.decode.p25.message.pdu.PDUMessage;
import module.decode.p25.message.tsbk.osp.control.SystemService;
import module.decode.p25.reference.DataUnitID;
import module.decode.p25.reference.Opcode;
import alias.AliasList;
import bits.BinaryMessage;
import edac.CRCP25;
public class RFSSStatusBroadcastExtended extends PDUMessage
implements IdentifierReceiver
{
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 IBandIdentifier mTransmitIdentifierUpdate;
private IBandIdentifier mReceiveIdentifierUpdate;
public RFSSStatusBroadcastExtended( BinaryMessage message,
DataUnitID duid, AliasList aliasList )
{
super( message, duid, aliasList );
/* Header block is already error detected/corrected - perform error
* detection correction on the intermediate and final data blocks */
mMessage = CRCP25.correctPDU1( mMessage );
mCRC[ 1 ] = mMessage.getCRC();
}
@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, IBandIdentifier 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

@@ -0,0 +1,269 @@
package module.decode.p25.message.pdu.osp.control;
import module.decode.p25.P25MessageFramer;
import module.decode.p25.message.pdu.PDUMessage;
import module.decode.p25.reference.DataUnitID;
import module.decode.p25.reference.Opcode;
import alias.AliasList;
import bits.BinaryMessage;
import edac.CRCP25;
public class RoamingAddressUpdateExtended extends PDUMessage
{
public static final int[] TARGET_ADDRESS = { 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 LAST_MESSAGE_INDICATOR = 128;
public static final int[] MESSAGE_SEQUENCE_NUMBER = { 132,133,134,135 };
public static final int[] WACN_A = { 136,137,138,139,140,141,142,143,160,
161,162,163,164,165,166,167,168,169,170,171 };
public static final int[] SYSTEM_ID_A = { 172,173,174,175,176,177,178,179,
180,181,182,183 };
public static final int[] SOURCE_ID_FORMAT_1 = { 184,185,186,187,188,189,
190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207 };
public static final int[] WACN_B = { 184,185,186,187,188,189,190,191,192,
193,194,195,196,197,198,199,200,201,202,203 };
public static final int[] SYSTEM_ID_B = { 204,205,206,207,208,209,210,211,
212,213,214,215 };
public static final int[] WACN_C = { 216,217,218,219,220,221,222,223,224,
225,226,227,228,229,230,231,232,233,234,235 };
public static final int[] SYSTEM_ID_C = { 236,237,238,239,240,241,242,243,
244,245,246,247 };
public static final int[] WACN_D = { 248,249,250,251,252,253,254,255,256,
257,258,259,260,261,262,263,264,265,266,267 };
public static final int[] SYSTEM_ID_D = { 268,269,270,271,272,273,274,275,
276,277,278,279 };
public static final int[] SOURCE_ID_FORMAT_2 = { 280,281,282,283,284,285,
286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303 };
public static final int[] WACN_E = { 280,281,282,283,284,285,
286,287,288,289,290,291,292,293,294,295,296,297,298,299 };
public static final int[] SYSTEM_ID_E = { 300,301,302,303,304,305,306,307,
308,309,310,311 };
public static final int[] WACN_F = { 312,313,314,315,316,317,318,319,320,
321,322,323,324,325,326,327,328,329,330,331 };
public static final int[] SYSTEM_ID_F = { 332,333,334,335,336,337,338,339,
340,341,342,343 };
public static final int[] WACN_G = { 344,345,346,347,348,349,350,351,352,
353,354,355,356,357,358,359,360,361,362,363 };
public static final int[] SYSTEM_ID_G = { 364,365,366,367,368,369,370,371,
372,373,374,375 };
public static final int[] SOURCE_ID_FORMAT_3 = { 376,377,378,379,380,381,
382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399 };
public static final int[] MULTIPLE_BLOCK_CRC_FORMAT_1 = { 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 };
public static final int[] MULTIPLE_BLOCK_CRC_FORMAT_2 = { 320,321,322,323,
324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,
342,343,344,345,346,347,348,349,350,351 };
public static final int[] MULTIPLE_BLOCK_CRC_FORMAT_3 = { 416,417,418,419,
420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,
438,439,440,441,442,443,444,445,446,447 };
private enum Format{ FORMAT_1, FORMAT_2, FORMAT_3 };
private Format mFormat;
public RoamingAddressUpdateExtended( BinaryMessage message,
DataUnitID duid, AliasList aliasList )
{
super( message, duid, aliasList );
if( mMessage.size() == P25MessageFramer.PDU2_BEGIN )
{
mFormat = Format.FORMAT_1;
/* Header block is already error detected/corrected - perform error
* detection correction on the intermediate and final data blocks */
mMessage = CRCP25.correctPDU1( mMessage );
mCRC[ 1 ] = mMessage.getCRC();
}
else if( mMessage.size() == P25MessageFramer.PDU3_BEGIN )
{
mFormat = Format.FORMAT_2;
/* Header block is already error detected/corrected - perform error
* detection correction on the intermediate and final data blocks */
mMessage = CRCP25.correctPDU2( mMessage );
mCRC[ 1 ] = mMessage.getCRC();
}
else if( mMessage.size() == P25MessageFramer.PDU3_DECODED_END )
{
mFormat = Format.FORMAT_3;
/* Header block is already error detected/corrected - perform error
* detection correction on the intermediate and final data blocks */
mMessage = CRCP25.correctPDU3( mMessage );
mCRC[ 1 ] = mMessage.getCRC();
}
else
{
mFormat = Format.FORMAT_1;
/* Header block is already error detected/corrected - perform error
* detection correction on the intermediate and final data blocks */
mMessage = CRCP25.correctPDU1( mMessage );
mCRC[ 1 ] = mMessage.getCRC();
}
}
@Override
public String getEventType()
{
return Opcode.ROAMING_ADDRESS_UPDATE.getDescription();
}
public String getMessage()
{
StringBuilder sb = new StringBuilder();
sb.append( getMessageStub() );
sb.append( " ROAMING ADDRESS STACK FROM:" );
sb.append( getSourceID() );
if( isLastBlock() )
{
sb.append( " LAST BLOCK" );
}
sb.append( "MSG SEQ:" );
sb.append( getMessageSequenceNumber() );
sb.append( " TO:" );
sb.append( getTargetAddress() );
sb.append( " WACN A:" + getWACNA() );
sb.append( " SYS A:" + getSystemIDA() );
if( isFormat2() )
{
sb.append( " WACN B:" + getWACNB() );
sb.append( " SYS B:" + getSystemIDB() );
sb.append( " WACN C:" + getWACNC() );
sb.append( " SYS C:" + getSystemIDC() );
sb.append( " WACN D:" + getWACND() );
sb.append( " SYS D:" + getSystemIDD() );
}
if( isFormat3() )
{
sb.append( " WACN E:" + getWACNE() );
sb.append( " SYS E:" + getSystemIDE() );
sb.append( " WACN F:" + getWACNF() );
sb.append( " SYS F:" + getSystemIDF() );
sb.append( " WACN G:" + getWACNG() );
sb.append( " SYS G:" + getSystemIDG() );
}
return sb.toString();
}
public boolean isLastBlock()
{
return mMessage.get( LAST_MESSAGE_INDICATOR );
}
public int getMessageSequenceNumber()
{
return mMessage.getInt( MESSAGE_SEQUENCE_NUMBER );
}
public String getTargetAddress()
{
return mMessage.getHex( TARGET_ADDRESS, 6 );
}
public String getWACNA()
{
return mMessage.getHex( WACN_A, 5 );
}
public String getSystemIDA()
{
return mMessage.getHex( SYSTEM_ID_A, 3 );
}
public String getWACNB()
{
return isFormat2() ? mMessage.getHex( WACN_B, 5 ) : null;
}
public String getSystemIDB()
{
return isFormat2() ? mMessage.getHex( SYSTEM_ID_B, 3 ) : null;
}
public String getWACNC()
{
return isFormat2() ? mMessage.getHex( WACN_C, 5 ) : null;
}
public String getSystemIDC()
{
return isFormat2() ? mMessage.getHex( SYSTEM_ID_C, 3 ) : null;
}
public String getWACND()
{
return isFormat2() ? mMessage.getHex( WACN_D, 5 ) : null;
}
public String getSystemIDD()
{
return isFormat2() ? mMessage.getHex( SYSTEM_ID_D, 3 ) : null;
}
public String getWACNE()
{
return isFormat3() ? mMessage.getHex( WACN_E, 5 ) : null;
}
public String getSystemIDE()
{
return isFormat3() ? mMessage.getHex( SYSTEM_ID_E, 3 ) : null;
}
public String getWACNF()
{
return isFormat3() ? mMessage.getHex( WACN_F, 5 ) : null;
}
public String getSystemIDF()
{
return isFormat3() ? mMessage.getHex( SYSTEM_ID_F, 3 ) : null;
}
public String getWACNG()
{
return isFormat3() ? mMessage.getHex( WACN_G, 5 ) : null;
}
public String getSystemIDG()
{
return isFormat3() ? mMessage.getHex( SYSTEM_ID_G, 3 ) : null;
}
public String getSourceID()
{
switch( mFormat )
{
case FORMAT_1:
return mMessage.getHex( SOURCE_ID_FORMAT_1, 6 );
case FORMAT_2:
return mMessage.getHex( SOURCE_ID_FORMAT_2, 6 );
case FORMAT_3:
return mMessage.getHex( SOURCE_ID_FORMAT_2, 6 );
}
return null;
}
public boolean isFormat2()
{
return mFormat != Format.FORMAT_3;
}
public boolean isFormat3()
{
return mFormat == Format.FORMAT_3;
}
}

View File

@@ -0,0 +1,81 @@
package module.decode.p25.message.pdu.osp.control;
import module.decode.p25.message.pdu.PDUMessage;
import module.decode.p25.reference.DataUnitID;
import module.decode.p25.reference.Opcode;
import alias.AliasList;
import bits.BinaryMessage;
import edac.CRCP25;
public class StatusQueryExtended extends PDUMessage
{
public static final int[] TARGET_ADDRESS = { 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[] SOURCE_WACN = { 128,129,130,131,132,133,134,135,136,137,
138,139,140,141,142,143,160,161,162,163 };
public static final int[] SOURCE_SYSTEM_ID = { 164,165,166,167,168,169,170,171,172,
173,174,175 };
public static final int[] SOURCE_ID = { 176,177,178,179,180,181,182,183,184,
185,186,187,188,189,190,191,192,193,194,195,196,197,198,199 };
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 };
public StatusQueryExtended( BinaryMessage message,
DataUnitID duid, AliasList aliasList )
{
super( message, duid, aliasList );
/* Header block is already error detected/corrected - perform error
* detection correction on the intermediate and final data blocks */
mMessage = CRCP25.correctPDU1( mMessage );
mCRC[ 1 ] = mMessage.getCRC();
}
@Override
public String getEventType()
{
return Opcode.STATUS_QUERY.getDescription();
}
public String getMessage()
{
StringBuilder sb = new StringBuilder();
sb.append( getMessageStub() );
sb.append( " TO:" );
sb.append( getTargetAddress() );
sb.append( " FROM:" );
sb.append( getSourceID() );
sb.append( " WACN:" );
sb.append( getSourceWACN() );
sb.append( " SYS:" );
sb.append( getSourceSystemID() );
return sb.toString();
}
public String getTargetAddress()
{
return mMessage.getHex( TARGET_ADDRESS, 6 );
}
public String getSourceWACN()
{
return mMessage.getHex( SOURCE_WACN, 5 );
}
public String getSourceSystemID()
{
return mMessage.getHex( SOURCE_SYSTEM_ID, 3 );
}
public String getSourceID()
{
return mMessage.getHex( SOURCE_ID, 6 );
}
}

View File

@@ -0,0 +1,97 @@
package module.decode.p25.message.pdu.osp.control;
import module.decode.p25.message.pdu.PDUMessage;
import module.decode.p25.reference.DataUnitID;
import module.decode.p25.reference.Opcode;
import alias.AliasList;
import bits.BinaryMessage;
import edac.CRCP25;
public class StatusUpdateExtended extends PDUMessage
{
public static final int[] TARGET_ADDRESS = { 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[] SOURCE_WACN = { 128,129,130,131,132,133,134,135,136,137,
138,139,140,141,142,143,160,161,162,163 };
public static final int[] SOURCE_SYSTEM_ID = { 164,165,166,167,168,169,170,171,172,
173,174,175 };
public static final int[] SOURCE_ID = { 176,177,178,179,180,181,182,183,184,
185,186,187,188,189,190,191,192,193,194,195,196,197,198,199 };
public static final int[] UNIT_STATUS = { 200,201,202,203,204,205,206,207 };
public static final int[] USER_STATUS = { 208,209,210,211,212,213,214,215 };
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 };
public StatusUpdateExtended( BinaryMessage message,
DataUnitID duid, AliasList aliasList )
{
super( message, duid, aliasList );
/* Header block is already error detected/corrected - perform error
* detection correction on the intermediate and final data blocks */
mMessage = CRCP25.correctPDU1( mMessage );
mCRC[ 1 ] = mMessage.getCRC();
}
@Override
public String getEventType()
{
return Opcode.STATUS_UPDATE.getDescription();
}
public String getMessage()
{
StringBuilder sb = new StringBuilder();
sb.append( getMessageStub() );
sb.append( " TO:" );
sb.append( getTargetAddress() );
sb.append( " FROM:" );
sb.append( getSourceID() );
sb.append( " WACN:" );
sb.append( getSourceWACN() );
sb.append( " SYS:" );
sb.append( getSourceSystemID() );
sb.append( " STATUS USER:" + getUserStatus() );
sb.append( " UNIT:" + getUnitStatus() );
return sb.toString();
}
public String getTargetAddress()
{
return mMessage.getHex( TARGET_ADDRESS, 6 );
}
public String getSourceWACN()
{
return mMessage.getHex( SOURCE_WACN, 5 );
}
public String getSourceSystemID()
{
return mMessage.getHex( SOURCE_SYSTEM_ID, 3 );
}
public String getSourceID()
{
return mMessage.getHex( SOURCE_ID, 6 );
}
public String getUserStatus()
{
return mMessage.getHex( USER_STATUS, 2 );
}
public String getUnitStatus()
{
return mMessage.getHex( UNIT_STATUS, 2 );
}
}

View File

@@ -0,0 +1,99 @@
package module.decode.p25.message.pdu.osp.control;
import module.decode.p25.message.pdu.PDUMessage;
import module.decode.p25.reference.DataUnitID;
import module.decode.p25.reference.Opcode;
import module.decode.p25.reference.Response;
import alias.AliasList;
import bits.BinaryMessage;
import edac.CRCP25;
public class UnitRegistrationResponseExtended extends PDUMessage
{
public static final int[] ASSIGNED_SOURCE_ADDRESS = { 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[] WACN = { 128,129,130,131,132,133,134,135,
136,137,138,139,140,141,142,143,160,161,162,163 };
public static final int[] SYSTEM_ID = { 164,165,166,167,168,169,170,
171,172,173,174,175 };
public static final int[] SOURCE_ID = { 176,177,178,179,180,181,182,183,184,
185,186,187,188,189,190,191,192,193,194,195,196,197,198,199 };
public static final int[] SOURCE_ADDRESS = { 200,201,202,203,204,205,206,
207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223 };
public static final int[] UNIT_REGISTRATION_RESPONSE_VALUE = { 230,231 };
public static final int[] MULTIPLE_BLOCK_CRC = { 320,321,322,323,324,325,
326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,
343,344,345,346,347,348,349,350,351 };
public UnitRegistrationResponseExtended( BinaryMessage message,
DataUnitID duid, AliasList aliasList )
{
super( message, duid, aliasList );
/* Header block is already error detected/corrected - perform error
* detection correction on the intermediate and final data blocks */
mMessage = CRCP25.correctPDU1( mMessage );
mCRC[ 1 ] = mMessage.getCRC();
}
@Override
public String getEventType()
{
return Opcode.UNIT_REGISTRATION_RESPONSE.getDescription();
}
public String getMessage()
{
StringBuilder sb = new StringBuilder();
sb.append( getMessageStub() );
sb.append( "REGISTRATION:" );
sb.append( getResponse().name() );
sb.append( " SRC ID:" );
sb.append( getSourceID() );
sb.append( " ADDR:" );
sb.append( getSourceAddress() );
sb.append( " WACN:" );
sb.append( getWACN() );
sb.append( " SYS:" );
sb.append( getSystemID() );
return sb.toString();
}
public String getAssignedSourceAddress()
{
return mMessage.getHex( ASSIGNED_SOURCE_ADDRESS, 6 );
}
public String getWACN()
{
return mMessage.getHex( WACN, 5 );
}
public String getSystemID()
{
return mMessage.getHex( SYSTEM_ID, 3 );
}
public String getSourceID()
{
return mMessage.getHex( SOURCE_ID, 6 );
}
public String getSourceAddress()
{
return mMessage.getHex( SOURCE_ADDRESS, 6 );
}
public Response getResponse()
{
return Response.fromValue(
mMessage.getInt( UNIT_REGISTRATION_RESPONSE_VALUE ) );
}
}