diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2014-02-27 23:15:10 +0100 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2014-02-27 23:15:10 +0100 |
commit | fab8321b68896a8a9ff085586652ed4d834ba173 (patch) | |
tree | 3ec798319c7e87d413239c74f52025ceeb0ee531 | |
parent | 043e8eb4929ca2078bba9aab3ca763beb429f237 (diff) |
HID: added get_feature_report().
-rw-r--r-- | usb/hid.h | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -225,9 +225,10 @@ constexpr auto padding_out(uint8_t size) -> decltype( } class USB_HID : public USB_class_driver { - private: + protected: USB_generic& usb; + private: desc_t report_desc_p; enum ControlState { @@ -285,6 +286,11 @@ class USB_HID : public USB_class_driver { return SetupStatus::Ok; } + // Get feature report. + if(bmRequestType == 0xa1 && wIndex == interface_num && bRequest == 0x01 && (wValue & 0xff00) == 0x0300) { + return get_feature_report(wValue & 0xff) ? SetupStatus::Ok : SetupStatus::Stall; + } + return SetupStatus::Unhandled; } @@ -329,6 +335,10 @@ class USB_HID : public USB_class_driver { virtual bool set_feature_report(uint32_t* buf, uint32_t len) { return false; } + + virtual bool get_feature_report(uint8_t report_id) { + return false; + } }; #endif |