// @file sns_activity_recognition.proto
//
// @brief Defines the API for the Activity Recognition (AR) Sensor.
//
// @copyright
// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
// All rights reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
//
// @details Activity Recognition sensor determines user activity states.
//
// ## Attribute Requirements:
// 1. SNS_STD_SENSOR_ATTRID_TYPE: "activity_recognition".
// 2. SNS_STD_SENSOR_ATTRID_STREAM_TYPE: SNS_STD_SENSOR_STREAM_TYPE_ON_CHANGE.
// 3. SNS_STD_SENSOR_ATTRID_API: "sns_activity_recognition.proto".
// 4. SNS_STD_SENSOR_ATTRID_TECH_USED: List of technologies used.
//
// ## Processing Stream Requests:
// - SNS_STD_SENSOR_MSGID_SNS_STD_ON_CHANGE_CONFIG is used to enable the sensor.
// - Client shall pass list of permitted technologies in the request payload.
// - Refer "sns_std_request :: permissions" in sns_std.proto.
//
// ## Publishing Stream Events:
// - SNS_ACTIVITY_RECOGNITION_MSGID_SNS_AR_CONFIG_EVENT: The configuration event
//   is generated at least once in response to enable request.
// - SNS_ACTIVITY_RECOGNITION_MSGID_SNS_AR_EVENT: The sns_ar_event message is
//   used to publish updated state. A new event will be generated upon any state
//   change.

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

// @brief Message IDs for Activity Recognition Sensor
enum sns_activity_recognition_msgid {
  option (nanopb_enumopt).long_names = false;

  SNS_ACTIVITY_RECOGNITION_MSGID_SNS_AR_EVENT = 800;
  SNS_ACTIVITY_RECOGNITION_MSGID_SNS_AR_CONFIG_EVENT = 801;
}

// @brief User activity states
enum sns_ar_motion_state
{
  option (nanopb_enumopt).long_names = false;

  // @brief Unknown is reported when the algorithm is unable to detect the
  //        current activity state.
  SNS_AR_UNKNOWN = 0;
  // @brief User is relatively stationary.
  SNS_AR_STATIONARY = 1;
  // @brief User is classified as a pedestrian.
  SNS_AR_PED = 2;
  // @brief User is in a non-motorized vehicle.
  SNS_AR_NMV = 3;
  // @brief User is in a motorized vehicle.
  SNS_AR_MV = 4;
  // @brief User is walking.
  SNS_AR_WALK = 5;
  // @brief User is running.
  SNS_AR_RUN = 6;
  // @brief User is on a bicycle.
  SNS_AR_BICYCLE = 7;
  // @brief User is in a car.
  SNS_AR_CAR = 8;
  // @brief User is in an airplane.
  SNS_AR_AIRPLANE = 9;
}

// @brief Event generated by Activity Recognition to convey all the supported
//        user activity states.
message sns_ar_config_event
{
  // @brief List of supported motion states.
  repeated sns_ar_motion_state states = 1;
}

// @brief Event generated by Activity Recognition to convey user current
//        activity state.
message sns_ar_event
{
  // @brief List of active states for this user.
  //        Multiple states may be reported concurrently.
  //        Any states not listed here are presumed to be inactive.
  repeated sns_ar_motion_state states = 1 [(nanopb).max_count = 4];
}
