/* Automatically generated nanopb header */
/* Generated by nanopb-0.4.9.1 */

#ifndef PB_SNS_DELTA_ANGLE_PB_H_INCLUDED
#define PB_SNS_DELTA_ANGLE_PB_H_INCLUDED
#include <pb.h>
#include "sns_std_sensor.pb.h"

#if PB_PROTO_HEADER_VERSION != 40
#error Regenerate this file with the current version of nanopb generator.
#endif

/* Enum definitions */
/* @brief Message IDs for Delta Angle Sensor */
typedef enum _sns_delta_angle_msgid {
    SNS_DELTA_ANGLE_MSGID_SNS_DELTA_ANGLE_CONFIG = 520,
    SNS_DELTA_ANGLE_MSGID_SNS_DELTA_ANGLE_EVENT = 772
} sns_delta_angle_msgid;

/* @brief The orientation type defines which orientation of rotation the client is interested in */
typedef enum _sns_delta_angle_ori_type {
    SNS_DELTA_ANGLE_ORIENTATION_PITCH = 1,
    SNS_DELTA_ANGLE_ORIENTATION_ROLL = 2,
    SNS_DELTA_ANGLE_ORIENTATION_HEADING = 3,
    SNS_DELTA_ANGLE_ORIENTATION_TOTAL = 4
} sns_delta_angle_ori_type;

/* Struct definitions */
/* @brief Gives the previous quaternion values */
typedef struct _sns_delta_angle_quat_history {
    /* @brief Timestamp of the historical quaternion */
    uint64_t quat_ts;
    /* @brief An array of x/y/z/w */
    pb_size_t quat_count;
    float quat[4];
} sns_delta_angle_quat_history;

/* @brief Configuration message for delta angle. */
typedef struct _sns_delta_angle_config {
    /* @brief The orientation type defines which orientation of rotation the client is interested in */
    sns_delta_angle_ori_type ori_type;
    /* @brief Absolute angle threshold for reporting events. */
    float radians;
    /* @brief Will be used as batch_period in request to underlying physical sensor requests.
 Note that it will not change the underlying sampling rate of the physical sensors. */
    uint32_t latency_us;
    /* @brief Optionally enable reporting the quaternion which caused the angle threshold to be met. */
    bool has_quat_output_enable;
    bool quat_output_enable;
    /* @brief Optionally enable reporting two historical quaternions from prior to the angle
 threshold being met. */
    bool has_quat_history_enable;
    bool quat_history_enable;
} sns_delta_angle_config;

/* @brief Event sent when the angle change threshold has been met */
typedef struct _sns_delta_angle_event {
    /* @brief Quaternion output. Optionally enabled by the "quat_output_enable" field in the request
 An array of x/y/z/w */
    pb_size_t quat_count;
    float quat[4];
    /* @brief The output event can optionally contain 2 historical quaternions from prior to
 the angle change being satisfied. This can be used (for example) to compute
 the device trajectory at the time the angle threshold is reached.
 Optionally enabled by the "quat_history_enable" field in the request */
    pb_size_t history_count;
    sns_delta_angle_quat_history history[2];
    /* @brief Initial quaternion. Only updated when it changes */
    pb_size_t init_quat_count;
    float init_quat[4];
} sns_delta_angle_event;


