Package org.ka2ddo.opentrac
Class OpenTracGpsQuality
java.lang.Object
org.ka2ddo.opentrac.OpenTracElement
org.ka2ddo.opentrac.OpenTracGpsQuality
- All Implemented Interfaces:
Serializable
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
Modifier and TypeFieldDescriptionbyte
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
ConstructorDescriptionCreate an uninitialized OpenTracGpsQuality element.OpenTracGpsQuality
(int type, byte[] body, int offset, int length) Extract a OpenTracGpsQuality element from a byte arrayOpenTracGpsQuality
(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 TypeMethodDescriptionint
computeBody
(byte[] buf, int offset) Append this element to a message bufferboolean
equalsElement
(OpenTracElement other) Test if this OpenTracElement has the same type and value as another OpenTracElement.int
length()
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
-
Field Details
-
fixType
public byte fixTypeThe GPS fix type of the signal.Fix type values value meaning 0 unknown or not available 1 no position fix 2 2D fix 3 3D fix -
fixValidity
public byte fixValidityThe validity of the current fix.Validity values value meaning 0 invalid 1 valid SPS (Standard Positioning Service) 2 value DGPS (Differential GPS) 3 valid PPS -
numSatellites
public byte numSatellitesNumber of satellites actually used for the fix as reported by the NMEA 0183 $GPGGA sentence. -
hdop
public short hdopHorizontal 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 pdopPosition 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 vdopVertical 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 elementbody
- byte array to extract element fromoffset
- zero-based array index to start extractionlength
- 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 3fixValidity
- int fix validity code in the range 0 to 3numSatellites
- 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 3fixValidity
- int fix validity code in the range 0 to 3numSatellites
- int number of satellites in use in the range 0 to 15hdop
- float horizontal dilution of precision in the range 0 to 25.5pdop
- float position dilution of precision in the range 0 to 25.5vdop
- 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 classOpenTracElement
- Parameters:
buf
- byte array to add the element tooffset
- starting index to store the element- Returns:
- index after the end of the stored element
-
valueString
Get the string representation of the value of this element.- Specified by:
valueString
in classOpenTracElement
- Returns:
- value string
-
length
public int length()Return the number of bytes needed to encode this element.- Specified by:
length
in classOpenTracElement
- Returns:
- byte count needed to hold this element
-
equalsElement
Test if this OpenTracElement has the same type and value as another OpenTracElement.- Specified by:
equalsElement
in classOpenTracElement
- Parameters:
other
- OpenTracElement to compare against this element- Returns:
- boolean true if elements are of the same type, class, and value
-