|
|||||||||
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 communicationMethod Detail |
public void addLocationListener(LocationListener ll)
addLocationListener
in interface LocationGenerator
ll
- the new location listener.public void removeLocationListener(LocationListener ll)
removeLocationListener
in interface LocationGenerator
ll
- the location listener to remove.public void addGpsInfoListener(GpsInfoListener gps)
addGpsInfoListener
in interface LocationGenerator
gps
- the new GpsInfo listener.public void removeGpsInfoListener(GpsInfoListener gps)
removeGpsInfoListener
in interface LocationGenerator
gps
- the GpsInfo listener to remove.public void kill()
kill
in interface LocationGenerator
public LocationEvent getLocation()
getLocation
in interface LocationGenerator
public void serialEvent(javax.comm.SerialPortEvent event)
serialEvent
in interface javax.comm.SerialPortEventListener
event
- the event generated by the serial portSerialPortEventListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |