Skip to content

PrimaryDeviceDeployment

Everything a single primary device needs to run its part of a study.

Created by a StudyDeployment (via DeploymentService.getDeviceDeploymentFor) from the StudyProtocol. It holds the device's own configuration and registration, its connected devices, and the tasks, triggers and task controls it must run. A client stores it in Study.deployment and runs it.

Key points:

CARP Mobile Sensing extends it as SmartphoneDeployment.

Mixed-in types
Annotations

Constructors

PrimaryDeviceDeployment.fromJson

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

PrimaryDeviceDeployment

PrimaryDeviceDeployment({
  1. required PrimaryDeviceConfiguration<DeviceRegistration> deviceConfiguration,
  2. required DeviceRegistration registration,
  3. Set<DeviceConfiguration<DeviceRegistration>> connectedDevices = const {},
  4. Map<String, DeviceRegistration?> connectedDeviceRegistrations = const {},
  5. Set<TaskConfiguration> tasks = const {},
  6. Map<String, TriggerConfiguration> triggers = const {},
  7. Set<TaskControl> taskControls = const {},
  8. Set<ExpectedParticipantData> expectedParticipantData = const {},
})

Properties

applicationData

Map<String, dynamic>? applicationData
getter/setter pair

Application-specific data to be stored as part of a study deployment.

This can be used by infrastructures or concrete applications which require exchanging additional data between the protocols and clients subsystems, outside of scope or not yet supported by CARP core.

connectedDeviceRegistrations

Map<String, DeviceRegistration?> connectedDeviceRegistrations
getter/setter pair

Preregistration of connected devices, including information such as connection properties, stored per role name.

connectedDevices

Set<DeviceConfiguration<DeviceRegistration>> connectedDevices
getter/setter pair

The devices this device needs to connect to.

deviceConfiguration

PrimaryDeviceConfiguration<DeviceRegistration> deviceConfiguration
getter/setter pair

The configuration for the primary device this deployment is intended for.

expectedDataStreams

Set<ExpectedDataStream> get expectedDataStreams

The set of expected data streams from this device deployment.

Computed once from taskControls and cached.

expectedParticipantData

Set<ExpectedParticipantData> expectedParticipantData
getter/setter pair

Expected data about participants in the deployment to be input by users.

lastUpdatedOn

DateTime get lastUpdatedOn

The time when this device deployment was last updated. This corresponds to the most recent device registration as part of this device deployment.

registration

DeviceRegistration registration
getter/setter pair

Registration for this primary device.

taskControls

Set<TaskControl> taskControls
getter/setter pair

The specification of tasks triggered and the devices they are sent to.

tasks

Set<TaskConfiguration> tasks
getter/setter pair

All tasks which should be able to be executed on this or connected devices.

triggers

Map<String, TriggerConfiguration> triggers
getter/setter pair

All triggers originating from this device and connected devices, stored per assigned id unique within the study protocol.

Methods

getTaskByName

TaskConfiguration? getTaskByName(
  1. String name
)

Get the task based on its task name in this deployment; null if not found.

hasBeenUpdated

void hasBeenUpdated()

Notify listeners that this deployment has been updated.

toJson

Map<String, dynamic> toJson()

toString

String toString()
override

A string representation of this object.

Some classes have a default textual representation, often paired with a static parse function (like int.parse). These classes will provide the textual representation as their string representation.

Other classes have no meaningful textual representation that a program will care about. Such classes will typically override toString to provide useful information when inspecting the object, mainly for debugging or logging.