Skip to content

MovesenseDevice

A Movesense sensor used as a connected device in a protocol.

Add it with SmartphoneStudyProtocol.addConnectedDevice and use it as the target device of tasks with Movesense measures (see MovesenseSamplingPackage). At runtime it is handled by a MovesenseDeviceManager and registered with a MovesenseDeviceRegistration.

Key points:

  • Optional by default (isOptional is true), so a study can start without it.
  • namePrefix defaults to "Movesense", so a BLE scan only shows Movesense devices.
Inheritance
Annotations

Constructors

MovesenseDevice.fromJson

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

MovesenseDevice

MovesenseDevice({
  1. String roleName = MovesenseDevice.DEFAULT_ROLE_NAME,
  2. bool? isOptional = true,
  3. String? namePrefix = 'Movesense',
})

Constants

DEFAULT_ROLE_NAME

String const DEFAULT_ROLE_NAME

The default role name of a Movesense device in a protocol.

DEVICE_TYPE

String const DEVICE_TYPE

The device type of a Movesense device.

Properties

fromJsonFunction

Function get fromJsonFunction
override

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

Methods

toJson

Map<String, dynamic> toJson()
override

Return a JSON encoding of this object.