summaryrefstree
path: root/vendor/etc/sensors/proto/sns_heart_rate.proto
blob: c6f90f5e14fa45573f247702f2d0dc32075038b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// @file sns_heart_rate.proto
//
// Defines the API for Heart Rate Detection Sensors.
//
// Copyright (c) 2017-2018 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.

syntax = "proto2";
import "nanopb.proto";
import "sns_std_sensor.proto";

// A sensor of this type returns the current heart rate in beats per minute
// (BPM).  Because this sensor is on-change, events must be generated when and
// only when BPM or status have changed since the last event.
//
// Upon the first activation, unless the device is known to not be on the
// body, the status field of the first event must be set to UNRELIABLE.
//
// ## Heart Rate sensor attributes:
// SNS_STD_SENSOR_ATTRID_TYPE is "heart_rate"
//
// ## Request Message: SNS_STD_SENSOR_MSGID_SNS_STD_ON_CHANGE_CONFIG
// No configuration is available for this sensor.
//
// ## Event Message: sns_std_sensor_event
// Output of the Heart Rate sensor will be populated in sns_std_sensor_event.
//
// SNS_HEART_RATE_MSGID_SNS_HEART_RATE_EVENT::data[0] = current heart rate in beats per minute (BPM)
//
// SNS_HEART_RATE_MSGID_SNS_HEART_RATE_EVENT::status specifies the reliability of the sample value
// value is of type sns_heart_rate_event_type.

enum sns_heart_rate_msgid {
  option (nanopb_enumopt).long_names = false;

  SNS_HEART_RATE_MSGID_SNS_HEART_RATE_EVENT = 779;
}

enum sns_heart_rate_event_type {
  option (nanopb_enumopt).long_names = false;

  SNS_HR_STATUS_NO_CONTACT = -1;
  SNS_HR_STATUS_UNRELIABLE  = 0;
  SNS_HR_STATUS_ACCURACY_LOW = 1;
  SNS_HR_STATUS_ACCURACY_MEDIUM = 2;
  SNS_HR_STATUS_ACCURACY_HIGH = 3;
}

// Events types from heart_rate Sensor
message sns_heart_rate_event
{
  required float heart_rate = 1;
  required sns_heart_rate_event_type heart_rate_event_type = 2 [default = SNS_HR_STATUS_NO_CONTACT];
}