jwo.landserf.process.gps.garmin
Class TimeDataPacket

java.lang.Object
  extended byjwo.landserf.process.gps.garmin.GarminPacket
      extended byjwo.landserf.process.gps.garmin.TimeDataPacket
All Implemented Interfaces:
GPSDate, GPSTime

public class TimeDataPacket
extends GarminPacket
implements GPSTime, GPSDate

Represents a Garmin date-time packet used for timestamping records.

Version:
2.2, 24th June, 2004
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
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_Almanac_Data, Pid_Command_Data, Pid_Date_Time_Data, 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_Trk_Data, Pid_Trk_Hdr, Pid_Wpt_Data, Pid_Xfer_Cmplt
 
Constructor Summary
TimeDataPacket(GarminPacket packet)
          Creates a time data packet from the given packet data.
TimeDataPacket(int[] packet)
          Creates a time data packet from the given data.
 
Method Summary
 short getDay()
          Reports the day of the month.
 short getHours()
          Reports the hour of the day.
 short getMinutes()
          Reports the minutes of the hour.
 short getMonth()
          Reports the month.
 short getSeconds()
          Reports the seconds of the minute.
 int getYear()
          Reports the year.
 String toString()
          Reports a textual representation of this packet.
 
Methods inherited from class jwo.landserf.process.gps.garmin.GarminPacket
calcChecksum, commandToString, createBasicPacket, createCommandPacket, getByte, getDataLength, getID, getLength, getPacket, getRawPacket, idToString, isLegal, readByte, readDouble, readFloat, readLong, readNullTerminatedString, readWord, setPacket
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimeDataPacket

public TimeDataPacket(int[] packet)
Creates a time data packet from the given data.

Parameters:
packet - Data representing the time data packet.
Throws:
PacketNotRecognizedException - if the data do not represent a time data packet.
InvalidPacketException - if the packet data are not the expected length.

TimeDataPacket

public TimeDataPacket(GarminPacket packet)
Creates a time data packet from the given packet data.

Parameters:
packet - Packet to copy.
Throws:
PacketNotRecognizedException - if the given packet is not a time data packet.
Method Detail

getDay

public short getDay()
Reports the day of the month.

Specified by:
getDay in interface GPSDate
Returns:
Timestamp day (1-31).

getMonth

public short getMonth()
Reports the month.

Specified by:
getMonth in interface GPSDate
Returns:
Timestamp month (1-12).

getYear

public int getYear()
Reports the year.

Specified by:
getYear in interface GPSDate
Returns:
Timestamp year.

getHours

public short getHours()
Reports the hour of the day.

Specified by:
getHours in interface GPSTime
Returns:
Timestamp hour (0-23).

getMinutes

public short getMinutes()
Reports the minutes of the hour.

Specified by:
getMinutes in interface GPSTime
Returns:
Timestamp minutes (0-59).

getSeconds

public short getSeconds()
Reports the seconds of the minute.

Specified by:
getSeconds in interface GPSTime
Returns:
Timestamp seconds (0-59).

toString

public String toString()
Reports a textual representation of this packet.

Overrides:
toString in class GarminPacket
Returns:
String containing the position in a human readable format.


Copyright Jo Wood, 1996-2005, last modified, 11th March, 2005