From b55a08cd6aba0364d8ef4c450f8aeb057bb936ee Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Mon, 11 Dec 2017 21:49:58 +0100 Subject: submessages --- elegoo/elegoo.pb.c | 54 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 44 insertions(+), 10 deletions(-) (limited to 'elegoo/elegoo.pb.c') diff --git a/elegoo/elegoo.pb.c b/elegoo/elegoo.pb.c index 1dd40bf..fad83e8 100644 --- a/elegoo/elegoo.pb.c +++ b/elegoo/elegoo.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.9 at Mon Dec 11 01:03:09 2017. */ +/* Generated by nanopb-0.3.9 at Mon Dec 11 21:46:37 2017. */ #include "elegoo.pb.h" @@ -10,25 +10,59 @@ -const pb_field_t elegoo_Command_fields[6] = { - PB_FIELD( 1, SINT32 , SINGULAR, STATIC , FIRST, elegoo_Command, SpeedR, SpeedR, 0), - PB_FIELD( 2, SINT32 , SINGULAR, STATIC , OTHER, elegoo_Command, SpeedL, SpeedR, 0), - PB_FIELD( 3, BOOL , SINGULAR, STATIC , OTHER, elegoo_Command, Stop, SpeedL, 0), +const pb_field_t elegoo_Speed_fields[3] = { + PB_FIELD( 1, SINT32 , SINGULAR, STATIC , FIRST, elegoo_Speed, L, L, 0), + PB_FIELD( 2, SINT32 , SINGULAR, STATIC , OTHER, elegoo_Speed, R, L, 0), + PB_LAST_FIELD +}; + +const pb_field_t elegoo_Command_fields[5] = { + PB_FIELD( 1, MESSAGE , SINGULAR, STATIC , FIRST, elegoo_Command, Speed, Speed, &elegoo_Speed_fields), + PB_FIELD( 3, BOOL , SINGULAR, STATIC , OTHER, elegoo_Command, Stop, Speed, 0), PB_FIELD( 4, UINT32 , SINGULAR, STATIC , OTHER, elegoo_Command, Direction, Stop, 0), PB_FIELD( 5, UINT32 , SINGULAR, STATIC , OTHER, elegoo_Command, StopAfter, Direction, 0), PB_LAST_FIELD }; -const pb_field_t elegoo_Events_fields[8] = { +const pb_field_t elegoo_Sensor_fields[4] = { + PB_FIELD( 1, BOOL , SINGULAR, STATIC , FIRST, elegoo_Sensor, R, R, 0), + PB_FIELD( 2, BOOL , SINGULAR, STATIC , OTHER, elegoo_Sensor, C, R, 0), + PB_FIELD( 3, BOOL , SINGULAR, STATIC , OTHER, elegoo_Sensor, L, C, 0), + PB_LAST_FIELD +}; + +const pb_field_t elegoo_Events_fields[6] = { PB_FIELD( 1, UINT32 , SINGULAR, STATIC , FIRST, elegoo_Events, Distance, Distance, 0), PB_FIELD( 2, SINT32 , SINGULAR, STATIC , OTHER, elegoo_Events, Direction, Distance, 0), - PB_FIELD( 3, BOOL , SINGULAR, STATIC , OTHER, elegoo_Events, SensorR, Direction, 0), - PB_FIELD( 4, BOOL , SINGULAR, STATIC , OTHER, elegoo_Events, SensorC, SensorR, 0), - PB_FIELD( 5, BOOL , SINGULAR, STATIC , OTHER, elegoo_Events, SensorL, SensorC, 0), - PB_FIELD( 6, UINT32 , SINGULAR, STATIC , OTHER, elegoo_Events, KeyPress, SensorL, 0), + PB_FIELD( 3, MESSAGE , SINGULAR, STATIC , OTHER, elegoo_Events, Sensor, Direction, &elegoo_Sensor_fields), + PB_FIELD( 6, UINT32 , SINGULAR, STATIC , OTHER, elegoo_Events, KeyPress, Sensor, 0), PB_FIELD( 7, UINT32 , SINGULAR, STATIC , OTHER, elegoo_Events, Time, KeyPress, 0), PB_LAST_FIELD }; +/* Check that field information fits in pb_field_t */ +#if !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_32BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * numbers or field sizes that are larger than what can fit in 8 or 16 bit + * field descriptors. + */ +PB_STATIC_ASSERT((pb_membersize(elegoo_Command, Speed) < 65536 && pb_membersize(elegoo_Events, Sensor) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_elegoo_Speed_elegoo_Command_elegoo_Sensor_elegoo_Events) +#endif + +#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_16BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * numbers or field sizes that are larger than what can fit in the default + * 8 bit descriptors. + */ +PB_STATIC_ASSERT((pb_membersize(elegoo_Command, Speed) < 256 && pb_membersize(elegoo_Events, Sensor) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_elegoo_Speed_elegoo_Command_elegoo_Sensor_elegoo_Events) +#endif + + /* @@protoc_insertion_point(eof) */ -- cgit v1.2.3