#ifdef __cplusplus
extern "C" {
#endif

/* Helper constants for enums */
#define _sns_delta_angle_msgid_MIN SNS_DELTA_ANGLE_MSGID_SNS_DELTA_ANGLE_CONFIG
#define _sns_delta_angle_msgid_MAX SNS_DELTA_ANGLE_MSGID_SNS_DELTA_ANGLE_EVENT
#define _sns_delta_angle_msgid_ARRAYSIZE ((sns_delta_angle_msgid)(SNS_DELTA_ANGLE_MSGID_SNS_DELTA_ANGLE_EVENT+1))
#define sns_delta_angle_msgid_SNS_DELTA_ANGLE_MSGID_SNS_DELTA_ANGLE_CONFIG SNS_DELTA_ANGLE_MSGID_SNS_DELTA_ANGLE_CONFIG
#define sns_delta_angle_msgid_SNS_DELTA_ANGLE_MSGID_SNS_DELTA_ANGLE_EVENT SNS_DELTA_ANGLE_MSGID_SNS_DELTA_ANGLE_EVENT

#define _sns_delta_angle_ori_type_MIN SNS_DELTA_ANGLE_ORIENTATION_PITCH
#define _sns_delta_angle_ori_type_MAX SNS_DELTA_ANGLE_ORIENTATION_TOTAL
#define _sns_delta_angle_ori_type_ARRAYSIZE ((sns_delta_angle_ori_type)(SNS_DELTA_ANGLE_ORIENTATION_TOTAL+1))
#define sns_delta_angle_ori_type_SNS_DELTA_ANGLE_ORIENTATION_PITCH SNS_DELTA_ANGLE_ORIENTATION_PITCH
#define sns_delta_angle_ori_type_SNS_DELTA_ANGLE_ORIENTATION_ROLL SNS_DELTA_ANGLE_ORIENTATION_ROLL
#define sns_delta_angle_ori_type_SNS_DELTA_ANGLE_ORIENTATION_HEADING SNS_DELTA_ANGLE_ORIENTATION_HEADING
#define sns_delta_angle_ori_type_SNS_DELTA_ANGLE_ORIENTATION_TOTAL SNS_DELTA_ANGLE_ORIENTATION_TOTAL


#define sns_delta_angle_config_ori_type_ENUMTYPE sns_delta_angle_ori_type



/* Initializer values for message structs */
#define sns_delta_angle_quat_history_init_default {0, 0, {0, 0, 0, 0}}
#define sns_delta_angle_config_init_default      {_sns_delta_angle_ori_type_MIN, 0, 0, false, 0, false, 0}
#define sns_delta_angle_event_init_default       {0, {0, 0, 0, 0}, 0, {sns_delta_angle_quat_history_init_default, sns_delta_angle_quat_history_init_default}, 0, {0, 0, 0, 0}}
#define sns_delta_angle_quat_history_init_zero   {0, 0, {0, 0, 0, 0}}
#define sns_delta_angle_config_init_zero         {_sns_delta_angle_ori_type_MIN, 0, 0, false, 0, false, 0}
#define sns_delta_angle_event_init_zero          {0, {0, 0, 0, 0}, 0, {sns_delta_angle_quat_history_init_zero, sns_delta_angle_quat_history_init_zero}, 0, {0, 0, 0, 0}}

/* Field tags (for use in manual encoding/decoding) */
#define sns_delta_angle_quat_history_quat_ts_tag 1
#define sns_delta_angle_quat_history_quat_tag    2
#define sns_delta_angle_config_ori_type_tag      1
#define sns_delta_angle_config_radians_tag       2
#define sns_delta_angle_config_latency_us_tag    3
#define sns_delta_angle_config_quat_output_enable_tag 4
#define sns_delta_angle_config_quat_history_enable_tag 5
#define sns_delta_angle_event_quat_tag           1
#define sns_delta_angle_event_history_tag        2
#define sns_delta_angle_event_init_quat_tag      3

/* Struct field encoding specification for nanopb */
#define sns_delta_angle_quat_history_FIELDLIST(X, a) \
X(a, STATIC,   REQUIRED, UINT64,   quat_ts,           1) \
X(a, STATIC,   REPEATED, FLOAT,    quat,              2)
#define sns_delta_angle_quat_history_CALLBACK NULL
#define sns_delta_angle_quat_history_DEFAULT NULL

#define sns_delta_angle_config_FIELDLIST(X, a) \
X(a, STATIC,   REQUIRED, UENUM,    ori_type,          1) \
X(a, STATIC,   REQUIRED, FLOAT,    radians,           2) \
X(a, STATIC,   REQUIRED, UINT32,   latency_us,        3) \
X(a, STATIC,   OPTIONAL, BOOL,     quat_output_enable,   4) \
X(a, STATIC,   OPTIONAL, BOOL,     quat_history_enable,   5)
#define sns_delta_angle_config_CALLBACK NULL
#define sns_delta_angle_config_DEFAULT (const pb_byte_t*)"\x08\x01\x00"

#define sns_delta_angle_event_FIELDLIST(X, a) \
X(a, STATIC,   REPEATED, FLOAT,    quat,              1) \
X(a, STATIC,   REPEATED, MESSAGE,  history,           2) \
X(a, STATIC,   REPEATED, FLOAT,    init_quat,         3)
#define sns_delta_angle_event_CALLBACK NULL
#define sns_delta_angle_event_DEFAULT NULL
#define sns_delta_angle_event_history_MSGTYPE sns_delta_angle_quat_history

extern const pb_msgdesc_t sns_delta_angle_quat_history_msg;
extern const pb_msgdesc_t sns_delta_angle_config_msg;
extern const pb_msgdesc_t sns_delta_angle_event_msg;

/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
#define sns_delta_angle_quat_history_fields &sns_delta_angle_quat_history_msg
#define sns_delta_angle_config_fields &sns_delta_angle_config_msg
#define sns_delta_angle_event_fields &sns_delta_angle_event_msg

/* Maximum encoded size of messages (where known) */
#define SNS_DELTA_ANGLE_PB_H_MAX_SIZE            sns_delta_angle_event_size
#define sns_delta_angle_config_size              17
#define sns_delta_angle_event_size               106
#define sns_delta_angle_quat_history_size        31

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif
