mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-15 01:57:39 -05:00
Revert "Merges master onto development branch"
This reverts commit 2420bc901c63ad9d41e7c99ac95a426f826182ff.
This commit is contained in:
@@ -87,8 +87,6 @@ public class P25Message extends Message
|
||||
sb.append( " " );
|
||||
sb.append( getDUID().getLabel() );
|
||||
|
||||
sb.append( " DATA UNIT ID:" + mMessage.getInt( DUID ) );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package module.decode.p25.message.pdu;
|
||||
|
||||
import module.decode.p25.message.pdu.confirmed.PacketData;
|
||||
import module.decode.p25.message.pdu.osp.control.AdjacentStatusBroadcastExtended;
|
||||
import module.decode.p25.message.pdu.osp.control.CallAlertExtended;
|
||||
import module.decode.p25.message.pdu.osp.control.GroupAffiliationQueryExtended;
|
||||
@@ -122,8 +121,7 @@ public class PDUMessageFactory
|
||||
}
|
||||
|
||||
return new PDUMessage( message, duid, aliasList );
|
||||
case PACKET_DATA:
|
||||
return new PacketData( message, aliasList );
|
||||
|
||||
case UNCONFIRMED_MULTI_BLOCK_TRUNKING_CONTROL:
|
||||
return new PDUMessage( message, duid, aliasList );
|
||||
default:
|
||||
|
||||
@@ -48,27 +48,19 @@ public class PDUConfirmedMessageFactory
|
||||
case UNENCRYPTED_USER_DATA:
|
||||
switch( message.getPDUType() )
|
||||
{
|
||||
case SNDCP_ACTIVATE_TDS_CONTEXT_ACCEPT:
|
||||
case SN_ACTIVATE_TDS_CONTEXT_ACCEPT:
|
||||
return new SNDCPActivateTDSContextAccept( message );
|
||||
case SNDCP_ACTIVATE_TDS_CONTEXT_REJECT:
|
||||
case SN_ACTIVATE_TDS_CONTEXT_REJECT:
|
||||
return new SNDCPActivateTDSContextReject( message );
|
||||
case SN_ACTIVATE_TDS_CONTEXT_REQUEST:
|
||||
return new SNDCPActivateTDSContextRequest( message );
|
||||
case SNDCP_DEACTIVATE_TDS_CONTEXT_ACCEPT:
|
||||
case SNDCP_DEACTIVATE_TDS_CONTEXT_REQUEST:
|
||||
case SN_DEACTIVATE_TDS_CONTEXT_ACCEPT:
|
||||
case SN_DEACTIVATE_TDS_CONTEXT_REQUEST:
|
||||
return new SNDCPDeactivateTDSContext( message );
|
||||
case SNDCP_RF_CONFIRMED_DATA:
|
||||
case SN_RF_CONFIRMED_DATA:
|
||||
return new SNDCPUserData( message );
|
||||
case SNDCP_RF_UNCONFIRMED_DATA:
|
||||
case SN_RF_UNCONFIRMED_DATA:
|
||||
break;
|
||||
case PDU_TYPE_6:
|
||||
case PDU_TYPE_7:
|
||||
case PDU_TYPE_8:
|
||||
case PDU_TYPE_9:
|
||||
case PDU_TYPE_10:
|
||||
case PDU_TYPE_11:
|
||||
return new PDUTypeUnknown( message );
|
||||
case UNKNOWN:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
package module.decode.p25.message.pdu.confirmed;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class PDUTypeUnknown extends PDUConfirmedMessage
|
||||
{
|
||||
public final static Logger mLog =
|
||||
LoggerFactory.getLogger( PDUTypeUnknown.class );
|
||||
|
||||
public PDUTypeUnknown( PDUConfirmedMessage message )
|
||||
{
|
||||
super( message );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( "NAC:" );
|
||||
sb.append( getNAC() );
|
||||
sb.append( " LLID:" );
|
||||
sb.append( getLogicalLinkID() );
|
||||
sb.append( " PACKET DATA UNIT CONFIRMED - " );
|
||||
sb.append( getPDUType().getLabel() );
|
||||
sb.append( " CRC[" );
|
||||
sb.append( getErrorStatus() );
|
||||
sb.append( "]" );
|
||||
|
||||
sb.append( " PACKET #" );
|
||||
sb.append( getPacketSequenceNumber() );
|
||||
|
||||
if( isFinalFragment() && getFragmentSequenceNumber() == 0 )
|
||||
{
|
||||
sb.append( ".C" );
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.append( "." );
|
||||
sb.append( getFragmentSequenceNumber() );
|
||||
|
||||
if( isFinalFragment() )
|
||||
{
|
||||
sb.append( "C" );
|
||||
}
|
||||
}
|
||||
|
||||
sb.append( " " );
|
||||
|
||||
sb.append( mMessage.toString() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
package module.decode.p25.message.pdu.confirmed;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
|
||||
public class PacketData extends PDUConfirmedMessage
|
||||
{
|
||||
public final static Logger mLog =
|
||||
LoggerFactory.getLogger( PacketData.class );
|
||||
|
||||
public static final int DATA_BLOCK_START = 176;
|
||||
|
||||
public PacketData( BinaryMessage message, AliasList aliasList )
|
||||
{
|
||||
super( message, aliasList );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( "NAC:" );
|
||||
sb.append( getNAC() );
|
||||
sb.append( " PDUC LLID:" );
|
||||
sb.append( getLogicalLinkID() );
|
||||
|
||||
|
||||
sb.append( " PACKET DATA" );
|
||||
sb.append( " CRC[" );
|
||||
sb.append( getErrorStatus() );
|
||||
sb.append( "]" );
|
||||
|
||||
if( !mMessage.get( FINAL_FRAGMENT_FLAG ) )
|
||||
{
|
||||
sb.append( " RESENDING" );
|
||||
}
|
||||
|
||||
sb.append( " PACKET #" );
|
||||
sb.append( getPacketSequenceNumber() );
|
||||
|
||||
if( isFinalFragment() && getFragmentSequenceNumber() == 0 )
|
||||
{
|
||||
sb.append( ".C" );
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.append( "." );
|
||||
sb.append( getFragmentSequenceNumber() );
|
||||
|
||||
if( isFinalFragment() )
|
||||
{
|
||||
sb.append( "C" );
|
||||
}
|
||||
}
|
||||
|
||||
sb.append( " " );
|
||||
|
||||
sb.append( mMessage.toString() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,7 @@ public class SNDCPDeactivateTDSContext extends PDUConfirmedMessage
|
||||
|
||||
public String getDeactivationType()
|
||||
{
|
||||
if( getPDUType() == PDUType.SNDCP_DEACTIVATE_TDS_CONTEXT_REQUEST )
|
||||
if( getPDUType() == PDUType.SN_DEACTIVATE_TDS_CONTEXT_REQUEST )
|
||||
{
|
||||
return mMessage.getInt( DEACTIVATION_TYPE ) == 0 ?
|
||||
"ALL NSAPIS" : "THIS NSAPI";
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package module.decode.p25.message.tsbk;
|
||||
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import module.decode.p25.message.tsbk.motorola.ControlChannelBaseStationIdentification;
|
||||
import module.decode.p25.message.tsbk.motorola.MotorolaOpcode;
|
||||
import module.decode.p25.message.tsbk.motorola.MotorolaTSBKMessage;
|
||||
@@ -21,7 +19,6 @@ import module.decode.p25.message.tsbk.osp.control.ExtendedFunctionCommand;
|
||||
import module.decode.p25.message.tsbk.osp.control.GroupAffiliationQuery;
|
||||
import module.decode.p25.message.tsbk.osp.control.GroupAffiliationResponse;
|
||||
import module.decode.p25.message.tsbk.osp.control.IdentifierUpdateNonVUHF;
|
||||
import module.decode.p25.message.tsbk.osp.control.IdentifierUpdateTDMA;
|
||||
import module.decode.p25.message.tsbk.osp.control.IdentifierUpdateVUHF;
|
||||
import module.decode.p25.message.tsbk.osp.control.LocationRegistrationResponse;
|
||||
import module.decode.p25.message.tsbk.osp.control.MessageUpdate;
|
||||
@@ -59,6 +56,8 @@ import module.decode.p25.message.tsbk.osp.voice.UnitToUnitVoiceChannelGrantUpdat
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import module.decode.p25.reference.Opcode;
|
||||
import module.decode.p25.reference.Vendor;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
|
||||
public class TSBKMessageFactory
|
||||
{
|
||||
@@ -120,8 +119,6 @@ public class TSBKMessageFactory
|
||||
case IDENTIFIER_UPDATE_NON_VUHF:
|
||||
return new IdentifierUpdateNonVUHF( message, duid,
|
||||
aliasList );
|
||||
case IDENTIFIER_UPDATE_TDMA:
|
||||
return new IdentifierUpdateTDMA( message, duid, aliasList );
|
||||
case IDENTIFIER_UPDATE_VHF_UHF_BANDS:
|
||||
return new IdentifierUpdateVUHF( message, duid,
|
||||
aliasList );
|
||||
|
||||
@@ -1,159 +0,0 @@
|
||||
package module.decode.p25.message.tsbk.osp.control;
|
||||
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import module.decode.p25.reference.Opcode;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
|
||||
public class IdentifierUpdateTDMA extends IdentifierUpdate
|
||||
{
|
||||
public static final int[] CHANNEL_TYPE = { 84,85,86,87 };
|
||||
public static final int TRANSMIT_OFFSET_SIGN = 88;
|
||||
public static final int[] TRANSMIT_OFFSET = { 89,90,91,92,93,94,95,96,97,98,
|
||||
99,100,101 };
|
||||
|
||||
public IdentifierUpdateTDMA( BinaryMessage message,
|
||||
DataUnitID duid,
|
||||
AliasList aliasList )
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return Opcode.IDENTIFIER_UPDATE_TDMA.getDescription();
|
||||
}
|
||||
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " IDEN:" + getIdentifier() );
|
||||
sb.append( " BASE:" + getBaseFrequency() );
|
||||
sb.append( " BW:" + getBandwidth() );
|
||||
sb.append( " SPACING:" + getChannelSpacing() );
|
||||
sb.append( " OFFSET:" + getTransmitOffset() );
|
||||
sb.append( " TYPE:" + getChannelType().toString() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public ChannelType getChannelType()
|
||||
{
|
||||
return ChannelType.fromValue( mMessage.getInt( CHANNEL_TYPE) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Channel bandwidth in hertz
|
||||
*/
|
||||
public int getBandwidth()
|
||||
{
|
||||
return getChannelType().getBandwidth();
|
||||
}
|
||||
|
||||
/**
|
||||
* Transmit offset in hertz
|
||||
*/
|
||||
@Override
|
||||
public long getTransmitOffset()
|
||||
{
|
||||
long offset = mMessage.getLong( TRANSMIT_OFFSET ) *
|
||||
getChannelSpacing();
|
||||
|
||||
if( mMessage.get( TRANSMIT_OFFSET_SIGN ) )
|
||||
{
|
||||
return offset;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -offset;
|
||||
}
|
||||
}
|
||||
|
||||
public enum ChannelType
|
||||
{
|
||||
TYPE_0( AccessType.FDMA, 12500, 1, Vocoder.HALF_RATE ),
|
||||
TYPE_1( AccessType.FDMA, 12500, 1, Vocoder.FULL_RATE ),
|
||||
TYPE_2( AccessType.FDMA, 6250, 1, Vocoder.HALF_RATE ),
|
||||
TYPE_3( AccessType.TDMA, 12500, 2, Vocoder.HALF_RATE ),
|
||||
TYPE_4( AccessType.TDMA, 25000, 4, Vocoder.HALF_RATE ),
|
||||
TYPE_5( AccessType.TDMA, 12500, 2, Vocoder.HALF_RATE ), //HD8PSK simulcast
|
||||
UNKNOWN( AccessType.UNKNOWN, 0, 0, Vocoder.HALF_RATE );
|
||||
|
||||
private AccessType mAccessType;
|
||||
private int mBandwidth;
|
||||
private int mSlotsPerCarrier;
|
||||
private Vocoder mVocoder;
|
||||
|
||||
private ChannelType( AccessType accessType,
|
||||
int bandwidth,
|
||||
int slots,
|
||||
Vocoder vocoder )
|
||||
{
|
||||
mAccessType = accessType;
|
||||
mBandwidth = bandwidth;
|
||||
mSlotsPerCarrier = slots;
|
||||
mVocoder = vocoder;
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
if( this.equals( TYPE_5 ) )
|
||||
{
|
||||
sb.append("H-D8PSK SIMULCAST " );
|
||||
}
|
||||
|
||||
sb.append( mAccessType.name() );
|
||||
sb.append( " BW:" + mBandwidth );
|
||||
sb.append( " SLOT/CARRIER:" + mSlotsPerCarrier );
|
||||
sb.append( " VOCODER:" + mVocoder.name() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static ChannelType fromValue( int value )
|
||||
{
|
||||
if( 0 <= value && value <= 5 )
|
||||
{
|
||||
return ChannelType.values()[ value ];
|
||||
}
|
||||
|
||||
return ChannelType.UNKNOWN;
|
||||
}
|
||||
|
||||
public AccessType getAccessType()
|
||||
{
|
||||
return mAccessType;
|
||||
}
|
||||
|
||||
public int getBandwidth()
|
||||
{
|
||||
return mBandwidth;
|
||||
}
|
||||
|
||||
public int getSlotsPerCarrier()
|
||||
{
|
||||
return mSlotsPerCarrier;
|
||||
}
|
||||
|
||||
public Vocoder getVocoder()
|
||||
{
|
||||
return mVocoder;
|
||||
}
|
||||
}
|
||||
|
||||
public enum AccessType
|
||||
{
|
||||
FDMA,TDMA,UNKNOWN;
|
||||
}
|
||||
|
||||
public enum Vocoder
|
||||
{
|
||||
HALF_RATE, FULL_RATE;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,8 @@
|
||||
package module.decode.p25.message.tsbk.osp.control;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.SimpleTimeZone;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import module.decode.p25.message.tsbk.TSBKMessage;
|
||||
@@ -14,21 +12,20 @@ import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
|
||||
/**
|
||||
* Sync Broadcast - used to broadcast FDMA-TDMA timing synchronization
|
||||
* information so that a subscriber unit that is time synchronized on an FDMA
|
||||
* control channel is also time synchronized with all TDMA traffic channels at
|
||||
* the site.
|
||||
* Sync Broadcast - used to broadcast FDMA-TDMA synchronization timestamp so
|
||||
* that a subscriber unit that is time synchronized on an FDMA control channel
|
||||
* is also synchronized with a TDMA traffic channel.
|
||||
*/
|
||||
public class SyncBroadcast extends TSBKMessage
|
||||
{
|
||||
public static final int[] RESERVED = { 80,81,82,83,84,85,86,87,88,89,90,91,92 };
|
||||
public static final int SYSTEM_TIME_NOT_LOCKED_TO_EXTERNAL_REFERENCE = 93;
|
||||
public static final int MICRO_SLOTS_TO_MINUTE_ROLLOVER_UNLOCKED = 94;
|
||||
public static final int[] LEAP_SECOND_CORRECTION = { 95,96 };
|
||||
public static final int LOCAL_TIME_OFFSET_VALID = 97;
|
||||
public static final int US = 92;
|
||||
public static final int IST = 93;
|
||||
public static final int MMU = 94;
|
||||
public static final int[] MC = { 95,96 };
|
||||
public static final int VL = 97;
|
||||
public static final int LOCAL_TIME_OFFSET_SIGN = 98;
|
||||
public static final int[] LOCAL_TIME_OFFSET_HOURS = { 99,100,101,102 };
|
||||
public static final int LOCAL_TIME_OFFSET_HALF_HOUR = 103;
|
||||
public static final int[] LOCAL_TIME_OFFSET = { 99,100,101,102 };
|
||||
public static final int LOCAL_TIME_OFFSET_HALF = 103;
|
||||
|
||||
public static final int[] YEAR = { 104,105,106,107,108,109,110 };
|
||||
public static final int[] MONTH = { 111,112,113,114 };
|
||||
@@ -39,10 +36,7 @@ public class SyncBroadcast extends TSBKMessage
|
||||
139,140,141,142,143 };
|
||||
public static final int[] TSBK_CRC = { 144,145,146,147,148,149,150,151,152,
|
||||
153,154,155,156,157,158,159 };
|
||||
|
||||
private static final DateFormat TIME_FORMATTER = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss.SSS Z" );
|
||||
private static final TimeZone NO_TIME_ZONE = new SimpleTimeZone( 0, "NONE" );
|
||||
|
||||
|
||||
public SyncBroadcast( BinaryMessage message,
|
||||
DataUnitID duid,
|
||||
AliasList aliasList )
|
||||
@@ -62,41 +56,24 @@ public class SyncBroadcast extends TSBKMessage
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " SYSTEM TIME" );
|
||||
|
||||
if( isSystemTimeNotLockedToExternalReference() )
|
||||
{
|
||||
sb.append( " UNLOCKED" );
|
||||
}
|
||||
|
||||
sb.append( ":" );
|
||||
|
||||
TIME_FORMATTER.setTimeZone( getTimeZone() );
|
||||
sb.append( " " + TIME_FORMATTER.format( new Date( getSystemTime() ) ) );
|
||||
|
||||
sb.append( " LEAP-SECOND CORRECTION:" + getLeapSecondCorrection() + "mS" );
|
||||
|
||||
if( isMicroslotsLockedToMinuteRollover() )
|
||||
{
|
||||
sb.append( " MICROSLOT-MINUTE ROLLOVER:LOCKED" );
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.append( " MICROSLOT-MINUTE ROLLOVER:UNLOCKED" );
|
||||
}
|
||||
sb.append( " " + new Date( getTime() ).toString() );
|
||||
sb.append( " TIME ZONE OFFSET:" + getTimeZone().toUpperCase() );
|
||||
sb.append( " US:" + isUS() );
|
||||
sb.append( " IST:" + isIST() );
|
||||
sb.append( " MMU:" + isMMU() );
|
||||
sb.append( " VL:" + isVL() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* System Time (UTC) in milliseconds since java epoch
|
||||
* Returns the time sync in java time (ie milliseconds since epoch )
|
||||
*/
|
||||
public long getSystemTime()
|
||||
public long getTime()
|
||||
{
|
||||
Calendar cal = Calendar.getInstance( TimeZone.getTimeZone( "UTC" ) );
|
||||
|
||||
Calendar cal = new GregorianCalendar();
|
||||
cal.clear();
|
||||
|
||||
cal.setTimeZone( TimeZone.getTimeZone( "GMT" ) );
|
||||
cal.set( Calendar.YEAR, getYear() );
|
||||
cal.set( Calendar.MONTH, getMonth() - 1 );
|
||||
cal.set( Calendar.DAY_OF_MONTH, getDay() );
|
||||
@@ -107,165 +84,102 @@ public class SyncBroadcast extends TSBKMessage
|
||||
return cal.getTimeInMillis();
|
||||
}
|
||||
|
||||
/**
|
||||
* System Time not locked to external time reference indicator
|
||||
*/
|
||||
public boolean isSystemTimeNotLockedToExternalReference()
|
||||
public boolean isUS()
|
||||
{
|
||||
return mMessage.get( SYSTEM_TIME_NOT_LOCKED_TO_EXTERNAL_REFERENCE );
|
||||
return mMessage.get( US );
|
||||
}
|
||||
|
||||
/**
|
||||
* Micro-slot-to-Minute rollover boundary lock indicator.
|
||||
*
|
||||
* Note: we invert the message value so that true indicates that the micro
|
||||
* slots and minute rollovers are locked, whereas the ICD uses false to
|
||||
* indicate a lock.
|
||||
*
|
||||
* @return true if the microslots rollover at each minute interval is locked
|
||||
* to the system time minute rollover.
|
||||
*
|
||||
* @return false if the microslots and minutes rollover are not locked. This
|
||||
* indicates that the microslots minute rollover is free rolling.
|
||||
*
|
||||
* Daylight Savings Time
|
||||
*/
|
||||
public boolean isMicroslotsLockedToMinuteRollover()
|
||||
public boolean isIST()
|
||||
{
|
||||
return !mMessage.get( MICRO_SLOTS_TO_MINUTE_ROLLOVER_UNLOCKED );
|
||||
return mMessage.get( IST );
|
||||
}
|
||||
|
||||
/**
|
||||
* Leap second correction value that should be applied to the system time.
|
||||
*
|
||||
* The leap-second correction field indicates the number of 2.5 millisecond
|
||||
* units that must be added to the system time to account for the insertion
|
||||
* of leap seconds when the system time is represented as UTC universal time.
|
||||
*
|
||||
* @return leap-second correction value in milliseconds 0.0-10.0
|
||||
* No idea ...
|
||||
*/
|
||||
public double getLeapSecondCorrection()
|
||||
public boolean isMMU()
|
||||
{
|
||||
return (double)mMessage.getInt( LEAP_SECOND_CORRECTION ) * 2.5d;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Indicates the local time offset fields contain valid information.
|
||||
*/
|
||||
public boolean isValidLocalTimeOffset()
|
||||
{
|
||||
return !mMessage.get( LOCAL_TIME_OFFSET_VALID );
|
||||
return mMessage.get( MMU );
|
||||
}
|
||||
|
||||
/**
|
||||
* Local time zone offset from UTC universal time (zulu) when the VALID
|
||||
* LOCAL TIME OFFSET flag indicates a valid offset. Otherwise, this method
|
||||
* returns a static +00:00 indicating no local time offset.
|
||||
* Millenium ...?
|
||||
*/
|
||||
public TimeZone getTimeZone()
|
||||
public int getMC()
|
||||
{
|
||||
if( isValidLocalTimeOffset() )
|
||||
{
|
||||
int offset = 0;
|
||||
|
||||
offset += mMessage.getInt( LOCAL_TIME_OFFSET_HOURS ) * 3600000;
|
||||
offset += mMessage.get( LOCAL_TIME_OFFSET_HALF_HOUR ) ? 1800000 : 0;
|
||||
offset = mMessage.get( LOCAL_TIME_OFFSET_SIGN ) ? -offset : offset;
|
||||
|
||||
return new SimpleTimeZone( offset, "LOCAL" );
|
||||
}
|
||||
else
|
||||
{
|
||||
return NO_TIME_ZONE;
|
||||
}
|
||||
return mMessage.getInt( MC );
|
||||
}
|
||||
|
||||
/**
|
||||
* System time - year.
|
||||
*
|
||||
* @return year in range 2000-2127
|
||||
* No idea ....
|
||||
*/
|
||||
public boolean isVL()
|
||||
{
|
||||
return mMessage.get( VL );
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates the time zone from the local time offset field.
|
||||
*/
|
||||
public String getTimeZone()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( mMessage.get( LOCAL_TIME_OFFSET_SIGN ) ? "-" : "+" );
|
||||
|
||||
int hours = mMessage.getInt( LOCAL_TIME_OFFSET );
|
||||
sb.append( ( hours < 10 ? "0" : "" ) + String.valueOf( hours ) );
|
||||
|
||||
sb.append( ":" );
|
||||
|
||||
sb.append( mMessage.get( LOCAL_TIME_OFFSET_HALF ) ? "30" : "00" );
|
||||
|
||||
if( mMessage.get( IST ) )
|
||||
{
|
||||
sb.append( " DST" );
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public int getYear()
|
||||
{
|
||||
return 2000 + mMessage.getInt( YEAR );
|
||||
}
|
||||
|
||||
/**
|
||||
* System time - month
|
||||
*
|
||||
* @return month 1-12 where 1=January and 12=December
|
||||
*/
|
||||
public int getMonth()
|
||||
{
|
||||
return mMessage.getInt( MONTH );
|
||||
}
|
||||
|
||||
/**
|
||||
* System time - day of month
|
||||
*
|
||||
* @return day of month in range 1-31
|
||||
*/
|
||||
public int getDay()
|
||||
{
|
||||
return mMessage.getInt( DAY );
|
||||
}
|
||||
|
||||
/**
|
||||
* System time - hours
|
||||
*
|
||||
* @return hours in range 0 - 23
|
||||
*/
|
||||
public int getHours()
|
||||
{
|
||||
return mMessage.getInt( HOURS );
|
||||
}
|
||||
|
||||
/**
|
||||
* System time - minutes
|
||||
*
|
||||
* @return minutes in range 0 - 59
|
||||
*/
|
||||
public int getMinutes()
|
||||
{
|
||||
return mMessage.getInt( MINUTES );
|
||||
}
|
||||
|
||||
/**
|
||||
* System time - milli-seconds
|
||||
*
|
||||
* Note: sub-millisecond values are rounded to nearest millisecond unit to
|
||||
* conform to java Date internal milli-second precision level.
|
||||
*
|
||||
* @return milli-seconds in range 0 - 59999;
|
||||
*/
|
||||
public int getMilliSeconds()
|
||||
{
|
||||
return (int)( (double)getMicroSlots() * 7.5 );
|
||||
}
|
||||
|
||||
/**
|
||||
* TDMA Micro Slots.
|
||||
*
|
||||
* Number of 7.5 millisecond micro slots since the last minute rollover, or
|
||||
* since the last micro-slot counter rollover when the the micro-slot to
|
||||
* minute rollover is unlocked.
|
||||
*
|
||||
* @see isMicroslotsLockedToMinuteRollover() method.
|
||||
*
|
||||
* This value supports mobile subscriber timing alignment with a TDMA traffic
|
||||
* channel when a channel is granted from the control channels, so that when
|
||||
* the mobile changes from the control channel to the traffic channel, it is
|
||||
* already aligned with the traffic channel TDMA timing.
|
||||
*
|
||||
* Super frames occur every 360 ms (48 micro-slots) on FDMA and Ultra frames
|
||||
* occur every 4 super frames on TDMA.
|
||||
*
|
||||
* Valid micro-slot values range 0-7999 and represent 60,000
|
||||
* milliseconds ( 8000 x 7.5 ms).
|
||||
*
|
||||
* @return number of 7.5 mS micro-slots since last minute or micro-slot
|
||||
* rollover
|
||||
* Micro Slots - each uslot = 7.5 milliseconds. The value ranges 0 - 7999
|
||||
* and represents 60,000 milliseconds ( 8000 x 7.5 ms). Superframes occur
|
||||
* every 360 ms (48 micro-slots) on FDMA and Ultraframes occur every 4
|
||||
* super frames on TDMA.
|
||||
*/
|
||||
public int getMicroSlots()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user