diff options
author | lonkaars <loek@pipeframe.xyz> | 2024-05-10 14:49:36 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2024-05-10 14:49:36 +0200 |
commit | 573643a1d3220830de47c810cb1a6be629ce7abd (patch) | |
tree | 162a6923f388fef4ab62ddb7ed4a2c82f274fa97 /proto | |
parent | ae8dfd2028bfbac5f37bbf4f5d7c2d8bff618b02 (diff) |
WIP protobuf hello world
Diffstat (limited to 'proto')
-rw-r--r-- | proto/.gitignore | 1 | ||||
-rw-r--r-- | proto/include.cmake | 1 | ||||
-rw-r--r-- | proto/makefile | 7 | ||||
-rw-r--r-- | proto/puzbusv1.proto | 12 |
4 files changed, 21 insertions, 0 deletions
diff --git a/proto/.gitignore b/proto/.gitignore new file mode 100644 index 0000000..75feca5 --- /dev/null +++ b/proto/.gitignore @@ -0,0 +1 @@ +*.pb.* diff --git a/proto/include.cmake b/proto/include.cmake new file mode 100644 index 0000000..d5beaef --- /dev/null +++ b/proto/include.cmake @@ -0,0 +1 @@ +include_directories(${CMAKE_CURRENT_LIST_DIR}) diff --git a/proto/makefile b/proto/makefile new file mode 100644 index 0000000..3bc4ca4 --- /dev/null +++ b/proto/makefile @@ -0,0 +1,7 @@ +PROTOCARGS += --cpp_out . + +all: puzbusv1.pb.cc puzbusv1.pb.h + +%.pb.cc %.pb.h &: %.proto + protoc $(PROTOCARGS) $< + diff --git a/proto/puzbusv1.proto b/proto/puzbusv1.proto new file mode 100644 index 0000000..6b4fa52 --- /dev/null +++ b/proto/puzbusv1.proto @@ -0,0 +1,12 @@ +syntax = "proto2"; + +package puzbus; + +message I2CMsg { + // 32-bit is the smallest integer format supported by protobuf, even though + // we only need 7-10 bits for the I2C address. + required uint32 address = 1; + + optional bytes data = 2; +} + |