Class OpenTracGpsQuality

java.lang.Object
org.ka2ddo.opentrac.OpenTracElement
org.ka2ddo.opentrac.OpenTracGpsQuality
All Implemented Interfaces:
Serializable

public class OpenTracGpsQuality extends OpenTracElement
This class represents an OpenTRAC data element with the quality information for the entity's GPS fix. It should not be included if the entity's position information was not obtained from a Global Positioning System receiver (any constellation). Also, if none of the information transmitted in this element can be obtained, it would be better to omit this element entirely rather than create one with all values set to unknown.
Author:
Andrew Pavlin, KA2DDO
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    byte
    The GPS fix type of the signal.
    byte
    The validity of the current fix.
    short
    Horizontal Dilution Of Precision of the satellite configuration, multiplied by 10.
    byte
    Number of satellites actually used for the fix as reported by the NMEA 0183 $GPGGA sentence.
    short
    Position Dilution Of Precision of the satellite configuration, multiplied by 10.
    short
    Vertical Dilution Of Precision of the satellite configuration, multiplied by 10.

    Fields inherited from class org.ka2ddo.opentrac.OpenTracElement

    id
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create an uninitialized OpenTracGpsQuality element.
    OpenTracGpsQuality(int type, byte[] body, int offset, int length)
    Extract a OpenTracGpsQuality element from a byte array
    OpenTracGpsQuality(int fixType, int fixValidity, int numSatellites)
    Create an OpenTracGpsQuality element with the specified fix quality.
    OpenTracGpsQuality(int fixType, int fixValidity, int numSatellites, float hdop, float pdop, float vdop)
    Create an OpenTracGpsQuality element with the specified fix quality and DOP.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    computeBody(byte[] buf, int offset)
    Append this element to a message buffer
    boolean
    Test if this OpenTracElement has the same type and value as another OpenTracElement.
    int
    Return the number of bytes needed to encode this element.
    Get the string representation of the value of this element.

    Methods inherited from class org.ka2ddo.opentrac.OpenTracElement

    getId, toString

    Methods inherited from class java.lang.Object

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

    • fixType

      public byte fixType
      The GPS fix type of the signal.
      Fix type values
      valuemeaning
      0unknown or not available
      1no position fix
      22D fix
      33D fix
    • fixValidity

      public byte fixValidity
      The validity of the current fix.
      Validity values
      valuemeaning
      0invalid
      1valid SPS (Standard Positioning Service)
      2value DGPS (Differential GPS)
      3valid PPS
    • numSatellites

      public byte numSatellites
      Number of satellites actually used for the fix as reported by the NMEA 0183 $GPGGA sentence.
    • hdop

      public short hdop
      Horizontal Dilution Of Precision of the satellite configuration, multiplied by 10. Negative value indicates HDOP is not known. Positive values are clipped at 255 (equivalent of the extremely poor DOP value of 25.5).
    • pdop

      public short pdop
      Position Dilution Of Precision of the satellite configuration, multiplied by 10. Negative value indicates PDOP is not known. Positive values are clipped at 255 (equivalent of the extremely poor DOP value of 25.5).
    • vdop

      public short vdop
      Vertical Dilution Of Precision of the satellite configuration, multiplied by 10. Negative value indicates VDOP is not known. Positive values are clipped at 255 (equivalent of the extremely poor DOP value of 25.5).
  • Constructor Details

    • OpenTracGpsQuality

      public OpenTracGpsQuality()
      Create an uninitialized OpenTracGpsQuality element.
    • OpenTracGpsQuality

      public OpenTracGpsQuality(int type, byte[] body, int offset, int length)
      Extract a OpenTracGpsQuality element from a byte array
      Parameters:
      type - OpenTracTypes code for this element
      body - byte array to extract element from
      offset - zero-based array index to start extraction
      length - number of bytes to extract
    • OpenTracGpsQuality

      public OpenTracGpsQuality(int fixType, int fixValidity, int numSatellites) throws IllegalArgumentException
      Create an OpenTracGpsQuality element with the specified fix quality.
      Parameters:
      fixType - int fix type code in the range 0 to 3
      fixValidity - int fix validity code in the range 0 to 3
      numSatellites - int number of satellites in use in the range 0 to 15
      Throws:
      IllegalArgumentException - if fixType, fixQuality, or numSatellites is out of range
    • OpenTracGpsQuality

      public OpenTracGpsQuality(int fixType, int fixValidity, int numSatellites, float hdop, float pdop, float vdop) throws IllegalArgumentException
      Create an OpenTracGpsQuality element with the specified fix quality and DOP.
      Parameters:
      fixType - int fix type code in the range 0 to 3
      fixValidity - int fix validity code in the range 0 to 3
      numSatellites - int number of satellites in use in the range 0 to 15
      hdop - float horizontal dilution of precision in the range 0 to 25.5
      pdop - float position dilution of precision in the range 0 to 25.5
      vdop - float vertical dilution of precision in the range 0 to 25.5
      Throws:
      IllegalArgumentException - if fixType, fixQuality, or numSatellites is out of range
  • Method Details

    • computeBody

      public int computeBody(byte[] buf, int offset)
      Append this element to a message buffer
      Specified by:
      computeBody in class OpenTracElement
      Parameters:
      buf - byte array to add the element to
      offset - starting index to store the element
      Returns:
      index after the end of the stored element
    • valueString

      public String valueString()
      Get the string representation of the value of this element.
      Specified by:
      valueString in class OpenTracElement
      Returns:
      value string
    • length

      public int length()
      Return the number of bytes needed to encode this element.
      Specified by:
      length in class OpenTracElement
      Returns:
      byte count needed to hold this element
    • equalsElement

      public boolean equalsElement(OpenTracElement other)
      Test if this OpenTracElement has the same type and value as another OpenTracElement.
      Specified by:
      equalsElement in class OpenTracElement
      Parameters:
      other - OpenTracElement to compare against this element
      Returns:
      boolean true if elements are of the same type, class, and value