// @file sns_facing.proto
//
// Defines message types for the the facing sensor
//
// 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";

// Facing calculates face up, down and neutral states. Facing will initially start in an
// unknown state, and later transition to face up, down and neutral. 
// Neutral state reported to client on demand

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

  SNS_FACING_MSGID_SNS_FACING_EVENT = 1024;
}

// Device Facing state detected by Facing sensor
enum sns_facing_event_state
{   
  option (nanopb_enumopt).long_names = false;
  SNS_FACING_EVENT_STATE_UNKNOWN = 0;
  //Phone has just moved to a facing-up phone posture
  //which is defined as screen up.  
  SNS_FACING_EVENT_STATE_UP = 1;
  //Phone has just moved to a facing-down phone posture,
  //which is defined as screen down.
  SNS_FACING_EVENT_STATE_DOWN = 2;
  //Phone has just left either the facing-up  
  //or the facing-down phone posture
  SNS_FACING_EVENT_STATE_NEUTRAL = 3;
}

// Event Message
// Output data event generated by the facing sensor.
message sns_facing_event
{ 
 // Facing sensor state info 
 required sns_facing_event_state state = 1[default = SNS_FACING_EVENT_STATE_UNKNOWN];
}

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

