// @file sns_time.proto
//
// @brief Defines the API for the Time Sensor.
//
// @copyright 
// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
// All rights reserved. 
// Confidential and Proprietary - Qualcomm Technologies, Inc.
//
// @details Clients can use this API to be notified of UTC time and time zone
// offset.
//
// ## Attribute Requirements:
// 1. SNS_STD_SENSOR_ATTRID_TYPE: "time"
// 2. SNS_STD_SENSOR_ATTRID_STREAM_TYPE: SNS_STD_SENSOR_STREAM_TYPE_ON_CHANGE
// 3. SNS_STD_SENSOR_ATTRID_API: "sns_time.proto"
//
// ## Processing Stream Requests:
// - SNS_STD_SENSOR_MSGID_SNS_STD_ON_CHANGE_CONFIG is used to enable the sensor.
//
// ## Publishing Stream Events:
// - SNS_TIME_MSGID_SNS_TIME_EVENT: The sns_time_event message is used to
//   publish the UTC time since 1/1/1970 00:00:00 in seconds or time zone offset
//   in seconds. A new event will be generated upon a change in the system time
//   or a change in time zone offset. 
// - Time sensor does not publish configuration events

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

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

  // @brief Event with utc time or time zone offset
  // Message: sns_time_event
  SNS_TIME_MSGID_SNS_TIME_EVENT = 771;
}

// @brief sns_time_event
message sns_time_event
{
  option (nanopb_msgopt).no_unions = true;
  oneof value 
  {
    // @brief UTC time in seconds since 1/1/1970 00:00:00
    uint64 utc_time = 1;
    // @brief Time zone offset in seconds
    sint32 time_zone_offset = 2;
  }
}
