jwo.landserf.process.gps.garmin
Class GarminPacket

java.lang.Object
  extended by jwo.landserf.process.gps.garmin.GarminPacket
Direct Known Subclasses:
PositionDataPacket, ProductDataPacket, ProtocolDataPacket, PVTDataPacket, RecordsPacket, RouteDataPacket, RouteHeaderPacket, TimeDataPacket, TrackDataPacket, TransferCompletedPacket, WaypointDataPacket

public class GarminPacket
extends Object

Represents a packet of information sent to or from Garmin GPS. See Garmin Protocol Specification at www.garmin.com/support/commProtocol.html.

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

Field Summary
static int APPLICATION_LAYER
          Indicates an application layer packet (USB packets only).
static int Cmnd_Abort_Transfer
          Indicates A010 device command protocol id representing request to abort transfer.
static int Cmnd_FlightBook_Transfer
          Indicates A010 device command protocol id representing request to transfer flight records.
static int Cmnd_Start_Pvt_Data
          Indicates A010 device command protocol id representing request to start transmitting PVT (Position, velocity, time) data.
static int Cmnd_Stop_Pvt_Data
          Indicates A010 device command protocol id representing request to stop transmitting PVT (Position, velocity, time) data.
static int Cmnd_Transfer_Alm
          Indicates A010 device command protocol id representing request to transfer almanac.
static int Cmnd_Transfer_Course_Laps
          Indicates A010 device command protocol id representing request to transfer fitness course laps.
static int Cmnd_Transfer_Course_Limits
          Indicates A010 device command protocol id representing request to transfer fitness course limits.
static int Cmnd_Transfer_Course_Points
          Indicates A010 device command protocol id representing request to transfer fitness course points.
static int Cmnd_Transfer_Course_Tracks
          Indicates A010 device command protocol id representing request to transfer fitness course tracks.
static int Cmnd_Transfer_Courses
          Indicates A010 device command protocol id representing request to transfer fitness courses.
static int Cmnd_Transfer_Fitness_User_Profile
          Indicates A010 device command protocol id representing request to transfer fitness user profile.
static int Cmnd_Transfer_Laps
          Indicates A010 device command protocol id representing request to transfer fitness laps.
static int Cmnd_Transfer_Posn
          Indicates A010 device command protocol id representing request to transfer position.
static int Cmnd_Transfer_Prx
          Indicates A010 device command protocol id representing request to transfer proximity waypoints.
static int Cmnd_Transfer_Rte
          Indicates A010 device command protocol id representing request to rtansfer routes.
static int Cmnd_Transfer_Runs
          Indicates A010 device command protocol id representing request to transfer fitness runs.
static int Cmnd_Transfer_Time
          Indicates A010 device command protocol id representing request to transfer time data.
static int Cmnd_Transfer_Trk
          Indicates A010 device command protocol id representing request to transfer track log.
static int Cmnd_Transfer_Workout_Limits
          Indicates A010 device command protocol id representing request to transfer workout limits.
static int Cmnd_Transfer_Workout_Occurrences
          Indicates A010 device command protocol id representing request to transfer workout occurrences.
static int Cmnd_Transfer_Workouts
          Indicates A010 device command protocol id representing request to transfer workouts.
static int Cmnd_Transfer_Wpt
          Indicates A010 device command protocol id representing request to transfer waypoints.
static int Cmnd_Transfer_Wpt_Cats
          Indicates A010 device command protocol id representing request to transfer waypoint categories.
static int Cmnd_Turn_Off_Pwr
          Indicates A010 device command protocol id representing request to turn off power.
static int DLE
          Data link escape.
static int ETX
          End of text.
static int Pid_Ack_Byte
          Indicates successful serial transfer of a packet .
static int Pid_Almanac_Data
          Indicates L001 id representing almanac data.
static int Pid_Command_Data
          Indicates L001 id representing command data.
static int Pid_Course
          Indicates L001 id representing a course item.
static int Pid_Course_CourseLimits
          Indicates L001 id representing course limits.
static int Pid_Course_Lap
          Indicates L001 id representing a course lap item.
static int Pid_Course_Point
          Indicates L001 id representing a course point.
static int Pid_Course_Trk_Data
          Indicates L001 id representing course track data.
static int Pid_Course_Trk_Hdr
          Indicates L001 id representing a course track header.
