Sergei G / Mbed OS ProtocBufTest

Dependencies:   nanopb protocol

Committer:
sgnezdov
Date:
Wed Jul 12 22:40:29 2017 +0000
Revision:
0:fbdd0d307c19
initial import demonstrates how to decode Sample protocol buffers message.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sgnezdov 0:fbdd0d307c19 1 /* Automatically generated nanopb constant definitions */
sgnezdov 0:fbdd0d307c19 2 /* Generated by nanopb-0.3.8 at Wed Jul 12 11:04:33 2017. */
sgnezdov 0:fbdd0d307c19 3
sgnezdov 0:fbdd0d307c19 4 #include "command.pb.h"
sgnezdov 0:fbdd0d307c19 5
sgnezdov 0:fbdd0d307c19 6 /* @@protoc_insertion_point(includes) */
sgnezdov 0:fbdd0d307c19 7 #if PB_PROTO_HEADER_VERSION != 30
sgnezdov 0:fbdd0d307c19 8 #error Regenerate this file with the current version of nanopb generator.
sgnezdov 0:fbdd0d307c19 9 #endif
sgnezdov 0:fbdd0d307c19 10
sgnezdov 0:fbdd0d307c19 11
sgnezdov 0:fbdd0d307c19 12
sgnezdov 0:fbdd0d307c19 13 const pb_field_t protocol_Command_fields[4] = {
sgnezdov 0:fbdd0d307c19 14 PB_FIELD( 1, MESSAGE , SINGULAR, STATIC , FIRST, protocol_Command, issuedDT, issuedDT, &google_protobuf_Timestamp_fields),
sgnezdov 0:fbdd0d307c19 15 PB_FIELD( 2, UINT32 , SINGULAR, STATIC , OTHER, protocol_Command, commandType, issuedDT, 0),
sgnezdov 0:fbdd0d307c19 16 PB_FIELD( 10, BYTES , SINGULAR, CALLBACK, OTHER, protocol_Command, payload, commandType, 0),
sgnezdov 0:fbdd0d307c19 17 PB_LAST_FIELD
sgnezdov 0:fbdd0d307c19 18 };
sgnezdov 0:fbdd0d307c19 19
sgnezdov 0:fbdd0d307c19 20 const pb_field_t protocol_CommandBatch_fields[3] = {
sgnezdov 0:fbdd0d307c19 21 PB_FIELD( 1, STRING , SINGULAR, CALLBACK, FIRST, protocol_CommandBatch, sn, sn, 0),
sgnezdov 0:fbdd0d307c19 22 PB_FIELD( 10, MESSAGE , REPEATED, CALLBACK, OTHER, protocol_CommandBatch, items, sn, &protocol_Command_fields),
sgnezdov 0:fbdd0d307c19 23 PB_LAST_FIELD
sgnezdov 0:fbdd0d307c19 24 };
sgnezdov 0:fbdd0d307c19 25
sgnezdov 0:fbdd0d307c19 26 const pb_field_t protocol_SecureCommandBatch_fields[3] = {
sgnezdov 0:fbdd0d307c19 27 PB_FIELD( 1, BYTES , SINGULAR, CALLBACK, FIRST, protocol_SecureCommandBatch, signature, signature, 0),
sgnezdov 0:fbdd0d307c19 28 PB_FIELD( 2, BYTES , SINGULAR, CALLBACK, OTHER, protocol_SecureCommandBatch, content, signature, 0),
sgnezdov 0:fbdd0d307c19 29 PB_LAST_FIELD
sgnezdov 0:fbdd0d307c19 30 };
sgnezdov 0:fbdd0d307c19 31
sgnezdov 0:fbdd0d307c19 32 const pb_field_t protocol_CommandResponse_fields[3] = {
sgnezdov 0:fbdd0d307c19 33 PB_FIELD( 1, MESSAGE , SINGULAR, STATIC , FIRST, protocol_CommandResponse, issuedDT, issuedDT, &google_protobuf_Timestamp_fields),
sgnezdov 0:fbdd0d307c19 34 PB_FIELD( 2, UENUM , SINGULAR, STATIC , OTHER, protocol_CommandResponse, status, issuedDT, 0),
sgnezdov 0:fbdd0d307c19 35 PB_LAST_FIELD
sgnezdov 0:fbdd0d307c19 36 };
sgnezdov 0:fbdd0d307c19 37
sgnezdov 0:fbdd0d307c19 38 const pb_field_t protocol_CommandResponseBatch_fields[3] = {
sgnezdov 0:fbdd0d307c19 39 PB_FIELD( 1, STRING , SINGULAR, CALLBACK, FIRST, protocol_CommandResponseBatch, sn, sn, 0),
sgnezdov 0:fbdd0d307c19 40 PB_FIELD( 2, MESSAGE , REPEATED, CALLBACK, OTHER, protocol_CommandResponseBatch, items, sn, &protocol_CommandResponse_fields),
sgnezdov 0:fbdd0d307c19 41 PB_LAST_FIELD
sgnezdov 0:fbdd0d307c19 42 };
sgnezdov 0:fbdd0d307c19 43
sgnezdov 0:fbdd0d307c19 44
sgnezdov 0:fbdd0d307c19 45
sgnezdov 0:fbdd0d307c19 46 /* Check that field information fits in pb_field_t */
sgnezdov 0:fbdd0d307c19 47 #if !defined(PB_FIELD_32BIT)
sgnezdov 0:fbdd0d307c19 48 /* If you get an error here, it means that you need to define PB_FIELD_32BIT
sgnezdov 0:fbdd0d307c19 49 * compile-time option. You can do that in pb.h or on compiler command line.
sgnezdov 0:fbdd0d307c19 50 *
sgnezdov 0:fbdd0d307c19 51 * The reason you need to do this is that some of your messages contain tag
sgnezdov 0:fbdd0d307c19 52 * numbers or field sizes that are larger than what can fit in 8 or 16 bit
sgnezdov 0:fbdd0d307c19 53 * field descriptors.
sgnezdov 0:fbdd0d307c19 54 */
sgnezdov 0:fbdd0d307c19 55 PB_STATIC_ASSERT((pb_membersize(protocol_Command, issuedDT) < 65536 && pb_membersize(protocol_CommandResponse, issuedDT) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_protocol_Command_protocol_CommandBatch_protocol_SecureCommandBatch_protocol_CommandResponse_protocol_CommandResponseBatch)
sgnezdov 0:fbdd0d307c19 56 #endif
sgnezdov 0:fbdd0d307c19 57
sgnezdov 0:fbdd0d307c19 58 #if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT)
sgnezdov 0:fbdd0d307c19 59 /* If you get an error here, it means that you need to define PB_FIELD_16BIT
sgnezdov 0:fbdd0d307c19 60 * compile-time option. You can do that in pb.h or on compiler command line.
sgnezdov 0:fbdd0d307c19 61 *
sgnezdov 0:fbdd0d307c19 62 * The reason you need to do this is that some of your messages contain tag
sgnezdov 0:fbdd0d307c19 63 * numbers or field sizes that are larger than what can fit in the default
sgnezdov 0:fbdd0d307c19 64 * 8 bit descriptors.
sgnezdov 0:fbdd0d307c19 65 */
sgnezdov 0:fbdd0d307c19 66 PB_STATIC_ASSERT((pb_membersize(protocol_Command, issuedDT) < 256 && pb_membersize(protocol_CommandResponse, issuedDT) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_protocol_Command_protocol_CommandBatch_protocol_SecureCommandBatch_protocol_CommandResponse_protocol_CommandResponseBatch)
sgnezdov 0:fbdd0d307c19 67 #endif
sgnezdov 0:fbdd0d307c19 68
sgnezdov 0:fbdd0d307c19 69
sgnezdov 0:fbdd0d307c19 70 /* @@protoc_insertion_point(eof) */