diff options
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; +} + |