summaryrefstree
path: root/vendor/etc/sensors/proto/sns_facing.proto
blob: 8decd9ffd738d19a90c20d931d8fde78eee39516 (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
// @file sns_facing.proto
//
// Defines message types for the the facing sensor
//
// Copyright (c) 2017 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
syntax = "proto2";
import "nanopb.proto";
import "sns_std_sensor.proto";

// Facing calculates face up, down and neutral states. Facing will initially start in an
// unknown state, and later transition to face up, down and neutral. 
// Neutral state reported to client on demand

// Facing Sensor Attribute Requirements:
// SNS_STD_SENSOR_ATTRID_TYPE: "facing"
// 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 Facing Sensor
enum sns_facing_msgid
{
  option (nanopb_enumopt).long_names = false;

  SNS_FACING_MSGID_SNS_FACING_EVENT = 1024;
}

// Device Facing state detected by Facing sensor
enum sns_facing_event_state
{   
  option (nanopb_enumopt).long_names = false;
  SNS_FACING_EVENT_STATE_UNKNOWN = 0;
  //Phone has just moved to a facing-up phone posture
  //which is defined as screen up.  
  SNS_FACING_EVENT_STATE_UP = 1;
  //Phone has just moved to a facing-down phone posture,
  //which is defined as screen down.
  SNS_FACING_EVENT_STATE_DOWN = 2;
  //Phone has just left either the facing-up  
  //or the facing-down phone posture
  SNS_FACING_EVENT_STATE_NEUTRAL = 3;
}

// Event Message
// Output data event generated by the facing sensor.
message sns_facing_event
{ 
 // Facing sensor state info 
 required sns_facing_event_state state = 1[default = SNS_FACING_EVENT_STATE_UNKNOWN];
}

// Stream events:
//
// The sns_facing_event message is used to publish updated state
//
// Facing sensor does not publish configuration events.