org.placelab.spotter
Class RemoteGSMSpotter
java.lang.Object
org.placelab.spotter.AbstractSpotter
org.placelab.spotter.SyncSpotter
org.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.
|
Constructor Summary |
RemoteGSMSpotter(java.lang.String bluetoothAddress,
boolean bufferMeasurements)
|
| 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 |
bluetoothAddress
protected java.lang.String bluetoothAddress
connectionURL
protected java.lang.String connectionURL
scanInterval
protected long scanInterval
RemoteGSMSpotter
public RemoteGSMSpotter(java.lang.String bluetoothAddress,
boolean bufferMeasurements)
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