static int Pid_Data_Available
          Indicates data are available for transfer.
static int Pid_Date_Time_Data
          Indicates L001 id representing date-time data.
static int Pid_Ext_Product_Data
          Indicates a basic packet containing extended product data.
static int Pid_Fitness_User_Profile
          Indicates L001 id representing a fitness profile item.
static int Pid_FlightBook_Record
          Indicates L001 id representing a flightbook record.
static int Pid_Lap
          Indicates L001 id representing a lap data item.
static int Pid_Nak_Byte
          Indicates a failed transfer of a serial packet.
static int Pid_Position_Data
          Indicates L001 id representing position data.
static int Pid_Product_Data
          Indicates a basic packet containing product data.
static int Pid_Product_Rqst
          Indicates a basic packet requesting device product information.
static int Pid_Protocol_Array
          Indicates a basic packet containing protocol availability.
static int Pid_Prx_Wpt_Data
          Indicates L001 id representing proximity waypoint data.
static int Pid_Pvt_Data
          Indicates L001 id representing position, velocity, time data.
static int Pid_Records
          Indicates L001 id representing record data.
static int Pid_Rte_Hdr
          Indicates L001 id representing route header.
static int Pid_Rte_Link_Data
          Indicates L001 id representing route link data.
static int Pid_Rte_Wpt_Data
          Indicates L001 id representing route waypoint data.
static int Pid_Run
          Indicates L001 id representing run data item.
static int Pid_Session_Started
          Indicates that a transfer session has started.
static int Pid_Start_Session
          Indicates the start of a GPS transfer session.
static int Pid_Trk_Data
          Indicates L001 id representing track data.
static int Pid_Trk_Hdr
          Indicates L001 id representing track header.
static int Pid_Workout
          Indicates L001 id representing a workout data item
static int Pid_Workout_Limits
          Indicates L001 id representing workout limits item (heart rate, climb etc.).
static int Pid_WorkoutOccurrence
          Indicates L001 id representing a workout occurrence item.
static int Pid_Wpt_Cat
          Indicates L001 id representing waypoint category item.
static int Pid_Wpt_Data
          Indicates L001 id representing waypoint data.
static int Pid_Xfer_Cmplt
          Indicates L001 id representing completed transfer.
static float UNKNOWN_FLOAT
          Indicates an an unsupported or unknown floating point value.
static int USB_PROTOCOL_LAYER
          Indicates a USB protocol layer packet (USB packets only).
 
Constructor Summary
GarminPacket(int connectionType)
          Creates an empty packet.
GarminPacket(int connectionType, int[] packetBytes)
          Creates a new GarminPacket with the given contents.
GarminPacket(int connectionType, int packetType, int packetID, int[] packetData)
          Creates a new GarminPacket with the given contents.
 
Method Summary
static String commandToString(int command)
          Reports the name of the given command ID.
static GarminPacket createBasicPacket(int connectionType, int basicType, int[] data)
          Factory method to create an instance of a basic packets from L000 (basic link protocol).
static GarminPacket createCommandPacket(int connectionType, int commandType)
          Factory method to create an instance of a command packet from A010 (Device Command Protocol 1).
 int getChecksum()
          Reports the checksum value currently stored in packet.
 int getConnectionType()
          Reports the connection type associated with the packet.
 int[] getData()
          Reports the packet data.
 int getDataLength()
          Reports the number of bytes in the data field of this packet.
 int getID()
          Reports the packet ID.
 String getRawPacketData()
          Reports a text representation of the bytes in the packet data.
 int getType()
          Reports the packet type.
static String idToString(int id)
          Reports the name of the given packet ID.
protected  short readDataByte(int pos)
          Reads a single byte in the packet and returns it as a short.
protected  double readDataDouble(int pos)
          Reads a Garmin 8-byte double value from the packet.
protected  float readDataFloat(int pos)
          Reads a Garmin 4-byte float value from the packet.
protected  int readDataLong(int pos)
          Reads a Garmin 4-byte word in the packet and returns it as an int.
protected  String readDataString(int pos)
          Reads a null-terminated string at the given offset in the packet.
protected  int readDataWord(int pos)
          Reads a Garmin 2-byte word from the data field of the packet and returns it as an integer.
 void setPacket(int packetType, int packetID, int[] packetData)
          Sets the packet contents to the given given content.
 void setSerialPacket(int[] packetBytes)
          Sets the packet contents based on the given serial content.
 String toString()
          Reports a summary of the packet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

Pid_Data_Available

public static final int Pid_Data_Available
Indicates data are available for transfer.

See Also:
Constant Field Values

Pid_Start_Session

public static final int Pid_Start_Session
Indicates the start of a GPS transfer session.

See Also:
Constant Field Values

Pid_Session_Started

public static final int Pid_Session_Started
Indicates that a transfer session has started.

See Also:
Constant Field Values

Pid_Ack_Byte

public static final int Pid_Ack_Byte
Indicates successful serial transfer of a packet .

See Also:
Constant Field Values

Pid_Nak_Byte

public static final int Pid_Nak_Byte
Indicates a failed transfer of a serial packet.

See Also:
Constant Field Values

Pid_Ext_Product_Data

public static final int Pid_Ext_Product_Data
Indicates a basic packet containing extended product data.

See Also:
Constant Field Values

Pid_Protocol_Array

public static final int Pid_Protocol_Array
Indicates a basic packet containing protocol availability.

See Also:
Constant Field Values

Pid_Product_Rqst

public static final int Pid_Product_Rqst
Indicates a basic packet requesting device product information.

See Also:
Constant Field Values

Pid_Product_Data

public static final int Pid_Product_Data
Indicates a basic packet containing product data.

See Also:
Constant Field Values

Pid_Command_Data

public static final int Pid_Command_Data
Indicates L001 id representing command data.

See Also:
Constant Field Values

Pid_Xfer_Cmplt

public static final int Pid_Xfer_Cmplt
Indicates L001 id representing completed transfer.

See Also:
Constant Field Values

Pid_Date_Time_Data

public static final int Pid_Date_Time_Data
Indicates L001 id representing date-time data.

See Also:
Constant Field Values

Pid_Position_Data

public static final int Pid_Position_Data
Indicates L001 id representing position data.

See Also:
Constant Field Values

Pid_Prx_Wpt_Data

public static final int Pid_Prx_Wpt_Data
Indicates L001 id representing proximity waypoint data.

See Also:
Constant Field Values

Pid_Records

public static final int Pid_Records
Indicates L001 id representing record data.

See Also:
Constant Field Values

Pid_Rte_Hdr

public static final int Pid_Rte_Hdr
Indicates L001 id representing route header.

See Also:
Constant Field Values

Pid_Rte_Wpt_Data

public static final int Pid_Rte_Wpt_Data
Indicates L001 id representing route waypoint data.

See Also:
Constant Field Values

Pid_Almanac_Data

public static final int Pid_Almanac_Data
Indicates L001 id representing almanac data.

See Also:
Constant Field Values

Pid_Trk_Data

public static final int Pid_Trk_Data
Indicates L001 id representing track data.

See Also:
Constant Field Values

Pid_Wpt_Data

public static final int Pid_Wpt_Data
Indicates L001 id representing waypoint data.

See Also:
Constant Field Values

Pid_Pvt_Data

public static final int Pid_Pvt_Data
Indicates L001 id representing position, velocity, time data.

See Also:
Constant Field Values

Pid_Rte_Link_Data

public static final int Pid_Rte_Link_Data
Indicates L001 id representing route link data.

See Also:
Constant Field Values

Pid_Trk_Hdr

public static final int Pid_Trk_Hdr
Indicates L001 id representing track header.

See Also:
Constant Field Values

Pid_FlightBook_Record

public static final int Pid_FlightBook_Record
Indicates L001 id representing a flightbook record.

See Also:
Constant Field Values

Pid_Lap

public static final int Pid_Lap
Indicates L001 id representing a lap data item.

See Also:
Constant Field Values

Pid_Wpt_Cat

public static final int Pid_Wpt_Cat
Indicates L001 id representing waypoint category item.

See Also:
Constant Field Values

Pid_Run

public static final int Pid_Run
Indicates L001 id representing run data item.

See Also:
Constant Field Values

Pid_Workout

public static final int Pid_Workout
Indicates L001 id representing a workout data item

See Also:
Constant Field Values

Pid_WorkoutOccurrence

public static final int Pid_WorkoutOccurrence
Indicates L001 id representing a workout occurrence item.

