DeploymentReference
A reference to one primary device in a study deployment in CAWS.
Obtained from CarpDeploymentService.deployment. It remembers the study deployment ID, the device role name, and the latest status and deployment it fetched. Following the CARP Core deployment sub-system, a client calls, in order:
- getStatus - get the study deployment status of this deployment.
- registerDevice - register this device in this deployment.
- get - get the deployment for this primary device.
- deployed - report the deployment as deployed.
- unRegisterDevice - unregister this device if no longer used.
final reference = CarpDeploymentService().deployment(studyDeploymentId);
await reference.registerDevice();
final deployment = await reference.get();
await reference.deployed();
- Inheritance
-
- Object
- CarpReference
- RPCCarpReference
- DeploymentReference
Properties
deployment
The deployment for this primary device, once fetched by get. Returns null if the deployment is not yet known.
deviceRoleName
The role name of the primary device in this deployment.
registeredDeviceId
A unique id for this device.
Uses the phone's unique hardware id, if available. Otherwise uses a v4 UUID. Note that registerDevice does not use this value; it uses the device ID from DeviceInfoService directly.
rpcEndpointUri
The URL for the deployment endpoint.
{{PROTOCOL}}://{{SERVER_HOST}}:{{SERVER_PORT}}/api/deployment-service
status
The latest known deployment status for this primary device fetched from CAWS. Returns null if status is not yet known.
studyDeploymentId
The CARP study deployment ID.
Methods
deployed
Marks this deployment as deployed in CAWS.
Call get first; the deployment timestamp is sent to CAWS. Returns the updated study deployment status if successful. Throws a CarpServiceException if not.
get
Downloads the deployment for this primary device and stores it in deployment.
Fetches status first if it is not yet known. The PrimaryDeviceDeployment from CAWS is returned as a SmartphoneDeployment.
getStatus
Fetches the deployment status from CAWS and stores it in status.
registerDevice
- DeviceRegistration? registration
Registers this device as deviceRoleName with registration for this deployment in CAWS.
If registration is null, a DefaultDeviceRegistration is created from DeviceInfoService.
Returns the updated study deployment status if the registration is successful. Throws a CarpServiceException if not.
unRegisterDevice
Unregisters deviceRoleName for this deployment in CAWS.
Returns the updated study deployment status if successful. Throws a CarpServiceException if not.