|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.placelab.stumbler.SpotterExtension
| Field Summary | |
static long |
GPS_STALE_TIME
|
| Constructor Summary | |
SpotterExtension(Spotter spotter,
boolean isQuick,
long staleTimeMillis)
|
|
| Method Summary | |
void |
addListener(SpotterListener listener)
Adds a SpotterListener to be called back whenever new Measurements are generated by the Spotter. |
void |
close()
Unloads resources used by the spotter. |
Measurement |
getLatestMeasurement()
|
Measurement |
getMeasurement()
A blocking call to get a new Measurement. |
Spotter |
getSpotter()
|
void |
gotMeasurement(Spotter sender,
Measurement m)
|
boolean |
isScanning()
|
void |
open()
Load resources used by the spotter. |
void |
removeListener(SpotterListener listener)
|
void |
scanOnce()
Performs a single background scan for Measurements and returns the result to registered SpotterListeners' SpotterListener.gotMeasurement(Spotter, Measurement) method. |
void |
scanOnce(EventSystem evs)
Like scanOnce() but instead uses the given EventSystem to deliver the
callback to hide the background thread from the application. |
void |
spotterExceptionThrown(Spotter s,
SpotterException ex)
|
void |
startScanning()
Start scanning for Measurements in the background and return the Measurements by notifying SpotterListeners with the SpotterListener.gotMeasurement(Spotter, Measurement) method. |
void |
startScanning(EventSystem evs)
Start scanning for Measurements. |
void |
stopScanning()
Stops a currently running background scan started from either scanOnce or startScanning. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static long GPS_STALE_TIME
| Constructor Detail |
public SpotterExtension(Spotter spotter,
boolean isQuick,
long staleTimeMillis)
| Method Detail |
public Spotter getSpotter()
public void open()
throws SpotterException
Spotter
open in interface SpotterSpotterException - if the necessary hardware or software for this spotter
is not present
public void close()
throws SpotterException
Spotter
close in interface SpotterSpotterException
public Measurement getLatestMeasurement()
throws SpotterException
SpotterException
public Measurement getMeasurement()
throws SpotterException
Spotter
getMeasurement in interface SpotterSpotterExceptionpublic void startScanning()
SpotterSpotterListener.gotMeasurement(Spotter, Measurement) method.
Depending on the Spotter implementation this
may start up a new background thread. Callbacks to the SpotterListener are
not guaranteed to (and probably won't) be in the the same thread as
startScanning was called in.
startScanning in interface SpotterSpotter.startScanning(EventSystem)public void startScanning(EventSystem evs)
Spotter
startScanning in interface SpotterSpotter.startScanning()public boolean isScanning()
public void stopScanning()
Spotter
stopScanning in interface Spotterpublic void scanOnce()
SpotterSpotterListener.gotMeasurement(Spotter, Measurement) method.
This may start a new thread and deliver the callback in that new thread.
Registered SpotterListeners that also implement the ScanOnceListener interface
will also receive ScanOnceListener.endOfScan(Spotter) notifications.
scanOnce in interface SpotterSpotter.scanOnce(EventSystem)public void scanOnce(EventSystem evs)
SpotterSpotter.scanOnce() but instead uses the given EventSystem to deliver the
callback to hide the background thread from the application.
scanOnce in interface Spotterpublic void addListener(SpotterListener listener)
Spotter
addListener in interface Spotterpublic void removeListener(SpotterListener listener)
removeListener in interface Spotter
public void gotMeasurement(Spotter sender,
Measurement m)
gotMeasurement in interface SpotterListener
public void spotterExceptionThrown(Spotter s,
SpotterException ex)
spotterExceptionThrown in interface SpotterListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||