de.unikassel.android.sdcframework.devices.facade
Interface SensorDeviceScanner

Package class diagram package SensorDeviceScanner
All Superinterfaces:
ObservableEventSource<Sample>, ObserverRegistration<Sample>
All Known Implementing Classes:
AbstractSensorDeviceScanner, AccelerometerDeviceScanner, AudioDeviceScanner, BluetoothDeviceScanner, ContentProviderDeviceScanner, GPSDeviceScanner, GSMDeviceScanner, GyroscopeDeviceScanner, LightDeviceScanner, MagneticFieldDeviceScanner, NetworkLocationDeviceScanner, OrientationDeviceScanner, PassiveSampleTakingDeviceScanner, PressureDeviceScanner, ProximityDeviceScanner, SampleReceivingDeviceScanner, SampleTakingDeviceScanner, TagDeviceScanner, TemperatureDeviceScanner, TimeProviderDeviceScanner, TwitterDeviceScanner, WifiDeviceScanner

public interface SensorDeviceScanner
extends ObservableEventSource<Sample>

Interface for sensor any device scanner type. A scanner is responsible to receive samples from a sensor device in the configured frequency and can be observed for the provided sensor samples.


Method Summary
 boolean enable(boolean enable, Context context)
          Does set the enabled state for the scanner.
 SensorDevice getDevice()
          Getter for the sensor device
 boolean isEnabled()
          Getter for the enabled state
 void onDestroy(Context context)
          Is called when the owner destroys this scanner
 void setDevice(SensorDevice device, Context context)
          Setter for the sensor device
 boolean start(Context context)
          Does start sampling
 boolean stop(Context context)
          Does stop sampling
 
Methods inherited from interface de.unikassel.android.sdcframework.util.facade.ObservableEventSource
hasObservers, notify
 
Methods inherited from interface de.unikassel.android.sdcframework.util.facade.ObserverRegistration
registerEventObserver, removeAllObservers, unregisterEventObserver
 

Method Detail

start

boolean start(Context context)
Does start sampling

Parameters:
context - the application context
Returns:
true if successful started, false otherwise

stop

boolean stop(Context context)
Does stop sampling

Parameters:
context - the application context
Returns:
true if successful started, false otherwise

enable

boolean enable(boolean enable,
               Context context)
Does set the enabled state for the scanner. Will invoke call to start() or stop() depending on current running state.

Parameters:
enable - enabled state for the scanner to set
context - the application context
Returns:
true if successful enabled, false otherwise

isEnabled

boolean isEnabled()
Getter for the enabled state

Returns:
true if scanner is running, false otherwise

setDevice

void setDevice(SensorDevice device,
               Context context)
Setter for the sensor device

Parameters:
device - the sensor device to set
context - the application context

getDevice

SensorDevice getDevice()
Getter for the sensor device

Returns:
the sensor device

onDestroy

void onDestroy(Context context)
Is called when the owner destroys this scanner

Parameters:
context - the application context