carp-dk / carp-dk/carp.sensing-flutter
Polar sample rate cannot be controlled from the protocol — defaultSamplingConfiguration is ignored
- Dominant language
- Dart
- Stars
- 84
- Forks
- 31
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 6
Description
# Polar sampling rate cannot be controlled from the study protocol
`SamplingConfiguration` values in the protocol (whether `GranularitySamplingConfiguration`, `IntervalSamplingConfiguration`, or
wrapped in `BatteryAwareSamplingConfiguration`) never reach Polar BLE streams at runtime — I traced this across `carp_core`
2.1.2, `carp_mobile_sensing` 2.1.1, and `carp_polar_package` 2.0.0 / 7.10.0.
Three issues compound: (1) no probe anywhere branches on the `Granularity` enum, so `Detailed/Balanced/Coarse` is a no-op tag;
(2) `StreamProbe.onResume` in `carp_mobile_sensing/lib/runtime/executors/probes.dart:250-270` never reads
`samplingConfiguration`, only `IntervalProbe` does; (3) `carp_polar_package/lib/polar_probes.dart` calls
`startAccStreaming(identifier)` / `startPpgStreaming(...)` / `startHrStreaming(...)` with no `PolarSensorSetting`, so the
`polar` plugin auto-picks `.maxSettings()` (`polar-7.8.0/lib/src/polar_base.dart:257-263`) and the device always runs at max
rate.
Is this an unfinished feature, and would you accept a PR that adds a `PolarSensorSettingsSamplingConfiguration` and patches the
Polar probes to read it and pass `PolarSensorSetting({sampleRate, resolution, range})` into the plugin?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in carp_mobile_sensing/lib/runtime/executors/probes.dart around StreamProbe.onResume and compare its handling with IntervalProbe. Then inspect carp_polar_package/lib/polar_probes.dart and the Polar plugin settings documented in polar-7.8.0/lib/src/polar_base.dart. Done means protocol sampling configuration reaches the Polar streams and the requested sensor settings are used at runtime.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100