ESenseDevice class
A DeviceDescriptor
for an eSense device used in a StudyProtocol
.
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 recognise 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
- DeviceDescriptor
- ESenseDevice
- Annotations
-
- @JsonSerializable(fieldRename: FieldRename.none, includeIfNull: false)
Constructors
- ESenseDevice.new({String roleName = ESenseDevice.DEFAULT_ROLENAME, String? deviceName, int? samplingRate})
-
ESenseDevice.fromJson(Map<
String, dynamic> json) -
factory
Properties
- $type ↔ String?
-
The runtime class name (type) of this object.
Used for deserialization from JSON objects.
getter/setter pairinherited
- deviceName ↔ String?
-
The name of the eSense device.
Used for connecting to the eSense hardware device over BTLE.
eSense devices are typically named
eSense-xxxx
.getter/setter pair - fromJsonFunction → Function
-
The function which can convert a JSON string to an object of this type.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- isMasterDevice ↔ bool?
-
Is this the master device?
getter/setter pairinherited
- jsonType → String
-
Return the
__type
to be used for JSON serialization of this class. Default is runtimeType. Only specify this if you need another type.no setterinherited - roleName ↔ String
-
The role name of this device in a specific
StudyProtocol
. For example, 'Parent's phone' or 'Child phone'.getter/setter pairinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
samplingConfiguration
↔ Map<
String, SamplingConfiguration> -
Sampling configurations for data types available on this device which
override the default configuration.
getter/setter pairinherited
- samplingRate ↔ int?
-
The sampling rate in Hz of getting sensor data from the device.
getter/setter pair
-
supportedDataTypes
↔ List<
String> ? -
The set of data types which can be collected on this device.
getter/setter pairinherited
- type → String
-
The device type identifier
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Return a JSON encoding of this object.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- DEFAULT_ROLENAME → const String
- The default rolename for a eSense device.
- DEVICE_TYPE → const String
- The type of a eSense device.