Class SubFrame

    • Constructor Detail

      • 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 Detail

      • 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