All in one solution demonstrating how to use nanopb Protocol Buffers library from within mbed environment. Test case is very simple. It works.
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.
Diff: source/protocol/gasQuality.pb.c
- Revision:
- 1:78f2fa2c125e
- Parent:
- 0:fbdd0d307c19
diff -r fbdd0d307c19 -r 78f2fa2c125e source/protocol/gasQuality.pb.c --- a/source/protocol/gasQuality.pb.c Wed Jul 12 22:40:29 2017 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.8 at Wed Jul 12 11:04:33 2017. */ - -#include "gasQuality.pb.h" - -/* @@protoc_insertion_point(includes) */ -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - - - -const pb_field_t protocol_GQSRawSample_fields[14] = { - PB_FIELD( 1, UINT32 , SINGULAR, STATIC , FIRST, protocol_GQSRawSample, Temperature1, Temperature1, 0), - PB_FIELD( 2, UENUM , SINGULAR, STATIC , OTHER, protocol_GQSRawSample, Temperature1Err, Temperature1, 0), - PB_FIELD( 3, UINT32 , SINGULAR, STATIC , OTHER, protocol_GQSRawSample, Temperature2, Temperature1Err, 0), - PB_FIELD( 4, UENUM , SINGULAR, STATIC , OTHER, protocol_GQSRawSample, Temperature2Err, Temperature2, 0), - PB_FIELD( 5, UINT32 , SINGULAR, STATIC , OTHER, protocol_GQSRawSample, Pressure1, Temperature2Err, 0), - PB_FIELD( 6, UENUM , SINGULAR, STATIC , OTHER, protocol_GQSRawSample, Pressure1Err, Pressure1, 0), - PB_FIELD( 7, UINT32 , SINGULAR, STATIC , OTHER, protocol_GQSRawSample, Pressure2, Pressure1Err, 0), - PB_FIELD( 8, UENUM , SINGULAR, STATIC , OTHER, protocol_GQSRawSample, Pressure2Err, Pressure2, 0), - PB_FIELD( 9, BYTES , SINGULAR, CALLBACK, OTHER, protocol_GQSRawSample, MemsStatus, Pressure2Err, 0), - PB_FIELD( 10, UENUM , SINGULAR, STATIC , OTHER, protocol_GQSRawSample, MemsStatusErr, MemsStatus, 0), - PB_FIELD( 11, BYTES , SINGULAR, CALLBACK, OTHER, protocol_GQSRawSample, MemsMeasurement, MemsStatusErr, 0), - PB_FIELD( 12, UENUM , SINGULAR, STATIC , OTHER, protocol_GQSRawSample, MemsMeasurementErr, MemsMeasurement, 0), - PB_FIELD( 15, MESSAGE , REPEATED, CALLBACK, OTHER, protocol_GQSRawSample, errors, MemsMeasurementErr, &protocol_GQSRawSample_ErrorsEntry_fields), - PB_LAST_FIELD -}; - -const pb_field_t protocol_GQSRawSample_ErrorsEntry_fields[3] = { - PB_FIELD( 1, UINT32 , SINGULAR, STATIC , FIRST, protocol_GQSRawSample_ErrorsEntry, key, key, 0), - PB_FIELD( 2, STRING , SINGULAR, CALLBACK, OTHER, protocol_GQSRawSample_ErrorsEntry, value, key, 0), - PB_LAST_FIELD -}; - - - -/* @@protoc_insertion_point(eof) */