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

#ifndef PB_SNS_DIAG_SENSOR_PB_H_INCLUDED
#define PB_SNS_DIAG_SENSOR_PB_H_INCLUDED
#include <pb.h>
#include "sns_std_type.pb.h"
#include "sns_client.pb.h"
#include "sns_direct_channel.pb.h"

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

/* Enum definitions */
/* @brief Stream requests and events. */
typedef enum _sns_diag_sensor_msgid {
    SNS_DIAG_SENSOR_MSGID_SNS_DIAG_LOG_TRIGGER_REQ = 520,
    /* @brief Request msg ID to query active client requests running on
 client manager. */
    SNS_DIAG_SENSOR_MSGID_SNS_DIAG_GET_CM_ACTIVE_CLIENT_REQ = 521,
    /* @brief Request msg ID to query debug information. */
    SNS_DIAG_SENSOR_MSGID_SNS_DIAG_DEBUG_REQ = 522,
    /* @brief A single Event sent to client for the active client requests
 running on  Client manager. */
    SNS_DIAG_SENSOR_MSGID_SNS_DIAG_CM_ACTIVE_CLIENT_REQ_EVENT = 800,
    /* @brief Event sent to client containing debug information. */
    SNS_DIAG_SENSOR_MSGID_SNS_DIAG_DEBUG_EVENT = 801
} sns_diag_sensor_msgid;

/* @brief Log packets that can be triggered by the diag sensor. */
typedef enum _sns_diag_triggered_log_type {
    /* @brief Triggers generation not initialized. */
    SNS_DIAG_TRIGGERED_LOG_TYPE_UNINITIALIZED = 0,
    /* @brief Triggers generation of sns_diag_island_transition_log.
 Only one log is generated per request. ( see sns_diag.proto,
 sns_diag_island_log message for more details.) */
    SNS_DIAG_TRIGGERED_LOG_TYPE_ISLAND_LOG = 1,
    /* @brief Triggers generation of sns_diag_mem_utilization_log.
 A single request will generate a log for each separate memory
 pool in the system. ( see sns_diag.proto, sns_diag_mem_utilization_log
 message for more details.) */
    SNS_DIAG_TRIGGERED_LOG_TYPE_MEMORY_USAGE_LOG = 2
} sns_diag_triggered_log_type;

/* @brief Debug mask flags for filtering debug state information
 These masks can be combined using bitwise OR to request multiple debug states
 Note: These are bitmask values */
typedef enum _sns_diag_debug_mask {
    /* @brief No debug information requested */
    SNS_DIAG_INVALID_DEBUG_MASK = 0,
    /* @brief Request power rail debug information */
    SNS_DIAG_POWER_RAIL_DEBUG_MASK = 1,
    /* @brief Request sleep debug information */
    SNS_DIAG_SLEEP_DEBUG_MASK = 2,
    /* @brief Request clock debug information */
    SNS_DIAG_CLOCK_DEBUG_MASK = 4,
    /* @brief Request latency debug information */
    SNS_DIAG_LATENCY_DEBUG_MASK = 8,
    /* @brief Request bandwidth debug information */
    SNS_DIAG_BANDWIDTH_DEBUG_MASK = 16,
    /* @brief Request island mode debug information */
    SNS_DIAG_ISLAND_DEBUG_MASK = 32
} sns_diag_debug_mask;

/* @brief Power rail vote */
typedef enum _sns_diag_power_rail_vote {
    /* @brief Power rail vote is unknown */
    SNS_DIAG_POWER_RAIL_VOTE_UNKNOWN = 0,
    /* @brief Power rail vote is off */
    SNS_DIAG_POWER_RAIL_VOTE_OFF = 1,
    /* @brief Power rail vote is on in low power mode */
    SNS_DIAG_POWER_RAIL_VOTE_ON_LPM = 2,
    /* @brief Power rail vote is on in normal power mode */
    SNS_DIAG_POWER_RAIL_VOTE_ON_NPM = 3
} sns_diag_power_rail_vote;

/* @brief Island mode vote status */
typedef enum _sns_diag_island_vote {
    /* @brief Island vote status is unknown or not initialized */
    SNS_DIAG_ISLAND_VOTE_UNKNOWN = 0,
    /* @brief Client is blocking island mode entry
 Prevents the system from entering low-power island mode */
    SNS_DIAG_ISLAND_VOTE_BLOCK = 1,
    /* @brief Client is not blocking island mode entry
 Allows the system to enter low-power island mode */
    SNS_DIAG_ISLAND_VOTE_UNBLOCK = 2
} sns_diag_island_vote;

/* @brief Clock domain identifiers
 Identifies different clock domains in the system that can be voted on */
typedef enum _sns_diag_clock_id {
    /* @brief Clock ID is unknown or not initialized */
    SNS_DIAG_CLOCK_ID_UNKNOWN = 0,
    /* @brief Clock ID for processor running the sensing hub */
    SNS_DIAG_CLOCK_ID_CPU = 1,
    /* @brief SDC clock */
    SNS_DIAG_CLOCK_ID_SDC = 2,
    /* @brief CCD clock */
    SNS_DIAG_CLOCK_ID_CCD = 3,
    /* @brief PRAM clock */
    SNS_DIAG_CLOCK_ID_PRAM = 4,
    /* @brief PSC clock */
    SNS_DIAG_CLOCK_ID_PSC = 5
} sns_diag_clock_id;

/* @brief Latency vote status */
typedef enum _sns_diag_latency_vote_status {
    /* @brief Latency vote status is unknown or not initialized */
    SNS_DIAG_LATENCY_VOTE_STATUS_UNKNOWN = 0,
    /* @brief Latency vote is active */
    SNS_DIAG_LATENCY_VOTE_STATUS_ACTIVE = 1,
    /* @brief Latency vote is inactive */
    SNS_DIAG_LATENCY_VOTE_STATUS_INACTIVE = 2
} sns_diag_latency_vote_status;

/* @brief Sleep processor identifiers */
typedef enum _sns_diag_sleep_proc {
    /* @brief Sleep processor is unknown or not initialized */
    SNS_DIAG_SLEEP_PROC_UNKNOWN = 0,
    /* @brief Processor running the sensing hub */
    SNS_DIAG_SLEEP_PROC_CPU = 1,
    /* @brief SDC processor */
    SNS_DIAG_SLEEP_PROC_SDC = 2
} sns_diag_sleep_proc;

/* @brief Bandwidth processor identifiers
 Identifies which processor is requesting bandwidth */
typedef enum _sns_diag_bandwidth_proc {
    /* @brief Bandwidth processor is unknown or not initialized */
    SNS_DIAG_BANDWIDTH_PROC_UNKNOWN = 0,
    /* @brief Bandwidth processor running the sensing hub */
    SNS_DIAG_BANDWIDTH_PROC_CPU = 1,
    /* @brief Bandwidth processor is SDC */
    SNS_DIAG_BANDWIDTH_PROC_SDC = 2
} sns_diag_bandwidth_proc;

/* @brief Bandwidth memory types
 Identifies the memory type for bandwidth requests */
typedef enum _sns_diag_bandwidth_memory {
    /* @brief Bandwidth memory is unknown or not initialized */
    SNS_DIAG_BANDWIDTH_MEMORY_UNKNOWN = 0,
    /* @brief Bandwidth memory is DDR */
    SNS_DIAG_BANDWIDTH_MEMORY_DDR = 1,
    /* @brief Bandwidth memory is SRAM */
    SNS_DIAG_BANDWIDTH_MEMORY_SRAM = 2,
    /* @brief Bandwidth memory is TCM */
    SNS_DIAG_BANDWIDTH_MEMORY_TCM = 3
} sns_diag_bandwidth_memory;

