// @file sns_ambient_temperature.proto
//
// Defines the API for Ambient Temperature Sensors.
// All Ambient Temperature Sensor drivers are required to comply with this API.
// Any new functionality for Ambient Temperature Sensor can be defined in a
// device specific API file.
//
// Copyright (c) 2016-2017 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.

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

// Attribute requirements:
// The Ambient Temperature Sensor publishes:
// 1. SNS_STD_SENSOR_ATTRID_TYPE attribute value as "ambient_temperature".
// 2. SNS_STD_SENSOR_ATTRID_RESOLUTIONS attribute value in degrees Celsius/LSB.
// 3. SNS_STD_SENSOR_ATTRID_RANGES attribute values in degrees Celsius unit.
// 4. The ambient_temperature sensor is an on-change sensor.
// 5. The SNS_STD_SENSOR_ATTRID_RATES attribute is not applicable
//    since this is an on-change sensor.
// 6. See sns_std_sensor.proto for other attributes.

// Handling stream requests:
// 1. The Ambient Temperature Sensor handles the SNS_STD_SENSOR_MSGID_SNS_STD_ON_CHANGE_CONFIG
//    message ID for all stream enable/update requests.
// 2. If the physical sensor supports hardware FIFO then the Ambient Temperature
//    Sensor uses batching_period item in sns_std_request as the requested
//    batching rate to determine hardware FIFO watermark.

// Handling stream events:
// 1. The Ambient Temperature Sensor publishes data stream events using the
//    sns_std_sensor_event message.
// 2. Each stream event contains one output data field where data is
//    factory calibrated and ordered as:
//    data[0] = Ambient Temperature data in degrees Celsius
// 3. Each stream event publishs an accuracy field:
//    SNS_STD_SENSOR_SAMPLE_STATUS_UNRELIABLE to mark invalid samples when hardware is
//    yet to stabilize after the sensor is configured.
//    SNS_STD_SENSOR_SAMPLE_STATUS_ACCURACY_HIGH to mark samples when they are valid.
// 4. The Ambient Temperature Sensor publishes a configuration event using the
//    sns_std_sensor_physical_config_event message.
//    It publishes this event each time there is change in hardware config of the sensor
//    and contains current physical sensor config of the sensor.
// 5. The Ambient Temperature Sensor publishes a factory calibration event using the
//    sns_cal_event message. It uses bias and scale_factor fields in this event.
//    It publishes this event each time there is change in it's factory calibration
//    data or when a client sends a new streaming request.

// Handling self-test requests:
// 1. The Ambient Temperature Sensor implements SNS_PHYSICAL_SENSOR_TEST_TYPE_COM test
//    type using the physical sensor test API.
// 2. The Ambient Temperature Sensor implements SNS_PHYSICAL_SENSOR_TEST_TYPE_FACTORY test
//    type to determine factory calibration parameters using the physical
//    sensor test API.
// 3. The Ambient Temperature Sensor could implement other test types.

// Handling test events:
// 1. The Ambient Temperature Sensor uses sns_physical_sensor_test_event message to publish
//    a test completion event.
// 2. The test_passed field in sns_physical_sensor_test_event is used to output the
//    pass/fail result of self-test execution.
// 3. The test_data field in sns_physical_sensor_test_event could be used to output any
//    driver-specific error data.
