// @file sns_rgb.proto
//
// @brief Defines message types for RGB Sensors.
// All RGB Sensor drivers are required to comply with this API.
// Any additional functionality for RGB Sensor may be defined in a
// device specific API file.
//
// @copyright
// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
//
// ## Attribute Requirements:
// The RGB Sensor publishes:
// 1. SNS_STD_SENSOR_ATTRID_TYPE attribute value as "rgb".
// 2. SNS_STD_SENSOR_ATTRID_API attribute contains "sns_rgb.proto"
// 3. SNS_STD_SENSOR_ATTRID_RESOLUTIONS attribute values in µW/cm2/LSB unit.
// 4. SNS_STD_SENSOR_ATTRID_RANGES attribute values in µW/cm2 unit.
// 5. SNS_STD_SENSOR_ATTRID_STREAM_TYPE as SNS_STD_SENSOR_STREAM_TYPE_STREAMING
//    or SNS_STD_SENSOR_STREAM_TYPE_ON_CHANGE
// 6. See sns_std_sensor.proto for other attributes.


// ## Processing Stream Requests:
// 1. An RGB Sensor may support either streaming or on-change
//    mode. The operating mode is configured in the Registry.
//  a. If a driver supports both modes, it must publish two sensors. One
//     with SNS_STD_SENSOR_ATTRID_STREAM_TYPE == SNS_STD_SENSOR_STREAM_TYPE_STREAMING,
//     and a second with SNS_STD_SENSOR_STREAM_TYPE_ON_CHANGE.
// 2. A streaming RGB Sensor handles the sns_std_sensor_config request
//    for all stream enable/update requests.
// 3. An on-change RGB Sensor handles the
//    SNS_STD_SENSOR_MSGID_SNS_STD_ON_CHANGE_CONFIG request for
//    all on-change enable/update requests.
// 4. In on-change mode the Sensor uses interrupt operation and reports
//    samples for only significant change in R/G/B/clear channel irradiance.
//    Example: +/- 10% change.

// ##  Publishing stream events:
// 1. The RGB Sensor publishes color data in ambient light using the
//    sns_std_sensor_event message.
// 2. Each stream event contains six output data fields where data is
//    factory calibrated and ordered as:
//    @code
//    data[0] = Red channel irradiance in µW/cm2
//    data[1] = Green channel irradiance in µW/cm2
//    data[2] = Blue channel irradiance in µW/cm2
//    data[3] = Clear channel irradiance in µW/cm2
//    data[4] = Color Temperature in Kelvin
//    data[5] = raw clear channel ADC value
//    @endcode
// 3. Each stream event publishes 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 RGB 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
//    or when a client sends a new request.
// 5. The RGB Sensor may publish a factory calibration event using the
//    sns_cal_event message.
//    If supported, it shall publish this event each time there is change in its
//    factory calibration data or when a client sends a new request.

// ## Processing self-test requests:
// 1. The RGB Sensor implements SNS_PHYSICAL_SENSOR_TEST_TYPE_COM test
//    type using the physical sensor test API.
// 2. The RGB Sensor implements SNS_PHYSICAL_SENSOR_TEST_TYPE_FACTORY test
//    type to determine factory calibration parameters using the physical
//    sensor test API. The factory test for RGB Sensor calibrates
//    the sensor such that its output is comparable to a standard Chroma meter
//    output in any lighting condition.
// 3. The RGB Sensor may implement other test types.

// ## Publishing self-test events:
// 1. The RGB 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 may be used to output any
//    driver-specific error data.
syntax = "proto2";
import "nanopb.proto";
import "sns_std_sensor.proto";
import "sns_physical_sensor_test.proto";
import "sns_cal.proto";
