Class BluetoothSensor
- java.lang.Object
-
- eu.h2020.helios_social.core.sensor.Sensor
-
- eu.h2020.helios_social.core.sensor.ext.BluetoothSensor
-
public class BluetoothSensor extends Sensor
This class provides an implementation of sensor API for discovering bluetooth devices. BluetoothSensor is a subclass of the abstract base class Sensor. It uses Android BluetoothAdapter API.
-
-
Constructor Summary
Constructors Constructor Description BluetoothSensor(android.content.ContextWrapper appEnv)
Creates a BluetoothSensorBluetoothSensor(java.lang.String id, android.content.ContextWrapper appEnv)
Creates a BluetoothSensor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isBluetoothEnabled()
Checks if Bluetooth LE enabledvoid
startDiscovery()
Starts discovering bluetooth devicesvoid
startUpdates()
Starts receiving sensor data valuesvoid
stopUpdates()
Stops receiving sensor data values-
Methods inherited from class eu.h2020.helios_social.core.sensor.Sensor
finalize, getId, getSensorById, getValueListeners, receiveValue, registerValueListener, unregisterValueListener
-
-
-
-
Constructor Detail
-
BluetoothSensor
public BluetoothSensor(java.lang.String id, android.content.ContextWrapper appEnv)
Creates a BluetoothSensor- Parameters:
appEnv
- the application env
-
BluetoothSensor
public BluetoothSensor(android.content.ContextWrapper appEnv)
Creates a BluetoothSensor- Parameters:
appEnv
- the application env
-
-
Method Detail
-
startUpdates
public void startUpdates()
Description copied from class:Sensor
Starts receiving sensor data values- Specified by:
startUpdates
in classSensor
-
stopUpdates
public void stopUpdates()
Description copied from class:Sensor
Stops receiving sensor data values- Specified by:
stopUpdates
in classSensor
-
startDiscovery
public void startDiscovery()
Starts discovering bluetooth devices
-
isBluetoothEnabled
public boolean isBluetoothEnabled()
Checks if Bluetooth LE enabled- Returns:
- boolean
-
-