Skip to content
CARP Docs
Ask AISystemLightDark
On this page

Watch settings

The exact keys the phone hands to the watch app, and the AppleWatchDevice properties they come from.

Copy MarkdownOpen inOpen in GitHubView as MarkdownOpen in Scira AIOpen in ChatGPTOpen in ClaudeOpen in Cursor

When the watch app calls AWWCSessionManager.shared.applyiPhoneSettings, the phone answers with the dictionary below. Every value comes from the AppleWatchDevice in the deployed study protocol, produced by AppleWatchDevice.toWatchSettings().

Use this page when you write your own watch app, extend the example watch app, or debug why a setting did not take effect.

Settings dictionary

KeyTypeApplied automatically by AWAREFrom AppleWatchDevice
labelString✓ sensor.set(label:)label
db_hostString✓ dbEngine.config.hostawareServerUrl
debugBool✓ syncConfig.debugenableNativeLogging
motion_sensor_hzInt—motionSamplingRate
watch_motion_enabledBool—motionEnabled
watch_motion_accelerometer_enabledBool—accelerometerEnabled
watch_motion_device_motion_enabledBool—deviceMotionEnabled
watch_battery_enabledBool—batteryEnabled
watch_device_enabledBool—deviceInfoEnabled
watch_healthkit_enabledBool—heartRateEnabled
watch_location_enabledBool—locationEnabled
watch_heading_enabledBool—headingEnabled
watch_bluetooth_enabledBool—bluetoothEnabled
watch_audio_enabledBool—audioEnabled
watch_audio_ambient_noise_enabledBool—ambientNoiseEnabled
watch_audio_classification_enabledBool—audioClassificationEnabled
watch_audio_duty_cycle_enabledBool—audioDutyCycleEnabled
watch_audio_active_durationDouble (seconds)—audioActiveDuration
watch_audio_rest_durationDouble (seconds)—audioRestDuration
file_transfer_interval_secondsDouble (seconds)—fileTransferInterval
watch_background_session_typeString—backgroundSessionType
watch_transfer_modeString—transferMode
watch_delete_after_transferBool—deleteAfterTransfer

Applied automatically by AWARE means the framework applies the value to every registered sensor on its own. The watch app has to read and apply everything else, because only the watch app knows which sensors exist. That is what apply(settings:) does in the example controller.

Note

The last two keys, watch_transfer_mode and watch_delete_after_transfer, are added by carp_aware_package. The plain AWARE framework does not know about them, so they are forwarded to the watch verbatim.

Phone-side only

One setting never reaches the watch:

KeyFrom AppleWatchDeviceEffect
save_to_local_aware_databasesaveToLocalAwareDatabaseWhether the phone also writes received records into its own AWARE database

Adding a setting of your own

A custom setting takes two small changes, one on each side:

  1. Send it from Dart

    Add the key to AppleWatchDevice.toWatchSettings(). Keys the native AppleWatchSensor.Config does not recognize are forwarded to the watch unchanged, so no native change is needed on the phone.

  2. Read it on the watch

    Pick it up in apply(settings:) in your watch controller and apply it to the sensor configuration it belongs to.

    if let threshold = settings["my_custom_threshold"] as? Double {
        mySensor.CONFIG.threshold = threshold
    }

When settings take effect

Settings are pulled by the watch, not pushed to it. The watch app requests them:

  • on startup;
  • whenever it calls applyiPhoneSettings(), for example from the Reload settings button in the example app.

After applying them, the controller restarts the sensors, so a changed configuration takes effect as soon as it has been fetched. A protocol update therefore reaches the watch within one watch-app launch, not instantly.

Quick links

Page · DocumentationCARP DocumentationPage · DocumentationIntroductionPage · DocumentationQuickstartPage · DocumentationTerminologyPage · DocumentationArchitecture