ESenseSamplingPackage class
The sampling package for the eSense earable.
Collects button and motion sensor events from an eSense earable over Bluetooth Low Energy (BLE), using the esense_flutter plugin. Works on Android and iOS and needs the ESenseDevice connected device, which is handled by an ESenseDeviceManager.
Measure types:
dk.cachet.carp.esense.button(ESENSE_BUTTON): button pressed / released events.dk.cachet.carp.esense.sensor(ESENSE_SENSOR): accelerometer and gyroscope events.
Key points:
- Both measures are event-based and need no sampling configuration.
- Creates an ESenseButtonProbe or an ESenseSensorProbe for each measure.
- Registers ESenseDevice, ESenseButton and ESenseSensor for JSON deserialization, including the CAMS 1.x device type.
Example of a protocol that collects eSense data as soon as the study starts:
final eSense = ESenseDevice(samplingRate: 10);
protocol.addConnectedDevice(eSense, phone);
protocol.addTaskControl(
ImmediateTrigger(),
BackgroundTask(measures: [
Measure(type: ESenseSamplingPackage.ESENSE_BUTTON),
Measure(type: ESenseSamplingPackage.ESENSE_SENSOR),
]),
eSense);
Register this package before running a study:
SamplingPackageRegistry().register(ESenseSamplingPackage());
Constructors
Properties
-
dataTypes
→ List<
DataTypeMetaData> -
The data types this package supports.
no setteroverride
-
deviceManager
→ DeviceManager<
DeviceConfiguration< DeviceRegistration> , DeviceRegistration> -
Get the
DeviceManagerfor the device used by this package.no setteroverride - deviceType → String
-
The type of device this package collects data from.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- samplingSchemes → DataTypeSamplingSchemeMap
-
The default sampling schemes for all dataTypes in this package.
no setteroverride
Methods
-
create(
String type) → Probe? -
Creates a new
Probeof the specifiedtype. Note thattypeshould be one of the dataTypes that this package supports. Returns null if a probe cannot be created for thetype.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onRegister(
) → void -
Called when this package is registered in the
SamplingPackageRegistry.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- ESENSE_BUTTON → const String
- Measure type for continuous collection of eSense button events (pressed/released) as ESenseButton data.
- ESENSE_NAMESPACE → const String
-
The namespace of the eSense measure types,
dk.cachet.carp.esense. - ESENSE_SENSOR → const String
- Measure type for continuous collection of eSense sensor events (accelerometer and gyroscope) as ESenseSensor data.