Skip to content

Deployment and persistence

Three services make CAMS run offline and keep its state:

  • SmartphoneDeploymentService is an in-memory DeploymentService that deploys a protocol on this phone. Use a remote one (e.g. CAWS) to deploy from a server.
  • PersistenceService keeps studies (table studies) and the user task queue (table task_queue) in SQLite, so they are restored after an app restart.
  • FileStudyProtocolManager reads and writes protocol JSON files, implementing the StudyProtocolManager interface.
File What is in it
infrastructure/services/deployment_service.dart SmartphoneDeploymentService
infrastructure/services/persistence_service.dart PersistenceService
infrastructure/services/file_protocol_manager.dart FileStudyProtocolManager: ~/carp/study/study-<id>.json
infrastructure/services/device_info_service.dart DeviceInfoService: static hardware information