// @file sns_dpc.proto
//
// @brief Defines the API for the DPC(Device Position Classifier) Sensor.
//
// @copyright
// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
// All rights reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
//
// @details The DPC Sensor provides device position information.
//
// ## Attribute Requirements:
// 1. SNS_STD_SENSOR_ATTRID_TYPE: "device_position_classifier".
// 2. SNS_STD_SENSOR_ATTRID_STREAM_TYPE: SNS_STD_SENSOR_STREAM_TYPE_ON_CHANGE.
// 3. SNS_STD_SENSOR_ATTRID_API: "sns_dpc.proto".
//
// ## Processing Stream Requests:
// - SNS_STD_SENSOR_MSGID_SNS_STD_ON_CHANGE_CONFIG is used to enable the sensor.
//
// ## Publishing Stream Events:
// - SNS_DPC_MSGID_SNS_DPC_EVENT_CONFIG: The configuration event is
//   sent immediately to new client to inform the current device position.
// - SNS_DPC_MSGID_SNS_DPC_EVENT: A new event will be generated upon device
//   position change.

syntax = "proto2";
import "nanopb.proto";
import "sns_std_sensor.proto";

// @brief Message IDs for DPC Sensor
enum sns_dpc_msgid {
  option (nanopb_enumopt).long_names = false;

  SNS_DPC_MSGID_SNS_DPC_EVENT_CONFIG = 777;
  SNS_DPC_MSGID_SNS_DPC_EVENT = 1030;
}

// @brief Device position states
enum sns_dpc_state
{
  option (nanopb_enumopt).long_names = false;

  SNS_DPC_UNINITIALIZED   = 0;
  // @brief when algo cannot identify other states.
  SNS_DPC_UNKNOWN         = 1;
  // @brief User keeps the device steady with display at an angle within
  //        +/-15 deg with respect to the horizontal plane
  SNS_DPC_FLAT_STATIC     = 2;
  // @brief Device is not in FLAT_STATIC state and proximity sensor detects NEAR
  SNS_DPC_HIDDEN          = 3;
  // @brief User picks up the device
  SNS_DPC_IN_HAND         = 4;
  // @brief User keeps the device steady with display at an angle greater than
  //        +/-15 deg with respect to the horizontal plane
  SNS_DPC_FACING          = 5;
}

// @brief Event generated by DPC to publish updated device position.
message sns_dpc_event
{
  // @brief current dpc state
  required sns_dpc_state dpc_state = 1;
}

// @brief Event generated by DPC to new client to inform the current device
//        position.
message sns_dpc_event_config
{
  // @brief current dpc state
  required sns_dpc_state dpc_state = 1;
}
