dk.itu.haas.GPS.Garmin
Class WaypointDataPacket

java.lang.Object
  |
  +--dk.itu.haas.GPS.Garmin.GarminPacket
        |
        +--dk.itu.haas.GPS.Garmin.WaypointDataPacket
All Implemented Interfaces:
IPosition, IWaypoint

public class WaypointDataPacket
extends GarminPacket
implements IWaypoint

This class encapsulates a Waypoint-packet. The Garmin-protocol contains a huge amount of different Waypoint-Packet specifications. Only the one labelled D108 is implemented so far.


Field Summary
protected  java.lang.String address
          Address number
protected  float alt
          Altitude.
protected  short attr
          Attributes.
protected  char[] cc
          Country code.
protected  java.lang.String city
          City name.
protected  short color
          Color of waypoint when displayed on the GPS.
protected  java.lang.String comment
          Waypoint comment.
protected  java.lang.String cross_road
          Intersecting road label.
protected static int datatypeversion
          Holds information about which waypoint-format this Garmin-unit uses.
protected  float depth
          Depth.
protected  float dist
          Proximity distance in meters.
protected  short dspl
          Display options.
protected  java.lang.String facility
          facility name.
protected  PositionDegrees lat
          Latitude of waypoint.
protected  PositionDegrees lon
          Longitude of waypoint.
protected  java.lang.String name
          Waypoint name.
protected  int smbl
          Waypoint symbol.
protected  char[] state
          State.
protected  short[] subclass
          Subclass of waypoint
protected  short wpt_class
          Class of waypoint.
 
Fields inherited from class dk.itu.haas.GPS.Garmin.GarminPacket
Cmnd_Abort_Transfer, Cmnd_Start_Pvt_Data, Cmnd_Stop_Pvt_Data, Cmnd_Transfer_Alm, Cmnd_Transfer_Posn, Cmnd_Transfer_Prx, Cmnd_Transfer_Rte, Cmnd_Transfer_Time, Cmnd_Transfer_Trk, Cmnd_Transfer_Wpt, Cmnd_Turn_Off_Pwr, DLE, ETX, packet, Pid_Ack_Byte, Pid_Command_Data, Pid_Date_Time_Data, Pid_Nak_Byte, Pid_Position_Data, Pid_Product_Data, Pid_Product_Rqst, Pid_Protocol_Array, Pid_Pvt_Data, Pid_Records, Pid_Wpt_Data, Pid_Xfer_Cmplt
 
Constructor Summary
WaypointDataPacket(GarminPacket p)
           
WaypointDataPacket(int[] p)
          Throws a PacketNotRecognizedException if the Waypoint-dataformat is not implemented.
 
Method Summary
 PositionRadians getLatitude()
          This method returns the latitude of the waypoint.
 PositionRadians getLongitude()
          This method returns the longitude of the waypoint.
 java.lang.String getName()
          This method returns the name of the waypoint.
static void setDatatypeVersion(int v)
          Sets which version of the packet that this class should treat.
 
Methods inherited from class dk.itu.haas.GPS.Garmin.GarminPacket
calcChecksum, createBasicPacket, createCommandPacket, getByte, getDataLength, getID, getLength, getPacket, getRawPacket, idToString, isLegal, readByte, readDouble, readFloat, readLong, readNullTerminatedString, readWord, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

datatypeversion

protected static int datatypeversion
Holds information about which waypoint-format this Garmin-unit uses. The default is 108.


wpt_class

protected short wpt_class
Class of waypoint.


color

protected short color
Color of waypoint when displayed on the GPS.


dspl

protected short dspl
Display options.


attr

protected short attr
Attributes.


smbl

protected int smbl
Waypoint symbol.


subclass

protected short[] subclass
Subclass of waypoint


lat

protected PositionDegrees lat
Latitude of waypoint.


lon

protected PositionDegrees lon
Longitude of waypoint.


alt

protected float alt
Altitude.


depth

protected float depth
Depth.


dist

protected float dist
Proximity distance in meters.


state

protected char[] state
State.


cc

protected char[] cc
Country code.


name

protected java.lang.String name
Waypoint name.


comment

protected java.lang.String comment
Waypoint comment.


facility

protected java.lang.String facility
facility name.


city

protected java.lang.String city
City name.


address

protected java.lang.String address
Address number


cross_road

protected java.lang.String cross_road
Intersecting road label.

Constructor Detail

WaypointDataPacket

public WaypointDataPacket(int[] p)
Throws a PacketNotRecognizedException if the Waypoint-dataformat is not implemented.


WaypointDataPacket

public WaypointDataPacket(GarminPacket p)
Method Detail

setDatatypeVersion

public static void setDatatypeVersion(int v)
Sets which version of the packet that this class should treat.
Note: Setting this value will affect all instances of the class.


getLatitude

public PositionRadians getLatitude()
This method returns the latitude of the waypoint.

Specified by:
getLatitude in interface IPosition

getLongitude

public PositionRadians getLongitude()
This method returns the longitude of the waypoint.

Specified by:
getLongitude in interface IPosition

getName

public java.lang.String getName()
This method returns the name of the waypoint.

Specified by:
getName in interface IWaypoint