|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjwo.landserf.process.gps.GPS
jwo.landserf.process.gps.garmin.GarminGPS
public class GarminGPS
Handles the link with a Garmin GPS unit (e.g. eTrex, Geko, Edge, StreetPilot).
| Field Summary | |
|---|---|
protected boolean |
active
|
protected StringBuffer |
description
|
protected Vector |
garminListeners
|
protected StringBuffer |
shortDescription
|
| Fields inherited from class jwo.landserf.process.gps.GPS |
|---|
gpsListeners, routeListeners, SERIAL, trackListeners, transferListeners, USB, waypointListeners |
| Constructor Summary | |
|---|---|
GarminGPS(BufferedInputStream iStream,
BufferedOutputStream oStream)
Creates a link with a Garmin GPS attached using the serial protocol. |
|
GarminGPS(GarminUSB usbDevice)
Creates a link with a Garmin GPS attached using the USB protocol. |
|
| Method Summary | |
|---|---|
void |
addGarminListener(GarminListener listener)
Adds the given GarminListener to receive all packets sent from the GPS. |
protected void |
distribute(GarminPacket packet)
Identifies the type of packet received, and distributes it to the correct listeners. |
protected void |
fireGarminPacket(GarminPacket packet)
Transmits the given packet to all registered GarminListeners |
int |
getConnectionType()
Reports the type of connection used by the GPS. |
String |
getDescription()
Returns a description of the Garmin GPS indicating the software version and the protocols supported. |
String |
getShortDescription()
Returns a short description of the Garmin GPS indicating the make and software version used. |
void |
removeGarminListener(GarminListener listener)
Removes the specified GarminListener from the list of listeners. |
void |
requestDate()
Makes a request for the date from the GPS. |
void |
requestPosition()
Makes a request for the position to be sent from the GPS. |
void |
requestRoutes()
Asks the GPS to transmit all the routes in its memory. |
void |
requestTime()
Makes a request for the time from the GPS. |
void |
requestTracks()
Asks the GPS to transmit all the tracks in its memory. |
void |
requestWaypoints()
Asks the GPS to transmit all the waypoints in its memory. |
void |
run()
Starts listening for input from the GPS as a threaded process. |
void |
sendWaypoints(Vector gpsWaypoints)
Sends the given collection of GPSWaypoints to the GPS. |
void |
setAutoTransmit(boolean transmit)
Asks the GPS to either start or stop transmitting data periodically. |
void |
shutdown(boolean turnOff)
Stops communication with GPS. |
| Methods inherited from class jwo.landserf.process.gps.GPS |
|---|
addGPSlistener, addRouteListener, addTrackListener, addWaypointListener, fireDateData, firePositionData, fireRouteData, fireTimeData, fireTrackData, fireTransferComplete, fireTransferStart, fireWaypointData, removeGPSListener, removeRouteListener, removeTrackListener, removeTransferListener, removeWaypointListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected StringBuffer description
protected StringBuffer shortDescription
protected boolean active
protected Vector garminListeners
| Constructor Detail |
|---|
public GarminGPS(GarminUSB usbDevice)
GarminUSB object.
usbDevice - Provides interface to the GPS via USB.
public GarminGPS(BufferedInputStream iStream,
BufferedOutputStream oStream)
iStream - Input stream connecting to GPS via a serial port.oStream - Output stream connecting to GPS via a serial port.| Method Detail |
|---|
public int getConnectionType()
USB or SERIAL.
getConnectionType in class GPSpublic void addGarminListener(GarminListener listener)
listener - Listener to add to those that will be broadcast.public void removeGarminListener(GarminListener listener)
listener - Listener to remove.protected void fireGarminPacket(GarminPacket packet)
packet - Packet to transmit.public void run()
run in interface Runnableprotected void distribute(GarminPacket packet)
packet - Packet received.public void requestPosition()
requestPosition in class GPSpublic void requestTime()
requestTime in class GPSpublic void requestDate()
requestDate in class GPSpublic void requestWaypoints()
requestWaypoints in class GPSpublic void requestTracks()
requestTracks in class GPSpublic void requestRoutes()
requestRoutes in class GPSpublic void sendWaypoints(Vector gpsWaypoints)
sendWaypoints in class GPSgpsWaypoints - Collection of waypoints. Each item in the collection should
be a WaypointDataPacket object.public void setAutoTransmit(boolean transmit)
setAutoTransmit in class GPStransmit - Start transmitting if true, otherwise stop transmitting.public void shutdown(boolean turnOff)
shutdown in class GPSturnOff - Turn of GPS unit if true, otherwise just stop listening.public String getDescription()
getDescription in class GPSpublic String getShortDescription()
getShortDescription in class GPS
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||