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

#ifndef PB_CHANNEL_PB_H_INCLUDED
#define PB_CHANNEL_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 _ChannelSettings_ModemConfig {
    ChannelSettings_ModemConfig_Bw125Cr45Sf128 = 0,
    ChannelSettings_ModemConfig_Bw500Cr45Sf128 = 1,
    ChannelSettings_ModemConfig_Bw31_25Cr48Sf512 = 2,
    ChannelSettings_ModemConfig_Bw125Cr48Sf4096 = 3
} ChannelSettings_ModemConfig;

typedef enum _Channel_Role {
    Channel_Role_DISABLED = 0,
    Channel_Role_PRIMARY = 1,
    Channel_Role_SECONDARY = 2
} Channel_Role;

/* Struct definitions */
typedef PB_BYTES_ARRAY_T(32) ChannelSettings_psk_t;
typedef struct _ChannelSettings {
    int8_t tx_power;
    ChannelSettings_ModemConfig modem_config;
    ChannelSettings_psk_t psk;
    char name[12];
    uint16_t bandwidth;
    uint32_t spread_factor;
    uint8_t coding_rate;
    uint8_t channel_num;
    uint32_t id;
    bool uplink_enabled;
    bool downlink_enabled;
} ChannelSettings;

typedef struct _Channel {
    uint8_t index;
    bool has_settings;
    ChannelSettings settings;
    Channel_Role role;
} Channel;


/* Helper constants for enums */
#define _ChannelSettings_ModemConfig_MIN ChannelSettings_ModemConfig_Bw125Cr45Sf128
#define _ChannelSettings_ModemConfig_MAX ChannelSettings_ModemConfig_Bw125Cr48Sf4096
#define _ChannelSettings_ModemConfig_ARRAYSIZE ((ChannelSettings_ModemConfig)(ChannelSettings_ModemConfig_Bw125Cr48Sf4096+1))

#define _Channel_Role_MIN Channel_Role_DISABLED
#define _Channel_Role_MAX Channel_Role_SECONDARY
#define _Channel_Role_ARRAYSIZE ((Channel_Role)(Channel_Role_SECONDARY+1))


#ifdef __cplusplus
extern "C" {
#endif

/* Initializer values for message structs */
#define ChannelSettings_init_default             {0, _ChannelSettings_ModemConfig_MIN, {0, {0}}, "", 0, 0, 0, 0, 0, 0, 0}
#define Channel_init_default                     {0, false, ChannelSettings_init_default, _Channel_Role_MIN}
#define ChannelSettings_init_zero                {0, _ChannelSettings_ModemConfig_MIN, {0, {0}}, "", 0, 0, 0, 0, 0, 0, 0}
#define Channel_init_zero                        {0, false, ChannelSettings_init_zero, _Channel_Role_MIN}

/* Field tags (for use in manual encoding/decoding) */
#define ChannelSettings_tx_power_tag             1
#define ChannelSettings_modem_config_tag         3
#define ChannelSettings_psk_tag                  4
#define ChannelSettings_name_tag                 5
#define ChannelSettings_bandwidth_tag            6
#define ChannelSettings_spread_factor_tag        7
#define ChannelSettings_coding_rate_tag          8
#define ChannelSettings_channel_num_tag          9
#define ChannelSettings_id_tag                   10
#define ChannelSettings_uplink_enabled_tag       16
#define ChannelSettings_downlink_enabled_tag     17
#define Channel_index_tag                        1
#define Channel_settings_tag                     2
#define Channel_role_tag                         3

/* Struct field encoding specification for nanopb */
#define ChannelSettings_FIELDLIST(X, a) \
X(a, STATIC,   SINGULAR, INT32,    tx_power,          1) \
X(a, STATIC,   SINGULAR, UENUM,    modem_config,      3) \
X(a, STATIC,   SINGULAR, BYTES,    psk,               4) \
X(a, STATIC,   SINGULAR, STRING,   name,              5) \
X(a, STATIC,   SINGULAR, UINT32,   bandwidth,         6) \
X(a, STATIC,   SINGULAR, UINT32,   spread_factor,     7) \
X(a, STATIC,   SINGULAR, UINT32,   coding_rate,       8) \
X(a, STATIC,   SINGULAR, UINT32,   channel_num,       9) \
X(a, STATIC,   SINGULAR, FIXED32,  id,               10) \
X(a, STATIC,   SINGULAR, BOOL,     uplink_enabled,   16) \
X(a, STATIC,   SINGULAR, BOOL,     downlink_enabled,  17)
#define ChannelSettings_CALLBACK NULL
#define ChannelSettings_DEFAULT NULL

#define Channel_FIELDLIST(X, a) \
X(a, STATIC,   SINGULAR, UINT32,   index,             1) \
X(a, STATIC,   OPTIONAL, MESSAGE,  settings,          2) \
X(a, STATIC,   SINGULAR, UENUM,    role,              3)
#define Channel_CALLBACK NULL
#define Channel_DEFAULT NULL
#define Channel_settings_MSGTYPE ChannelSettings

extern const pb_msgdesc_t ChannelSettings_msg;
extern const pb_msgdesc_t Channel_msg;

/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
#define ChannelSettings_fields &ChannelSettings_msg
#define Channel_fields &Channel_msg

/* Maximum encoded size of messages (where known) */
#define ChannelSettings_size                     87
#define Channel_size                             94

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

#endif
