aboutsummaryrefslogtreecommitdiff
path: root/shared/serial_parse.h
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-01-07 14:43:03 +0100
committerlonkaars <loek@pipeframe.xyz>2023-01-07 14:43:03 +0100
commitadb70d5ee1987cfb1680114d2db9786923aad1f1 (patch)
treea15de82808f40153cd285994cab7534ed9a10538 /shared/serial_parse.h
parent46ede2c109fe2aa390936ec4f0a30321fb7b5d86 (diff)
parentb083c8e08d610a4e74f39f66f3daa191301893b1 (diff)
Merge branch 'qt-gui-meshconnector-serial' into dev
Diffstat (limited to 'shared/serial_parse.h')
-rw-r--r--shared/serial_parse.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/shared/serial_parse.h b/shared/serial_parse.h
new file mode 100644
index 0000000..1e9c404
--- /dev/null
+++ b/shared/serial_parse.h
@@ -0,0 +1,26 @@
+#pragma once
+
+/** @file serial_parse.h */
+
+#include <stdint.h>
+#include <stdbool.h>
+
+#include "protocol.h"
+
+#define CD_SERIAL_READ_SUCCESS true
+#define CD_SERIAL_READ_FAILURE false
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * parse serial data byte by byte
+ * @return true if read success, false if read fails
+ */
+bool cd_serial_parse(uint8_t byte);
+
+#ifdef __cplusplus
+}
+#endif
+