|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--location.generators.RealGPSMonitor
This class monitors the GPS information provided by the Garmin GPS unit on the serial port. It uses the javax.comm package to connect to the serial port and read data from it.
| Constructor Summary | |
RealGPSMonitor(java.lang.String commName,
int baud)
The constructor sets the instance variables and sets up the serial port to be read from. |
|
| Method Summary | |
void |
addGpsInfoListener(GpsInfoListener gps)
Add a GpsInfo listener. |
void |
addLocationListener(LocationListener ll)
Add a Location listener. |
LocationEvent |
getLocation()
Returns the current location reading of the GPS receiver or null of the no reading has been received yet. |
void |
kill()
Stops this RealGPSMonitor. |
void |
removeGpsInfoListener(GpsInfoListener gps)
Remove a GpsInfo listener. |
void |
removeLocationListener(LocationListener ll)
Remove a location listener. |
void |
serialEvent(javax.comm.SerialPortEvent event)
This method implements the serialEvent(....) method required by SerialPortEventListener. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public RealGPSMonitor(java.lang.String commName,
int baud)
commName - the String name of the serial port to connect to. For
example, to connect to COM port 1, specify "COM1".baud - the baud rate of the GPS unit's communication| Method Detail |
public void addLocationListener(LocationListener ll)
addLocationListener in interface LocationGeneratorll - the new location listener.public void removeLocationListener(LocationListener ll)
removeLocationListener in interface LocationGeneratorll - the location listener to remove.public void addGpsInfoListener(GpsInfoListener gps)
addGpsInfoListener in interface LocationGeneratorgps - the new GpsInfo listener.public void removeGpsInfoListener(GpsInfoListener gps)
removeGpsInfoListener in interface LocationGeneratorgps - the GpsInfo listener to remove.public void kill()
kill in interface LocationGeneratorpublic LocationEvent getLocation()
getLocation in interface LocationGeneratorpublic void serialEvent(javax.comm.SerialPortEvent event)
serialEvent in interface javax.comm.SerialPortEventListenerevent - the event generated by the serial portSerialPortEventListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||