summaryrefstree
path: root/vendor/etc/sensors/proto/sns_dpc.proto
blob: bbc27d770aaa735c24eaa0a6a72c774abb17dc01 (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
57
58
59
60
61
62
63
64
// @file sns_dpc.proto
//
// Defines message types for the DPC(Device Position Classifier) Sensor.
//
// 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";

// The DPC Sensor provides device position information

// DPC Sensor Attribute Requirements:
// SNS_STD_SENSOR_ATTRID_TYPE: "device_position_classifier"
// SNS_STD_SENSOR_ATTRID_STREAM_TYPE: SNS_STD_SENSOR_STREAM_TYPE_ON_CHANGE

// Stream Requests:
// - SNS_STD_SENSOR_MSGID_SNS_STD_ON_CHANGE_CONFIG is used to enable the sensor

// Message IDs for DPC Sensor
enum sns_dpc_msgid {
  option (nanopb_enumopt).long_names = false;

  //send to new client immediatly to inform current device position
  SNS_DPC_MSGID_SNS_DPC_EVENT_CONFIG = 777;

  //send when detect device position change
  SNS_DPC_MSGID_SNS_DPC_EVENT = 1030;
}

// Stream events:
//
// The sns_dpc_event message is used to publish updated device position
// The sns_dpc_event_config message is sent immediately to new client to inform the current device position

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

  // when algo cannot identify other states
  SNS_DPC_UNKNOWN         = 1;
  // User keeps the device steady with display at an angle within +/-15 deg with respect to the horizontal plane
  SNS_DPC_FLAT_STATIC     = 2;
  // Device is not in FLAT_STATIC state and proximity sensor detects NEAR
  SNS_DPC_HIDDEN          = 3;
  // User picks up the device
  SNS_DPC_IN_HAND         = 4;
  // User keeps the device steady with display at an angle greater than +/-15 deg with respect to the horizontal plane
  SNS_DPC_FACING          = 5;
}

// Events types from DPC Sensor
message sns_dpc_event
{
  required sns_dpc_state dpc_state = 1;
}

message sns_dpc_event_config
{
  //current dpc state
  required sns_dpc_state dpc_state = 1;
}