/* Struct definitions */
/* @brief Trigger generation of log packets. Depending upon
 the type of log packet that is being triggered,
 multiple log packets can be triggered for each
 request.

 If the log packet that is triggered has been disabled
 no log will be generated. */
typedef struct _sns_diag_log_trigger_req {
    /* @brief User defined cookie.
 Used by test scripts to identify logs triggered
 by messages sent to the SSC. */
    bool has_cookie;
    uint64_t cookie;
    /* @brief The type of log packets that the diag sensor must
 generate. */
    sns_diag_triggered_log_type log_type;
} sns_diag_log_trigger_req;

/* @brief An Event generated by Diag sensor listing all the active
 client request running on Client Manager and Direct Channel Client
 Manager. It may be split into multiple Events. */
typedef struct _sns_diag_cm_active_client_req_event {
    pb_callback_t cm_request;
    /* @brief Client may send multiple config requests on the same channel if
 the direct channel type is DIRECT_CHANNEL_TYPE_STRUCTURED_MUX_CHANNEL. */
    pb_callback_t direct_channel_cm_request;
    /* @brief partial_event is set to true if additional
 sns_diag_cm_active_client_req_event messages will be sent to the client,
 and set to false for the final message. */
    bool has_partial_event;
    bool partial_event;
} sns_diag_cm_active_client_req_event;

typedef struct _sns_diag_cm_active_client_req_event_request_msg {
    /* @brief Timestamp (in ticks) when request was received by Client manager
 to activate sensor. */
    uint64_t timestamp;
    /* @brief Client request. */
    sns_client_request_msg request;
} sns_diag_cm_active_client_req_event_request_msg;

typedef struct _sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_create_msg {
    /* @brief Timestamp when the create request was received by direct channel
 client manager. */
    bool has_timestamp;
    uint64_t timestamp;
    /* @brief Create request */
    bool has_request;
    sns_direct_channel_create_msg request;
} sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_create_msg;

typedef struct _sns_diag_cm_active_client_req_event_direct_channel_request_msg {
    bool has_create_request;
    sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_create_msg create_request;
    pb_callback_t config_request;
} sns_diag_cm_active_client_req_event_direct_channel_request_msg;

typedef struct _sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_config_msg {
    /* @brief Timestamp (in ticks) when the last configuration request was
 received by direct channel client manager. */
    bool has_timestamp;
    uint64_t timestamp;
    /* @brief Configuration request */
    bool has_request;
    sns_direct_channel_config_msg request;
} sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_config_msg;

/* @brief Request message to query debug information */
typedef struct _sns_diag_debug_req {
    /* @brief Bitmask filter to request for specific debug states.
 If it is not specified, all the debug states will be reported.
 sns_diag_debug_mask values can be combined using bitwise OR to request for
 multiple debug states.
 Examples:
 1. SNS_DIAG_POWER_RAIL_DEBUG_MASK to request for power rail debug
    information only.
 2. (SNS_DIAG_POWER_RAIL_DEBUG_MASK | SNS_DIAG_CLOCK_DEBUG_MASK)
    to request both power rail and clock debug information */
    bool has_debug_mask_filter;
    uint32_t debug_mask_filter;
} sns_diag_debug_req;

/* @brief Power rail info
 Contains information about all power rails and their votes */
typedef struct _sns_diag_power_rail_info {
    /* @brief List of all power rails */
    pb_callback_t rails;
} sns_diag_power_rail_info;

/* @brief Current state of the power rail */
typedef struct _sns_diag_power_rail_info_rail_info_vote_state {
    /* @brief Current vote on the power rail */
    bool has_vote;
    sns_diag_power_rail_vote vote;
    /* @brief Timestamp (in ticks) when the rail vote was set */
    bool has_vote_ts;
    uint64_t vote_ts;
} sns_diag_power_rail_info_rail_info_vote_state;

/* @brief Information about a single power rail */
typedef struct _sns_diag_power_rail_info_rail_info {
    /* @brief Name of the power rail */
    pb_callback_t name;
    /* @brief Current state of this power rail */
    bool has_state;
    sns_diag_power_rail_info_rail_info_vote_state state;
    /* @brief List of clients using this power rail */
    pb_callback_t clients;
} sns_diag_power_rail_info_rail_info;

/* @brief Client information for power rail */
typedef struct _sns_diag_power_rail_info_rail_info_client {
    /* @brief Name of the client using this power rail */
    pb_callback_t name;
} sns_diag_power_rail_info_rail_info_client;

/* @brief Island mode state information
 Contains information about all clients and their island mode votes */
typedef struct _sns_diag_island_info {
    /* @brief List of all island clients */
    pb_callback_t clients;
} sns_diag_island_info;

/* @brief Current state of the client's island mode vote */
typedef struct _sns_diag_island_info_client_info_vote_state {
    /* @brief Current island mode vote from this client */
    bool has_vote;
    sns_diag_island_vote vote;
    /* @brief Timestamp when the client vote was set (in ticks) */
    bool has_vote_ts;
    uint64_t vote_ts;
} sns_diag_island_info_client_info_vote_state;

/* @brief Information about a single island client */
typedef struct _sns_diag_island_info_client_info {
    /* @brief Name of the client */
    pb_callback_t name;
    /* @brief Current state of this client's island mode vote */
    bool has_state;
    sns_diag_island_info_client_info_vote_state state;
    /* @brief Duration of the last island block period (in ticks)
 Only valid if the client has previously blocked island mode.
 Note: The current island block duration is not included if the client is
 currently blocking island. */
    bool has_last_block_duration;
    uint64_t last_block_duration;
} sns_diag_island_info_client_info;

/* @brief Clock info
 Contains information about all clients and their clock frequency votes */
typedef struct _sns_diag_clock_info {
    /* @brief List of all clients with clock votes */
    pb_callback_t clients;
} sns_diag_clock_info;

/* @brief Information about a single client's clock vote */
typedef struct _sns_diag_clock_info_client_info {
    /* @brief Name of the client */
    pb_callback_t name;
    /* @brief Clock domain being voted on */
    bool has_clock_id;
    sns_diag_clock_id clock_id;
    /* @brief Clock frequency vote in Hz */
    bool has_clock_vote;
    uint64_t clock_vote;
} sns_diag_clock_info_client_info;

/* @brief Latency info
 Contains information about all clients and their latency requirement votes */
typedef struct _sns_diag_latency_info {
    /* @brief List of all clients with latency votes */
    pb_callback_t clients;
} sns_diag_latency_info;

/* @brief Information about a single client's latency vote */
typedef struct _sns_diag_latency_info_client_info {
    /* @brief Name of the client */
    pb_callback_t name;
    /* @brief Maximum acceptable latency vote in microseconds */
    bool has_latency_vote;
    uint64_t latency_vote;
    /* @brief Current status of this client's latency vote */
    bool has_latency_vote_status;
    sns_diag_latency_vote_status latency_vote_status;
    /* @brief Timestamp when this vote state was last updated (in ticks) */
    bool has_latency_vote_ts;
    uint64_t latency_vote_ts;
    /* @brief Last duration for which latency vote remained active (in ticks)
 Note: The current active duration is not included if the client currently
 has an active latency vote */
    bool has_last_active_duration;
    uint64_t last_active_duration;
} sns_diag_latency_info_client_info;

/* @brief Sleep info
 Contains information about processor and their wakeup rate requirements */
