aboutsummaryrefslogtreecommitdiff
path: root/lib/pbdrv/pb-serial.h
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-06-13 17:46:26 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-06-13 17:46:26 +0200
commit557b995f9641f7cb7a0566eefac7e576debec61a (patch)
tree1b2b0966f6b1671e5accfe0d980ee1f370d21b58 /lib/pbdrv/pb-serial.h
parentda57aaed1295d72d8d840c69c0e08c0bcab46aee (diff)
really WIP driver (de)serialization
Diffstat (limited to 'lib/pbdrv/pb-serial.h')
-rw-r--r--lib/pbdrv/pb-serial.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/lib/pbdrv/pb-serial.h b/lib/pbdrv/pb-serial.h
new file mode 100644
index 0000000..77e1345
--- /dev/null
+++ b/lib/pbdrv/pb-serial.h
@@ -0,0 +1,38 @@
+#pragma once
+
+#include <mpack.h>
+
+#include "pb-types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+void pbdrv_serialize(mpack_writer_t * writer, const pb_msg_t * msg);
+
+void pbdrv_s_msg_header(mpack_writer_t * writer, const pb_msg_t * msg);
+void pbdrv_s_cmd_req_read(mpack_writer_t * writer, const pb_cmd_req_read_t * msg);
+void pbdrv_s_cmd_res_read(mpack_writer_t * writer, const pb_cmd_res_read_t * msg);
+void pbdrv_s_cmd_req_write(mpack_writer_t * writer, const pb_cmd_req_write_t * msg);
+void pbdrv_s_cmd_req_state(mpack_writer_t * writer, const pb_cmd_req_state_t * msg);
+void pbdrv_s_cmd_res_state(mpack_writer_t * writer, const pb_cmd_res_state_t * msg);
+void pbdrv_s_cmd_req_set_state(mpack_writer_t * writer, const pb_cmd_req_set_state_t * msg);
+void pbdrv_s_cmd_req_magic(mpack_writer_t * writer, const pb_cmd_req_magic_t * msg);
+void pbdrv_s_cmd_res_magic(mpack_writer_t * writer, const pb_cmd_res_magic_t * msg);
+
+// typedef void pbdrv_deserialize_t(mpack_reader_t * reader);
+// pbdrv_deserialize_t pbdrv_d_msg_header;
+// pbdrv_deserialize_t pbdrv_d_cmd_req_read;
+// pbdrv_deserialize_t pbdrv_d_cmd_res_read;
+// pbdrv_deserialize_t pbdrv_d_cmd_req_write;
+// pbdrv_deserialize_t pbdrv_d_cmd_req_state;
+// pbdrv_deserialize_t pbdrv_d_cmd_res_state;
+// pbdrv_deserialize_t pbdrv_d_cmd_req_set_state;
+// pbdrv_deserialize_t pbdrv_d_cmd_req_magic;
+// pbdrv_deserialize_t pbdrv_d_cmd_res_magic;
+
+#ifdef __cplusplus
+}
+#endif
+