summaryrefslogtreecommitdiff
path: root/tmk_core/common/webusb.h
diff options
context:
space:
mode:
authorFlorian Didron <fd@librem.one>2019-11-05 19:02:07 +0900
committerFlorian Didron <fdidron@users.noreply.github.com>2019-12-06 08:20:51 +0900
commitf3edef8c69384d92c026c4ffbcc167464d045c03 (patch)
treeabae48d2dbbe0229902e88059ff87dd6f7f4b9f9 /tmk_core/common/webusb.h
parent40e9813ba2620b9b11811f3a2e5d5879a60aee83 (diff)
feat: adds pairing key
Diffstat (limited to 'tmk_core/common/webusb.h')
-rw-r--r--tmk_core/common/webusb.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/tmk_core/common/webusb.h b/tmk_core/common/webusb.h
new file mode 100644
index 0000000000..35d9610fc9
--- /dev/null
+++ b/tmk_core/common/webusb.h
@@ -0,0 +1,24 @@
+#pragma once
+
+#include <stdint.h>
+#include <stdbool.h>
+
+void webusb_receive(uint8_t *data, uint8_t length);
+void webusb_send(uint8_t *data, uint8_t length);
+void webusb_error(uint8_t);
+void webusb_set_pairing_state(void);
+
+typedef struct{
+ bool paired;
+ bool pairing;
+} webusb_state_t;
+
+extern webusb_state_t webusb_state;
+
+enum Webusb_Status_Code {
+ WEBUSB_STATUS_NOT_PAIRED = -1,
+ WEBUSB_STATUS_OK,
+ WEBUSB_STATUS_UNKNOWN_COMMAND,
+};
+
+