From 24034031b6d4324a0bee00b57bd0cf133785a57b Mon Sep 17 00:00:00 2001 From: NicoHood Date: Sat, 10 Oct 2015 07:52:22 +0200 Subject: [PATCH] Added HID protocol (bios/normal mode) --- src/SingleReport/BootKeyboard.cpp | 4 ++++ src/SingleReport/BootKeyboard.h | 1 + src/SingleReport/HID-Driver.h | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/src/SingleReport/BootKeyboard.cpp b/src/SingleReport/BootKeyboard.cpp index 0dfd13c..8e6b811 100644 --- a/src/SingleReport/BootKeyboard.cpp +++ b/src/SingleReport/BootKeyboard.cpp @@ -101,6 +101,10 @@ uint8_t BootKeyboard_::getLeds(void){ return leds; } +uint8_t BootKeyboard_::getProtocol(void){ + return protocol; +} + void BootKeyboard_::sendReport(void* data, int length){ USB_Send(pluggedEndpoint | TRANSFER_RELEASE, data, length); } diff --git a/src/SingleReport/BootKeyboard.h b/src/SingleReport/BootKeyboard.h index 01bcfcf..fdad4f3 100644 --- a/src/SingleReport/BootKeyboard.h +++ b/src/SingleReport/BootKeyboard.h @@ -35,6 +35,7 @@ class BootKeyboard_ : public PUSBListNode, public KeyboardAPI public: BootKeyboard_(void); uint8_t getLeds(void); + uint8_t getProtocol(void); protected: // Implementation of the PUSBListNode diff --git a/src/SingleReport/HID-Driver.h b/src/SingleReport/HID-Driver.h index 9dcfd6a..0dcde68 100644 --- a/src/SingleReport/HID-Driver.h +++ b/src/SingleReport/HID-Driver.h @@ -37,6 +37,10 @@ THE SOFTWARE. #define HID_REPORT_DESCRIPTOR_TYPE 0x22 #define HID_PHYSICAL_DESCRIPTOR_TYPE 0x23 +// Keyboard/Mouse protocols (normal or bios) HID1.11 Page 8 4.2 Subclass +#define HID_PROTOCOL_NO_SUBCLASS 0 +#define HID_PROTOCOL_BOOT 1 + typedef struct { uint8_t len; // 9