See Also:
Constant Field Values

Pid_Fitness_User_Profile

public static final int Pid_Fitness_User_Profile
Indicates L001 id representing a fitness profile item.

See Also:
Constant Field Values

Pid_Workout_Limits

public static final int Pid_Workout_Limits
Indicates L001 id representing workout limits item (heart rate, climb etc.).

See Also:
Constant Field Values

Pid_Course

public static final int Pid_Course
Indicates L001 id representing a course item.

See Also:
Constant Field Values

Pid_Course_Lap

public static final int Pid_Course_Lap
Indicates L001 id representing a course lap item.

See Also:
Constant Field Values

Pid_Course_Point

public static final int Pid_Course_Point
Indicates L001 id representing a course point.

See Also:
Constant Field Values

Pid_Course_Trk_Hdr

public static final int Pid_Course_Trk_Hdr
Indicates L001 id representing a course track header.

See Also:
Constant Field Values

Pid_Course_Trk_Data

public static final int Pid_Course_Trk_Data
Indicates L001 id representing course track data.

See Also:
Constant Field Values

Pid_Course_CourseLimits

public static final int Pid_Course_CourseLimits
Indicates L001 id representing course limits.

See Also:
Constant Field Values

Cmnd_Abort_Transfer

public static final int Cmnd_Abort_Transfer
Indicates A010 device command protocol id representing request to abort transfer.

See Also:
Constant Field Values

Cmnd_Transfer_Alm

public static final int Cmnd_Transfer_Alm
Indicates A010 device command protocol id representing request to transfer almanac.

See Also:
Constant Field Values

Cmnd_Transfer_Posn

public static final int Cmnd_Transfer_Posn
Indicates A010 device command protocol id representing request to transfer position.

See Also:
Constant Field Values

Cmnd_Transfer_Prx

public static final int Cmnd_Transfer_Prx
Indicates A010 device command protocol id representing request to transfer proximity waypoints.

See Also:
Constant Field Values

Cmnd_Transfer_Rte

public static final int Cmnd_Transfer_Rte
Indicates A010 device command protocol id representing request to rtansfer routes.

See Also:
Constant Field Values

Cmnd_Transfer_Time

public static final int Cmnd_Transfer_Time
Indicates A010 device command protocol id representing request to transfer time data.

See Also:
Constant Field Values

Cmnd_Transfer_Trk

public static final int Cmnd_Transfer_Trk
Indicates A010 device command protocol id representing request to transfer track log.

See Also:
Constant Field Values

Cmnd_Transfer_Wpt

public static final int Cmnd_Transfer_Wpt
Indicates A010 device command protocol id representing request to transfer waypoints.

See Also:
Constant Field Values

Cmnd_Turn_Off_Pwr

public static final int Cmnd_Turn_Off_Pwr
Indicates A010 device command protocol id representing request to turn off power.

See Also:
Constant Field Values

Cmnd_Start_Pvt_Data

public static final int Cmnd_Start_Pvt_Data
Indicates A010 device command protocol id representing request to start transmitting PVT (Position, velocity, time) data.

See Also:
Constant Field Values

Cmnd_Stop_Pvt_Data

public static final int Cmnd_Stop_Pvt_Data
Indicates A010 device command protocol id representing request to stop transmitting PVT (Position, velocity, time) data.

See Also:
Constant Field Values

Cmnd_FlightBook_Transfer

public static final int Cmnd_FlightBook_Transfer
Indicates A010 device command protocol id representing request to transfer flight records.

See Also:
Constant Field Values

Cmnd_Transfer_Laps

public static final int Cmnd_Transfer_Laps
Indicates A010 device command protocol id representing request to transfer fitness laps.

See Also:
Constant Field Values

Cmnd_Transfer_Wpt_Cats

public static final int Cmnd_Transfer_Wpt_Cats
Indicates A010 device command protocol id representing request to transfer waypoint categories.

See Also:
Constant Field Values

Cmnd_Transfer_Runs

public static final int Cmnd_Transfer_Runs
Indicates A010 device command protocol id representing request to transfer fitness runs.

See Also:
Constant Field Values

Cmnd_Transfer_Workouts

public static final int Cmnd_Transfer_Workouts
Indicates A010 device command protocol id representing request to transfer workouts.

See Also:
Constant Field Values

