get method

Future<SmartphoneDeployment> get()

Get the deployment for this DeploymentReference for the specified studyDeploymentId.

Implementation

Future<SmartphoneDeployment> get() async {
  if (status == null) await getStatus();

  // downloading a PrimaryDeviceDeployment
  var downloaded =
      PrimaryDeviceDeployment.fromJson(await _rpc(GetDeviceDeploymentFor(
    studyDeploymentId,
    status!.primaryDeviceStatus!.device.roleName,
  )));

  // converting it to a SmartphoneDeployment and saving it
  return _deployment = SmartphoneDeployment.fromPrimaryDeviceDeployment(
    studyId: CarpService().app.studyId,
    studyDeploymentId: studyDeploymentId,
    deployment: downloaded,
  );
}