-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SOFT-495] Migrate bootloader from protobuf-c to nanopb (#426)
Nanopb is a more embedded-friendly protobuf implementation, so we use it instead of protobuf-c.
- Loading branch information
Showing
13 changed files
with
341 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* Automatically generated nanopb constant definitions */ | ||
/* Generated by nanopb-0.4.6-dev */ | ||
|
||
#include "flash_application_code.pb.h" | ||
#if PB_PROTO_HEADER_VERSION != 40 | ||
#error Regenerate this file with the current version of nanopb generator. | ||
#endif | ||
|
||
PB_BIND(FlashApplicationCode, FlashApplicationCode, AUTO) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* Automatically generated nanopb header */ | ||
/* Generated by nanopb-0.4.6-dev */ | ||
|
||
#ifndef PB_FLASH_APPLICATION_CODE_PB_H_INCLUDED | ||
#define PB_FLASH_APPLICATION_CODE_PB_H_INCLUDED | ||
#include <pb.h> | ||
|
||
#if PB_PROTO_HEADER_VERSION != 40 | ||
#error Regenerate this file with the current version of nanopb generator. | ||
#endif | ||
|
||
/* Struct definitions */ | ||
typedef struct _FlashApplicationCode { | ||
pb_callback_t name; | ||
pb_callback_t git_version; | ||
uint32_t application_crc; | ||
uint32_t size; | ||
} FlashApplicationCode; | ||
|
||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/* Initializer values for message structs */ | ||
#define FlashApplicationCode_init_default {{{NULL}, NULL}, {{NULL}, NULL}, 0, 0} | ||
#define FlashApplicationCode_init_zero {{{NULL}, NULL}, {{NULL}, NULL}, 0, 0} | ||
|
||
/* Field tags (for use in manual encoding/decoding) */ | ||
#define FlashApplicationCode_name_tag 1 | ||
#define FlashApplicationCode_git_version_tag 2 | ||
#define FlashApplicationCode_application_crc_tag 3 | ||
#define FlashApplicationCode_size_tag 4 | ||
|
||
/* Struct field encoding specification for nanopb */ | ||
#define FlashApplicationCode_FIELDLIST(X, a) \ | ||
X(a, CALLBACK, SINGULAR, STRING, name, 1) \ | ||
X(a, CALLBACK, SINGULAR, STRING, git_version, 2) \ | ||
X(a, STATIC, SINGULAR, UINT32, application_crc, 3) \ | ||
X(a, STATIC, SINGULAR, UINT32, size, 4) | ||
#define FlashApplicationCode_CALLBACK pb_default_field_callback | ||
#define FlashApplicationCode_DEFAULT NULL | ||
|
||
extern const pb_msgdesc_t FlashApplicationCode_msg; | ||
|
||
/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ | ||
#define FlashApplicationCode_fields &FlashApplicationCode_msg | ||
|
||
/* Maximum encoded size of messages (where known) */ | ||
/* FlashApplicationCode_size depends on runtime parameters */ | ||
|
||
#ifdef __cplusplus | ||
} /* extern "C" */ | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* Automatically generated nanopb constant definitions */ | ||
/* Generated by nanopb-0.4.6-dev */ | ||
|
||
#include "querying.pb.h" | ||
#if PB_PROTO_HEADER_VERSION != 40 | ||
#error Regenerate this file with the current version of nanopb generator. | ||
#endif | ||
|
||
PB_BIND(Querying, Querying, AUTO) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* Automatically generated nanopb header */ | ||
/* Generated by nanopb-0.4.6-dev */ | ||
|
||
#ifndef PB_QUERYING_PB_H_INCLUDED | ||
#define PB_QUERYING_PB_H_INCLUDED | ||
#include <pb.h> | ||
|
||
#if PB_PROTO_HEADER_VERSION != 40 | ||
#error Regenerate this file with the current version of nanopb generator. | ||
#endif | ||
|
||
/* Struct definitions */ | ||
typedef struct _Querying { | ||
pb_callback_t id; | ||
pb_callback_t name; | ||
pb_callback_t current_project; | ||
pb_callback_t project_info; | ||
pb_callback_t git_version; | ||
} Querying; | ||
|
||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/* Initializer values for message structs */ | ||
#define Querying_init_default {{{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}} | ||
#define Querying_init_zero {{{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}} | ||
|
||
/* Field tags (for use in manual encoding/decoding) */ | ||
#define Querying_id_tag 1 | ||
#define Querying_name_tag 2 | ||
#define Querying_current_project_tag 3 | ||
#define Querying_project_info_tag 4 | ||
#define Querying_git_version_tag 5 | ||
|
||
/* Struct field encoding specification for nanopb */ | ||
#define Querying_FIELDLIST(X, a) \ | ||
X(a, CALLBACK, REPEATED, UINT32, id, 1) \ | ||
X(a, CALLBACK, REPEATED, STRING, name, 2) \ | ||
X(a, CALLBACK, REPEATED, STRING, current_project, 3) \ | ||
X(a, CALLBACK, REPEATED, STRING, project_info, 4) \ | ||
X(a, CALLBACK, REPEATED, STRING, git_version, 5) | ||
#define Querying_CALLBACK pb_default_field_callback | ||
#define Querying_DEFAULT NULL | ||
|
||
extern const pb_msgdesc_t Querying_msg; | ||
|
||
/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ | ||
#define Querying_fields &Querying_msg | ||
|
||
/* Maximum encoded size of messages (where known) */ | ||
/* Querying_size depends on runtime parameters */ | ||
|
||
#ifdef __cplusplus | ||
} /* extern "C" */ | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* Automatically generated nanopb constant definitions */ | ||
/* Generated by nanopb-0.4.6-dev */ | ||
|
||
#include "querying_response.pb.h" | ||
#if PB_PROTO_HEADER_VERSION != 40 | ||
#error Regenerate this file with the current version of nanopb generator. | ||
#endif | ||
|
||
PB_BIND(QueryingResponse, QueryingResponse, AUTO) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* Automatically generated nanopb header */ | ||
/* Generated by nanopb-0.4.6-dev */ | ||
|
||
#ifndef PB_QUERYING_RESPONSE_PB_H_INCLUDED | ||
#define PB_QUERYING_RESPONSE_PB_H_INCLUDED | ||
#include <pb.h> | ||
|
||
#if PB_PROTO_HEADER_VERSION != 40 | ||
#error Regenerate this file with the current version of nanopb generator. | ||
#endif | ||
|
||
/* Struct definitions */ | ||
typedef struct _QueryingResponse { | ||
uint32_t id; | ||
pb_callback_t name; | ||
pb_callback_t current_project; | ||
pb_callback_t project_info; | ||
pb_callback_t git_version; | ||
} QueryingResponse; | ||
|
||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/* Initializer values for message structs */ | ||
#define QueryingResponse_init_default {0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}} | ||
#define QueryingResponse_init_zero {0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}} | ||
|
||
/* Field tags (for use in manual encoding/decoding) */ | ||
#define QueryingResponse_id_tag 1 | ||
#define QueryingResponse_name_tag 2 | ||
#define QueryingResponse_current_project_tag 3 | ||
#define QueryingResponse_project_info_tag 4 | ||
#define QueryingResponse_git_version_tag 5 | ||
|
||
/* Struct field encoding specification for nanopb */ | ||
#define QueryingResponse_FIELDLIST(X, a) \ | ||
X(a, STATIC, SINGULAR, UINT32, id, 1) \ | ||
X(a, CALLBACK, SINGULAR, STRING, name, 2) \ | ||
X(a, CALLBACK, SINGULAR, STRING, current_project, 3) \ | ||
X(a, CALLBACK, SINGULAR, STRING, project_info, 4) \ | ||
X(a, CALLBACK, SINGULAR, STRING, git_version, 5) | ||
#define QueryingResponse_CALLBACK pb_default_field_callback | ||
#define QueryingResponse_DEFAULT NULL | ||
|
||
extern const pb_msgdesc_t QueryingResponse_msg; | ||
|
||
/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ | ||
#define QueryingResponse_fields &QueryingResponse_msg | ||
|
||
/* Maximum encoded size of messages (where known) */ | ||
/* QueryingResponse_size depends on runtime parameters */ | ||
|
||
#ifdef __cplusplus | ||
} /* extern "C" */ | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* Automatically generated nanopb constant definitions */ | ||
/* Generated by nanopb-0.4.6-dev */ | ||
|
||
#include "update_id.pb.h" | ||
#if PB_PROTO_HEADER_VERSION != 40 | ||
#error Regenerate this file with the current version of nanopb generator. | ||
#endif | ||
|
||
PB_BIND(UpdateId, UpdateId, AUTO) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* Automatically generated nanopb header */ | ||
/* Generated by nanopb-0.4.6-dev */ | ||
|
||
#ifndef PB_UPDATE_ID_PB_H_INCLUDED | ||
#define PB_UPDATE_ID_PB_H_INCLUDED | ||
#include <pb.h> | ||
|
||
#if PB_PROTO_HEADER_VERSION != 40 | ||
#error Regenerate this file with the current version of nanopb generator. | ||
#endif | ||
|
||
/* Struct definitions */ | ||
typedef struct _UpdateId { | ||
uint32_t new_id; | ||
} UpdateId; | ||
|
||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/* Initializer values for message structs */ | ||
#define UpdateId_init_default {0} | ||
#define UpdateId_init_zero {0} | ||
|
||
/* Field tags (for use in manual encoding/decoding) */ | ||
#define UpdateId_new_id_tag 1 | ||
|
||
/* Struct field encoding specification for nanopb */ | ||
#define UpdateId_FIELDLIST(X, a) \ | ||
X(a, STATIC, SINGULAR, UINT32, new_id, 1) | ||
#define UpdateId_CALLBACK NULL | ||
#define UpdateId_DEFAULT NULL | ||
|
||
extern const pb_msgdesc_t UpdateId_msg; | ||
|
||
/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ | ||
#define UpdateId_fields &UpdateId_msg | ||
|
||
/* Maximum encoded size of messages (where known) */ | ||
#define UpdateId_size 6 | ||
|
||
#ifdef __cplusplus | ||
} /* extern "C" */ | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* Automatically generated nanopb constant definitions */ | ||
/* Generated by nanopb-0.4.6-dev */ | ||
|
||
#include "update_name.pb.h" | ||
#if PB_PROTO_HEADER_VERSION != 40 | ||
#error Regenerate this file with the current version of nanopb generator. | ||
#endif | ||
|
||
PB_BIND(UpdateName, UpdateName, AUTO) | ||
|
||
|
||
|
Oops, something went wrong.