Skip to content

Commit

Permalink
GT3X report enabled device features
Browse files Browse the repository at this point in the history
  • Loading branch information
nx10 committed Sep 19, 2024
1 parent 2fff1c4 commit 5168ea2
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion src/actigraph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,37 @@ impl<'a> sensors::SensorsFormatReader<'a> for ActigraphReader {
let params = parse_parameters(record_data);
sample_rate = params.sample_rate;
accel_scale = params.accel_scale;

metadata_callback(sensors::MetadataEntry {
category: "device_feature_enabled",
key: "data_summary",
value: &format!("{}", params.device_features.data_summary),
});
metadata_callback(sensors::MetadataEntry {
category: "device_feature_enabled",
key: "epoch_data",
value: &format!("{}", params.device_features.epoch_data),
});
metadata_callback(sensors::MetadataEntry {
category: "device_feature_enabled",
key: "heart_rate_monitor",
value: &format!("{}", params.device_features.heart_rate_monitor),
});
metadata_callback(sensors::MetadataEntry {
category: "device_feature_enabled",
key: "no_raw_data",
value: &format!("{}", params.device_features.no_raw_data),
});
metadata_callback(sensors::MetadataEntry {
category: "device_feature_enabled",
key: "proximity_tagging",
value: &format!("{}", params.device_features.proximity_tagging),
});
metadata_callback(sensors::MetadataEntry {
category: "device_feature_enabled",
key: "sleep_mode",
value: &format!("{}", params.device_features.sleep_mode),
});
}
LogRecordType::Activity => {
let dt = record_header.datetime();
Expand Down Expand Up @@ -503,7 +534,7 @@ mod tests {
)
.is_ok());

assert_eq!(metadata.len(), 19);
assert_eq!(metadata.len(), 25);
assert_eq!(sensor_table.len(), 4);

assert_eq!(metadata[&("info".into(), "Sample Rate".into())], "60");
Expand Down

0 comments on commit 5168ea2

Please sign in to comment.