ESenseDevice class
A connected device configuration for an eSense earable used in a StudyProtocol.
Add it to a protocol with StudyProtocol.addConnectedDevice and use it as
the target device of tasks with eSense measures. At runtime it is handled
by an ESenseDeviceManager. It is optional by default.
From the eSense User Documentation:
Both the left and right earbud have a microphone onboard. The microphone can be used to record audio samples as well as input source for phone or VoIP calls.
There is no need for special configuration to use the microphone on the earbud. Once the earbud is paired (Bluetooth Classic interface), the host device will recognize the earbud as a new input source. The audio recorded is mono, only from the earbud paired with the host device. The same happens for calls, only the speaker and microphone on the earbud paired with the host will be used during an active call.
Either the right or left earbud (but not both) can be paired with a host device. If the left earbud is paired, the same host device can also connect to the BLE interface of the earbud to collect IMU data at the same time as audio is recorded from its microphone. The earbuds are limited devices and the achievable data rate of the sensors (microphone and IMU) might be affected by the number of operations performed. For example, if the IMU and the microphone are enabled on the same earbud while the user is also listening to music, it might not be possible to achieve the desired data rate and the music might be interrupted. In this situation it would be better to use the right earbud to record only sound samples and the left earbud to record only IMU data.
- Inheritance
-
- Object
- Serializable
- DeviceConfiguration<
BLEDeviceRegistration> - CamsDevice<
BLEDeviceRegistration> - BLEDevice<
BLEDeviceRegistration> - ESenseDevice
- Annotations
-
- @JsonSerializable.new(fieldRename: FieldRename.none, includeIfNull: false)
Constructors
- ESenseDevice({String roleName = ESenseDevice.DEFAULT_ROLE_NAME, bool? isOptional = true, int samplingRate = 10})
- Creates an ESenseDevice configuration.
-
ESenseDevice.fromJson(Map<
String, dynamic> json) -
factory
Properties
- $type ↔ String?
-
The type name written to
__typein JSON; set tojsonTypeon creation.getter/setter pairinherited - allowDuplicates ↔ bool
-
Whether to receive repeated scan results for the same device.
Useful for RSSI updates. Default is
true.getter/setter pairinherited - dataTypeSamplingSchemes → DataTypeSamplingSchemeMap?
-
Sampling schemes for all the sensors available on this device.
no setterinherited
-
defaultSamplingConfiguration
↔ Map<
String, SamplingConfiguration> ? -
Sampling configurations which override the default configurations for
data types available on this device, mapped by data type.
getter/setter pairinherited
- fromJsonFunction → Function
-
The generated function that converts a JSON map to an object of this type.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- isOptional ↔ bool?
-
Determines whether device registration for this device is optional prior to
starting a study, i.e., whether the study can run without this device or not.
getter/setter pairinherited
- jsonType → String
-
The
__typeused for JSON serialization of this class.no setterinherited - minRssi ↔ int?
-
Minimum RSSI (dBm) to accept, for example: -80.
getter/setter pairinherited
- namePrefix ↔ String?
-
Optional device name filter (substring match, case-insensitive).
Applied AFTER discovery, not at the BLE controller level.
getter/setter pairinherited
- roleName ↔ String
-
A name which describes how the device participates within the study protocol;
its 'role'. For example, 'Parent's phone' or 'Child phone'.
Must be unique within a protocol.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- samplingRate ↔ int
-
The sampling rate in Hz of getting sensor data from the device.
Defaults to 10 Hz.
getter/setter pair
-
serviceUuids
↔ List<
String> -
Advertised service UUIDs to filter for. Empty means no filter.
getter/setter pairinherited
-
supportedDataTypes
→ Set<
String> ? -
The set of data types which can be collected on this device.
no setterinherited
- timeout ↔ Duration?
-
Scan timeout. If
null, the scan has no timeout.getter/setter pairinherited - type → String
-
The device type identifier, i.e. its
jsonType.no setterinherited
Methods
-
acceptedRegistration(
DeviceRegistration registration) → DeviceRegistration -
The
registrationin the form the deployment service accepts for this device.inherited -
createRegistration(
{String? deviceId, String? deviceDisplayName}) → BLEDeviceRegistration -
Create a
DeviceRegistrationwhich can be used to configure this device for deployment.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Returns a JSON map of this object, including the
__typeproperty.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- DEFAULT_ROLE_NAME → const String
- The default role name for an eSense device.
- DEVICE_TYPE → const String
- The type of an eSense device.