// @file sns_mcmd.proto
//
// Defines the API for Magnitude Change Motion Detection Sensors.
//
// 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";

// A magnitude change motion sensor reports once
// - The device is moving
// - The device is detected to be stationary
// The period of time to monitor for stationarity is 5 seconds.
// After reporting, conceptually the algorithm's state is reset,
// and detection begins again.
//
// Motion here refers to any change in accelerometer greater than 78ug in
// any direction
//
// Stationarity here refers to change in accelerometer smaller than 78ug in
// any direction for 5 seconds.
//
// ## Magnitude Change Motion Detect sensor attributes:
// SNS_STD_SENSOR_ATTRID_TYPE is "mcmd"
// SNS_STD_SENSOR_ATTRID_STREAM_TYPE: SNS_STD_SENSOR_STREAM_TYPE_ON_CHANGE

// Message IDs for Magnitude Change Motion Sensor
enum sns_mcmd_msgid
{
  option (nanopb_enumopt).long_names = false;

  // Configuration Request
  SNS_MCMD_MSGID_SNS_MCMD_CONFIG = 512;

  // Empty Event
  // Indicates that the requested state has been detected
  SNS_MCMD_MSGID_SNS_MCMD_EVENT = 770;
}

// Detected states supported by the MC Motion Detector
enum sns_mcmd_type
{
  option (nanopb_enumopt).long_names = false;

  SNS_MCMD_TYPE_STATIONARY = 0;
  SNS_MCMD_TYPE_MOTION = 1;
}

// Configuration Message
// Used to specify the MCMD configuration
message sns_mcmd_config
{
  // Which detector type to enable
  required sns_mcmd_type type = 1;
}
