Package org.orekit.gnss.rflink.gps
Class SubFrame
java.lang.Object
org.orekit.gnss.rflink.gps.SubFrame
- Direct Known Subclasses:
SubFrame1,SubFrame2,SubFrame3,SubFrame45
Container for sub-frames in a GPS navigation message.
- Since:
- 12.0
- Author:
- Luc Maisonobe
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intSize of parity field.static final intTLM preamble.protected static final intWords size. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckParity(int previous, int current) Check parity.intgetAlert()Get alert flag.intGet anti-spoofing flag.protected intgetField(int fieldIndex) Get a field.intgetId()Get sub-frame id.intGet integrity status flag.intGet telemetry message.intGet telemetry preamble.intgetTow()Get Time Of Week of next 12 second message.booleanCheck if the sub-frame has parity errors.static SubFrameparse(EncodedMessage encodedMessage) Builder for sub-frames.protected voidsetField(int fieldIndex, int wordIndex, int shift, int nbBits, int[] words) Set a field.protected voidsetField(int fieldIndex, int wordIndexMSB, int shiftMSB, int nbBitsMSB, int wordIndexLSB, int shiftLSB, int nbBitsLSB, int[] words) Set a field.
-
Field Details
-
PREAMBLE_VALUE
public static final int PREAMBLE_VALUETLM preamble.- See Also:
-
WORD_SIZE
protected static final int WORD_SIZEWords size.- See Also:
-
PARITY_SIZE
protected static final int PARITY_SIZESize of parity field.- See Also:
-
-
Constructor Details
-
SubFrame
protected SubFrame(int[] words, int nbFields) Simple constructor.- Parameters:
words- raw wordsnbFields- number of fields in the sub-frame (including TLM and HOW data fields, excluding non-information and parity)
-
-
Method Details
-
parse
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:
-
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
-