Skip to content

PrimaryDeviceConfiguration

A device which aggregates, synchronizes, and optionally uploads incoming data received from one or more connected devices (potentially just itself).

Add one with StudyProtocol.addPrimaryDevice; a protocol needs at least one before it can be deployed. In CARP Mobile Sensing this is the phone (Smartphone). Each primary device receives its own PrimaryDeviceDeployment. The constructor sets isOptional to false.

Inheritance
Implementers
Annotations

Constructors

PrimaryDeviceConfiguration.fromJson

PrimaryDeviceConfiguration<TRegistration extends DeviceRegistration>.fromJson(
  1. Map<String, dynamic> json
)

PrimaryDeviceConfiguration

PrimaryDeviceConfiguration<TRegistration extends DeviceRegistration>({
  1. required String roleName,
})

Properties

atStartOfStudy

TriggerConfiguration get atStartOfStudy

A new trigger which fires immediately at the start of a study deployment on this device.

fromJsonFunction

Function get fromJsonFunction
override

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

isPrimaryDevice

bool isPrimaryDevice
getter/setter pair

Defaults to true. Only here for (de)serialization: for unknown device types, the JSON tells whether to treat them as primary devices.

Methods

toJson

Map<String, dynamic> toJson()
override

Return a JSON encoding of this object.