• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Automatically generated nanopb header */
2 /* This is a file generated using nanopb-0.2.0-dev.
3  * It is used as a part of test suite in order to detect any
4  * incompatible changes made to the generator in future versions.
5  */
6 
7 #ifndef _PB_ALLTYPES_PB_H_
8 #define _PB_ALLTYPES_PB_H_
9 #include <pb.h>
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 /* Enum definitions */
16 typedef enum _MyEnum {
17     MyEnum_Zero = 0,
18     MyEnum_First = 1,
19     MyEnum_Second = 2,
20     MyEnum_Truth = 42
21 } MyEnum;
22 
23 /* Struct definitions */
24 typedef struct _SubMessage {
25     char substuff1[16];
26     int32_t substuff2;
27     bool has_substuff3;
28     uint32_t substuff3;
29 } SubMessage;
30 
31 typedef struct {
32     size_t size;
33     uint8_t bytes[16];
34 } AllTypes_req_bytes_t;
35 
36 typedef struct {
37     size_t size;
38     uint8_t bytes[16];
39 } AllTypes_rep_bytes_t;
40 
41 typedef struct {
42     size_t size;
43     uint8_t bytes[16];
44 } AllTypes_opt_bytes_t;
45 
46 typedef struct _AllTypes {
47     int32_t req_int32;
48     int64_t req_int64;
49     uint32_t req_uint32;
50     uint64_t req_uint64;
51     int32_t req_sint32;
52     int64_t req_sint64;
53     bool req_bool;
54     uint32_t req_fixed32;
55     int32_t req_sfixed32;
56     float req_float;
57     uint64_t req_fixed64;
58     int64_t req_sfixed64;
59     double req_double;
60     char req_string[16];
61     AllTypes_req_bytes_t req_bytes;
62     SubMessage req_submsg;
63     MyEnum req_enum;
64     size_t rep_int32_count;
65     int32_t rep_int32[5];
66     size_t rep_int64_count;
67     int64_t rep_int64[5];
68     size_t rep_uint32_count;
69     uint32_t rep_uint32[5];
70     size_t rep_uint64_count;
71     uint64_t rep_uint64[5];
72     size_t rep_sint32_count;
73     int32_t rep_sint32[5];
74     size_t rep_sint64_count;
75     int64_t rep_sint64[5];
76     size_t rep_bool_count;
77     bool rep_bool[5];
78     size_t rep_fixed32_count;
79     uint32_t rep_fixed32[5];
80     size_t rep_sfixed32_count;
81     int32_t rep_sfixed32[5];
82     size_t rep_float_count;
83     float rep_float[5];
84     size_t rep_fixed64_count;
85     uint64_t rep_fixed64[5];
86     size_t rep_sfixed64_count;
87     int64_t rep_sfixed64[5];
88     size_t rep_double_count;
89     double rep_double[5];
90     size_t rep_string_count;
91     char rep_string[5][16];
92     size_t rep_bytes_count;
93     AllTypes_rep_bytes_t rep_bytes[5];
94     size_t rep_submsg_count;
95     SubMessage rep_submsg[5];
96     size_t rep_enum_count;
97     MyEnum rep_enum[5];
98     bool has_opt_int32;
99     int32_t opt_int32;
100     bool has_opt_int64;
101     int64_t opt_int64;
102     bool has_opt_uint32;
103     uint32_t opt_uint32;
104     bool has_opt_uint64;
105     uint64_t opt_uint64;
106     bool has_opt_sint32;
107     int32_t opt_sint32;
108     bool has_opt_sint64;
109     int64_t opt_sint64;
110     bool has_opt_bool;
111     bool opt_bool;
112     bool has_opt_fixed32;
113     uint32_t opt_fixed32;
114     bool has_opt_sfixed32;
115     int32_t opt_sfixed32;
116     bool has_opt_float;
117     float opt_float;
118     bool has_opt_fixed64;
119     uint64_t opt_fixed64;
120     bool has_opt_sfixed64;
121     int64_t opt_sfixed64;
122     bool has_opt_double;
123     double opt_double;
124     bool has_opt_string;
125     char opt_string[16];
126     bool has_opt_bytes;
127     AllTypes_opt_bytes_t opt_bytes;
128     bool has_opt_submsg;
129     SubMessage opt_submsg;
130     bool has_opt_enum;
131     MyEnum opt_enum;
132     int32_t end;
133 } AllTypes;
134 
135 /* Default values for struct fields */
136 extern const char SubMessage_substuff1_default[16];
137 extern const int32_t SubMessage_substuff2_default;
138 extern const uint32_t SubMessage_substuff3_default;
139 extern const int32_t AllTypes_opt_int32_default;
140 extern const int64_t AllTypes_opt_int64_default;
141 extern const uint32_t AllTypes_opt_uint32_default;
142 extern const uint64_t AllTypes_opt_uint64_default;
143 extern const int32_t AllTypes_opt_sint32_default;
144 extern const int64_t AllTypes_opt_sint64_default;
145 extern const bool AllTypes_opt_bool_default;
146 extern const uint32_t AllTypes_opt_fixed32_default;
147 extern const int32_t AllTypes_opt_sfixed32_default;
148 extern const float AllTypes_opt_float_default;
149 extern const uint64_t AllTypes_opt_fixed64_default;
150 extern const int64_t AllTypes_opt_sfixed64_default;
151 extern const double AllTypes_opt_double_default;
152 extern const char AllTypes_opt_string_default[16];
153 extern const AllTypes_opt_bytes_t AllTypes_opt_bytes_default;
154 extern const MyEnum AllTypes_opt_enum_default;
155 
156 /* Struct field encoding specification for nanopb */
157 extern const pb_field_t SubMessage_fields[4];
158 extern const pb_field_t AllTypes_fields[53];
159 
160 /* Check that field information fits in pb_field_t */
161 #if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT)
162 STATIC_ASSERT((pb_membersize(AllTypes, req_submsg) < 256 && pb_membersize(AllTypes, rep_submsg[0]) < 256 && pb_membersize(AllTypes, opt_submsg) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_SubMessage_AllTypes)
163 #endif
164 
165 #if !defined(PB_FIELD_32BIT)
166 STATIC_ASSERT((pb_membersize(AllTypes, req_submsg) < 65536 && pb_membersize(AllTypes, rep_submsg[0]) < 65536 && pb_membersize(AllTypes, opt_submsg) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_SubMessage_AllTypes)
167 #endif
168 
169 /* On some platforms (such as AVR), double is really float.
170  * These are not directly supported by nanopb, but see example_avr_double.
171  */
172 STATIC_ASSERT(sizeof(double) == 8, DOUBLE_MUST_BE_8_BYTES)
173 
174 #ifdef __cplusplus
175 } /* extern "C" */
176 #endif
177 
178 #endif
179