org.jscience.devices.gps.garmin
Class WaypointDataPacket

java.lang.Object
  extended by org.jscience.devices.gps.garmin.GarminPacket
      extended by org.jscience.devices.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 posn
          proximity position
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 org.jscience.devices.gps.garmin.GarminPacket
Cmnd_Abort_Transfer, Cmnd_Start_Pvt_Data, Cmnd_Stop_Pvt_Data, Cmnd_Transfer_Alm, Cmnd_Transfer_Laps, 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_Lap, Pid_Nak_Byte, Pid_Position_Data, Pid_Product_Data, Pid_Product_Rqst, Pid_Protocol_Array, Pid_Prx_Wpt_Data, Pid_Pvt_Data, Pid_Records, Pid_Trk_data, Pid_Trk_Hdr, Pid_Wpt_Data, Pid_Xfer_Cmplt, pointer
 
Constructor Summary
WaypointDataPacket(GarminPacket p)
          Creates a new WaypointDataPacket object.
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.
 java.lang.String toString()
          DOCUMENT ME!
 
Methods inherited from class org.jscience.devices.gps.garmin.GarminPacket
calcChecksum, createBasicPacket, createCommandPacket, getByte, getDataLength, getID, getLength, getPacket, getPointer, getRawPacket, idToString, isLegal, readBoolean, readBoolean, readByte, readByte, readDouble, readDouble, readFloat, readFloat, readLong, readLong, readNullTerminatedString, readNullTerminatedString, readPosition, readPosition, readWord, readWord, setPointer
 
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


posn

protected int posn
proximity position


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.

Parameters:
p - DOCUMENT ME!

WaypointDataPacket

public WaypointDataPacket(GarminPacket p)
Creates a new WaypointDataPacket object.

Parameters:
p - DOCUMENT ME!
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.

Parameters:
v - DOCUMENT ME!

getLatitude

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

Specified by:
getLatitude in interface IPosition
Returns:
DOCUMENT ME!

getLongitude

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

Specified by:
getLongitude in interface IPosition
Returns:
DOCUMENT ME!

getName

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

Specified by:
getName in interface IWaypoint
Returns:
DOCUMENT ME!

toString

public java.lang.String toString()
DOCUMENT ME!

Overrides:
toString in class GarminPacket
Returns:
DOCUMENT ME!