unregisterDevice method
Unregister the device with the specified deviceRoleName
for the study
deployment with studyDeploymentId
.
Implementation
@override
Future<StudyDeploymentStatus> unregisterDevice(
String studyDeploymentId,
String deviceRoleName,
) async {
StudyDeployment deployment = _repository[studyDeploymentId]!;
DeviceDescriptor device = deployment.registeredDevices.keys
.firstWhere((descriptor) => descriptor.roleName == deviceRoleName);
deployment.unregisterDevice(device);
return deployment.status;
}