Package org.orekit.gnss.rflink.gps
Class SubFrame
- java.lang.Object
-
- org.orekit.gnss.rflink.gps.SubFrame
-
- Direct Known Subclasses:
SubFrame1
,SubFrame2
,SubFrame3
,SubFrame45
public abstract class SubFrame extends Object
Container for sub-frames in a GPS navigation message.- Since:
- 12.0
- Author:
- Luc Maisonobe
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
PARITY_SIZE
Size of parity field.static int
PREAMBLE_VALUE
TLM preamble.protected static int
WORD_SIZE
Words size.
-
Constructor Summary
Constructors Modifier Constructor Description protected
SubFrame(int[] words, int nbFields)
Simple constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
checkParity(int previous, int current)
Check parity.int
getAlert()
Get alert flag.int
getAntiSpoofing()
Get anti-spoofing flag.protected int
getField(int fieldIndex)
Get a field.int
getId()
Get sub-frame id.int
getIntegrityStatus()
Get integrity status flag.int
getMessage()
Get telemetry message.int
getPreamble()
Get telemetry preamble.int
getTow()
Get Time Of Week of next 12 second message.boolean
hasParityErrors()
Check if the sub-frame has parity errors.static SubFrame
parse(EncodedMessage encodedMessage)
Builder for sub-frames.protected void
setField(int fieldIndex, int wordIndex, int shift, int nbBits, int[] words)
Set a field.protected void
setField(int fieldIndex, int wordIndexMSB, int shiftMSB, int nbBitsMSB, int wordIndexLSB, int shiftLSB, int nbBitsLSB, int[] words)
Set a field.
-
-
-
Field Detail
-
PREAMBLE_VALUE
public static final int PREAMBLE_VALUE
TLM preamble.- See Also:
- Constant Field Values
-
WORD_SIZE
protected static final int WORD_SIZE
Words size.- See Also:
- Constant Field Values
-
PARITY_SIZE
protected static final int PARITY_SIZE
Size of parity field.- See Also:
- Constant Field Values
-
-
Method Detail
-
parse
public static SubFrame parse(EncodedMessage encodedMessage)
Builder for sub-frames.This builder creates the proper sub-frame type corresponding to the ID in handover word and the SV Id for sub-frames 4 and 5.
- Parameters:
encodedMessage
- encoded message containing exactly one sub-frame- Returns:
- sub-frame with TLM and HOW fields already set up
- See Also:
SubFrame1
,SubFrame2
,SubFrame3
,SubFrame4A0
,SubFrame4A1
,SubFrame4B
,SubFrame4C
,SubFrame4D
,SubFrame4E
,SubFrameAlmanac
,SubFrameDummyAlmanac
-
checkParity
public static boolean checkParity(int previous, int current)
Check parity.This implements algorithm in table 20-XIV from IS-GPS-200N
- Parameters:
previous
- previous 30 bits word (only two least significant bits are used)current
- current 30 bits word- Returns:
- true if parity check succeeded
-
hasParityErrors
public boolean hasParityErrors()
Check if the sub-frame has parity errors.- Returns:
- true if frame has parity errors
-
getField
protected int getField(int fieldIndex)
Get a field.The field indices are defined as constants in the various sub-frames classes.
- Parameters:
fieldIndex
- field index (counting from 0)- Returns:
- field value
-
setField
protected void setField(int fieldIndex, int wordIndex, int shift, int nbBits, int[] words)
Set a field.- Parameters:
fieldIndex
- field index (counting from 0)wordIndex
- word index (counting from 1, to match IS-GPS-200 tables)shift
- right shift to apply (i.e. number of LSB bits for next fields that should be removed)nbBits
- number of bits in the fieldwords
- raw 30 bits words
-
setField
protected void setField(int fieldIndex, int wordIndexMSB, int shiftMSB, int nbBitsMSB, int wordIndexLSB, int shiftLSB, int nbBitsLSB, int[] words)
Set a field.- Parameters:
fieldIndex
- field index (counting from 0)wordIndexMSB
- word index containing MSB (counting from 1, to match IS-GPS-200 tables)shiftMSB
- right shift to apply to MSB (i.e. number of LSB bits for next fields that should be removed)nbBitsMSB
- number of bits in the MSBwordIndexLSB
- word index containing LSB (counting from 1, to match IS-GPS-200 tables)shiftLSB
- right shift to apply to LSB (i.e. number of LSB bits for next fields that should be removed)nbBitsLSB
- number of bits in the LSBwords
- raw 30 bits words
-
getPreamble
public int getPreamble()
Get telemetry preamble.- Returns:
- telemetry preamble
-
getMessage
public int getMessage()
Get telemetry message.- Returns:
- telemetry message
-
getIntegrityStatus
public int getIntegrityStatus()
Get integrity status flag.- Returns:
- integrity status flag
-
getTow
public int getTow()
Get Time Of Week of next 12 second message.- Returns:
- Time Of Week of next 12 second message (s)
-
getAlert
public int getAlert()
Get alert flag.- Returns:
- alert flag
-
getAntiSpoofing
public int getAntiSpoofing()
Get anti-spoofing flag.- Returns:
- anti-spoofing flag
-
getId
public int getId()
Get sub-frame id.- Returns:
- sub-frame id
-
-