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 final int
    Size of parity field.
    static final int
    TLM preamble.
    protected static final int
    Words size.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    SubFrame(int[] words, int nbFields)
    Simple constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    checkParity(int previous, int current)
    Check parity.
    int
    Get alert flag.
    int
    Get anti-spoofing flag.
    protected int
    getField(int fieldIndex)
    Get a field.
    int
    Get sub-frame id.
    int
    Get integrity status flag.
    int
    Get telemetry message.
    int
    Get telemetry preamble.
    int
    Get Time Of Week of next 12 second message.
    boolean
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • SubFrame

      protected SubFrame(int[] words, int nbFields)
      Simple constructor.
      Parameters:
      words - raw words
      nbFields - number of fields in the sub-frame (including TLM and HOW data fields, excluding non-information and parity)
  • Method Details

    • 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:
    • 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 field
      words - 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 MSB
      wordIndexLSB - 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 LSB
      words - 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