jwo.landserf.process.gps.garmin
Class WaypointDataPacket

java.lang.Object
  extended by jwo.landserf.process.gps.garmin.GarminPacket
      extended by jwo.landserf.process.gps.garmin.WaypointDataPacket
All Implemented Interfaces:
GPSWaypoint, Position

public class WaypointDataPacket
extends GarminPacket
implements GPSWaypoint

Represents a Garmin waypoint packet used for storing named locations. The Garmin-protocol contains a large number of different waypoint packet specifications. Currently, only the one labelled D108 is implemented.

Version:
2.3, 24th August, 2006.
Author:
Jo Wood, based on the design by Henrik Sorensen (haas@itu.dk).

Field Summary
 
Fields inherited from class jwo.landserf.process.gps.garmin.GarminPacket
APPLICATION_LAYER, Cmnd_Abort_Transfer, Cmnd_FlightBook_Transfer, Cmnd_Start_Pvt_Data, Cmnd_Stop_Pvt_Data, Cmnd_Transfer_Alm, Cmnd_Transfer_Course_Laps, Cmnd_Transfer_Course_Limits, Cmnd_Transfer_Course_Points, Cmnd_Transfer_Course_Tracks, Cmnd_Transfer_Courses, Cmnd_Transfer_Fitness_User_Profile, Cmnd_Transfer_Laps, Cmnd_Transfer_Posn, Cmnd_Transfer_Prx, Cmnd_Transfer_Rte, Cmnd_Transfer_Runs, Cmnd_Transfer_Time, Cmnd_Transfer_Trk, Cmnd_Transfer_Workout_Limits, Cmnd_Transfer_Workout_Occurrences, Cmnd_Transfer_Workouts, Cmnd_Transfer_Wpt, Cmnd_Transfer_Wpt_Cats, Cmnd_Turn_Off_Pwr, DLE, ETX, Pid_Ack_Byte, Pid_Almanac_Data, Pid_Command_Data, Pid_Course, Pid_Course_CourseLimits, Pid_Course_Lap, Pid_Course_Point, Pid_Course_Trk_Data, Pid_Course_Trk_Hdr, Pid_Data_Available, Pid_Date_Time_Data, Pid_Ext_Product_Data, Pid_Fitness_User_Profile, Pid_FlightBook_Record, 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_Rte_Hdr, Pid_Rte_Link_Data, Pid_Rte_Wpt_Data, Pid_Run, Pid_Session_Started, Pid_Start_Session, Pid_Trk_Data, Pid_Trk_Hdr, Pid_Workout, Pid_Workout_Limits, Pid_WorkoutOccurrence, Pid_Wpt_Cat, Pid_Wpt_Data, Pid_Xfer_Cmplt, UNKNOWN_FLOAT, USB_PROTOCOL_LAYER
 
Constructor Summary
WaypointDataPacket(GarminPacket packet)
          Creates a waypoint packet from the given packet.
WaypointDataPacket(int connectionType, Footprint fp, float elev, String name)
          Creates a waypoint packet from the given location and name.
 
Method Summary
 float getAltitude()
          Reports the altitude of this position.
 AngleRadians getLatitude()
          Reports the latitude of the waypoint.
 AngleRadians getLongitude()
          Reports the longitude of the waypoint.
 String getName()
          Reports the name of the waypoint.
 void setDatatypeVersion(int version)
          Sets which version of the packet that this class should represent.
 
Methods inherited from class jwo.landserf.process.gps.garmin.GarminPacket
commandToString, createBasicPacket, createCommandPacket, getChecksum, getConnectionType, getData, getDataLength, getID, getRawPacketData, getType, idToString, readDataByte, readDataDouble, readDataFloat, readDataLong, readDataString, readDataWord, setPacket, setSerialPacket, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WaypointDataPacket

public WaypointDataPacket(int connectionType,
                          Footprint fp,
                          float elev,
                          String name)
Creates a waypoint packet from the given location and name.

Parameters:
connectionType - Type of packet connection - either GarminGPS.USB or GarminGPS.SERIAL.
fp - Location of waypoint in decimal degrees longitude/latitude.
elev - Elevation of waypoint.
name - Name of waypoint (will be truncated to 6 characters).

WaypointDataPacket

public WaypointDataPacket(GarminPacket packet)
Creates a waypoint packet from the given packet.

Parameters:
packet - Packet to copy.
Throws:
PacketNotRecognisedException - if the given packet is not a waypoint packet.
Method Detail

setDatatypeVersion

public void setDatatypeVersion(int version)
Sets which version of the packet that this class should represent.

Parameters:
version - Waypoint packet version.

getLatitude

public AngleRadians getLatitude()
Reports the latitude of the waypoint.

Specified by:
getLatitude in interface Position
Returns:
Latitude in radians.

getLongitude

public AngleRadians getLongitude()
Reports the longitude of the waypoint.

Specified by:
getLongitude in interface Position
Returns:
Latitude in radians.

getAltitude

public float getAltitude()
Reports the altitude of this position.

Specified by:
getAltitude in interface Position
Returns:
Altitude of this position in units determined by the GPS. May be 0 if GPS unit does not record waypoint altitude.

getName

public String getName()
Reports the name of the waypoint.

Specified by:
getName in interface GPSWaypoint
Returns:
Name associated with the waypoint.


Copyright Jo Wood, 1996-2009, last modified, 17th April, 2009