Skip to content

ESenseDevice

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
Annotations

Constructors

ESenseDevice.fromJson

ESenseDevice.fromJson(
  1. Map<String, dynamic> json
)

ESenseDevice

ESenseDevice({
  1. String roleName = ESenseDevice.DEFAULT_ROLE_NAME,
  2. bool? isOptional = true,
  3. int samplingRate = 10,
})

Creates an ESenseDevice configuration.

Constants

DEFAULT_ROLE_NAME

String const DEFAULT_ROLE_NAME

The default role name for an eSense device.

DEVICE_TYPE

String const DEVICE_TYPE

The type of an eSense device.

Properties

fromJsonFunction

Function get fromJsonFunction
override

The function which can convert a JSON string to an object of this type.

samplingRate

int samplingRate
getter/setter pair

The sampling rate in Hz of getting sensor data from the device. Defaults to 10 Hz.

Methods

toJson

Map<String, dynamic> toJson()
override

Return a JSON encoding of this object.