summaryrefstree
path: root/vendor/etc/sensors/proto/sns_offbody_detect.proto
blob: b198b6dd75058255f9ee6983d82d30ea8ebd04e3 (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
56
// @file sns_offbody_detect.proto
//
// Defines the API for Offbody Detection Sensors.
//
// Copyright (c) 2017-2018,2020 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.

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

// An offbody detect sensor reports every time the device transitions from
// off-body to on-body and from on-body to off-body (e.g. a wearable device
// being removed from the wrist would trigger an event indicating an off-body
// transition).
//
// This sensor must be able to detect and report an on-body to off-body
// transition within 1 second of the device being removed from the body,
// and must be able to detect and report an off-body to on-body transition
// within 5 seconds of the device being put back onto the body.
//
// ## Offbody Detection sensor attributes:
// SNS_STD_SENSOR_ATTRID_TYPE is "offbody_detect"
// SNS_STD_SENSOR_ATTRID_STREAM_TYPE: SNS_STD_SENSOR_STREAM_TYPE_ON_CHANGE
//
// ## Request Message: SNS_STD_SENSOR_MSGID_SNS_STD_ON_CHANGE_CONFIG
// No configuration is available for this sensor.
//
// ## Event Message: SNS_OFFBODY_DETECT_MSGID_SNS_OFFBODY_DETECT_EVENT

// Message IDs for Offbody Detection Sensor
enum sns_offbody_detect_msgid {
  option (nanopb_enumopt).long_names = false;

  SNS_OFFBODY_DETECT_MSGID_SNS_OFFBODY_DETECT_EVENT = 772;
}

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

  // Current state is unknown: not yet detected
  SNS_OFFBODY_DETECT_EVENT_TYPE_UNKNOWN     = 0;
  // Device has been detected to be on-body
  SNS_OFFBODY_DETECT_EVENT_TYPE_ON          = 1;
  // Device has been detected to be off-body
  SNS_OFFBODY_DETECT_EVENT_TYPE_OFF         = 2;
}

message sns_offbody_detect_event
{
  // Detected state
  required sns_offbody_detect_event_type state = 1 [default = SNS_OFFBODY_DETECT_EVENT_TYPE_UNKNOWN];
}