org.placelab.midp
Class GSMSpotter

java.lang.Object
  extended byorg.placelab.spotter.AbstractSpotter
      extended byorg.placelab.spotter.SyncSpotter
          extended byorg.placelab.midp.GSMSpotter
All Implemented Interfaces:
Spotter

public class GSMSpotter
extends SyncSpotter

This spotter polls a localhost server running on the phone. This is a synchronous spotter that makes a blocking read request to the server, returning when the read completes. NEW: The GSMSpotter now supports operation in the emulator by using log files that were uploaded by the StumbleUploadProxy placed inside the jar to get the Measurements. The build.xml helps here by only placing those log files in the jar when the do-emulate target is selected.


Constructor Summary
GSMSpotter()
          Construct a GSMSpotter with default scan time of 1 second
GSMSpotter(long intervalMillis)
          Construct a GSMSpotter
 
Method Summary
 void close()
          Unloads resources used by the spotter.
protected  Measurement getMeasurementImpl()
          Collects and returns a single Measurement.
protected  long nextScanInterval()
          Returns the scan interval for polling the native server
 void open()
          Load resources used by the spotter.
 
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
 

Constructor Detail

GSMSpotter

public GSMSpotter()
Construct a GSMSpotter with default scan time of 1 second


GSMSpotter

public GSMSpotter(long intervalMillis)
Construct a GSMSpotter

Parameters:
intervalMillis - time between scans
Method Detail

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

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

nextScanInterval

protected long nextScanInterval()
Returns the scan interval for polling the native server

Specified by:
nextScanInterval in class SyncSpotter
Returns:
nextScanInterval