summaryrefstree
path: root/vendor/etc/sensors/proto/sns_basic_gestures.proto
blob: dfec6ba870349a321a401567e60516063347257c (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// @file sns_basic_gestures.proto
//
// Defines message types for the the basic_gestures sensor
//
// Copyright (c) 2017 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
syntax = "proto2";
import "nanopb.proto";

// Basic Gestures algorithm provides the ability to detect a Push, Pull,
// or Shake gesture.
// Basic Gestures reports "Axis Unknown", when the direction of a shake cannot
// be reliably determined.

// Basic gestures Sensor Attribute Requirements:
// SNS_STD_SENSOR_ATTRID_TYPE: "basic_gestures"
// SNS_STD_SENSOR_ATTRID_STREAM_TYPE: SNS_STD_SENSOR_STREAM_TYPE_ON_CHANGE

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

// Message IDs for Basic gestures Sensor
enum sns_basic_gestures_msgid
{
  option (nanopb_enumopt).long_names = false;
  SNS_BASIC_GESTURES_MSGID_SNS_BASIC_GESTURES_CONFIG = 512;
  SNS_BASIC_GESTURES_MSGID_SNS_BASIC_GESTURES_EVENT = 1024;
}
//To mask Basic gesture algorithm output states
enum sns_basic_gestures_event_mask
{
  option (nanopb_enumopt).long_names = false;
  // For masking push and pull states
  SNS_BASIC_GESTURES_EVENT_MASK_PUSH_AND_PULL        = 1;
  // For masking shake left and right states
  SNS_BASIC_GESTURES_EVENT_MASK_SHAKE_LEFT_AND_RIGHT = 2;
  // For masking shake top and bottom states
  SNS_BASIC_GESTURES_EVENT_MASK_SHAKE_TOP_AND_BOTTOM = 4;
  //For masking shake other state
  SNS_BASIC_GESTURES_EVENT_MASK_SHAKE_OTHER          = 8;
}
// Device Basic gesture detected by Basic gestures sensor
enum sns_basic_gestures_event_type
{
  option (nanopb_enumopt).long_names = false;
  //Phone is pulled away from the user in a direction perpendicular to the screen
  SNS_BASIC_GESTURES_EVENT_TYPE_PUSH          = 1;
  //Phone is pulled toward the user in a direction perpendicular to the screen
  SNS_BASIC_GESTURES_EVENT_TYPE_PULL          = 2;
  //Phone is shaken toward the left
  SNS_BASIC_GESTURES_EVENT_TYPE_SHAKE_LEFT    = 3;
  //Phone is shaken toward the right
  SNS_BASIC_GESTURES_EVENT_TYPE_SHAKE_RIGHT   = 4;
  //Phone is shaken toward the top
  SNS_BASIC_GESTURES_EVENT_TYPE_SHAKE_TOP     = 5;
  //Phone is shaken toward the bottom
  SNS_BASIC_GESTURES_EVENT_TYPE_SHAKE_BOTTOM  = 6;
  //Phone is shaken, but phone shake direction cannot be clearly determined
  SNS_BASIC_GESTURES_EVENT_TYPE_SHAKE_OTHER   = 7;
}
// Event Message
// Output data event generated by the basic_gestures sensor.
// Default values of optional fields added in registry
message sns_basic_gestures_config
{
  //Sleep time in seconds
  optional float sleep           = 1;
  //Push threshold m/s/s(default = 1.5G),where G=9.81188
  //min_push_threshold:1G, max_push_threshold:5G
  optional float push_threshold  = 2;
  //Pull threshold m/s/s (default = 1.5G)
  //min_pull_threshold:1G, max_pull_threshold:5G
  optional float pull_threshold  = 3;
  //Shake threshold m/s/s(default = 1.5G)
  //min_shake_threshold:1G, max_shake_threshold:5G
  optional float shake_threshold = 4;
  //For masking output events.
  //By default, All states reported.
  //Client should use sns_basic_gestures_event_mask fields for masking,
  //specific events
  //Example: If client doesn't want push and pull events,then,
  //client updates event_mask with SNS_BASIC_GESTURES_EVENT_MASK_PUSH_AND_PULL
  //event_mask |= SNS_BASIC_GESTURES_EVENT_MASK_PUSH_AND_PULL;
  optional bytes event_mask    = 5;
}

// Event Message
// Output data event generated by the basic_gestures sensor.
message sns_basic_gestures_event
{
 // basic_gestures sensor state info
 required sns_basic_gestures_event_type state=1;
}

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