SmartphoneDeployment
Everything a smartphone needs to run its part of a study deployment.
A deployment is the protocol made concrete for one primary device: its devices, tasks, triggers, and task controls, plus the CAMS fields from SmartphoneProtocolExtension (study description, data endpoint, privacy schema). It is created by the deployment service, e.g. SmartphoneDeploymentService or CAWS, and stored in SmartphoneStudy.deployment.
Key points:
- deployed and status track the deployment on this phone.
- measures lists all measures of all tasks.
- Serializable, and can read deployments from CAMS 1.x.
See also SmartphoneDeploymentExecutor, which runs it.
- Inheritance
-
- Object
- PrimaryDeviceDeployment
- SmartphoneDeployment
- Mixed-in types
- Annotations
-
- @JsonSerializable(includeIfNull: false, explicitToJson: true)
Constructors
SmartphoneDeployment.fromJson
SmartphoneDeployment.fromPrimaryDeviceDeployment
- String? studyId,
- String? studyDeploymentId,
- required PrimaryDeviceDeployment deployment,
Creates a SmartphoneDeployment from a carp_core PrimaryDeviceDeployment.
Reads the CAMS fields from the application data of deployment if it was made from a CAMS protocol. Used when a deployment is downloaded from CAWS.
SmartphoneDeployment.fromPrimaryDeviceDeploymentAndSmartphoneStudyProtocol
- String? studyId,
- String? studyDeploymentId,
- required PrimaryDeviceDeployment deployment,
- required SmartphoneStudyProtocol protocol,
Creates a SmartphoneDeployment that combines a PrimaryDeviceDeployment and a SmartphoneStudyProtocol.
It takes the deployment information from the deployment (such as device configuration, device registration, and what devices are connected) and takes the data collection configuration from the protocol (such as task, triggers, task controls, and expected participant data).
SmartphoneDeployment.fromSmartphoneStudyProtocol
- String? studyId,
- String? studyDeploymentId,
- required String primaryDeviceRoleName,
- required SmartphoneStudyProtocol protocol,
Creates a SmartphoneDeployment based on a SmartphoneStudyProtocol.
Maps the protocol 1:1 to the deployment, using a Smartphone with primaryDeviceRoleName as the primary device and a DefaultDeviceRegistration.
SmartphoneDeployment
- String? studyId,
- String? studyDeploymentId,
- required PrimaryDeviceConfiguration<
DeviceRegistration> deviceConfiguration, - required DeviceRegistration registration,
- Set<
DeviceConfiguration< connectedDevices = const {},DeviceRegistration> > - Map<
String, DeviceRegistration?> connectedDeviceRegistrations = const {}, - Set<
TaskConfiguration> tasks = const {}, - Map<
String, TriggerConfiguration> triggers = const {}, - Set<
TaskControl> taskControls = const {}, - Set<
ExpectedParticipantData> expectedParticipantData = const {}, - StudyDescription? studyDescription,
- DataEndPoint? dataEndPoint,
- String? privacySchemaName,
Creates a new SmartphoneDeployment.
studyDeploymentId is a unique id for this deployment. If not specified, a unique id is generated.
Properties
deployed
The timestamp (in UTC) when this deployment was deployed on this smartphone.
deviceRoleName
The role name of this smartphone device.
devices
All devices this deployment is using.
This set combines the primary deviceConfiguration with all connectedDevices.
measures
All measures of all tasks in this deployment.
status
- @JsonKey(fromJson: _statusFromJson)
The status of this study deployment. Default is StudyDeploymentStatusTypes.Invited.
studyDeploymentId
The unique id of this study deployment.
studyId
The unique id of the study that this deployment is part of.
null if this is a local deployment running only on this phone.
Methods
getDeviceFromRoleName
- String roleName
The primary or connected device with roleName, or null if not found.
toJson
toString
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.