diff options
author | Florian Didron <fd@librem.one> | 2019-11-05 19:02:07 +0900 |
---|---|---|
committer | Florian Didron <fdidron@users.noreply.github.com> | 2019-12-06 08:20:51 +0900 |
commit | f3edef8c69384d92c026c4ffbcc167464d045c03 (patch) | |
tree | abae48d2dbbe0229902e88059ff87dd6f7f4b9f9 /tmk_core/protocol/lufa | |
parent | 40e9813ba2620b9b11811f3a2e5d5879a60aee83 (diff) |
feat: adds pairing key
Diffstat (limited to 'tmk_core/protocol/lufa')
-rw-r--r-- | tmk_core/protocol/lufa/lufa.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index 998db1c6d8..c68c3c2e5b 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -90,6 +90,10 @@ extern keymap_config_t keymap_config; # include "raw_hid.h" #endif +#ifdef WEBUSB_ENABLE +#include "webusb.h" +#endif + uint8_t keyboard_idle = 0; /* 0: Boot Protocol, 1: Report Protocol(default) */ uint8_t keyboard_protocol = 1; @@ -307,7 +311,12 @@ static void webusb_task(void) { Endpoint_ClearOUT(); if (data_read) { - webusb_receive(data, sizeof(data)); + if(webusb_state.paired == true) { + webusb_receive(data, sizeof(data)); + } + else { + webusb_error(WEBUSB_STATUS_NOT_PAIRED); + } } } } |