/* Automatically generated nanopb header */
/* Generated by nanopb-1.0.0-dev */

#ifndef PB_PROTOCOL_PROTOCOL_PB_H_INCLUDED
#define PB_PROTOCOL_PROTOCOL_PB_H_INCLUDED
#include <pb.h>
#include "model.pb.h"

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

/* Struct definitions */
/* Message to request the capabilities of the board. A board contains one or more devices. */
typedef struct _protocol_BoardCapabilitiesRequest {
    /* If negative all devices are in response, else only given device. */
    int32_t device;
    /* Optional tag, this tag will be in the respose.
 This may be used to pair Requests with Responses. */
    int32_t tag;
} protocol_BoardCapabilitiesRequest;

/* Message representing the capabilities of the board. */
typedef struct _protocol_BoardCapabilitiesResponse {
    /* Board info */
    struct _protocol_Board *board;
    /* Tag value from Request.
 This may be used to pair Requests with Responses. */
    int32_t tag;
} protocol_BoardCapabilitiesResponse;

/* Represents an option value for device configuration. */
typedef struct _protocol_OptionValue {
    int32_t option_id;
    pb_size_t which_value;
    union _protocol_OptionValue_value {
        int32_t int_value; /* Integer value */
        float float_value; /* Floating-point value */
        bool bool_value; /* Boolean value */
        int32_t oneof_value; /* Index into OptionOneOf items */
        pb_bytes_array_t *blob_value; /* Blob value */
        char *string_value; /* String value */
        char *password_value; /* String value (hidden) */
    } value;
} protocol_OptionValue;

/* Request to configure a device. This may not necessarily initialize the device
 but will reply with a DeviceConfigurationResponse that defines the data to expect once a subscription is started. */
typedef struct _protocol_DeviceConfigurationRequest {
    /* The device to configure (index) */
    int32_t device;
    /* The option values for configuration */
    pb_size_t options_count;
    struct _protocol_OptionValue *options;
    /* Optional tag, this tag will be in the respose.
 This may be used to pair Requests with Responses. */
    int32_t tag;
} protocol_DeviceConfigurationRequest;

/* Response message describing the device configuration. */
typedef struct _protocol_DeviceConfigurationResponse {
    /* The device that was configured */
    int32_t device;
    /* All the option values */
    pb_size_t options_count;
    struct _protocol_OptionValue *options;
    /* Device streams */
    pb_size_t streams_count;
    struct _protocol_StreamConfig *streams;
    /* The status of the device */
    protocol_DeviceStatus status;
    /* Optional status message */
    char *status_message;
    /* Tag value from Request.
 This may be used to pair Requests with Responses. */
    int32_t tag;
} protocol_DeviceConfigurationResponse;

/* Message to start streaming data for a specified device. */
typedef struct _protocol_StartRequest {
    /* The device index to start streaming. */
    int32_t device;
} protocol_StartRequest;

/* Message to stop streaming data for a specified device. */
typedef struct _protocol_StopRequest {
    /* The device index to stop streaming. If negative, all streaming is stopped. */
    int32_t device;
} protocol_StopRequest;

/* Reset request */
typedef struct _protocol_ResetRequest {
    char dummy_field;
} protocol_ResetRequest;

/* Represents a chunk of data streamed from a device. */
typedef struct _protocol_DataChunk {
    /* The device index this data originates from. */
    int32_t device;
    /* Device stream index. */
    int32_t stream;
    /* The number of frames. This value is equal to or less than StreamConfiguration.max_frame_count */
    int32_t frame_count;
    /* The index of the first frame.
 This is incremented in each response with frame_count, unless frames are dropped.
 The timestamp (seconds) of the first frame in payload is frame_number/StreamConfig.frequency. */
    int32_t frame_number;
    /* The size of the payload in bytes is: sizeof(DataType) * shape.flat * frame_count */
    pb_callback_t payload;
    /* Optional timestamps for irregular frames.
 If present it should contain frame_count items. */
    pb_size_t timestamps_count;
    struct _protocol_Timestamp *timestamps;
} protocol_DataChunk;