typedef struct _sns_diag_sleep_info {
    /* @brief List of all processors with sleep configurations */
    pb_callback_t procs;
} sns_diag_sleep_info;

/* @brief Wakeup rate requirements for different power modes */
typedef struct _sns_diag_sleep_info_proc_info_wakeup_rate_info {
    /* @brief Wakeup rate in Low Power Mode (Hz)
 Identifies how frequently the CPU needs to wake up in LPM */
    bool has_lpm;
    uint32_t lpm;
    /* @brief Wakeup rate in Normal Power Mode (Hz)
 Identifies how frequently the CPU needs to wake up in NPM */
    bool has_npm;
    uint32_t npm;
} sns_diag_sleep_info_proc_info_wakeup_rate_info;

/* @brief Information about a single CPU's sleep configuration */
typedef struct _sns_diag_sleep_info_proc_info {
    /* @brief Processor identifier */
    bool has_proc;
    sns_diag_sleep_proc proc;
    /* @brief Current wakeup rate configuration for this CPU */
    bool has_wakeup_rate;
    sns_diag_sleep_info_proc_info_wakeup_rate_info wakeup_rate;
} sns_diag_sleep_info_proc_info;

/* @brief Bandwidth info
 Contains information about all clients and their bandwidth votes */
typedef struct _sns_diag_bandwidth_info {
    /* @brief List of all clients with bandwidth votes */
    pb_callback_t clients;
} sns_diag_bandwidth_info;

/* @brief Information about a single client's bandwidth vote */
typedef struct _sns_diag_bandwidth_info_client_info {
    /* @brief Name of the client */
    pb_callback_t name;
    /* @brief Processor making the bandwidth request */
    bool has_proc;
    sns_diag_bandwidth_proc proc;
    /* @brief Memory type for the bandwidth request */
    bool has_memory;
    sns_diag_bandwidth_memory memory;
    /* @brief Bandwidth vote in bytes per second */
    bool has_bandwidth_vote;
    uint64_t bandwidth_vote;
} sns_diag_bandwidth_info_client_info;

/* @brief Debug information */
typedef struct _sns_diag_debug_info {
    pb_size_t which_debug_info;
    union {
        /* @brief Power rail info
     Sent when SNS_DIAG_POWER_RAIL_DEBUG_MASK is set */
        sns_diag_power_rail_info power_rail_info;
        /* @brief Clock info
     Sent when SNS_DIAG_CLOCK_DEBUG_MASK is set */
        sns_diag_clock_info clock_info;
        /* @brief Latency info
     Sent when SNS_DIAG_LATENCY_DEBUG_MASK is set */
        sns_diag_latency_info latency_info;
        /* @brief Sleep info
     Sent when SNS_DIAG_SLEEP_DEBUG_MASK is set */
        sns_diag_sleep_info sleep_info;
        /* @brief Bandwidth info
     Sent when SNS_DIAG_BANDWIDTH_DEBUG_MASK is set */
        sns_diag_bandwidth_info bandwidth_info;
        /* @brief Island mode info
     Sent when SNS_DIAG_ISLAND_DEBUG_MASK is set */
        sns_diag_island_info island_info;
    } debug_info;
} sns_diag_debug_info;

/* @brief Event message containing debug information
 Response to sns_diag_debug_req. Multiple events may be sent
 if the requested debug information is too large for a single message. */
typedef struct _sns_diag_debug_event {
    /* @brief Indicates if this is a partial event
 When true, additional sns_diag_debug_event messages will be sent.
 When false, this is the final (or only) sns_diag_debug_event message. */
    bool has_partial_event;
    bool partial_event;
    /* @brief List of debug information entries
 Contains the requested debug information types based on the
 debug_mask_filter in sns_diag_debug_req */
    pb_callback_t debug_info;
} sns_diag_debug_event;


