org.placelab.spotter
Class RemoteGSMSpotter

java.lang.Object
  extended byorg.placelab.spotter.AbstractSpotter
      extended byorg.placelab.spotter.SyncSpotter
          extended byorg.placelab.spotter.RemoteGSMSpotter
All Implemented Interfaces:
PeriodicScannable, Spotter

public class RemoteGSMSpotter
extends SyncSpotter
implements PeriodicScannable

This spotter talkes via bluetooth to read GSM readings from a 60 Series Bluetooth phone. The phone must be running the 'BTGSM' Midlet which creates the GSM sharing service. Other than the remoteness, this spotters behaves as expected. The phone is capable of buffering up to 60 seconds of GSM readings. This spotter can be created to either pull over all of the buffered readings, or just the latest reading. In the case that all readings are pulled over, repeated calls to getMeasurement will empty the buffer.


Field Summary
protected  java.lang.String bluetoothAddress
           
protected  java.lang.String connectionURL
           
protected  long scanInterval
           
 
Constructor Summary
RemoteGSMSpotter(java.lang.String bluetoothAddress, boolean bufferMeasurements)
           
 
Method Summary
 void close()
          Unloads resources used by the spotter.
protected  Measurement getMeasurementImpl()
          Collects and returns a single Measurement.
 long getPeriodicScanInterval()
           
protected  long nextScanInterval()
           
 void open()
          Load resources used by the spotter.
 void setPeriodicScanInterval(long intervalMillis)
          Sets the minimum amount of time between SpotterListener.gotMeasurement(Spotter, Measurement) callbacks to listeners.
 
Methods inherited from class org.placelab.spotter.SyncSpotter
errorInBackgroundThreadAndThreadDeath, getMeasurement, scanUsingBackgroundThread, scanUsingEventSystem, 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
 

Field Detail

bluetoothAddress

protected java.lang.String bluetoothAddress

connectionURL

protected java.lang.String connectionURL

scanInterval

protected long scanInterval
Constructor Detail

RemoteGSMSpotter

public RemoteGSMSpotter(java.lang.String bluetoothAddress,
                        boolean bufferMeasurements)
Method Detail

nextScanInterval

protected long nextScanInterval()
Specified by:
nextScanInterval in class SyncSpotter
Returns:
the interval that the spotter should wait before invoking the next scan

getMeasurementImpl

protected Measurement getMeasurementImpl()
                                  throws SpotterException
Description copied from class: SyncSpotter
Collects and returns a single Measurement.

Specified by:
getMeasurementImpl in class SyncSpotter
Throws:
SpotterException

setPeriodicScanInterval

public void setPeriodicScanInterval(long intervalMillis)
Description copied from interface: PeriodicScannable
Sets the minimum amount of time between SpotterListener.gotMeasurement(Spotter, Measurement) callbacks to listeners.

Specified by:
setPeriodicScanInterval in interface PeriodicScannable

getPeriodicScanInterval

public long getPeriodicScanInterval()
Specified by:
getPeriodicScanInterval in interface PeriodicScannable

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.

Specified by:
open in interface Spotter
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.

Specified by:
close in interface Spotter
Throws:
SpotterException