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.

Revision:
1:78f2fa2c125e
Parent:
0:fbdd0d307c19
--- a/source/protocol/stm.pb.h	Wed Jul 12 22:40:29 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/* Automatically generated nanopb header */
-/* Generated by nanopb-0.3.8 at Wed Jul 12 11:04:33 2017. */
-
-#ifndef PB_PROTOCOL_STM_PB_H_INCLUDED
-#define PB_PROTOCOL_STM_PB_H_INCLUDED
-#include <pb.h>
-
-#include "google/protobuf/timestamp.pb.h"
-
-/* @@protoc_insertion_point(includes) */
-#if PB_PROTO_HEADER_VERSION != 30
-#error Regenerate this file with the current version of nanopb generator.
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Struct definitions */
-typedef struct _protocol_StmAdcSchedule {
-    uint32_t ReadingStepSizeSecs;
-    pb_callback_t LoThreshold;
-    pb_callback_t HiThreshold;
-    pb_callback_t Deadband;
-    uint32_t RecPeriod;
-    uint32_t LoDelayd;
-    uint32_t HiDelayd;
-    uint32_t FlagDelayd;
-/* @@protoc_insertion_point(struct:protocol_StmAdcSchedule) */
-} protocol_StmAdcSchedule;
-
-/* Default values for struct fields */
-
-/* Initializer values for message structs */
-#define protocol_StmAdcSchedule_init_default     {0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, 0, 0, 0, 0}
-#define protocol_StmAdcSchedule_init_zero        {0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, 0, 0, 0, 0}
-
-/* Field tags (for use in manual encoding/decoding) */
-#define protocol_StmAdcSchedule_ReadingStepSizeSecs_tag 1
-#define protocol_StmAdcSchedule_LoThreshold_tag  2
-#define protocol_StmAdcSchedule_HiThreshold_tag  3
-#define protocol_StmAdcSchedule_Deadband_tag     4
-#define protocol_StmAdcSchedule_RecPeriod_tag    5
-#define protocol_StmAdcSchedule_LoDelayd_tag     6
-#define protocol_StmAdcSchedule_HiDelayd_tag     7
-#define protocol_StmAdcSchedule_FlagDelayd_tag   8
-
-/* Struct field encoding specification for nanopb */
-extern const pb_field_t protocol_StmAdcSchedule_fields[9];
-
-/* Maximum encoded size of messages (where known) */
-/* protocol_StmAdcSchedule_size depends on runtime parameters */
-
-/* Message IDs (where set with "msgid" option) */
-#ifdef PB_MSGID
-
-#define STM_MESSAGES \
-
-
-#endif
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-/* @@protoc_insertion_point(eof) */
-
-#endif