summaryrefstree
path: root/vendor/etc/sensors/proto/sns_tilt.proto
blob: faf095ac1c37a9d6848f21e310c1ca82a95f4230 (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
// @file sns_tilt.proto
//
// Defines message types for the Tilt Sensor.
//
// 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";

// The Tilt Sensor looks for a change in angle of a gravity vector from an
// anchor vector.
//
// The initial anchor vector is based on an average of one second of
// accel data after initial activation.
//
// The gravity vector is calculated based on an average of two seconds of
// accel data.
//
// The anchor vector is reset to the current gravity vector each time the
// Tilt event is generated.
// There is only one anchor vector shared amongst all clients.
//
// The Tilt event is generated when the current gravity vector is 35 degrees
// or more from the anchor vector.

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

  SNS_TILT_MSGID_SNS_TILT_EVENT = 774;
}

// Stream events:
//
// A NULL message with message ID SNS_TILT_MSGID_SNS_TILT_EVENT is used to
// publish tilt event
//
// Tilt does not publish configuration events.