aboutsummaryrefslogtreecommitdiff
path: root/client/main.cpp
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2024-05-10 14:49:36 +0200
committerlonkaars <loek@pipeframe.xyz>2024-05-10 14:49:36 +0200
commit573643a1d3220830de47c810cb1a6be629ce7abd (patch)
tree162a6923f388fef4ab62ddb7ed4a2c82f274fa97 /client/main.cpp
parentae8dfd2028bfbac5f37bbf4f5d7c2d8bff618b02 (diff)
WIP protobuf hello world
Diffstat (limited to 'client/main.cpp')
-rw-r--r--client/main.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/client/main.cpp b/client/main.cpp
new file mode 100644
index 0000000..7a05049
--- /dev/null
+++ b/client/main.cpp
@@ -0,0 +1,25 @@
+#include <cstdio>
+#include <string>
+
+#include "puzbusv1.pb.h"
+
+int main() {
+ GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+ puzbus::I2CMsg test_msg;
+
+ test_msg.set_address(0x39);
+ test_msg.set_data("Test message data!");
+
+ std::string output;
+ test_msg.SerializeToString(&output);
+
+ printf("output[%lu]:\n", output.size());
+ for (size_t i = 0; i < output.size(); i++) {
+ printf("%02x ", output[i]);
+ }
+ printf("\n");
+
+ return 0;
+}
+