#ifdef __cplusplus
extern "C" {
#endif

/* Helper constants for enums */
#define _sns_diag_sensor_msgid_MIN SNS_DIAG_SENSOR_MSGID_SNS_DIAG_LOG_TRIGGER_REQ
#define _sns_diag_sensor_msgid_MAX SNS_DIAG_SENSOR_MSGID_SNS_DIAG_DEBUG_EVENT
#define _sns_diag_sensor_msgid_ARRAYSIZE ((sns_diag_sensor_msgid)(SNS_DIAG_SENSOR_MSGID_SNS_DIAG_DEBUG_EVENT+1))
#define sns_diag_sensor_msgid_SNS_DIAG_SENSOR_MSGID_SNS_DIAG_LOG_TRIGGER_REQ SNS_DIAG_SENSOR_MSGID_SNS_DIAG_LOG_TRIGGER_REQ
#define sns_diag_sensor_msgid_SNS_DIAG_SENSOR_MSGID_SNS_DIAG_GET_CM_ACTIVE_CLIENT_REQ SNS_DIAG_SENSOR_MSGID_SNS_DIAG_GET_CM_ACTIVE_CLIENT_REQ
#define sns_diag_sensor_msgid_SNS_DIAG_SENSOR_MSGID_SNS_DIAG_DEBUG_REQ SNS_DIAG_SENSOR_MSGID_SNS_DIAG_DEBUG_REQ
#define sns_diag_sensor_msgid_SNS_DIAG_SENSOR_MSGID_SNS_DIAG_CM_ACTIVE_CLIENT_REQ_EVENT SNS_DIAG_SENSOR_MSGID_SNS_DIAG_CM_ACTIVE_CLIENT_REQ_EVENT
#define sns_diag_sensor_msgid_SNS_DIAG_SENSOR_MSGID_SNS_DIAG_DEBUG_EVENT SNS_DIAG_SENSOR_MSGID_SNS_DIAG_DEBUG_EVENT

#define _sns_diag_triggered_log_type_MIN SNS_DIAG_TRIGGERED_LOG_TYPE_UNINITIALIZED
#define _sns_diag_triggered_log_type_MAX SNS_DIAG_TRIGGERED_LOG_TYPE_MEMORY_USAGE_LOG
#define _sns_diag_triggered_log_type_ARRAYSIZE ((sns_diag_triggered_log_type)(SNS_DIAG_TRIGGERED_LOG_TYPE_MEMORY_USAGE_LOG+1))
#define sns_diag_triggered_log_type_SNS_DIAG_TRIGGERED_LOG_TYPE_UNINITIALIZED SNS_DIAG_TRIGGERED_LOG_TYPE_UNINITIALIZED
#define sns_diag_triggered_log_type_SNS_DIAG_TRIGGERED_LOG_TYPE_ISLAND_LOG SNS_DIAG_TRIGGERED_LOG_TYPE_ISLAND_LOG
#define sns_diag_triggered_log_type_SNS_DIAG_TRIGGERED_LOG_TYPE_MEMORY_USAGE_LOG SNS_DIAG_TRIGGERED_LOG_TYPE_MEMORY_USAGE_LOG

#define _sns_diag_debug_mask_MIN SNS_DIAG_INVALID_DEBUG_MASK
#define _sns_diag_debug_mask_MAX SNS_DIAG_ISLAND_DEBUG_MASK
#define _sns_diag_debug_mask_ARRAYSIZE ((sns_diag_debug_mask)(SNS_DIAG_ISLAND_DEBUG_MASK+1))
#define sns_diag_debug_mask_SNS_DIAG_INVALID_DEBUG_MASK SNS_DIAG_INVALID_DEBUG_MASK
#define sns_diag_debug_mask_SNS_DIAG_POWER_RAIL_DEBUG_MASK SNS_DIAG_POWER_RAIL_DEBUG_MASK
#define sns_diag_debug_mask_SNS_DIAG_SLEEP_DEBUG_MASK SNS_DIAG_SLEEP_DEBUG_MASK
#define sns_diag_debug_mask_SNS_DIAG_CLOCK_DEBUG_MASK SNS_DIAG_CLOCK_DEBUG_MASK
#define sns_diag_debug_mask_SNS_DIAG_LATENCY_DEBUG_MASK SNS_DIAG_LATENCY_DEBUG_MASK
#define sns_diag_debug_mask_SNS_DIAG_BANDWIDTH_DEBUG_MASK SNS_DIAG_BANDWIDTH_DEBUG_MASK
#define sns_diag_debug_mask_SNS_DIAG_ISLAND_DEBUG_MASK SNS_DIAG_ISLAND_DEBUG_MASK

#define _sns_diag_power_rail_vote_MIN SNS_DIAG_POWER_RAIL_VOTE_UNKNOWN
#define _sns_diag_power_rail_vote_MAX SNS_DIAG_POWER_RAIL_VOTE_ON_NPM
#define _sns_diag_power_rail_vote_ARRAYSIZE ((sns_diag_power_rail_vote)(SNS_DIAG_POWER_RAIL_VOTE_ON_NPM+1))
#define sns_diag_power_rail_vote_SNS_DIAG_POWER_RAIL_VOTE_UNKNOWN SNS_DIAG_POWER_RAIL_VOTE_UNKNOWN
#define sns_diag_power_rail_vote_SNS_DIAG_POWER_RAIL_VOTE_OFF SNS_DIAG_POWER_RAIL_VOTE_OFF
#define sns_diag_power_rail_vote_SNS_DIAG_POWER_RAIL_VOTE_ON_LPM SNS_DIAG_POWER_RAIL_VOTE_ON_LPM
#define sns_diag_power_rail_vote_SNS_DIAG_POWER_RAIL_VOTE_ON_NPM SNS_DIAG_POWER_RAIL_VOTE_ON_NPM

#define _sns_diag_island_vote_MIN SNS_DIAG_ISLAND_VOTE_UNKNOWN
#define _sns_diag_island_vote_MAX SNS_DIAG_ISLAND_VOTE_UNBLOCK
#define _sns_diag_island_vote_ARRAYSIZE ((sns_diag_island_vote)(SNS_DIAG_ISLAND_VOTE_UNBLOCK+1))
#define sns_diag_island_vote_SNS_DIAG_ISLAND_VOTE_UNKNOWN SNS_DIAG_ISLAND_VOTE_UNKNOWN
#define sns_diag_island_vote_SNS_DIAG_ISLAND_VOTE_BLOCK SNS_DIAG_ISLAND_VOTE_BLOCK
#define sns_diag_island_vote_SNS_DIAG_ISLAND_VOTE_UNBLOCK SNS_DIAG_ISLAND_VOTE_UNBLOCK

#define _sns_diag_clock_id_MIN SNS_DIAG_CLOCK_ID_UNKNOWN
#define _sns_diag_clock_id_MAX SNS_DIAG_CLOCK_ID_PSC
#define _sns_diag_clock_id_ARRAYSIZE ((sns_diag_clock_id)(SNS_DIAG_CLOCK_ID_PSC+1))
#define sns_diag_clock_id_SNS_DIAG_CLOCK_ID_UNKNOWN SNS_DIAG_CLOCK_ID_UNKNOWN
#define sns_diag_clock_id_SNS_DIAG_CLOCK_ID_CPU SNS_DIAG_CLOCK_ID_CPU
#define sns_diag_clock_id_SNS_DIAG_CLOCK_ID_SDC SNS_DIAG_CLOCK_ID_SDC
#define sns_diag_clock_id_SNS_DIAG_CLOCK_ID_CCD SNS_DIAG_CLOCK_ID_CCD
#define sns_diag_clock_id_SNS_DIAG_CLOCK_ID_PRAM SNS_DIAG_CLOCK_ID_PRAM
#define sns_diag_clock_id_SNS_DIAG_CLOCK_ID_PSC SNS_DIAG_CLOCK_ID_PSC

#define _sns_diag_latency_vote_status_MIN SNS_DIAG_LATENCY_VOTE_STATUS_UNKNOWN
#define _sns_diag_latency_vote_status_MAX SNS_DIAG_LATENCY_VOTE_STATUS_INACTIVE
#define _sns_diag_latency_vote_status_ARRAYSIZE ((sns_diag_latency_vote_status)(SNS_DIAG_LATENCY_VOTE_STATUS_INACTIVE+1))
#define sns_diag_latency_vote_status_SNS_DIAG_LATENCY_VOTE_STATUS_UNKNOWN SNS_DIAG_LATENCY_VOTE_STATUS_UNKNOWN
#define sns_diag_latency_vote_status_SNS_DIAG_LATENCY_VOTE_STATUS_ACTIVE SNS_DIAG_LATENCY_VOTE_STATUS_ACTIVE
#define sns_diag_latency_vote_status_SNS_DIAG_LATENCY_VOTE_STATUS_INACTIVE SNS_DIAG_LATENCY_VOTE_STATUS_INACTIVE

#define _sns_diag_sleep_proc_MIN SNS_DIAG_SLEEP_PROC_UNKNOWN
#define _sns_diag_sleep_proc_MAX SNS_DIAG_SLEEP_PROC_SDC
#define _sns_diag_sleep_proc_ARRAYSIZE ((sns_diag_sleep_proc)(SNS_DIAG_SLEEP_PROC_SDC+1))
#define sns_diag_sleep_proc_SNS_DIAG_SLEEP_PROC_UNKNOWN SNS_DIAG_SLEEP_PROC_UNKNOWN
#define sns_diag_sleep_proc_SNS_DIAG_SLEEP_PROC_CPU SNS_DIAG_SLEEP_PROC_CPU
#define sns_diag_sleep_proc_SNS_DIAG_SLEEP_PROC_SDC SNS_DIAG_SLEEP_PROC_SDC

#define _sns_diag_bandwidth_proc_MIN SNS_DIAG_BANDWIDTH_PROC_UNKNOWN
#define _sns_diag_bandwidth_proc_MAX SNS_DIAG_BANDWIDTH_PROC_SDC
#define _sns_diag_bandwidth_proc_ARRAYSIZE ((sns_diag_bandwidth_proc)(SNS_DIAG_BANDWIDTH_PROC_SDC+1))
#define sns_diag_bandwidth_proc_SNS_DIAG_BANDWIDTH_PROC_UNKNOWN SNS_DIAG_BANDWIDTH_PROC_UNKNOWN
#define sns_diag_bandwidth_proc_SNS_DIAG_BANDWIDTH_PROC_CPU SNS_DIAG_BANDWIDTH_PROC_CPU
#define sns_diag_bandwidth_proc_SNS_DIAG_BANDWIDTH_PROC_SDC SNS_DIAG_BANDWIDTH_PROC_SDC

#define _sns_diag_bandwidth_memory_MIN SNS_DIAG_BANDWIDTH_MEMORY_UNKNOWN
#define _sns_diag_bandwidth_memory_MAX SNS_DIAG_BANDWIDTH_MEMORY_TCM
#define _sns_diag_bandwidth_memory_ARRAYSIZE ((sns_diag_bandwidth_memory)(SNS_DIAG_BANDWIDTH_MEMORY_TCM+1))
#define sns_diag_bandwidth_memory_SNS_DIAG_BANDWIDTH_MEMORY_UNKNOWN SNS_DIAG_BANDWIDTH_MEMORY_UNKNOWN
#define sns_diag_bandwidth_memory_SNS_DIAG_BANDWIDTH_MEMORY_DDR SNS_DIAG_BANDWIDTH_MEMORY_DDR
#define sns_diag_bandwidth_memory_SNS_DIAG_BANDWIDTH_MEMORY_SRAM SNS_DIAG_BANDWIDTH_MEMORY_SRAM
#define sns_diag_bandwidth_memory_SNS_DIAG_BANDWIDTH_MEMORY_TCM SNS_DIAG_BANDWIDTH_MEMORY_TCM

#define sns_diag_log_trigger_req_log_type_ENUMTYPE sns_diag_triggered_log_type









#define sns_diag_power_rail_info_rail_info_vote_state_vote_ENUMTYPE sns_diag_power_rail_vote




#define sns_diag_island_info_client_info_vote_state_vote_ENUMTYPE sns_diag_island_vote


#define sns_diag_clock_info_client_info_clock_id_ENUMTYPE sns_diag_clock_id


#define sns_diag_latency_info_client_info_latency_vote_status_ENUMTYPE sns_diag_latency_vote_status


#define sns_diag_sleep_info_proc_info_proc_ENUMTYPE sns_diag_sleep_proc



#define sns_diag_bandwidth_info_client_info_proc_ENUMTYPE sns_diag_bandwidth_proc
#define sns_diag_bandwidth_info_client_info_memory_ENUMTYPE sns_diag_bandwidth_memory




/* Initializer values for message structs */
#define sns_diag_log_trigger_req_init_default    {false, 0, _sns_diag_triggered_log_type_MIN}
#define sns_diag_cm_active_client_req_event_init_default {{{NULL}, NULL}, {{NULL}, NULL}, false, false}
#define sns_diag_cm_active_client_req_event_request_msg_init_default {0, sns_client_request_msg_init_default}
#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_init_default {false, sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_create_msg_init_default, {{NULL}, NULL}}
#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_create_msg_init_default {false, 0, false, sns_direct_channel_create_msg_init_default}
#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_config_msg_init_default {false, 0, false, sns_direct_channel_config_msg_init_default}
#define sns_diag_debug_req_init_default          {false, 0}
#define sns_diag_power_rail_info_init_default    {{{NULL}, NULL}}
#define sns_diag_power_rail_info_rail_info_init_default {{{NULL}, NULL}, false, sns_diag_power_rail_info_rail_info_vote_state_init_default, {{NULL}, NULL}}
#define sns_diag_power_rail_info_rail_info_vote_state_init_default {false, _sns_diag_power_rail_vote_MIN, false, 0}
#define sns_diag_power_rail_info_rail_info_client_init_default {{{NULL}, NULL}}
#define sns_diag_island_info_init_default        {{{NULL}, NULL}}
#define sns_diag_island_info_client_info_init_default {{{NULL}, NULL}, false, sns_diag_island_info_client_info_vote_state_init_default, false, 0}
#define sns_diag_island_info_client_info_vote_state_init_default {false, _sns_diag_island_vote_MIN, false, 0}
#define sns_diag_clock_info_init_default         {{{NULL}, NULL}}
#define sns_diag_clock_info_client_info_init_default {{{NULL}, NULL}, false, _sns_diag_clock_id_MIN, false, 0}
#define sns_diag_latency_info_init_default       {{{NULL}, NULL}}
#define sns_diag_latency_info_client_info_init_default {{{NULL}, NULL}, false, 0, false, _sns_diag_latency_vote_status_MIN, false, 0, false, 0}
#define sns_diag_sleep_info_init_default         {{{NULL}, NULL}}
#define sns_diag_sleep_info_proc_info_init_default {false, _sns_diag_sleep_proc_MIN, false, sns_diag_sleep_info_proc_info_wakeup_rate_info_init_default}
#define sns_diag_sleep_info_proc_info_wakeup_rate_info_init_default {false, 0, false, 0}
#define sns_diag_bandwidth_info_init_default     {{{NULL}, NULL}}
#define sns_diag_bandwidth_info_client_info_init_default {{{NULL}, NULL}, false, _sns_diag_bandwidth_proc_MIN, false, _sns_diag_bandwidth_memory_MIN, false, 0}
#define sns_diag_debug_info_init_default         {0, {sns_diag_power_rail_info_init_default}}
#define sns_diag_debug_event_init_default        {false, 0, {{NULL}, NULL}}
#define sns_diag_log_trigger_req_init_zero       {false, 0, _sns_diag_triggered_log_type_MIN}
#define sns_diag_cm_active_client_req_event_init_zero {{{NULL}, NULL}, {{NULL}, NULL}, false, 0}
#define sns_diag_cm_active_client_req_event_request_msg_init_zero {0, sns_client_request_msg_init_zero}
#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_init_zero {false, sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_create_msg_init_zero, {{NULL}, NULL}}
#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_create_msg_init_zero {false, 0, false, sns_direct_channel_create_msg_init_zero}
#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_config_msg_init_zero {false, 0, false, sns_direct_channel_config_msg_init_zero}
#define sns_diag_debug_req_init_zero             {false, 0}
#define sns_diag_power_rail_info_init_zero       {{{NULL}, NULL}}
#define sns_diag_power_rail_info_rail_info_init_zero {{{NULL}, NULL}, false, sns_diag_power_rail_info_rail_info_vote_state_init_zero, {{NULL}, NULL}}
#define sns_diag_power_rail_info_rail_info_vote_state_init_zero {false, _sns_diag_power_rail_vote_MIN, false, 0}
#define sns_diag_power_rail_info_rail_info_client_init_zero {{{NULL}, NULL}}
#define sns_diag_island_info_init_zero           {{{NULL}, NULL}}
#define sns_diag_island_info_client_info_init_zero {{{NULL}, NULL}, false, sns_diag_island_info_client_info_vote_state_init_zero, false, 0}
#define sns_diag_island_info_client_info_vote_state_init_zero {false, _sns_diag_island_vote_MIN, false, 0}
#define sns_diag_clock_info_init_zero            {{{NULL}, NULL}}
#define sns_diag_clock_info_client_info_init_zero {{{NULL}, NULL}, false, _sns_diag_clock_id_MIN, false, 0}
#define sns_diag_latency_info_init_zero          {{{NULL}, NULL}}
#define sns_diag_latency_info_client_info_init_zero {{{NULL}, NULL}, false, 0, false, _sns_diag_latency_vote_status_MIN, false, 0, false, 0}
#define sns_diag_sleep_info_init_zero            {{{NULL}, NULL}}
#define sns_diag_sleep_info_proc_info_init_zero  {false, _sns_diag_sleep_proc_MIN, false, sns_diag_sleep_info_proc_info_wakeup_rate_info_init_zero}
#define sns_diag_sleep_info_proc_info_wakeup_rate_info_init_zero {false, 0, false, 0}
#define sns_diag_bandwidth_info_init_zero        {{{NULL}, NULL}}
#define sns_diag_bandwidth_info_client_info_init_zero {{{NULL}, NULL}, false, _sns_diag_bandwidth_proc_MIN, false, _sns_diag_bandwidth_memory_MIN, false, 0}
#define sns_diag_debug_info_init_zero            {0, {sns_diag_power_rail_info_init_zero}}
#define sns_diag_debug_event_init_zero           {false, 0, {{NULL}, NULL}}

/* Field tags (for use in manual encoding/decoding) */
#define sns_diag_log_trigger_req_cookie_tag      1
#define sns_diag_log_trigger_req_log_type_tag    2
#define sns_diag_cm_active_client_req_event_cm_request_tag 1
#define sns_diag_cm_active_client_req_event_direct_channel_cm_request_tag 2
#define sns_diag_cm_active_client_req_event_partial_event_tag 3
#define sns_diag_cm_active_client_req_event_request_msg_timestamp_tag 1
#define sns_diag_cm_active_client_req_event_request_msg_request_tag 2
#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_create_msg_timestamp_tag 1
#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_create_msg_request_tag 2
#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_create_request_tag 1
#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_config_request_tag 2
#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_config_msg_timestamp_tag 1
#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_config_msg_request_tag 2
#define sns_diag_debug_req_debug_mask_filter_tag 1
#define sns_diag_power_rail_info_rails_tag       1
#define sns_diag_power_rail_info_rail_info_vote_state_vote_tag 1
#define sns_diag_power_rail_info_rail_info_vote_state_vote_ts_tag 2
#define sns_diag_power_rail_info_rail_info_name_tag 1
#define sns_diag_power_rail_info_rail_info_state_tag 2
#define sns_diag_power_rail_info_rail_info_clients_tag 3
#define sns_diag_power_rail_info_rail_info_client_name_tag 1
#define sns_diag_island_info_clients_tag         1
#define sns_diag_island_info_client_info_vote_state_vote_tag 1
#define sns_diag_island_info_client_info_vote_state_vote_ts_tag 2
#define sns_diag_island_info_client_info_name_tag 1
#define sns_diag_island_info_client_info_state_tag 2
#define sns_diag_island_info_client_info_last_block_duration_tag 3
#define sns_diag_clock_info_clients_tag          1
#define sns_diag_clock_info_client_info_name_tag 1
#define sns_diag_clock_info_client_info_clock_id_tag 2
#define sns_diag_clock_info_client_info_clock_vote_tag 3
#define sns_diag_latency_info_clients_tag        1
#define sns_diag_latency_info_client_info_name_tag 1
#define sns_diag_latency_info_client_info_latency_vote_tag 2
#define sns_diag_latency_info_client_info_latency_vote_status_tag 3
#define sns_diag_latency_info_client_info_latency_vote_ts_tag 4
#define sns_diag_latency_info_client_info_last_active_duration_tag 5
#define sns_diag_sleep_info_procs_tag            1
#define sns_diag_sleep_info_proc_info_wakeup_rate_info_lpm_tag 1
#define sns_diag_sleep_info_proc_info_wakeup_rate_info_npm_tag 2
#define sns_diag_sleep_info_proc_info_proc_tag   1
#define sns_diag_sleep_info_proc_info_wakeup_rate_tag 2
#define sns_diag_bandwidth_info_clients_tag      1
#define sns_diag_bandwidth_info_client_info_name_tag 1
#define sns_diag_bandwidth_info_client_info_proc_tag 2
#define sns_diag_bandwidth_info_client_info_memory_tag 3
#define sns_diag_bandwidth_info_client_info_bandwidth_vote_tag 4
#define sns_diag_debug_info_power_rail_info_tag  1
#define sns_diag_debug_info_clock_info_tag       2
#define sns_diag_debug_info_latency_info_tag     3
#define sns_diag_debug_info_sleep_info_tag       4
#define sns_diag_debug_info_bandwidth_info_tag   5
#define sns_diag_debug_info_island_info_tag      6
#define sns_diag_debug_event_partial_event_tag   1
#define sns_diag_debug_event_debug_info_tag      2

/* Struct field encoding specification for nanopb */
#define sns_diag_log_trigger_req_FIELDLIST(X, a) \
X(a, STATIC,   OPTIONAL, FIXED64,  cookie,            1) \
X(a, STATIC,   REQUIRED, UENUM,    log_type,          2)
#define sns_diag_log_trigger_req_CALLBACK NULL
#define sns_diag_log_trigger_req_DEFAULT NULL

#define sns_diag_cm_active_client_req_event_FIELDLIST(X, a) \
X(a, CALLBACK, REPEATED, MESSAGE,  cm_request,        1) \
X(a, CALLBACK, REPEATED, MESSAGE,  direct_channel_cm_request,   2) \
X(a, STATIC,   OPTIONAL, BOOL,     partial_event,     3)
#define sns_diag_cm_active_client_req_event_CALLBACK pb_default_field_callback
#define sns_diag_cm_active_client_req_event_DEFAULT (const pb_byte_t*)"\x18\x00\x00"
#define sns_diag_cm_active_client_req_event_cm_request_MSGTYPE sns_diag_cm_active_client_req_event_request_msg
#define sns_diag_cm_active_client_req_event_direct_channel_cm_request_MSGTYPE sns_diag_cm_active_client_req_event_direct_channel_request_msg

#define sns_diag_cm_active_client_req_event_request_msg_FIELDLIST(X, a) \
X(a, STATIC,   REQUIRED, FIXED64,  timestamp,         1) \
X(a, STATIC,   REQUIRED, MESSAGE,  request,           2)
#define sns_diag_cm_active_client_req_event_request_msg_CALLBACK NULL
#define sns_diag_cm_active_client_req_event_request_msg_DEFAULT NULL
#define sns_diag_cm_active_client_req_event_request_msg_request_MSGTYPE sns_client_request_msg

#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_FIELDLIST(X, a) \
X(a, STATIC,   OPTIONAL, MESSAGE,  create_request,    1) \
X(a, CALLBACK, REPEATED, MESSAGE,  config_request,    2)
#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_CALLBACK pb_default_field_callback
#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_DEFAULT NULL
#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_create_request_MSGTYPE sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_create_msg
#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_config_request_MSGTYPE sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_config_msg

#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_create_msg_FIELDLIST(X, a) \
X(a, STATIC,   OPTIONAL, FIXED64,  timestamp,         1) \
X(a, STATIC,   OPTIONAL, MESSAGE,  request,           2)
#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_create_msg_CALLBACK NULL
#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_create_msg_DEFAULT NULL
#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_create_msg_request_MSGTYPE sns_direct_channel_create_msg

#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_config_msg_FIELDLIST(X, a) \
X(a, STATIC,   OPTIONAL, FIXED64,  timestamp,         1) \
X(a, STATIC,   OPTIONAL, MESSAGE,  request,           2)
#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_config_msg_CALLBACK NULL
#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_config_msg_DEFAULT NULL
#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_config_msg_request_MSGTYPE sns_direct_channel_config_msg

#define sns_diag_debug_req_FIELDLIST(X, a) \
X(a, STATIC,   OPTIONAL, UINT32,   debug_mask_filter,   1)
#define sns_diag_debug_req_CALLBACK NULL
#define sns_diag_debug_req_DEFAULT NULL

#define sns_diag_power_rail_info_FIELDLIST(X, a) \
X(a, CALLBACK, REPEATED, MESSAGE,  rails,             1)
#define sns_diag_power_rail_info_CALLBACK pb_default_field_callback
#define sns_diag_power_rail_info_DEFAULT NULL
#define sns_diag_power_rail_info_rails_MSGTYPE sns_diag_power_rail_info_rail_info

#define sns_diag_power_rail_info_rail_info_FIELDLIST(X, a) \
X(a, CALLBACK, OPTIONAL, STRING,   name,              1) \
X(a, STATIC,   OPTIONAL, MESSAGE,  state,             2) \
X(a, CALLBACK, REPEATED, MESSAGE,  clients,           3)
#define sns_diag_power_rail_info_rail_info_CALLBACK pb_default_field_callback
#define sns_diag_power_rail_info_rail_info_DEFAULT NULL
#define sns_diag_power_rail_info_rail_info_state_MSGTYPE sns_diag_power_rail_info_rail_info_vote_state
#define sns_diag_power_rail_info_rail_info_clients_MSGTYPE sns_diag_power_rail_info_rail_info_client

#define sns_diag_power_rail_info_rail_info_vote_state_FIELDLIST(X, a) \
X(a, STATIC,   OPTIONAL, UENUM,    vote,              1) \
X(a, STATIC,   OPTIONAL, FIXED64,  vote_ts,           2)
#define sns_diag_power_rail_info_rail_info_vote_state_CALLBACK NULL
#define sns_diag_power_rail_info_rail_info_vote_state_DEFAULT NULL

#define sns_diag_power_rail_info_rail_info_client_FIELDLIST(X, a) \
X(a, CALLBACK, OPTIONAL, STRING,   name,              1)
#define sns_diag_power_rail_info_rail_info_client_CALLBACK pb_default_field_callback
#define sns_diag_power_rail_info_rail_info_client_DEFAULT NULL

#define sns_diag_island_info_FIELDLIST(X, a) \
X(a, CALLBACK, REPEATED, MESSAGE,  clients,           1)
#define sns_diag_island_info_CALLBACK pb_default_field_callback
#define sns_diag_island_info_DEFAULT NULL
#define sns_diag_island_info_clients_MSGTYPE sns_diag_island_info_client_info

#define sns_diag_island_info_client_info_FIELDLIST(X, a) \
X(a, CALLBACK, OPTIONAL, STRING,   name,              1) \
X(a, STATIC,   OPTIONAL, MESSAGE,  state,             2) \
X(a, STATIC,   OPTIONAL, FIXED64,  last_block_duration,   3)
#define sns_diag_island_info_client_info_CALLBACK pb_default_field_callback
#define sns_diag_island_info_client_info_DEFAULT NULL
#define sns_diag_island_info_client_info_state_MSGTYPE sns_diag_island_info_client_info_vote_state

#define sns_diag_island_info_client_info_vote_state_FIELDLIST(X, a) \
X(a, STATIC,   OPTIONAL, UENUM,    vote,              1) \
X(a, STATIC,   OPTIONAL, FIXED64,  vote_ts,           2)
#define sns_diag_island_info_client_info_vote_state_CALLBACK NULL
#define sns_diag_island_info_client_info_vote_state_DEFAULT NULL

#define sns_diag_clock_info_FIELDLIST(X, a) \
X(a, CALLBACK, REPEATED, MESSAGE,  clients,           1)
#define sns_diag_clock_info_CALLBACK pb_default_field_callback
#define sns_diag_clock_info_DEFAULT NULL
#define sns_diag_clock_info_clients_MSGTYPE sns_diag_clock_info_client_info

#define sns_diag_clock_info_client_info_FIELDLIST(X, a) \
X(a, CALLBACK, OPTIONAL, STRING,   name,              1) \
X(a, STATIC,   OPTIONAL, UENUM,    clock_id,          2) \
X(a, STATIC,   OPTIONAL, UINT64,   clock_vote,        3)
#define sns_diag_clock_info_client_info_CALLBACK pb_default_field_callback
#define sns_diag_clock_info_client_info_DEFAULT NULL

#define sns_diag_latency_info_FIELDLIST(X, a) \
X(a, CALLBACK, REPEATED, MESSAGE,  clients,           1)
#define sns_diag_latency_info_CALLBACK pb_default_field_callback
#define sns_diag_latency_info_DEFAULT NULL
#define sns_diag_latency_info_clients_MSGTYPE sns_diag_latency_info_client_info

#define sns_diag_latency_info_client_info_FIELDLIST(X, a) \
X(a, CALLBACK, OPTIONAL, STRING,   name,              1) \
X(a, STATIC,   OPTIONAL, UINT64,   latency_vote,      2) \
X(a, STATIC,   OPTIONAL, UENUM,    latency_vote_status,   3) \
X(a, STATIC,   OPTIONAL, FIXED64,  latency_vote_ts,   4) \
X(a, STATIC,   OPTIONAL, FIXED64,  last_active_duration,   5)
#define sns_diag_latency_info_client_info_CALLBACK pb_default_field_callback
#define sns_diag_latency_info_client_info_DEFAULT NULL

#define sns_diag_sleep_info_FIELDLIST(X, a) \
X(a, CALLBACK, REPEATED, MESSAGE,  procs,             1)
#define sns_diag_sleep_info_CALLBACK pb_default_field_callback
#define sns_diag_sleep_info_DEFAULT NULL
#define sns_diag_sleep_info_procs_MSGTYPE sns_diag_sleep_info_proc_info

#define sns_diag_sleep_info_proc_info_FIELDLIST(X, a) \
X(a, STATIC,   OPTIONAL, UENUM,    proc,              1) \
X(a, STATIC,   OPTIONAL, MESSAGE,  wakeup_rate,       2)
#define sns_diag_sleep_info_proc_info_CALLBACK NULL
#define sns_diag_sleep_info_proc_info_DEFAULT NULL
#define sns_diag_sleep_info_proc_info_wakeup_rate_MSGTYPE sns_diag_sleep_info_proc_info_wakeup_rate_info

#define sns_diag_sleep_info_proc_info_wakeup_rate_info_FIELDLIST(X, a) \
X(a, STATIC,   OPTIONAL, UINT32,   lpm,               1) \
X(a, STATIC,   OPTIONAL, UINT32,   npm,               2)
#define sns_diag_sleep_info_proc_info_wakeup_rate_info_CALLBACK NULL
#define sns_diag_sleep_info_proc_info_wakeup_rate_info_DEFAULT NULL

#define sns_diag_bandwidth_info_FIELDLIST(X, a) \
X(a, CALLBACK, REPEATED, MESSAGE,  clients,           1)
#define sns_diag_bandwidth_info_CALLBACK pb_default_field_callback
#define sns_diag_bandwidth_info_DEFAULT NULL
#define sns_diag_bandwidth_info_clients_MSGTYPE sns_diag_bandwidth_info_client_info

#define sns_diag_bandwidth_info_client_info_FIELDLIST(X, a) \
X(a, CALLBACK, OPTIONAL, STRING,   name,              1) \
X(a, STATIC,   OPTIONAL, UENUM,    proc,              2) \
X(a, STATIC,   OPTIONAL, UENUM,    memory,            3) \
X(a, STATIC,   OPTIONAL, UINT64,   bandwidth_vote,    4)
#define sns_diag_bandwidth_info_client_info_CALLBACK pb_default_field_callback
#define sns_diag_bandwidth_info_client_info_DEFAULT NULL

#define sns_diag_debug_info_FIELDLIST(X, a) \
X(a, STATIC,   ONEOF,    MESSAGE,  (debug_info,power_rail_info,debug_info.power_rail_info),   1) \
X(a, STATIC,   ONEOF,    MESSAGE,  (debug_info,clock_info,debug_info.clock_info),   2) \
X(a, STATIC,   ONEOF,    MESSAGE,  (debug_info,latency_info,debug_info.latency_info),   3) \
X(a, STATIC,   ONEOF,    MESSAGE,  (debug_info,sleep_info,debug_info.sleep_info),   4) \
X(a, STATIC,   ONEOF,    MESSAGE,  (debug_info,bandwidth_info,debug_info.bandwidth_info),   5) \
X(a, STATIC,   ONEOF,    MESSAGE,  (debug_info,island_info,debug_info.island_info),   6)
#define sns_diag_debug_info_CALLBACK NULL
#define sns_diag_debug_info_DEFAULT NULL
#define sns_diag_debug_info_debug_info_power_rail_info_MSGTYPE sns_diag_power_rail_info
#define sns_diag_debug_info_debug_info_clock_info_MSGTYPE sns_diag_clock_info
#define sns_diag_debug_info_debug_info_latency_info_MSGTYPE sns_diag_latency_info
#define sns_diag_debug_info_debug_info_sleep_info_MSGTYPE sns_diag_sleep_info
#define sns_diag_debug_info_debug_info_bandwidth_info_MSGTYPE sns_diag_bandwidth_info
#define sns_diag_debug_info_debug_info_island_info_MSGTYPE sns_diag_island_info

#define sns_diag_debug_event_FIELDLIST(X, a) \
X(a, STATIC,   OPTIONAL, BOOL,     partial_event,     1) \
X(a, CALLBACK, REPEATED, MESSAGE,  debug_info,        2)
#define sns_diag_debug_event_CALLBACK pb_default_field_callback
#define sns_diag_debug_event_DEFAULT NULL
#define sns_diag_debug_event_debug_info_MSGTYPE sns_diag_debug_info

extern const pb_msgdesc_t sns_diag_log_trigger_req_msg;
extern const pb_msgdesc_t sns_diag_cm_active_client_req_event_msg;
extern const pb_msgdesc_t sns_diag_cm_active_client_req_event_request_msg_msg;
extern const pb_msgdesc_t sns_diag_cm_active_client_req_event_direct_channel_request_msg_msg;
extern const pb_msgdesc_t sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_create_msg_msg;
extern const pb_msgdesc_t sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_config_msg_msg;
extern const pb_msgdesc_t sns_diag_debug_req_msg;
extern const pb_msgdesc_t sns_diag_power_rail_info_msg;
extern const pb_msgdesc_t sns_diag_power_rail_info_rail_info_msg;
extern const pb_msgdesc_t sns_diag_power_rail_info_rail_info_vote_state_msg;
extern const pb_msgdesc_t sns_diag_power_rail_info_rail_info_client_msg;
extern const pb_msgdesc_t sns_diag_island_info_msg;
extern const pb_msgdesc_t sns_diag_island_info_client_info_msg;
extern const pb_msgdesc_t sns_diag_island_info_client_info_vote_state_msg;
extern const pb_msgdesc_t sns_diag_clock_info_msg;
extern const pb_msgdesc_t sns_diag_clock_info_client_info_msg;
extern const pb_msgdesc_t sns_diag_latency_info_msg;
extern const pb_msgdesc_t sns_diag_latency_info_client_info_msg;
extern const pb_msgdesc_t sns_diag_sleep_info_msg;
extern const pb_msgdesc_t sns_diag_sleep_info_proc_info_msg;
extern const pb_msgdesc_t sns_diag_sleep_info_proc_info_wakeup_rate_info_msg;
extern const pb_msgdesc_t sns_diag_bandwidth_info_msg;
extern const pb_msgdesc_t sns_diag_bandwidth_info_client_info_msg;
extern const pb_msgdesc_t sns_diag_debug_info_msg;
extern const pb_msgdesc_t sns_diag_debug_event_msg;

/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
#define sns_diag_log_trigger_req_fields &sns_diag_log_trigger_req_msg
#define sns_diag_cm_active_client_req_event_fields &sns_diag_cm_active_client_req_event_msg
#define sns_diag_cm_active_client_req_event_request_msg_fields &sns_diag_cm_active_client_req_event_request_msg_msg
#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_fields &sns_diag_cm_active_client_req_event_direct_channel_request_msg_msg
#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_create_msg_fields &sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_create_msg_msg
#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_config_msg_fields &sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_config_msg_msg
#define sns_diag_debug_req_fields &sns_diag_debug_req_msg
#define sns_diag_power_rail_info_fields &sns_diag_power_rail_info_msg
#define sns_diag_power_rail_info_rail_info_fields &sns_diag_power_rail_info_rail_info_msg
#define sns_diag_power_rail_info_rail_info_vote_state_fields &sns_diag_power_rail_info_rail_info_vote_state_msg
#define sns_diag_power_rail_info_rail_info_client_fields &sns_diag_power_rail_info_rail_info_client_msg
#define sns_diag_island_info_fields &sns_diag_island_info_msg
#define sns_diag_island_info_client_info_fields &sns_diag_island_info_client_info_msg
#define sns_diag_island_info_client_info_vote_state_fields &sns_diag_island_info_client_info_vote_state_msg
#define sns_diag_clock_info_fields &sns_diag_clock_info_msg
#define sns_diag_clock_info_client_info_fields &sns_diag_clock_info_client_info_msg
#define sns_diag_latency_info_fields &sns_diag_latency_info_msg
#define sns_diag_latency_info_client_info_fields &sns_diag_latency_info_client_info_msg
#define sns_diag_sleep_info_fields &sns_diag_sleep_info_msg
#define sns_diag_sleep_info_proc_info_fields &sns_diag_sleep_info_proc_info_msg
#define sns_diag_sleep_info_proc_info_wakeup_rate_info_fields &sns_diag_sleep_info_proc_info_wakeup_rate_info_msg
#define sns_diag_bandwidth_info_fields &sns_diag_bandwidth_info_msg
#define sns_diag_bandwidth_info_client_info_fields &sns_diag_bandwidth_info_client_info_msg
#define sns_diag_debug_info_fields &sns_diag_debug_info_msg
#define sns_diag_debug_event_fields &sns_diag_debug_event_msg

/* Maximum encoded size of messages (where known) */
/* sns_diag_cm_active_client_req_event_size depends on runtime parameters */
/* sns_diag_cm_active_client_req_event_direct_channel_request_msg_size depends on runtime parameters */
/* sns_diag_power_rail_info_size depends on runtime parameters */
/* sns_diag_power_rail_info_rail_info_size depends on runtime parameters */
/* sns_diag_power_rail_info_rail_info_client_size depends on runtime parameters */
/* sns_diag_island_info_size depends on runtime parameters */
/* sns_diag_island_info_client_info_size depends on runtime parameters */
/* sns_diag_clock_info_size depends on runtime parameters */
/* sns_diag_clock_info_client_info_size depends on runtime parameters */
/* sns_diag_latency_info_size depends on runtime parameters */
/* sns_diag_latency_info_client_info_size depends on runtime parameters */
/* sns_diag_sleep_info_size depends on runtime parameters */
/* sns_diag_bandwidth_info_size depends on runtime parameters */
/* sns_diag_bandwidth_info_client_info_size depends on runtime parameters */
/* sns_diag_debug_info_size depends on runtime parameters */
/* sns_diag_debug_event_size depends on runtime parameters */
#define SNS_DIAG_SENSOR_PB_H_MAX_SIZE            sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_create_msg_size
#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_create_msg_size 27
#define sns_diag_debug_req_size                  6
#define sns_diag_island_info_client_info_vote_state_size 11
#define sns_diag_log_trigger_req_size            11
#define sns_diag_power_rail_info_rail_info_vote_state_size 11
#define sns_diag_sleep_info_proc_info_size       16
#define sns_diag_sleep_info_proc_info_wakeup_rate_info_size 12
#if defined(sns_client_request_msg_size)
#define sns_diag_cm_active_client_req_event_request_msg_size (15 + sns_client_request_msg_size)
#endif
#if defined(sns_direct_channel_config_msg_size)
#define sns_diag_cm_active_client_req_event_direct_channel_request_msg_direct_channel_config_msg_size (15 + sns_direct_channel_config_msg_size)
#endif

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

#endif