typedef struct _protocol_Timestamp {
    /* Time stamp */
    int64_t timestamp;
    /* Optional, 0 if absent. */
    int32_t duration;
} protocol_Timestamp;

/* Streams with STREAM_DIRECTION_INPUT inquire for their data by sending these packages. */
typedef struct _protocol_DataInquire {
    /* The device index this data targets. */
    int32_t device;
    /* Device stream index. */
    int32_t stream;
    /* The number of frames requested. */
    int32_t frame_count;
} protocol_DataInquire;

/* Message representing an error response. */
typedef struct _protocol_ErrorResponse {
    /* Description of the error */
    char *error_message;
    /* Error code */
    int32_t error_code;
} protocol_ErrorResponse;

/* Wrapper message for all response types. */
typedef struct _protocol_Response {
    pb_size_t which_response_type;
    union _protocol_Response_response_type {
        protocol_BoardCapabilitiesResponse capabilities;
        protocol_DeviceConfigurationResponse config;
        protocol_ErrorResponse error;
        protocol_DataChunk data;
        protocol_DataInquire data_inquire;
    } response_type;
} protocol_Response;

/* Request to reset the watchdog timer on the device. This prevents the device from resetting itself. */
typedef struct _protocol_WatchdogResetRequest {
    char dummy_field;
} protocol_WatchdogResetRequest;

/* Wrapper message for all request types. */
typedef struct _protocol_Request {
    pb_callback_t cb_request_type;
    pb_size_t which_request_type;
    union _protocol_Request_request_type {
        protocol_BoardCapabilitiesRequest capabilities;
        protocol_DeviceConfigurationRequest config;
        protocol_StartRequest start;
        protocol_StopRequest stop;
        protocol_WatchdogResetRequest watchdog_reset;
        protocol_DataChunk data;
        protocol_ResetRequest reset;
    } request_type;
} protocol_Request;


