// @file sns_ppg.proto
//
// Defines the API for PPG Sensors.
//
// Copyright (c) 2017-2018 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";

// Attribute requirements:
// The PPG Sensor publishes:
// 1. SNS_STD_SENSOR_ATTRID_TYPE attribute value as "ppg".
// 2. SNS_STD_SENSOR_ATTRID_RATES attribute values in Hz.

// Handling stream requests:
// 1. The PPG Sensor handles the sns_std_sensor_config
//    message request with msgid SNS_STD_SENSOR_MSGID_SNS_STD_SENSOR_CONFIG
//    for all stream enable/update requests.
//    SNS_STD_SENSOR_ATTRID_STREAM_TYPE: SNS_STD_SENSOR_STREAM_TYPE_STREAMING
// 2. The PPG Sensor uses batching_period item in
//    sns_std_request as the requested batching rate to determine
//    hardware FIFO watermark.

// Handling stream events:
// 1. The PPG Sensor publishes PPG data stream events
//    using the sns_std_sensor_event message.
// 2. Each stream event contains three output data fields
//    data[0] => PPG ch1
//    data[1] => PPG ch2
//    data[2] => 128 if touched,  0 otherwise
// 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 PPG 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.

