org.placelab.spotter
Class SerialGPSSpotter

java.lang.Object
  extended byorg.placelab.spotter.AbstractSpotter
      extended byorg.placelab.spotter.NMEAGPSSpotter
          extended byorg.placelab.spotter.SerialGPSSpotter
All Implemented Interfaces:
Spotter

public class SerialGPSSpotter
extends NMEAGPSSpotter

The SerialGPSSpotter uses rxtx to communicate with a serial interface gps unit.

The System property placelab.gps_device is used to specify the serial port that the gps device is connected to. placelab.gps_speed may be used to set a non-standard baud rate for communicating with the gps device, but be aware that the NMEA standard specifies 4800 baud and that most gps devices won't function properly at other speeds.


Constructor Summary
SerialGPSSpotter()
           
 
Method Summary
 void close()
          Unloads resources used by the spotter.
static NMEAGPSSpotter newSpotter()
           
 void open()
          Load resources used by the spotter.
 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.NMEAGPSSpotter
getMeasurement, lineAvailable, measurementAvailable, startScanning, startScanning, stopScanning
 
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
 

Constructor Detail

SerialGPSSpotter

public SerialGPSSpotter()
Method Detail

newSpotter

public static NMEAGPSSpotter newSpotter()

open

public void open()
          throws SpotterException
Description copied from interface: Spotter
Load resources used by the spotter. Applications should be able to invoke this methods multiple times in sequence and have the "right" things happen. All Spotters should be opened before being used.

Throws:
SpotterException - if the necessary hardware or software for this spotter is not present

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