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

#ifndef PB_NETWORKMESSAGE_PB_H_INCLUDED
#define PB_NETWORKMESSAGE_PB_H_INCLUDED
#include "pb.h"

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

/* Enum definitions */
typedef enum _MessageType {
    MessageType_MESSAGE_TYPE_UNSPECIFIED = 0,
    MessageType_MESSAGE_TYPE_DATA = 1,
    MessageType_MESSAGE_TYPE_JOIN = 2,
    MessageType_MESSAGE_TYPE_LEAVE = 3,
    MessageType_MESSAGE_TYPE_KEEPALIVE = 4,
    MessageType_MESSAGE_TYPE_FRAGMENT = 5,
    MessageType_MESSAGE_TYPE_ACK = 6,
    MessageType_MESSAGE_TYPE_CONNECT_REQUEST = 7,
    MessageType_MESSAGE_TYPE_CONNECT_REPLY = 8
} MessageType;

/* Struct definitions */
typedef struct _Fragment {
    uint32_t id;
    uint32_t sequence;
    uint32_t total;
} Fragment;

typedef struct _Ack {
    uint32_t id;
    uint32_t history;
} Ack;

typedef struct _NetworkMessage {
    MessageType message_type;
    uint32_t client_id;
    pb_bytes_array_t *mac;
    pb_bytes_array_t *frame;
    uint32_t flags;
    uint32_t version;
    bool has_ack;
    Ack ack;
    bool has_fragment;
    Fragment fragment;
    int64_t timestamp;
    uint32_t sequence;
} NetworkMessage;


#ifdef __cplusplus
extern "C" {
#endif

/* Helper constants for enums */
#define _MessageType_MIN MessageType_MESSAGE_TYPE_UNSPECIFIED
#define _MessageType_MAX MessageType_MESSAGE_TYPE_CONNECT_REPLY
#define _MessageType_ARRAYSIZE ((MessageType)(MessageType_MESSAGE_TYPE_CONNECT_REPLY+1))



#define NetworkMessage_message_type_ENUMTYPE MessageType


/* Initializer values for message structs */
#define Fragment_init_default                    {0, 0, 0}
#define Ack_init_default                         {0, 0}
#define NetworkMessage_init_default              {_MessageType_MIN, 0, NULL, NULL, 0, 0, false, Ack_init_default, false, Fragment_init_default, 0, 0}
#define Fragment_init_zero                       {0, 0, 0}
#define Ack_init_zero                            {0, 0}
#define NetworkMessage_init_zero                 {_MessageType_MIN, 0, NULL, NULL, 0, 0, false, Ack_init_zero, false, Fragment_init_zero, 0, 0}

/* Field tags (for use in manual encoding/decoding) */
#define Fragment_id_tag                          1
#define Fragment_sequence_tag                    2
#define Fragment_total_tag                       3
#define Ack_id_tag                               1
#define Ack_history_tag                          2
#define NetworkMessage_message_type_tag          1
#define NetworkMessage_client_id_tag             2
#define NetworkMessage_mac_tag                   3
#define NetworkMessage_frame_tag                 4
#define NetworkMessage_flags_tag                 5
#define NetworkMessage_version_tag               6
#define NetworkMessage_ack_tag                   7
#define NetworkMessage_fragment_tag              8
#define NetworkMessage_timestamp_tag             9
#define NetworkMessage_sequence_tag              10

/* Struct field encoding specification for nanopb */
#define Fragment_FIELDLIST(X, a) \
X(a, STATIC,   SINGULAR, UINT32,   id,                1) \
X(a, STATIC,   SINGULAR, UINT32,   sequence,          2) \
X(a, STATIC,   SINGULAR, UINT32,   total,             3)
#define Fragment_CALLBACK NULL
#define Fragment_DEFAULT NULL

#define Ack_FIELDLIST(X, a) \
X(a, STATIC,   SINGULAR, UINT32,   id,                1) \
X(a, STATIC,   SINGULAR, UINT32,   history,           2)
#define Ack_CALLBACK NULL
#define Ack_DEFAULT NULL

#define NetworkMessage_FIELDLIST(X, a) \
X(a, STATIC,   SINGULAR, UENUM,    message_type,      1) \
X(a, STATIC,   SINGULAR, UINT32,   client_id,         2) \
X(a, POINTER,  SINGULAR, BYTES,    mac,               3) \
X(a, POINTER,  SINGULAR, BYTES,    frame,             4) \
X(a, STATIC,   SINGULAR, UINT32,   flags,             5) \
X(a, STATIC,   SINGULAR, UINT32,   version,           6) \
X(a, STATIC,   OPTIONAL, MESSAGE,  ack,               7) \
X(a, STATIC,   OPTIONAL, MESSAGE,  fragment,          8) \
X(a, STATIC,   SINGULAR, INT64,    timestamp,         9) \
X(a, STATIC,   SINGULAR, UINT32,   sequence,         10)
#define NetworkMessage_CALLBACK NULL
#define NetworkMessage_DEFAULT NULL
#define NetworkMessage_ack_MSGTYPE Ack
#define NetworkMessage_fragment_MSGTYPE Fragment

extern const pb_msgdesc_t Fragment_msg;
extern const pb_msgdesc_t Ack_msg;
extern const pb_msgdesc_t NetworkMessage_msg;

/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
#define Fragment_fields &Fragment_msg
#define Ack_fields &Ack_msg
#define NetworkMessage_fields &NetworkMessage_msg

/* Maximum encoded size of messages (where known) */
/* NetworkMessage_size depends on runtime parameters */
#define Ack_size                                 12
#define Fragment_size                            18

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

#endif
