org.placelab.spotter
Class BluetoothSpotter

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

public class BluetoothSpotter
extends AsyncSpotter
implements PeriodicScannable

Spotter for Bluetooth on systems with JSR-82 support.


Constructor Summary
BluetoothSpotter()
           
BluetoothSpotter(long intervalMillis, boolean filterPhones)
           
 
Method Summary
protected  void cancelScan()
          Stops the scan that was started in startOneScan(EventSystem)
 void close()
          Unloads resources used by the spotter.
protected  Measurement getMeasurementImpl()
          Collect Measurements with a blocking implementation and return them.
 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.
protected  void startOneScan(EventSystem evs)
          This performs a single scan of the environment that should call AbstractSpotter.notifyGotMeasurement(EventSystem, Measurement) upon collecting the Measurement.
 
Methods inherited from class org.placelab.spotter.AsyncSpotter
errorInBackgroundThreadAndThreadDeath, getMeasurement, scanDone, scanOnce, scanOnce, scanUsingBackgroundThread, scanUsingEventSystem, startScanning, startScanning, stopScanning
 
Methods inherited from class org.placelab.spotter.AbstractSpotter
addListener, notifyEndOfScan, notifyEndOfScan, notifyGotException, notifyGotException, notifyGotMeasurement, notifyGotMeasurement, removeListener, waitForThread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BluetoothSpotter

public BluetoothSpotter()

BluetoothSpotter

public BluetoothSpotter(long intervalMillis,
                        boolean filterPhones)
Method Detail

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()
Description copied from interface: Spotter
Unloads resources used by the spotter. Multiple calls to close are ok.

Specified by:
close in interface Spotter

nextScanInterval

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

startOneScan

protected void startOneScan(EventSystem evs)
Description copied from class: AsyncSpotter
This performs a single scan of the environment that should call AbstractSpotter.notifyGotMeasurement(EventSystem, Measurement) upon collecting the Measurement.

Specified by:
startOneScan in class AsyncSpotter
Parameters:
evs - the EventSystem to pass through to notifyGotMeasurement

cancelScan

protected void cancelScan()
Description copied from class: AsyncSpotter
Stops the scan that was started in AsyncSpotter.startOneScan(EventSystem)

Specified by:
cancelScan in class AsyncSpotter

getMeasurementImpl

protected Measurement getMeasurementImpl()
                                  throws SpotterException
Description copied from class: AsyncSpotter
Collect Measurements with a blocking implementation and return them.

Specified by:
getMeasurementImpl in class AsyncSpotter
Throws:
SpotterException