Cmnd_Transfer_Workout_Occurrences

public static final int Cmnd_Transfer_Workout_Occurrences
Indicates A010 device command protocol id representing request to transfer workout occurrences.

See Also:
Constant Field Values

Cmnd_Transfer_Fitness_User_Profile

public static final int Cmnd_Transfer_Fitness_User_Profile
Indicates A010 device command protocol id representing request to transfer fitness user profile.

See Also:
Constant Field Values

Cmnd_Transfer_Workout_Limits

public static final int Cmnd_Transfer_Workout_Limits
Indicates A010 device command protocol id representing request to transfer workout limits.

See Also:
Constant Field Values

Cmnd_Transfer_Courses

public static final int Cmnd_Transfer_Courses
Indicates A010 device command protocol id representing request to transfer fitness courses.

See Also:
Constant Field Values

Cmnd_Transfer_Course_Laps

public static final int Cmnd_Transfer_Course_Laps
Indicates A010 device command protocol id representing request to transfer fitness course laps.

See Also:
Constant Field Values

Cmnd_Transfer_Course_Points

public static final int Cmnd_Transfer_Course_Points
Indicates A010 device command protocol id representing request to transfer fitness course points.

See Also:
Constant Field Values

Cmnd_Transfer_Course_Tracks

public static final int Cmnd_Transfer_Course_Tracks
Indicates A010 device command protocol id representing request to transfer fitness course tracks.

See Also:
Constant Field Values

Cmnd_Transfer_Course_Limits

public static final int Cmnd_Transfer_Course_Limits
Indicates A010 device command protocol id representing request to transfer fitness course limits.

See Also:
Constant Field Values

DLE

public static final int DLE
Data link escape. Packet boundary for serial transfer.

See Also:
Constant Field Values

ETX

public static final int ETX
End of text. Packet boundary for serial transfer.

See Also:
Constant Field Values

USB_PROTOCOL_LAYER

public static final int USB_PROTOCOL_LAYER
Indicates a USB protocol layer packet (USB packets only).

See Also:
Constant Field Values

APPLICATION_LAYER

public static final int APPLICATION_LAYER
Indicates an application layer packet (USB packets only).

See Also:
Constant Field Values

UNKNOWN_FLOAT

public static final float UNKNOWN_FLOAT
Indicates an an unsupported or unknown floating point value.

See Also:
Constant Field Values
Constructor Detail

GarminPacket

public GarminPacket(int connectionType)
Creates an empty packet. Is not normally called directly, but allows subclasses to create their own constructor.

Parameters:
connectionType - Type of connection used to transfer packet. Either GarminGPS.USB or GarminGPS.SERIAL.

GarminPacket

public GarminPacket(int connectionType,
                    int[] packetBytes)
Creates a new GarminPacket with the given contents.

Parameters:
connectionType - Type of connection used to transfer packet. Either GarminGPS.USB or GarminGPS.SERIAL.
packetBytes - Contents to be placed in packet.
Throws:
InvalidPacketException - if packet is malformed.

GarminPacket

public GarminPacket(int connectionType,
                    int packetType,
                    int packetID,
                    int[] packetData)
Creates a new GarminPacket with the given contents.

Parameters:
connectionType - Type of connection used to transfer packet. Either GarminGPS.USB or GarminGPS.SERIAL.
packetType - Type of Garmin packet (applies to USB packets only and should be one of USB_PROTOCOL_LAYER or APPLICATION_LAYER).
packetID - Packet ID.
packetData - Packet data.
Throws:
InvalidPacketException - if packet is malformed.
Method Detail

setPacket

public void setPacket(int packetType,
                      int packetID,
                      int[] packetData)
Sets the packet contents to the given given content.

Parameters:
packetType - Type of Garmin packet (applies to USB packets only and should be one of USB_PROTOCOL_LAYER or APPLICATION_LAYER).
packetID - Packet ID.
packetData - Packet data.
Throws:
InvalidPacketException - if packet is malformed.

setSerialPacket

public void setSerialPacket(int[] packetBytes)
Sets the packet contents based on the given serial content. Note that this method assumes entire packet is represented in the array, not just the packet data field.

Parameters:
packetBytes - Bytes representing entire serial packet.
Throws:
InvalidPacketException - if packet is malformed.

getConnectionType