#ifdef __cplusplus
extern "C" {
#endif

/* Initializer values for message structs */
#define protocol_Request_init_default            {{{NULL}, NULL}, 0, {protocol_BoardCapabilitiesRequest_init_default}}
#define protocol_Response_init_default           {0, {protocol_BoardCapabilitiesResponse_init_default}}
#define protocol_BoardCapabilitiesRequest_init_default {0, 0}
#define protocol_BoardCapabilitiesResponse_init_default {NULL, 0}
#define protocol_OptionValue_init_default        {0, 0, {0}}
#define protocol_DeviceConfigurationRequest_init_default {0, 0, NULL, 0}
#define protocol_DeviceConfigurationResponse_init_default {0, 0, NULL, 0, NULL, _protocol_DeviceStatus_MIN, NULL, 0}
#define protocol_StartRequest_init_default       {0}
#define protocol_StopRequest_init_default        {0}
#define protocol_ResetRequest_init_default       {0}
#define protocol_DataChunk_init_default          {0, 0, 0, 0, {{NULL}, NULL}, 0, NULL}
#define protocol_Timestamp_init_default          {0, 0}
#define protocol_DataInquire_init_default        {0, 0, 0}
#define protocol_ErrorResponse_init_default      {NULL, 0}
#define protocol_WatchdogResetRequest_init_default {0}
#define protocol_Request_init_zero               {{{NULL}, NULL}, 0, {protocol_BoardCapabilitiesRequest_init_zero}}
#define protocol_Response_init_zero              {0, {protocol_BoardCapabilitiesResponse_init_zero}}
#define protocol_BoardCapabilitiesRequest_init_zero {0, 0}
#define protocol_BoardCapabilitiesResponse_init_zero {NULL, 0}
#define protocol_OptionValue_init_zero           {0, 0, {0}}
#define protocol_DeviceConfigurationRequest_init_zero {0, 0, NULL, 0}
#define protocol_DeviceConfigurationResponse_init_zero {0, 0, NULL, 0, NULL, _protocol_DeviceStatus_MIN, NULL, 0}
#define protocol_StartRequest_init_zero          {0}
#define protocol_StopRequest_init_zero           {0}
#define protocol_ResetRequest_init_zero          {0}
#define protocol_DataChunk_init_zero             {0, 0, 0, 0, {{NULL}, NULL}, 0, NULL}
#define protocol_Timestamp_init_zero             {0, 0}
#define protocol_DataInquire_init_zero           {0, 0, 0}
#define protocol_ErrorResponse_init_zero         {NULL, 0}
#define protocol_WatchdogResetRequest_init_zero  {0}

/* Field tags (for use in manual encoding/decoding) */
#define protocol_BoardCapabilitiesRequest_device_tag 1
#define protocol_BoardCapabilitiesRequest_tag_tag 2
#define protocol_BoardCapabilitiesResponse_board_tag 1
#define protocol_BoardCapabilitiesResponse_tag_tag 2
#define protocol_OptionValue_option_id_tag       1
#define protocol_OptionValue_int_value_tag       2
#define protocol_OptionValue_float_value_tag     3
#define protocol_OptionValue_bool_value_tag      4
#define protocol_OptionValue_oneof_value_tag     5
#define protocol_OptionValue_blob_value_tag      6
#define protocol_OptionValue_string_value_tag    7
#define protocol_OptionValue_password_value_tag  8
#define protocol_DeviceConfigurationRequest_device_tag 1
#define protocol_DeviceConfigurationRequest_options_tag 2
#define protocol_DeviceConfigurationRequest_tag_tag 3
#define protocol_DeviceConfigurationResponse_device_tag 1
#define protocol_DeviceConfigurationResponse_options_tag 2
#define protocol_DeviceConfigurationResponse_streams_tag 3
#define protocol_DeviceConfigurationResponse_status_tag 4
#define protocol_DeviceConfigurationResponse_status_message_tag 5
#define protocol_DeviceConfigurationResponse_tag_tag 6
#define protocol_StartRequest_device_tag         1
#define protocol_StopRequest_device_tag          1
#define protocol_DataChunk_device_tag            1
#define protocol_DataChunk_stream_tag            2
#define protocol_DataChunk_frame_count_tag       3
#define protocol_DataChunk_frame_number_tag      4
#define protocol_DataChunk_payload_tag           5
#define protocol_DataChunk_timestamps_tag        6
#define protocol_Timestamp_timestamp_tag         1
#define protocol_Timestamp_duration_tag          2
#define protocol_DataInquire_device_tag          1
#define protocol_DataInquire_stream_tag          2
#define protocol_DataInquire_frame_count_tag     3
#define protocol_ErrorResponse_error_message_tag 1
#define protocol_ErrorResponse_error_code_tag    2
#define protocol_Response_capabilities_tag       1
#define protocol_Response_config_tag             2
#define protocol_Response_error_tag              3
#define protocol_Response_data_tag               4
#define protocol_Response_data_inquire_tag       5
#define protocol_Request_capabilities_tag        1
#define protocol_Request_config_tag              2
#define protocol_Request_start_tag               3
#define protocol_Request_stop_tag                4
#define protocol_Request_watchdog_reset_tag      5
#define protocol_Request_data_tag                6
#define protocol_Request_reset_tag               7

/* Struct field encoding specification for nanopb */
#define protocol_Request_FIELDLIST(X, a) \
X(a, STATIC,   ONEOF,    MSG_W_CB, (request_type,capabilities,request_type.capabilities),   1) \
X(a, STATIC,   ONEOF,    MSG_W_CB, (request_type,config,request_type.config),   2) \
X(a, STATIC,   ONEOF,    MSG_W_CB, (request_type,start,request_type.start),   3) \
X(a, STATIC,   ONEOF,    MSG_W_CB, (request_type,stop,request_type.stop),   4) \
X(a, STATIC,   ONEOF,    MSG_W_CB, (request_type,watchdog_reset,request_type.watchdog_reset),   5) \
X(a, STATIC,   ONEOF,    MSG_W_CB, (request_type,data,request_type.data),   6) \
X(a, STATIC,   ONEOF,    MSG_W_CB, (request_type,reset,request_type.reset),   7)
#define protocol_Request_CALLBACK NULL
#define protocol_Request_DEFAULT NULL
#define protocol_Request_request_type_capabilities_MSGTYPE protocol_BoardCapabilitiesRequest
#define protocol_Request_request_type_config_MSGTYPE protocol_DeviceConfigurationRequest
#define protocol_Request_request_type_start_MSGTYPE protocol_StartRequest
#define protocol_Request_request_type_stop_MSGTYPE protocol_StopRequest
#define protocol_Request_request_type_watchdog_reset_MSGTYPE protocol_WatchdogResetRequest
#define protocol_Request_request_type_data_MSGTYPE protocol_DataChunk
#define protocol_Request_request_type_reset_MSGTYPE protocol_ResetRequest

#define protocol_Response_FIELDLIST(X, a) \
X(a, STATIC,   ONEOF,    MESSAGE,  (response_type,capabilities,response_type.capabilities),   1) \
X(a, STATIC,   ONEOF,    MESSAGE,  (response_type,config,response_type.config),   2) \
X(a, STATIC,   ONEOF,    MESSAGE,  (response_type,error,response_type.error),   3) \
X(a, STATIC,   ONEOF,    MESSAGE,  (response_type,data,response_type.data),   4) \
X(a, STATIC,   ONEOF,    MESSAGE,  (response_type,data_inquire,response_type.data_inquire),   5)
#define protocol_Response_CALLBACK NULL
#define protocol_Response_DEFAULT NULL
#define protocol_Response_response_type_capabilities_MSGTYPE protocol_BoardCapabilitiesResponse
#define protocol_Response_response_type_config_MSGTYPE protocol_DeviceConfigurationResponse
#define protocol_Response_response_type_error_MSGTYPE protocol_ErrorResponse
#define protocol_Response_response_type_data_MSGTYPE protocol_DataChunk
#define protocol_Response_response_type_data_inquire_MSGTYPE protocol_DataInquire

#define protocol_BoardCapabilitiesRequest_FIELDLIST(X, a) \
X(a, STATIC,   SINGULAR, SINT32,   device,            1) \
X(a, STATIC,   SINGULAR, INT32,    tag,               2)
#define protocol_BoardCapabilitiesRequest_CALLBACK NULL
#define protocol_BoardCapabilitiesRequest_DEFAULT NULL

#define protocol_BoardCapabilitiesResponse_FIELDLIST(X, a) \
X(a, POINTER,  OPTIONAL, MESSAGE,  board,             1) \
X(a, STATIC,   SINGULAR, INT32,    tag,               2)
#define protocol_BoardCapabilitiesResponse_CALLBACK NULL
#define protocol_BoardCapabilitiesResponse_DEFAULT NULL
#define protocol_BoardCapabilitiesResponse_board_MSGTYPE protocol_Board

#define protocol_OptionValue_FIELDLIST(X, a) \
X(a, STATIC,   SINGULAR, INT32,    option_id,         1) \
X(a, STATIC,   ONEOF,    INT32,    (value,int_value,value.int_value),   2) \
X(a, STATIC,   ONEOF,    FLOAT,    (value,float_value,value.float_value),   3) \
X(a, STATIC,   ONEOF,    BOOL,     (value,bool_value,value.bool_value),   4) \
X(a, STATIC,   ONEOF,    INT32,    (value,oneof_value,value.oneof_value),   5) \
X(a, POINTER,  ONEOF,    BYTES,    (value,blob_value,value.blob_value),   6) \
X(a, POINTER,  ONEOF,    STRING,   (value,string_value,value.string_value),   7) \
X(a, POINTER,  ONEOF,    STRING,   (value,password_value,value.password_value),   8)
#define protocol_OptionValue_CALLBACK NULL
#define protocol_OptionValue_DEFAULT NULL

#define protocol_DeviceConfigurationRequest_FIELDLIST(X, a) \
X(a, STATIC,   SINGULAR, INT32,    device,            1) \
X(a, POINTER,  REPEATED, MESSAGE,  options,           2) \
X(a, STATIC,   SINGULAR, INT32,    tag,               3)
#define protocol_DeviceConfigurationRequest_CALLBACK NULL
#define protocol_DeviceConfigurationRequest_DEFAULT NULL
#define protocol_DeviceConfigurationRequest_options_MSGTYPE protocol_OptionValue

#define protocol_DeviceConfigurationResponse_FIELDLIST(X, a) \
X(a, STATIC,   SINGULAR, INT32,    device,            1) \
X(a, POINTER,  REPEATED, MESSAGE,  options,           2) \
X(a, POINTER,  REPEATED, MESSAGE,  streams,           3) \
X(a, STATIC,   SINGULAR, UENUM,    status,            4) \
X(a, POINTER,  SINGULAR, STRING,   status_message,    5) \
X(a, STATIC,   SINGULAR, INT32,    tag,               6)
#define protocol_DeviceConfigurationResponse_CALLBACK NULL
#define protocol_DeviceConfigurationResponse_DEFAULT NULL
#define protocol_DeviceConfigurationResponse_options_MSGTYPE protocol_OptionValue
#define protocol_DeviceConfigurationResponse_streams_MSGTYPE protocol_StreamConfig

#define protocol_StartRequest_FIELDLIST(X, a) \
X(a, STATIC,   SINGULAR, INT32,    device,            1)
#define protocol_StartRequest_CALLBACK NULL
#define protocol_StartRequest_DEFAULT NULL

#define protocol_StopRequest_FIELDLIST(X, a) \
X(a, STATIC,   SINGULAR, SINT32,   device,            1)
#define protocol_StopRequest_CALLBACK NULL
#define protocol_StopRequest_DEFAULT NULL

#define protocol_ResetRequest_FIELDLIST(X, a) \

#define protocol_ResetRequest_CALLBACK NULL
#define protocol_ResetRequest_DEFAULT NULL

#define protocol_DataChunk_FIELDLIST(X, a) \
X(a, STATIC,   SINGULAR, INT32,    device,            1) \
X(a, STATIC,   SINGULAR, INT32,    stream,            2) \
X(a, STATIC,   SINGULAR, INT32,    frame_count,       3) \
X(a, STATIC,   SINGULAR, INT32,    frame_number,      4) \
X(a, CALLBACK, SINGULAR, BYTES,    payload,           5) \
X(a, POINTER,  REPEATED, MESSAGE,  timestamps,        6)
#define protocol_DataChunk_CALLBACK pb_default_field_callback
#define protocol_DataChunk_DEFAULT NULL
#define protocol_DataChunk_timestamps_MSGTYPE protocol_Timestamp

#define protocol_Timestamp_FIELDLIST(X, a) \
X(a, STATIC,   SINGULAR, INT64,    timestamp,         1) \
X(a, STATIC,   SINGULAR, INT32,    duration,          2)
#define protocol_Timestamp_CALLBACK NULL
#define protocol_Timestamp_DEFAULT NULL

#define protocol_DataInquire_FIELDLIST(X, a) \
X(a, STATIC,   SINGULAR, INT32,    device,            1) \
X(a, STATIC,   SINGULAR, INT32,    stream,            2) \
X(a, STATIC,   SINGULAR, INT32,    frame_count,       3)
#define protocol_DataInquire_CALLBACK NULL
#define protocol_DataInquire_DEFAULT NULL

#define protocol_ErrorResponse_FIELDLIST(X, a) \
X(a, POINTER,  SINGULAR, STRING,   error_message,     1) \
X(a, STATIC,   SINGULAR, INT32,    error_code,        2)
#define protocol_ErrorResponse_CALLBACK NULL
#define protocol_ErrorResponse_DEFAULT NULL

#define protocol_WatchdogResetRequest_FIELDLIST(X, a) \

#define protocol_WatchdogResetRequest_CALLBACK NULL
#define protocol_WatchdogResetRequest_DEFAULT NULL

extern const pb_msgdesc_t protocol_Request_msg;
extern const pb_msgdesc_t protocol_Response_msg;
extern const pb_msgdesc_t protocol_BoardCapabilitiesRequest_msg;
extern const pb_msgdesc_t protocol_BoardCapabilitiesResponse_msg;
extern const pb_msgdesc_t protocol_OptionValue_msg;
extern const pb_msgdesc_t protocol_DeviceConfigurationRequest_msg;
extern const pb_msgdesc_t protocol_DeviceConfigurationResponse_msg;
extern const pb_msgdesc_t protocol_StartRequest_msg;
extern const pb_msgdesc_t protocol_StopRequest_msg;
extern const pb_msgdesc_t protocol_ResetRequest_msg;
extern const pb_msgdesc_t protocol_DataChunk_msg;
extern const pb_msgdesc_t protocol_Timestamp_msg;
extern const pb_msgdesc_t protocol_DataInquire_msg;
extern const pb_msgdesc_t protocol_ErrorResponse_msg;
extern const pb_msgdesc_t protocol_WatchdogResetRequest_msg;

/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
#define protocol_Request_fields &protocol_Request_msg
#define protocol_Response_fields &protocol_Response_msg
#define protocol_BoardCapabilitiesRequest_fields &protocol_BoardCapabilitiesRequest_msg
#define protocol_BoardCapabilitiesResponse_fields &protocol_BoardCapabilitiesResponse_msg
#define protocol_OptionValue_fields &protocol_OptionValue_msg
#define protocol_DeviceConfigurationRequest_fields &protocol_DeviceConfigurationRequest_msg
#define protocol_DeviceConfigurationResponse_fields &protocol_DeviceConfigurationResponse_msg
#define protocol_StartRequest_fields &protocol_StartRequest_msg
#define protocol_StopRequest_fields &protocol_StopRequest_msg
#define protocol_ResetRequest_fields &protocol_ResetRequest_msg
#define protocol_DataChunk_fields &protocol_DataChunk_msg
#define protocol_Timestamp_fields &protocol_Timestamp_msg
#define protocol_DataInquire_fields &protocol_DataInquire_msg
#define protocol_ErrorResponse_fields &protocol_ErrorResponse_msg
#define protocol_WatchdogResetRequest_fields &protocol_WatchdogResetRequest_msg

/* Maximum encoded size of messages (where known) */
/* protocol_Request_size depends on runtime parameters */
/* protocol_Response_size depends on runtime parameters */
/* protocol_BoardCapabilitiesResponse_size depends on runtime parameters */
/* protocol_OptionValue_size depends on runtime parameters */
/* protocol_DeviceConfigurationRequest_size depends on runtime parameters */
/* protocol_DeviceConfigurationResponse_size depends on runtime parameters */
/* protocol_DataChunk_size depends on runtime parameters */
/* protocol_ErrorResponse_size depends on runtime parameters */
#define PROTOCOL_PROTOCOL_PB_H_MAX_SIZE          protocol_DataInquire_size
#define protocol_BoardCapabilitiesRequest_size   17
#define protocol_DataInquire_size                33
#define protocol_ResetRequest_size               0
#define protocol_StartRequest_size               11
#define protocol_StopRequest_size                6
#define protocol_Timestamp_size                  22
#define protocol_WatchdogResetRequest_size       0

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

#endif
