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 11:04:33 2017. */
sgnezdov 0:fbdd0d307c19 3
sgnezdov 0:fbdd0d307c19 4 #include "stm.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_StmAdcSchedule_fields[9] = {
sgnezdov 0:fbdd0d307c19 14 PB_FIELD( 1, UINT32 , SINGULAR, STATIC , FIRST, protocol_StmAdcSchedule, ReadingStepSizeSecs, ReadingStepSizeSecs, 0),
sgnezdov 0:fbdd0d307c19 15 PB_FIELD( 2, UINT32 , REPEATED, CALLBACK, OTHER, protocol_StmAdcSchedule, LoThreshold, ReadingStepSizeSecs, 0),
sgnezdov 0:fbdd0d307c19 16 PB_FIELD( 3, UINT32 , REPEATED, CALLBACK, OTHER, protocol_StmAdcSchedule, HiThreshold, LoThreshold, 0),
sgnezdov 0:fbdd0d307c19 17 PB_FIELD( 4, UINT32 , REPEATED, CALLBACK, OTHER, protocol_StmAdcSchedule, Deadband, HiThreshold, 0),
sgnezdov 0:fbdd0d307c19 18 PB_FIELD( 5, UINT32 , SINGULAR, STATIC , OTHER, protocol_StmAdcSchedule, RecPeriod, Deadband, 0),
sgnezdov 0:fbdd0d307c19 19 PB_FIELD( 6, UINT32 , SINGULAR, STATIC , OTHER, protocol_StmAdcSchedule, LoDelayd, RecPeriod, 0),
sgnezdov 0:fbdd0d307c19 20 PB_FIELD( 7, UINT32 , SINGULAR, STATIC , OTHER, protocol_StmAdcSchedule, HiDelayd, LoDelayd, 0),
sgnezdov 0:fbdd0d307c19 21 PB_FIELD( 8, UINT32 , SINGULAR, STATIC , OTHER, protocol_StmAdcSchedule, FlagDelayd, HiDelayd, 0),
sgnezdov 0:fbdd0d307c19 22 PB_LAST_FIELD
sgnezdov 0:fbdd0d307c19 23 };
sgnezdov 0:fbdd0d307c19 24
sgnezdov 0:fbdd0d307c19 25
sgnezdov 0:fbdd0d307c19 26 /* @@protoc_insertion_point(eof) */