public int getConnectionType()
Reports the connection type associated with the packet. Should be one of GarminGPS.USB or GarminGPS.SERIAL.

Returns:
Type connection associated with packet.

getType

public int getType()
Reports the packet type. This only applies to USB packets and should be one of USB_PROTOCOL_LAYER or APPLICATION_LAYER.

Returns:
Type of packet.

getID

public int getID()
Reports the packet ID. See www.garmin.com/support/commProtocol.html for details of possible IDs.

Returns:
ID of packet.

getChecksum

public int getChecksum()
Reports the checksum value currently stored in packet. This is only used by Serial packets.

Returns:
Checksum value stored in serial packet or 0 if USB packet.

getData

public int[] getData()
Reports the packet data. Excludes the packet header and footer metadata.

Returns:
Packet data.

getDataLength

public int getDataLength()
Reports the number of bytes in the data field of this packet.

Returns:
Size of data field in packet.

readDataWord

protected int readDataWord(int pos)
Reads a Garmin 2-byte word from the data field of the packet and returns it as an integer. This method can be used to read both ints and words from a Garmin packet.

Parameters:
pos - Offset position in packet data field.
Returns:
Word at the given offset.

readDataLong

protected int readDataLong(int pos)
Reads a Garmin 4-byte word in the packet and returns it as an int.

Parameters:
pos - Offset position in packet data field.
Returns:
Long value at the given offset.

readDataByte

protected short readDataByte(int pos)
Reads a single byte in the packet and returns it as a short.

Parameters:
pos - Offset position in packet data field.
Returns:
Byte value at the given offset.

readDataFloat

protected float readDataFloat(int pos)
Reads a Garmin 4-byte float value from the packet.

Parameters:
pos - Offset position in packet data field.
Returns:
Float value at the given offset.

readDataDouble

protected double readDataDouble(int pos)
Reads a Garmin 8-byte double value from the packet.

Parameters:
pos - Offset position in packet data field.
Returns:
Double value at the given offset.

readDataString

protected String readDataString(int pos)
Reads a null-terminated string at the given offset in the packet.

Parameters:
pos - Offset position in packet data field.
Returns:
String found at given offset.

getRawPacketData

public String getRawPacketData()
Reports a text representation of the bytes in the packet data. Used for debugging purposes only.

Returns:
text representation of the packet.

createCommandPacket

public static GarminPacket createCommandPacket(int connectionType,
                                               int commandType)
Factory method to create an instance of a command packet from A010 (Device Command Protocol 1). type can be one of the following constants:
  • Cmnd_Turn_Off_Pwr
  • Cmnd_Transfer_Posn
  • Cmnd_Transfer_Time
  • Cmnd_Abort_Transfer
  • Cmnd_Transfer_Alm
  • Cmnd_Transfer_Prx
  • Cmnd_Transfer_Rte
  • Cmnd_Transfer_Trk
  • Cmnd_Transfer_Wpt
  • Cmnd_Start_Pvt_Data
  • Cmnd_Stop_Pvt_Data

Parameters:
connectionType - Type of connection used to transfer packet. Either GarminGPS.USB or GarminGPS.SERIAL.
commandType - Type of command to create.
Returns:
A Garmin packet of the given type or null if type not recognised.

createBasicPacket

public static GarminPacket createBasicPacket(int connectionType,
                                             int basicType,
                                             int[] data)
Factory method to create an instance of a basic packets from L000 (basic link protocol). type should be one of the following constants:
  • Pid_Ack_Byte
  • Pid_Nak_Byte
  • Pid_Protocol_Array
  • Pid_Product_Rqst
  • Pid_Product_Data

Parameters:
connectionType - Type of connection used to transfer packet. Either GarminGPS.USB or GarminGPS.SERIAL.
basicType - Type of basic packet to create.
data - Data that will be put in the data field of the packet.
Returns:
A Garmin packet of the given type or null if type not recognised.

toString

public String toString()
Reports a summary of the packet.

Overrides:
toString in class Object
Returns:
Text representation of the type of packet.

idToString

public static String idToString(int id)
Reports the name of the given packet ID.

Parameters:
id - ID to translate.
Returns:
Name of the given ID.

commandToString

public static String commandToString(int command)
Reports the name of the given command ID.

Parameters:
command - Command ID to translate.
Returns:
Name of the given command ID.


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