org.placelab.spotter
Class StreamGPSSpotter
java.lang.Object
org.placelab.spotter.AbstractSpotter
org.placelab.spotter.NMEAGPSSpotter
org.placelab.spotter.StreamGPSSpotter
- All Implemented Interfaces:
- Spotter
- Direct Known Subclasses:
- SerialJ9GPSSpotter
- public abstract class StreamGPSSpotter
- extends NMEAGPSSpotter
An NMEAGPSSpotter that provides default implementations for almost
everything. All you need to provide is input and output streams
to talk to the gps unit.
|
Method Summary |
void |
close()
Unloads resources used by the spotter. |
void |
open(java.io.InputStream in,
java.io.OutputStream out)
|
void |
sendASentence(java.lang.String sentence)
Send a sentence, complete with checksum, to the gps device. |
protected void |
startScanningImpl()
Begin collecting and processing sentences from the gps device,
handing them off to the NMEAGPSSpotter.lineAvailable(String) method
as they are read in. |
protected void |
stopScanningImpl()
Stop collecting sentences from the gps device |
| Methods inherited from class org.placelab.spotter.AbstractSpotter |
addListener, notifyEndOfScan, notifyEndOfScan, notifyGotException, notifyGotException, notifyGotMeasurement, notifyGotMeasurement, removeListener, scanOnce, scanOnce, waitForThread |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.placelab.spotter.Spotter |
open |
StreamGPSSpotter
public StreamGPSSpotter()
open
public void open(java.io.InputStream in,
java.io.OutputStream out)
throws SpotterException
- Throws:
SpotterException
close
public void close()
throws SpotterException
- Description copied from interface:
Spotter
- Unloads resources used by the spotter. Multiple calls to close are ok.
- Throws:
SpotterException
startScanningImpl
protected void startScanningImpl()
- Description copied from class:
NMEAGPSSpotter
- Begin collecting and processing sentences from the gps device,
handing them off to the
NMEAGPSSpotter.lineAvailable(String) method
as they are read in.
- Specified by:
startScanningImpl in class NMEAGPSSpotter
stopScanningImpl
protected void stopScanningImpl()
- Description copied from class:
NMEAGPSSpotter
- Stop collecting sentences from the gps device
- Specified by:
stopScanningImpl in class NMEAGPSSpotter
sendASentence
public void sendASentence(java.lang.String sentence)
- Description copied from class:
NMEAGPSSpotter
- Send a sentence, complete with checksum, to the gps device.
Neither newline nor carraige return should be included.
- Specified by:
sendASentence in class NMEAGPSSpotter