All in one solution demonstrating how to use nanopb Protocol Buffers library from within mbed environment. Test case is very simple. It works.

Dependencies:   nanopb protocol

Original import was an all-in-one solution that only depends on mbed.

Current implementation extracted 2 librarires:

1) nanopb contains code required to use nanopb and Timestamp dependency. 2) protocol is a specific research protocol used by LCE at Itron at the moment of commit.

The application decodes Protocol Buffers message generated with GO application using the same 'protocol'. This test level application decodes message and validates that it matches expected.

It is simply a proof that nanopb library can be used.

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 14:16:40 2017. */
sgnezdov 0:fbdd0d307c19 3
sgnezdov 0:fbdd0d307c19 4 #include "timestamp.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 google_protobuf_Timestamp_fields[3] = {
sgnezdov 0:fbdd0d307c19 14 PB_FIELD( 1, INT64 , SINGULAR, STATIC , FIRST, google_protobuf_Timestamp, seconds, seconds, 0),
sgnezdov 0:fbdd0d307c19 15 PB_FIELD( 2, INT32 , SINGULAR, STATIC , OTHER, google_protobuf_Timestamp, nanos, seconds, 0),
sgnezdov 0:fbdd0d307c19 16 PB_LAST_FIELD
sgnezdov 0:fbdd0d307c19 17 };
sgnezdov 0:fbdd0d307c19 18
sgnezdov 0:fbdd0d307c19 19
sgnezdov 0:fbdd0d307c19 20 /* @@protoc_insertion_point(eof) */