de.unikassel.android.sdcframework.devices
Class BluetoothDeviceScanner

Package class diagram package BluetoothDeviceScanner
java.lang.Object
  extended by de.unikassel.android.sdcframework.util.ObservableEventSourceImpl<Sample>
      extended by de.unikassel.android.sdcframework.devices.AbstractSensorDeviceScanner
          extended by de.unikassel.android.sdcframework.devices.SampleReceivingDeviceScanner
              extended by de.unikassel.android.sdcframework.devices.BluetoothDeviceScanner
All Implemented Interfaces:
SensorDeviceScanner, ObservableEventSource<Sample>, ObserverRegistration<Sample>

public class BluetoothDeviceScanner
extends SampleReceivingDeviceScanner

Implementation of the bluetooth sensor device scanner.


Field Summary
private  BluetoothAdapter bluetoothAdapter
          The bluetooth adapter
 
Fields inherited from class de.unikassel.android.sdcframework.devices.SampleReceivingDeviceScanner
lastScanFinished, receiver, worker
 
Constructor Summary
BluetoothDeviceScanner()
          Constructor
 
Method Summary
 void doHandleScanResults(Intent intent)
          Handler for the device scan results
 boolean doStartDeviceScan()
          Method to start a device scan
 void doStopDeviceScan()
          Method to stop a device scan which is called if scanner is stopped while a scan is ongoing
protected  IntentFilter getIntentFilter()
          Getter for intent filter used by the broadcast receiver
protected  boolean isCompatibleDevice(SensorDevice device)
          Validation method for a compatible device type
 void onDestroy(Context context)
          Is called when the owner destroys this scanner
 
Methods inherited from class de.unikassel.android.sdcframework.devices.SampleReceivingDeviceScanner
isLastScanFinished, setLastScanFinished, start, stop
 
Methods inherited from class de.unikassel.android.sdcframework.devices.AbstractSensorDeviceScanner
enable, getDevice, isActive, isEnabled, setActive, setDevice
 
Methods inherited from class de.unikassel.android.sdcframework.util.ObservableEventSourceImpl
getObservers, hasObservers, notify, onObserverRegistration, onObserverUnregistration, registerEventObserver, removeAllObservers, unregisterEventObserver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
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
 

Field Detail

bluetoothAdapter

private final BluetoothAdapter bluetoothAdapter
The bluetooth adapter

Constructor Detail

BluetoothDeviceScanner

public BluetoothDeviceScanner()
Constructor

Method Detail

isCompatibleDevice

protected boolean isCompatibleDevice(SensorDevice device)
Description copied from class: AbstractSensorDeviceScanner
Validation method for a compatible device type

Specified by:
isCompatibleDevice in class AbstractSensorDeviceScanner
Parameters:
device - the device to test for compatibility

getIntentFilter

protected IntentFilter getIntentFilter()
Description copied from class: SampleReceivingDeviceScanner
Getter for intent filter used by the broadcast receiver

Specified by:
getIntentFilter in class SampleReceivingDeviceScanner
Returns:
the intent filter used by the broadcast receiver

doHandleScanResults

public void doHandleScanResults(Intent intent)
Description copied from class: SampleReceivingDeviceScanner
Handler for the device scan results

Specified by:
doHandleScanResults in class SampleReceivingDeviceScanner
Parameters:
intent - the broadcast intent to handle

doStartDeviceScan

public boolean doStartDeviceScan()
Description copied from class: SampleReceivingDeviceScanner
Method to start a device scan

Specified by:
doStartDeviceScan in class SampleReceivingDeviceScanner
Returns:
true if successful, false otherwise

doStopDeviceScan

public void doStopDeviceScan()
Description copied from class: SampleReceivingDeviceScanner
Method to stop a device scan which is called if scanner is stopped while a scan is ongoing

Specified by:
doStopDeviceScan in class SampleReceivingDeviceScanner

onDestroy

public void onDestroy(Context context)
Description copied from interface: SensorDeviceScanner
Is called when the owner destroys this scanner

Specified by:
onDestroy in interface SensorDeviceScanner
Overrides:
onDestroy in class SampleReceivingDeviceScanner
Parameters:
context - the application context