mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-13 00:57:31 -05:00
Note: Several of the decoders are currently non-functioning in this commit. If you want the latest functioning codebase, please checkout the commit prior to this one. All decoders will eventually be updated with this new architecture. Currently broken: - Logging and recording - Aux decoders (Fleetsync/MDC/LoJack/Tait) - LTR/Passport decoders Changes in this commit: - Module architecture for decoders and components with central provisioning by the DecoderFactory - Transition from Complex sample stream processing to float buffer processing for improved memory management - Redesigned filter structures - to support buffers and streams - Resolved several memory leak issues - Universal sharing of the thread pool manager - Added centralized audio management with call/user prioritization and new gui with mute/volume controls - Embedded audio metadata for eventual streaming support - Redesigned ProcessingChain to support independent re-use - Added new TrafficChannelManager to handle traffic channel allocations - Traffic Channel pool size and Call timeout available in P25 and MPT1327 configs - Redesigned channel and decoder gui components
96 lines
2.7 KiB
Java
96 lines
2.7 KiB
Java
package module.decode.p25.message.tsbk.osp.control;
|
|
|
|
import module.decode.p25.message.tsbk.TSBKMessage;
|
|
import module.decode.p25.reference.DataUnitID;
|
|
import module.decode.p25.reference.DenyReason;
|
|
import module.decode.p25.reference.Opcode;
|
|
import alias.AliasList;
|
|
import bits.BinaryMessage;
|
|
|
|
public class DenyResponse extends TSBKMessage
|
|
{
|
|
public static final int ADDITIONAL_INFORMATION_FLAG = 80;
|
|
public static final int[] SERVICE_TYPE = { 82,83,84,85,86,87 };
|
|
public static final int[] REASON_CODE = { 88,89,90,91,92,93,94,95 };
|
|
|
|
public static final int[] CALL_OPTIONS = { 96,97,98,99,100,101,102,103 };
|
|
public static final int[] SOURCE_GROUP = { 104,105,106,107,108,109,110,111 };
|
|
public static final int[] SOURCE_ADDRESS = { 96,97,98,99,100,101,102,103,104,
|
|
105,106,107,108,109,110,111 };
|
|
|
|
public static final int[] TARGET_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 };
|
|
|
|
public DenyResponse( BinaryMessage message,
|
|
DataUnitID duid,
|
|
AliasList aliasList )
|
|
{
|
|
super( message, duid, aliasList );
|
|
}
|
|
|
|
@Override
|
|
public String getEventType()
|
|
{
|
|
return Opcode.DENY_RESPONSE.getDescription();
|
|
}
|
|
|
|
public String getMessage()
|
|
{
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
sb.append( getMessageStub() );
|
|
|
|
sb.append( " TGT ADDR: " + getTargetAddress() );
|
|
|
|
sb.append( " REASON:" + getReason().name() );
|
|
|
|
return sb.toString();
|
|
}
|
|
|
|
public DenyReason getReason()
|
|
{
|
|
int code = mMessage.getInt( REASON_CODE );
|
|
|
|
return DenyReason.fromCode( code );
|
|
}
|
|
|
|
public boolean hasAdditionalInformation()
|
|
{
|
|
return mMessage.get( ADDITIONAL_INFORMATION_FLAG );
|
|
}
|
|
|
|
public Opcode getServiceType()
|
|
{
|
|
return Opcode.fromValue( mMessage.getInt( SERVICE_TYPE ) );
|
|
}
|
|
|
|
public String getSourceAddress()
|
|
{
|
|
switch( getServiceType() )
|
|
{
|
|
case GROUP_DATA_CHANNEL_GRANT:
|
|
case GROUP_VOICE_CHANNEL_GRANT:
|
|
return mMessage.getHex( SOURCE_GROUP, 4 );
|
|
case UNIT_TO_UNIT_VOICE_CHANNEL_GRANT:
|
|
case INDIVIDUAL_DATA_CHANNEL_GRANT:
|
|
case TELEPHONE_INTERCONNECT_VOICE_CHANNEL_GRANT:
|
|
return mMessage.getHex( SOURCE_ADDRESS, 6 );
|
|
default:
|
|
break;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
public String getTargetAddress()
|
|
{
|
|
return mMessage.getHex( TARGET_ADDRESS, 6 );
|
|
}
|
|
|
|
@Override
|
|
public String getToID()
|
|
{
|
|
return getTargetAddress();
|
|
}
|
|
}
|