mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-16 18:47:33 -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:
@@ -0,0 +1,121 @@
|
||||
package module.decode.p25.message.tsbk.motorola;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
|
||||
public class ControlChannelBaseStationIdentification extends MotorolaTSBKMessage
|
||||
implements IdentifierReceiver
|
||||
{
|
||||
public static final int[] CHARACTER_1 = { 80,81,82,83,84,85 };
|
||||
public static final int[] CHARACTER_2 = { 86,87,88,89,90,91 };
|
||||
public static final int[] CHARACTER_3 = { 92,93,94,95,96,97 };
|
||||
public static final int[] CHARACTER_4 = { 98,99,100,101,102,103 };
|
||||
public static final int[] CHARACTER_5 = { 104,105,106,107,108,109 };
|
||||
public static final int[] CHARACTER_6 = { 110,111,112,113,114,115 };
|
||||
public static final int[] CHARACTER_7 = { 116,117,118,119,120,121 };
|
||||
public static final int[] CHARACTER_8 = { 122,123,124,125,126,127 };
|
||||
|
||||
public static final int[] IDENTIFIER = { 128,129,130,131 };
|
||||
public static final int[] CHANNEL = { 132,133,134,135,136,137,138,139,140,
|
||||
141,142,143 };
|
||||
|
||||
private IBandIdentifier mIdentifierUpdate;
|
||||
|
||||
public ControlChannelBaseStationIdentification( BinaryMessage message,
|
||||
DataUnitID duid,
|
||||
AliasList aliasList )
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return MotorolaOpcode.CONTROL_CHANNEL_ID.getDescription();
|
||||
}
|
||||
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " CHAN:" + getIdentifier() + "-" + getChannel() );
|
||||
|
||||
sb.append( " CWID:" + getCWID() );
|
||||
|
||||
sb.append( " DN:" + getDownlinkFrequency() );
|
||||
|
||||
sb.append( " UP:" + getUplinkFrequency() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
public String getCWID()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getCharacter( CHARACTER_1 ) );
|
||||
sb.append( getCharacter( CHARACTER_2 ) );
|
||||
sb.append( getCharacter( CHARACTER_3 ) );
|
||||
sb.append( getCharacter( CHARACTER_4 ) );
|
||||
sb.append( getCharacter( CHARACTER_5 ) );
|
||||
sb.append( getCharacter( CHARACTER_6 ) );
|
||||
sb.append( getCharacter( CHARACTER_7 ) );
|
||||
sb.append( getCharacter( CHARACTER_8 ) );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
private String getCharacter( int[] field )
|
||||
{
|
||||
int value = mMessage.getInt( field );
|
||||
|
||||
if( value != 0 )
|
||||
{
|
||||
return String.valueOf( (char)( value + 43 ) );
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getIdentifier()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getChannel()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL );
|
||||
}
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mIdentifierUpdate, getChannel() );
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mIdentifierUpdate, getChannel() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
{
|
||||
mIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 1 ];
|
||||
|
||||
identifiers[ 0 ] = getIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
}
|
||||
111
src/module/decode/p25/message/tsbk/motorola/MotorolaOpcode.java
Normal file
111
src/module/decode/p25/message/tsbk/motorola/MotorolaOpcode.java
Normal file
@@ -0,0 +1,111 @@
|
||||
package module.decode.p25.message.tsbk.motorola;
|
||||
|
||||
public enum MotorolaOpcode
|
||||
{
|
||||
PATCH_GROUP_ADD( "ADD PATCH GROUP", "ADD PATCH SUPER GROUP", 0x00 ),
|
||||
PATCH_GROUP_DELETE( "DELETE PATCH GROUP", "DELETE PATCH SUPER GROUP", 0x01 ),
|
||||
PATCH_GROUP_CHANNEL_GRANT( "PATCH VOICE CHANNEL GRANT", "PATCH VOICE CHANNEL GRANT", 0x02 ),
|
||||
PATCH_GROUP_CHANNEL_GRANT_UPDATE( "PATCH VOICE CHANNEL UPDATE", "PATCH VOICE CHANNEL GRANT UPDATE", 0x03 ),
|
||||
OP04( "MOT OP04:UNKNOWN", "Opcode 0x04 Unknown", 0x04 ),
|
||||
TRAFFIC_CHANNEL_ID( "TRAFFIC CHAN STATION ID", "TRAFFIC CHAN STATION ID", 0x05 ),
|
||||
OP06( "MOT OP06:UNKNOWN ", "Opcode 0x06 Unknown", 0x06 ),
|
||||
OP07( "MOT OP07:UNKNOWN ", "Opcode 0x07 Unknown", 0x07 ),
|
||||
OP08( "MOT OP08:UNKNOWN ", "Opcode 0x08 Unknown", 0x08 ),
|
||||
SYSTEM_LOAD( "SYSTEM LOADING", "SYSTEM LOAD", 0x09 ),
|
||||
OP0A( "OP0A:UNKNOWN ", "Opcode 0x0A Unknown", 0x0A ),
|
||||
CONTROL_CHANNEL_ID( "CONTROL CHAN BASE STATION ID", "CONTROL CHAN BASE STATION ID", 0x0B ),
|
||||
OP0C( "MOT OP0C:UNKNOWN ", "Opcode 0x0C Unknown", 0x0C ),
|
||||
OP0D( "MOT OP0D:UNKNOWN ", "Opcode 0x0D Unknown", 0x0D ),
|
||||
CCH_PLANNED_SHUTDOWN( "PLANNED CONTROL CHANNEL SHUTDOWN ", "PLANNED CONTROL CHANNEL SHUTDOWN", 0x0E ),
|
||||
OP0F( "MOT OP0F:UNKNOWN ", "Opcode 0x0F Unknown", 0x0F ),
|
||||
OP10( "MOT OP10:UNKNOWN ", "Opcode 0x10 Unknown", 0x10 ),
|
||||
OP11( "MOT OP11:UNKNOWN ", "Opcode 0x11 Unknown", 0x11 ),
|
||||
OP12( "MOT OP12:UNKNOWN ", "Opcode 0x12 Unknown", 0x12 ),
|
||||
OP13( "MOT OP13:UNKNOWN ", "Opcode 0x13 Unknown", 0x13 ),
|
||||
OP14( "MOT OP14:UNKNOWN ", "Opcode 0x14 Unknown", 0x14 ),
|
||||
OP15( "MOT OP15:UNKNOWN ", "Opcode 0x15 Unknown", 0x15 ),
|
||||
OP16( "MOT OP16:UNKNOWN ", "Opcode 0x16 Unknown", 0x16 ),
|
||||
OP17( "MOT OP17:UNKNOWN ", "Opcode 0x17 Unknown", 0x17 ),
|
||||
OP18( "MOT OP18:UNKNOWN ", "Opcode 0x18 Unknown", 0x18 ),
|
||||
OP19( "MOT OP19:UNKNOWN ", "Opcode 0x19 Unknown", 0x19 ),
|
||||
OP1A( "MOT OP1A:UNKNOWN ", "Opcode 0x1A Unknown", 0x1A ),
|
||||
OP1B( "MOT OP1B:UNKNOWN ", "Opcode 0x1B Unknown", 0x1B ),
|
||||
OP1C( "MOT OP1C:UNKNOWN ", "Opcode 0x1C Unknown", 0x1C ),
|
||||
OP1D( "MOT OP1D:UNKNOWN ", "Opcode 0x1D Unknown", 0x1D ),
|
||||
OP1E( "MOT OP1E:UNKNOWN ", "Opcode 0x1E Unknown", 0x1E ),
|
||||
OP1F( "MOT OP1F:UNKNOWN ", "Opcode 0x1F Unknown", 0x1F ),
|
||||
OP20( "MOT OP20:UNKNOWN ", "Opcode 0x20 Unknown", 0x20 ),
|
||||
OP21( "MOT OP21:UNKNOWN ", "Opcode 0x21 Unknown", 0x21 ),
|
||||
OP22( "MOT OP22:UNKNOWN ", "Opcode 0x22 Unknown", 0x22 ),
|
||||
OP23( "MOT OP23:UNKNOWN ", "Opcode 0x23 Unknown", 0x23 ),
|
||||
OP24( "MOT OP24:UNKNOWN ", "Opcode 0x24 Unknown", 0x24 ),
|
||||
OP25( "MOT OP25:UNKNOWN ", "Opcode 0x25 Unknown", 0x25 ),
|
||||
OP26( "MOT OP26:UNKNOWN ", "Opcode 0x26 Unknown", 0x26 ),
|
||||
OP27( "MOT OP27:UNKNOWN ", "Opcode 0x27 Unknown", 0x27 ),
|
||||
OP28( "MOT OP28:UNKNOWN ", "Opcode 0x28 Unknown", 0x28 ),
|
||||
OP29( "MOT OP29:UNKNOWN ", "Opcode 0x29 Unknown", 0x29 ),
|
||||
OP2A( "MOT OP2A:UNKNOWN ", "Opcode 0x2A Unknown", 0x2A ),
|
||||
OP2B( "MOT OP2B:UNKNOWN ", "Opcode 0x2B Unknown", 0x2B ),
|
||||
OP2C( "MOT OP2C:UNKNOWN ", "Opcode 0x2C Unknown", 0x2C ),
|
||||
OP2D( "MOT OP2D:UNKNOWN ", "Opcode 0x2D Unknown", 0x2D ),
|
||||
OP2E( "MOT OP2E:UNKNOWN ", "Opcode 0x2E Unknown", 0x2E ),
|
||||
OP2F( "MOT OP2F:UNKNOWN ", "Opcode 0x2F Unknown", 0x2F ),
|
||||
OP30( "MOT OP30:UNKNOWN ", "Opcode 0x30 Unknown", 0x30 ),
|
||||
OP31( "MOT OP31:UNKNOWN ", "Opcode 0x31 Unknown", 0x31 ),
|
||||
OP32( "MOT OP32:UNKNOWN ", "Opcode 0x32 Unknown", 0x32 ),
|
||||
OP33( "MOT OP33:UNKNOWN ", "Opcode 0x33 Unknown", 0x33 ),
|
||||
OP34( "MOT OP34:UNKNOWN ", "Opcode 0x34 Unknown", 0x34 ),
|
||||
OP35( "MOT OP35:UNKNOWN ", "Opcode 0x35 Unknown", 0x35 ),
|
||||
OP36( "MOT OP36:UNKNOWN ", "Opcode 0x36 Unknown", 0x36 ),
|
||||
OP37( "MOT OP37:UNKNOWN ", "Opcode 0x37 Unknown", 0x37 ),
|
||||
OP38( "MOT OP38:UNKNOWN ", "Opcode 0x38 Unknown", 0x38 ),
|
||||
OP39( "MOT OP39:UNKNOWN ", "Opcode 0x39 Unknown", 0x39 ),
|
||||
OP3A( "MOT OP3A:UNKNOWN ", "Opcode 0x3A Unknown", 0x3A ),
|
||||
OP3B( "MOT OP3B:UNKNOWN ", "Opcode 0x3B Unknown", 0x3B ),
|
||||
OP3C( "MOT OP3C:UNKNOWN ", "Opcode 0x3C Unknown", 0x3C ),
|
||||
OP3D( "MOT OP3D:UNKNOWN ", "Opcode 0x3D Unknown", 0x3D ),
|
||||
OP3E( "MOT OP3E:UNKNOWN ", "Opcode 0x3E Unknown", 0x3E ),
|
||||
OP3F( "MOT OP3F:UNKNOWN ", "Opcode 0x3F Unknown", 0x3F ),
|
||||
UNKNOWN( "UNKNOWN OPCODE ", "Unknown", -1 );
|
||||
|
||||
private String mLabel;
|
||||
private String mDescription;
|
||||
private int mCode;
|
||||
|
||||
private MotorolaOpcode( String label, String description, int code )
|
||||
{
|
||||
mLabel = label;
|
||||
mDescription = description;
|
||||
mCode = code;
|
||||
}
|
||||
|
||||
public String getLabel()
|
||||
{
|
||||
return mLabel;
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return getLabel();
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return mDescription;
|
||||
}
|
||||
|
||||
public int getCode()
|
||||
{
|
||||
return mCode;
|
||||
}
|
||||
|
||||
public static MotorolaOpcode fromValue( int value )
|
||||
{
|
||||
if( 0 <= value && value <= 0x3F )
|
||||
{
|
||||
return MotorolaOpcode.values()[ value ];
|
||||
}
|
||||
|
||||
return UNKNOWN;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package module.decode.p25.message.tsbk.motorola;
|
||||
|
||||
import module.decode.p25.message.tsbk.TSBKMessage;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
|
||||
public class MotorolaTSBKMessage extends TSBKMessage
|
||||
{
|
||||
public MotorolaTSBKMessage( BinaryMessage message, DataUnitID duid,
|
||||
AliasList aliasList )
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
}
|
||||
|
||||
protected String getMessageStub()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( "NAC:" );
|
||||
sb.append( getNAC() ); /* NAC is the system id for TSBK messages */
|
||||
sb.append( " " );
|
||||
sb.append( getDUID().getLabel() );
|
||||
|
||||
sb.append( " MOTOROLA" );
|
||||
|
||||
if( isEncrypted() )
|
||||
{
|
||||
sb.append( " ENCRYPTED" );
|
||||
}
|
||||
|
||||
sb.append( getMotorolaOpcode().getLabel() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public MotorolaOpcode getMotorolaOpcode()
|
||||
{
|
||||
return MotorolaOpcode.fromValue( mMessage.getInt( OPCODE ) );
|
||||
}
|
||||
}
|
||||
62
src/module/decode/p25/message/tsbk/motorola/PatchGroup.java
Normal file
62
src/module/decode/p25/message/tsbk/motorola/PatchGroup.java
Normal file
@@ -0,0 +1,62 @@
|
||||
package module.decode.p25.message.tsbk.motorola;
|
||||
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
|
||||
public abstract class PatchGroup extends MotorolaTSBKMessage
|
||||
{
|
||||
public static final int[] PATCH_GROUP_ADDRESS = { 80,81,82,83,84,85,86,87,
|
||||
88,89,90,91,92,93,94,95 };
|
||||
public static final int[] GROUP_ADDRESS_1 = { 96,97,98,99,100,101,102,103,
|
||||
104,105,106,107,108,109,110,111 };
|
||||
public static final int[] GROUP_ADDRESS_2 = { 112,113,114,115,116,117,118,
|
||||
119,120,121,122,123,124,125,126,127 };
|
||||
public static final int[] GROUP_ADDRESS_3 = { 128,129,130,131,132,133,134,
|
||||
135,136,137,138,139,140,141,142,143 };
|
||||
|
||||
public PatchGroup( BinaryMessage message, DataUnitID duid,
|
||||
AliasList aliasList )
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " PATCH GROUP:" );
|
||||
sb.append( getPatchGroupAddress() );
|
||||
sb.append( " GRP1:" );
|
||||
sb.append( getGroupAddress1() );
|
||||
sb.append( " GRP2:" );
|
||||
sb.append( getGroupAddress2() );
|
||||
sb.append( " GRP3:" );
|
||||
sb.append( getGroupAddress3() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getPatchGroupAddress()
|
||||
{
|
||||
return mMessage.getHex( PATCH_GROUP_ADDRESS, 4 );
|
||||
}
|
||||
|
||||
public String getGroupAddress1()
|
||||
{
|
||||
return mMessage.getHex( GROUP_ADDRESS_1, 4 );
|
||||
}
|
||||
|
||||
public String getGroupAddress2()
|
||||
{
|
||||
return mMessage.getHex( GROUP_ADDRESS_2, 4 );
|
||||
}
|
||||
|
||||
public String getGroupAddress3()
|
||||
{
|
||||
return mMessage.getHex( GROUP_ADDRESS_3, 4 );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package module.decode.p25.message.tsbk.motorola;
|
||||
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
|
||||
public class PatchGroupAdd extends PatchGroup
|
||||
{
|
||||
public PatchGroupAdd( BinaryMessage message, DataUnitID duid,
|
||||
AliasList aliasList )
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return MotorolaOpcode.PATCH_GROUP_ADD.getLabel();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package module.decode.p25.message.tsbk.motorola;
|
||||
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
|
||||
public class PatchGroupDelete extends PatchGroup
|
||||
{
|
||||
public PatchGroupDelete( BinaryMessage message, DataUnitID duid,
|
||||
AliasList aliasList )
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return MotorolaOpcode.PATCH_GROUP_DELETE.getLabel();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
package module.decode.p25.message.tsbk.motorola;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
|
||||
public class PatchGroupVoiceChannelGrant extends MotorolaTSBKMessage
|
||||
implements IdentifierReceiver
|
||||
{
|
||||
/* Service Options */
|
||||
public static final int EMERGENCY_FLAG = 80;
|
||||
public static final int ENCRYPTED_CHANNEL_FLAG = 81;
|
||||
public static final int DUPLEX_MODE = 82;
|
||||
public static final int SESSION_MODE = 83;
|
||||
|
||||
public static final int[] PRIORITY = { 85,86,87 };
|
||||
public static final int[] CHANNEL = { 88,89,90,91 };
|
||||
public static final int[] IDENTIFIER = { 92,93,94,95,96,97,98,99,100,101,
|
||||
102,103 };
|
||||
public static final int[] PATCH_GROUP_ADDRESS = { 104,105,106,107,108,109,
|
||||
110,111,112,113,114,115,116,117,118,119 };
|
||||
public static final int[] SOURCE_ADDRESS = { 120,121,122,123,124,125,126,
|
||||
127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 };
|
||||
|
||||
private IBandIdentifier mIdentifierUpdate;
|
||||
|
||||
public PatchGroupVoiceChannelGrant( BinaryMessage message, DataUnitID duid,
|
||||
AliasList aliasList )
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return MotorolaOpcode.PATCH_GROUP_CHANNEL_GRANT.getLabel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
if( isEmergency() )
|
||||
{
|
||||
sb.append( " EMERGENCY" );
|
||||
}
|
||||
|
||||
sb.append( " PATCH GROUP:" );
|
||||
sb.append( getPatchGroupAddress() );
|
||||
sb.append( " FROM:" );
|
||||
sb.append( getSourceAddress() );
|
||||
sb.append( " PRI:" );
|
||||
sb.append( getPriority() );
|
||||
|
||||
sb.append( " CHAN:" );
|
||||
sb.append( getChannelIdentifier() + "-" + getChannelNumber() );
|
||||
|
||||
sb.append( " DN:" + getDownlinkFrequency() );
|
||||
|
||||
sb.append( " UP:" + getUplinkFrequency() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getPatchGroupAddress()
|
||||
{
|
||||
return mMessage.getHex( PATCH_GROUP_ADDRESS, 4 );
|
||||
}
|
||||
|
||||
public String getSourceAddress()
|
||||
{
|
||||
return mMessage.getHex( SOURCE_ADDRESS, 6 );
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1 = Lowest, 4 = Default, 7 = Highest
|
||||
*/
|
||||
public int getPriority()
|
||||
{
|
||||
return mMessage.getInt( PRIORITY );
|
||||
}
|
||||
|
||||
public int getChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL );
|
||||
}
|
||||
|
||||
public String getChannel()
|
||||
{
|
||||
return getChannelIdentifier() + "-" + getChannelNumber();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
{
|
||||
mIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 1 ];
|
||||
identifiers[ 0 ] = getChannelIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mIdentifierUpdate, getChannelNumber() );
|
||||
}
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mIdentifierUpdate, getChannelNumber() );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
package module.decode.p25.message.tsbk.motorola;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
|
||||
public class PatchGroupVoiceChannelGrantUpdate extends MotorolaTSBKMessage
|
||||
implements IdentifierReceiver
|
||||
{
|
||||
public static final int[] CHANNEL_1 = { 80,81,82,83 };
|
||||
public static final int[] IDENTIFIER_1 = { 84,85,86,87,88,89,90,91,92,93,94,
|
||||
95 };
|
||||
public static final int[] PATCH_GROUP_ADDRESS_1 = { 96,97,98,99,100,101,102,
|
||||
103,104,105,106,107,108,109,110,111 };
|
||||
public static final int[] CHANNEL_2 = { 112,113,114,115 };
|
||||
public static final int[] IDENTIFIER_2 = { 116,117,118,119,120,121,122,123,
|
||||
124,125,126,127 };
|
||||
public static final int[] PATCH_GROUP_ADDRESS_2 = { 128,129,130,131,132,133,
|
||||
134,135,136,137,138,139,140,141,142,143 };
|
||||
|
||||
private IBandIdentifier mIdentifierUpdate1;
|
||||
private IBandIdentifier mIdentifierUpdate2;
|
||||
|
||||
public PatchGroupVoiceChannelGrantUpdate( BinaryMessage message,
|
||||
DataUnitID duid, AliasList aliasList )
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return MotorolaOpcode.PATCH_GROUP_CHANNEL_GRANT_UPDATE.getLabel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
|
||||
sb.append( " PATCH GRP1:" );
|
||||
sb.append( getPatchGroupAddress1() );
|
||||
sb.append( " GRP2:" );
|
||||
sb.append( getPatchGroupAddress2() );
|
||||
|
||||
sb.append( " CHAN 1:" );
|
||||
sb.append( getChannel1() );
|
||||
sb.append( " DN:" + getDownlinkFrequency1() );
|
||||
|
||||
sb.append( " CHAN 2:" );
|
||||
sb.append( getChannel2() );
|
||||
sb.append( " DN:" + getDownlinkFrequency2() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getPatchGroupAddress1()
|
||||
{
|
||||
return mMessage.getHex( PATCH_GROUP_ADDRESS_1, 4 );
|
||||
}
|
||||
|
||||
public String getPatchGroupAddress2()
|
||||
{
|
||||
return mMessage.getHex( PATCH_GROUP_ADDRESS_2, 4 );
|
||||
}
|
||||
|
||||
public int getChannelIdentifier1()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER_1 );
|
||||
}
|
||||
|
||||
public int getChannelNumber1()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL_1 );
|
||||
}
|
||||
|
||||
public String getChannel1()
|
||||
{
|
||||
return getChannelIdentifier1() + "-" + getChannelNumber1();
|
||||
}
|
||||
|
||||
public int getChannelIdentifier2()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER_2 );
|
||||
}
|
||||
|
||||
public int getChannelNumber2()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL_2 );
|
||||
}
|
||||
|
||||
public String getChannel2()
|
||||
{
|
||||
return getChannelIdentifier2() + "-" + getChannelNumber2();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
{
|
||||
if( identifier == getChannelIdentifier1() )
|
||||
{
|
||||
mIdentifierUpdate1 = message;
|
||||
}
|
||||
|
||||
if( identifier == getChannelIdentifier2() )
|
||||
{
|
||||
mIdentifierUpdate2 = message;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 2 ];
|
||||
identifiers[ 0 ] = getChannelIdentifier1();
|
||||
identifiers[ 1 ] = getChannelIdentifier2();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency1()
|
||||
{
|
||||
return calculateDownlink( mIdentifierUpdate1, getChannelNumber1() );
|
||||
}
|
||||
|
||||
public long getUplinkFrequency1()
|
||||
{
|
||||
return calculateUplink( mIdentifierUpdate1, getChannelNumber1() );
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency2()
|
||||
{
|
||||
return calculateDownlink( mIdentifierUpdate2, getChannelNumber2() );
|
||||
}
|
||||
|
||||
public long getUplinkFrequency2()
|
||||
{
|
||||
return calculateUplink( mIdentifierUpdate2, getChannelNumber2() );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package module.decode.p25.message.tsbk.motorola;
|
||||
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
|
||||
public class PlannedControlChannnelShutdown extends MotorolaTSBKMessage
|
||||
{
|
||||
public PlannedControlChannnelShutdown( BinaryMessage message,
|
||||
DataUnitID duid,
|
||||
AliasList aliasList )
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return MotorolaOpcode.CCH_PLANNED_SHUTDOWN.getDescription();
|
||||
}
|
||||
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package module.decode.p25.message.tsbk.motorola;
|
||||
|
||||
import module.decode.p25.message.tsbk.TSBKMessage;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
|
||||
public class SystemLoading extends MotorolaTSBKMessage
|
||||
{
|
||||
public SystemLoading( BinaryMessage message, DataUnitID duid,
|
||||
AliasList aliasList )
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return MotorolaOpcode.SYSTEM_LOAD.getLabel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " - " + getMessageHex() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package module.decode.p25.message.tsbk.motorola;
|
||||
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
|
||||
public class TrafficChannelBaseStationIdentification extends MotorolaTSBKMessage
|
||||
{
|
||||
public static final int[] CHARACTER_1 = { 80,81,82,83,84,85 };
|
||||
public static final int[] CHARACTER_2 = { 86,87,88,89,90,91 };
|
||||
public static final int[] CHARACTER_3 = { 92,93,94,95,96,97 };
|
||||
public static final int[] CHARACTER_4 = { 98,99,100,101,102,103 };
|
||||
public static final int[] CHARACTER_5 = { 104,105,106,107,108,109 };
|
||||
public static final int[] CHARACTER_6 = { 110,111,112,113,114,115 };
|
||||
public static final int[] CHARACTER_7 = { 116,117,118,119,120,121 };
|
||||
public static final int[] CHARACTER_8 = { 122,123,124,125,126,127 };
|
||||
|
||||
public TrafficChannelBaseStationIdentification( BinaryMessage message,
|
||||
DataUnitID duid,
|
||||
AliasList aliasList )
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return MotorolaOpcode.TRAFFIC_CHANNEL_ID.getDescription();
|
||||
}
|
||||
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " ID:" + getID() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
public String getID()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getCharacter( CHARACTER_1 ) );
|
||||
sb.append( getCharacter( CHARACTER_2 ) );
|
||||
sb.append( getCharacter( CHARACTER_3 ) );
|
||||
sb.append( getCharacter( CHARACTER_4 ) );
|
||||
sb.append( getCharacter( CHARACTER_5 ) );
|
||||
sb.append( getCharacter( CHARACTER_6 ) );
|
||||
sb.append( getCharacter( CHARACTER_7 ) );
|
||||
sb.append( getCharacter( CHARACTER_8 ) );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
private String getCharacter( int[] field )
|
||||
{
|
||||
int value = mMessage.getInt( field );
|
||||
|
||||
return String.valueOf( (char)( value + 43 ) );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user