17ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen/* Automatically generated nanopb header */ 27ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen/* This is a file generated using nanopb-0.2.0-dev. 37ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen * It is used as a part of test suite in order to detect any 47ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen * incompatible changes made to the generator in future versions. 57ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen */ 67ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen 77ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen#ifndef _PB_ALLTYPES_PB_H_ 87ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen#define _PB_ALLTYPES_PB_H_ 97ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen#include <pb.h> 107ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen 117ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen#ifdef __cplusplus 127ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohenextern "C" { 137ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen#endif 147ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen 157ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen/* Enum definitions */ 167ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohentypedef enum _MyEnum { 177ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen MyEnum_Zero = 0, 187ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen MyEnum_First = 1, 197ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen MyEnum_Second = 2, 207ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen MyEnum_Truth = 42 217ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen} MyEnum; 227ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen 237ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen/* Struct definitions */ 247ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohentypedef struct _SubMessage { 257ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen char substuff1[16]; 267ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen int32_t substuff2; 277ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen bool has_substuff3; 287ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen uint32_t substuff3; 297ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen} SubMessage; 307ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen 317ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohentypedef struct { 327ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen size_t size; 337ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen uint8_t bytes[16]; 347ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen} AllTypes_req_bytes_t; 357ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen 367ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohentypedef struct { 377ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen size_t size; 387ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen uint8_t bytes[16]; 397ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen} AllTypes_rep_bytes_t; 407ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen 417ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohentypedef struct { 427ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen size_t size; 437ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen uint8_t bytes[16]; 447ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen} AllTypes_opt_bytes_t; 457ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen 467ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohentypedef struct _AllTypes { 477ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen int32_t req_int32; 487ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen int64_t req_int64; 497ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen uint32_t req_uint32; 507ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen uint64_t req_uint64; 517ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen int32_t req_sint32; 527ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen int64_t req_sint64; 537ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen bool req_bool; 547ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen uint32_t req_fixed32; 557ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen int32_t req_sfixed32; 567ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen float req_float; 577ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen uint64_t req_fixed64; 587ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen int64_t req_sfixed64; 597ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen double req_double; 607ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen char req_string[16]; 617ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen AllTypes_req_bytes_t req_bytes; 627ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen SubMessage req_submsg; 637ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen MyEnum req_enum; 647ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen size_t rep_int32_count; 657ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen int32_t rep_int32[5]; 667ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen size_t rep_int64_count; 677ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen int64_t rep_int64[5]; 687ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen size_t rep_uint32_count; 697ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen uint32_t rep_uint32[5]; 707ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen size_t rep_uint64_count; 717ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen uint64_t rep_uint64[5]; 727ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen size_t rep_sint32_count; 737ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen int32_t rep_sint32[5]; 747ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen size_t rep_sint64_count; 757ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen int64_t rep_sint64[5]; 767ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen size_t rep_bool_count; 777ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen bool rep_bool[5]; 787ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen size_t rep_fixed32_count; 797ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen uint32_t rep_fixed32[5]; 807ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen size_t rep_sfixed32_count; 817ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen int32_t rep_sfixed32[5]; 827ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen size_t rep_float_count; 837ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen float rep_float[5]; 847ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen size_t rep_fixed64_count; 857ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen uint64_t rep_fixed64[5]; 867ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen size_t rep_sfixed64_count; 877ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen int64_t rep_sfixed64[5]; 887ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen size_t rep_double_count; 897ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen double rep_double[5]; 907ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen size_t rep_string_count; 917ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen char rep_string[5][16]; 927ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen size_t rep_bytes_count; 937ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen AllTypes_rep_bytes_t rep_bytes[5]; 947ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen size_t rep_submsg_count; 957ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen SubMessage rep_submsg[5]; 967ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen size_t rep_enum_count; 977ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen MyEnum rep_enum[5]; 987ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen bool has_opt_int32; 997ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen int32_t opt_int32; 1007ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen bool has_opt_int64; 1017ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen int64_t opt_int64; 1027ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen bool has_opt_uint32; 1037ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen uint32_t opt_uint32; 1047ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen bool has_opt_uint64; 1057ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen uint64_t opt_uint64; 1067ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen bool has_opt_sint32; 1077ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen int32_t opt_sint32; 1087ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen bool has_opt_sint64; 1097ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen int64_t opt_sint64; 1107ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen bool has_opt_bool; 1117ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen bool opt_bool; 1127ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen bool has_opt_fixed32; 1137ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen uint32_t opt_fixed32; 1147ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen bool has_opt_sfixed32; 1157ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen int32_t opt_sfixed32; 1167ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen bool has_opt_float; 1177ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen float opt_float; 1187ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen bool has_opt_fixed64; 1197ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen uint64_t opt_fixed64; 1207ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen bool has_opt_sfixed64; 1217ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen int64_t opt_sfixed64; 1227ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen bool has_opt_double; 1237ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen double opt_double; 1247ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen bool has_opt_string; 1257ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen char opt_string[16]; 1267ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen bool has_opt_bytes; 1277ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen AllTypes_opt_bytes_t opt_bytes; 1287ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen bool has_opt_submsg; 1297ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen SubMessage opt_submsg; 1307ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen bool has_opt_enum; 1317ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen MyEnum opt_enum; 1327ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen int32_t end; 1337ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen} AllTypes; 1347ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen 1357ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen/* Default values for struct fields */ 1367ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohenextern const char SubMessage_substuff1_default[16]; 1377ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohenextern const int32_t SubMessage_substuff2_default; 1387ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohenextern const uint32_t SubMessage_substuff3_default; 1397ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohenextern const int32_t AllTypes_opt_int32_default; 1407ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohenextern const int64_t AllTypes_opt_int64_default; 1417ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohenextern const uint32_t AllTypes_opt_uint32_default; 1427ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohenextern const uint64_t AllTypes_opt_uint64_default; 1437ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohenextern const int32_t AllTypes_opt_sint32_default; 1447ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohenextern const int64_t AllTypes_opt_sint64_default; 1457ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohenextern const bool AllTypes_opt_bool_default; 1467ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohenextern const uint32_t AllTypes_opt_fixed32_default; 1477ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohenextern const int32_t AllTypes_opt_sfixed32_default; 1487ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohenextern const float AllTypes_opt_float_default; 1497ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohenextern const uint64_t AllTypes_opt_fixed64_default; 1507ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohenextern const int64_t AllTypes_opt_sfixed64_default; 1517ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohenextern const double AllTypes_opt_double_default; 1527ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohenextern const char AllTypes_opt_string_default[16]; 1537ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohenextern const AllTypes_opt_bytes_t AllTypes_opt_bytes_default; 1547ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohenextern const MyEnum AllTypes_opt_enum_default; 1557ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen 1567ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen/* Struct field encoding specification for nanopb */ 1577ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohenextern const pb_field_t SubMessage_fields[4]; 1587ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohenextern const pb_field_t AllTypes_fields[53]; 1597ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen 1607ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen/* Check that field information fits in pb_field_t */ 1617ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) 1627ef855e462b9a18b7d330e4b40f350164a6ad9daEtan CohenSTATIC_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) 1637ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen#endif 1647ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen 1657ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen#if !defined(PB_FIELD_32BIT) 1667ef855e462b9a18b7d330e4b40f350164a6ad9daEtan CohenSTATIC_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) 1677ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen#endif 1687ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen 1697ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen/* On some platforms (such as AVR), double is really float. 1707ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen * These are not directly supported by nanopb, but see example_avr_double. 1717ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen */ 1727ef855e462b9a18b7d330e4b40f350164a6ad9daEtan CohenSTATIC_ASSERT(sizeof(double) == 8, DOUBLE_MUST_BE_8_BYTES) 1737ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen 1747ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen#ifdef __cplusplus 1757ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen} /* extern "C" */ 1767ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen#endif 1777ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen 1787ef855e462b9a18b7d330e4b40f350164a6ad9daEtan Cohen#endif 179