jwo.landserf.process.gps.garmin
Class GarminUSB

java.lang.Object
  extended by jwo.landserf.process.gps.garmin.GarminUSB

public class GarminUSB
extends Object

Provides an interface between Java and a Garmin GPS connected via USB. Uses native methods to perform the USB message passing.

Version:
2.3, 26th August, 2006.
Author:
Jo Wood

Constructor Summary
GarminUSB()
          Attempts to create a connection with a USB GPS.
 
Method Summary
 String getDeviceType()
          Reports the GPS device connected or error message if no connection made.
 GarminPacket getPacket()
          Attempts to get a packet from the USB device.
 boolean hasConnection()
          Reports whether a USB connection with the GPS has been established.
 boolean hasUSBLib()
          Reports whether the USB library necessary for a connection is present.
 boolean sendPacket(GarminPacket packet)
          Sends the given USB packet to the connected device.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GarminUSB

public GarminUSB()
Attempts to create a connection with a USB GPS. Call getProductDescription() or hasConnection() to find connection status.

Method Detail

hasUSBLib

public boolean hasUSBLib()
Reports whether the USB library necessary for a connection is present. This may depend on the platform, since the library is not available for all platforms.

Returns:
True if USB library is present or otherwise false.

hasConnection

public boolean hasConnection()
Reports whether a USB connection with the GPS has been established.

Returns:
True if USB connection with GPS device has been made.

getDeviceType

public String getDeviceType()
Reports the GPS device connected or error message if no connection made.

Returns:
Text describing connected device, or error message if not connected.

sendPacket

public boolean sendPacket(GarminPacket packet)
Sends the given USB packet to the connected device.

Parameters:
packet - Packet to send.
Returns:
True if USB packet send successfully.

getPacket

public GarminPacket getPacket()
Attempts to get a packet from the USB device.

Returns:
Packet retrieved from the device, or null if no packet expected/read.


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