|
||||||||||
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
Handles the link with a Garmin GPS unit (e.g. etrex, Geko, 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, trackListeners, transferListeners, waypointListeners |
Constructor Summary | |
GarminGPS(BufferedInputStream i,
BufferedOutputStream o)
Creates a link with a Garmin GPS. |
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 |
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(BufferedInputStream i, BufferedOutputStream o)
i
- Input stream connecting to GPS.o
- Output stream connecting to GPS.Method Detail |
public 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 Runnable
protected void distribute(GarminPacket packet)
packet
- Packet recieved.public void requestPosition()
requestPosition
in class GPS
public void requestTime()
requestTime
in class GPS
public void requestDate()
requestDate
in class GPS
public void requestWaypoints()
requestWaypoints
in class GPS
public void requestTracks()
requestTracks
in class GPS
public void requestRoutes()
requestRoutes
in class GPS
public void sendWaypoints(Vector gpsWaypoints)
sendWaypoints
in class GPS
gpsWaypoints
- Collection of waypoints. Each item in the collection should
be a WaypointDataPacket object.public void setAutoTransmit(boolean transmit)
setAutoTransmit
in class GPS
transmit
- Start transmitting if true, otherwise stop transmitting.public void shutdown(boolean turnOff)
shutdown
in class GPS
turnOff
- Turn of GPS unit if true, otherwise just stop listening.public String getDescription()
getDescription
in class GPS
public String getShortDescription()
getShortDescription
in class GPS
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |