Difference between revisions of "Protobuf notes"
Jump to navigation
Jump to search
m |
m (Add link to FindNanopb.cmake example file found on chromium.googlesource.com.) |
||
| (5 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| − | + | Protobuf references, somewhat arbitrary starting point yet introduces some key topics of Protobuf standard and use cases: | |
* https://www.crankuptheamps.com/blog/posts/2017/10/12/protobuf-battle-of-the-syntaxes/ | * https://www.crankuptheamps.com/blog/posts/2017/10/12/protobuf-battle-of-the-syntaxes/ | ||
| Line 6: | Line 6: | ||
* https://developers.google.com/protocol-buffers/docs/proto | * https://developers.google.com/protocol-buffers/docs/proto | ||
* https://spline.de/talks/protobuf.pdf | * https://spline.de/talks/protobuf.pdf | ||
| + | |||
| + | JSON supported data types: | ||
| + | <ul> | ||
| + | * https://www.w3schools.com/js/js_json_datatypes.asp | ||
| + | </ul> | ||
| + | |||
| + | |||
| + | First Protobuf .proto file, compiles using `protoc-c`, part of a package available with Ubuntu 20.04: | ||
| + | |||
| + | <pre> | ||
| + | // syntax = "proto3"; | ||
| + | syntax = "proto2"; | ||
| + | |||
| + | // Notes: | ||
| + | // $ protoc-c --c_out=. ./first.proto | ||
| + | |||
| + | message sensorUpdates { | ||
| + | required int32 message_id = 1; | ||
| + | optional float vrms = 2; | ||
| + | } | ||
| + | </pre> | ||
| + | |||
| + | . . . It appears that the integer values which message elements are assigned as tantamount to key names in JSON. | ||
| + | |||
| + | == [#top|^] Nanopb == | ||
| + | |||
| + | 2022-01-08 Saturday | ||
| + | |||
| + | * https://github.com/nanopb/nanopb/blob/master/generator/proto/nanopb.proto | ||
| + | * https://jpa.kapsi.fi/nanopb/docs/whats_new.html | ||
| + | * https://jpa.kapsi.fi/nanopb/docs/ | ||
| + | |||
| + | * https://docs.python.org/3/tutorial/modules.html | ||
| + | |||
| + | Cmake script to locate Nanopb headers and sources: | ||
| + | |||
| + | * https://chromium.googlesource.com/external/github.com/nanopb/nanopb/+/nanopb-0.2.9.1/extra/FindNanopb.cmake | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | <!-- comentario --> | ||
Revision as of 21:13, 27 August 2024
Protobuf references, somewhat arbitrary starting point yet introduces some key topics of Protobuf standard and use cases:
- https://www.crankuptheamps.com/blog/posts/2017/10/12/protobuf-battle-of-the-syntaxes/
- https://www.educative.io/edpresso/what-is-the-difference-between-protocol-buffers-and-json
JSON supported data types:
First Protobuf .proto file, compiles using `protoc-c`, part of a package available with Ubuntu 20.04:
// syntax = "proto3";
syntax = "proto2";
// Notes:
// $ protoc-c --c_out=. ./first.proto
message sensorUpdates {
required int32 message_id = 1;
optional float vrms = 2;
}
. . . It appears that the integer values which message elements are assigned as tantamount to key names in JSON.
[#top|^] Nanopb
2022-01-08 Saturday
- https://github.com/nanopb/nanopb/blob/master/generator/proto/nanopb.proto
- https://jpa.kapsi.fi/nanopb/docs/whats_new.html
- https://jpa.kapsi.fi/nanopb/docs/
Cmake script to locate Nanopb headers and sources: