summaryrefstree
path: root/vendor/etc/sensors/proto/sns_cmc.proto
blob: 122da0621da64bd245599e32c5a2b0a4a53a2e0d (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

// @file sns_cmc.proto
//
// Defines message types for the Coarse Motion Classifier (CMC) 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";


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

  SNS_CMC_MSGID_SNS_CMC_EVENT = 772;
}

// Gives the state which the algorithm is capable
// of detecting
enum sns_cmc_motion_state
{
  option (nanopb_enumopt).long_names = false;

  // stated with 1 to match with algo where 0
  // is for UNKNOWN
  SNS_CMC_STATIONARY  = 1;
  SNS_CMC_MOVE        = 2;
  SNS_CMC_FIDDLE      = 3;
  SNS_CMC_PEDESTRIAN  = 4;
  SNS_CMC_VEHICLE     = 5;
  SNS_CMC_WALK        = 6;
  SNS_CMC_RUN         = 7;
  SNS_CMC_BIKE        = 8;
}

// Gives the information about the states represented
// by sns_cmc_motion_state
enum sns_cmc_motion_state_event
{
  option (nanopb_enumopt).long_names = false;
  // when any state of any of the motion state cannot
  // be determined. The first event of first client will
  // typically have all states as SNS_MS_UNKNOWN
  SNS_MS_UNKNOWN  = 0;
  // A given motion state is ACTIVE
  SNS_MS_ACTIVE   = 1;
  // A given motion state is INACTIVE
  SNS_MS_INACTIVE = 2;
}

message sns_cmc_event
{
  message data
  {
     // motion state by CMC
     required sns_cmc_motion_state ms_state = 1;

     // gives UNKNOWN/ACTIVE/INACTIVE information for the motion state
     required sns_cmc_motion_state_event ms_state_event = 2  [default = SNS_MS_UNKNOWN];
  }

  repeated data events = 1;
}

// Stream events:
//
// The sns_cmc_event message is used to publish updated state
//
// CMC does not publish configuration events.