寻找一些帮助获得报告ID到我的USB HID键盘的目的是添加媒体密钥。我一定会更新这个帖子,当我的问题已经解决。对不起,这有点长,但我想证明我已经尝试了很多东西。从MLA 2017 03-06开始。在修正FixDead地址后,可以(最后)发送键盘键到记事本。好的。现在,我想通过添加另一个TLD并引入报告ID来发送媒体控制键。这使我的描述符如下:我已经添加到KiBooDr.IpPuthRePosits中,然后我不确定是否应该改变:OR,并且我有SE
tiN MyAppHykey BoBOARD任务,如果(HIDTXHANDLL繁忙…代码。但是,据我所知,键盘消息现在是9字节,限制为8字节,因此较低级别需要将其拆分为两个消息。我已经做了很多谷歌,Requneo和帖子从其他人,到目前为止,什么也没有。目前,它似乎无法适当地枚举。我还尝试修改原来的示例——删除保留字节并将报告ID添加到KEYBOADARIN PUTPUX报表的开始处,更新描述符如下:然后枚举,但不发送按键。
以上来自于百度翻译
以下为原文
Looking for some help getting report IDs into my USB HID keyboard with the aim of adding media keys. I will be sure to update this post when the issue I am having is resolved. Sorry, it's a bit long but I wanted to show that I've tried a lot of things.
Started with MLA 2017-03-06. After correcting
fixed_address_descriptor.h
#define KEYBOARD_INPUT_REPORT_DATA_BUFFER_ADDRESS_TAG @0x500
#define KEYBOARD_OUTPUT_REPORT_DATA_BUFFER_ADDRESS_TAG @0x508
I can (finally) send keyboard keys to notepad. Good.
Now, what I want is to send media control keys by adding another TLD and introduce report IDs.
This leaves my descriptor as follows:
//Class specific descriptor - HID Keyboard + media (size 100))
const struct{uint8_t report[HID_RPT01_SIZE];}hid_rpt01={
{ 0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x06, // USAGE (Keyboard)
0xa1, 0x01, // COLLECTION (Application)
0x85, 0x01, // Report ID
0x05, 0x07, // USAGE_PAGE (Keyboard)
0x19, 0xe0, // USAGE_MINIMUM (Keyboard LeftControl)
0x29, 0xe7, // USAGE_MAXIMUM (Keyboard Right GUI)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x01, // LOGICAL_MAXIMUM (1)
0x75, 0x01, // REPORT_SIZE (1)
0x95, 0x08, // REPORT_COUNT (8)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x95, 0x01, // REPORT_COUNT (1)
0x75, 0x08, // REPORT_SIZE (8)
0x81, 0x03, // INPUT (Cnst,Var,Abs)
0x95, 0x05, // REPORT_COUNT (5)
0x75, 0x01, // REPORT_SIZE (1)
0x05, 0x08, // USAGE_PAGE (LEDs)
0x19, 0x01, // USAGE_MINIMUM (Num Lock)
0x29, 0x05, // USAGE_MAXIMUM (Kana)
0x91, 0x02, // OUTPUT (Data,Var,Abs)
0x95, 0x01, // REPORT_COUNT (1)
0x75, 0x03, // REPORT_SIZE (3)
0x91, 0x03, // OUTPUT (Cnst,Var,Abs)
0x95, 0x06, // REPORT_COUNT (6)
0x75, 0x08, // REPORT_SIZE (8)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x65, // LOGICAL_MAXIMUM (101)
0x05, 0x07, // USAGE_PAGE (Keyboard)
0x19, 0x00, // USAGE_MINIMUM (Reserved (no event indicated))
0x29, 0x65, // USAGE_MAXIMUM (Keyboard Application)
0x81, 0x00, // INPUT (Data,Ary,Abs)
0xc0, // End Collection
0x05, 0x0C, //* Usage Page (Consumer Devices)
0x09, 0x01, //* Usage (Consumer Control)
0xA1, 0x01, //* Collection (Application)
0x85, 0x02, //* Report ID=2
0x05, 0x0C, //* Usage Page (Consumer Devices)
0x15, 0x00, //* Logical Minimum (0)
0x25, 0x01, //* Logical Maximum (1)
0x75, 0x01, //* Report Size (1)
0x95, 0x07, //* Report Count (7)
0x09, 0xe2, // USAGE (Mute) 0x01
0x09, 0xe9, // USAGE (Volume Up) 0x02
0x09, 0xea, // USAGE (Volume Down) 0x03
0x09, 0xcd, // USAGE (Play/Pause) 0x04
0x09, 0xb7, // USAGE (Stop) 0x05
0x09, 0xb6, // USAGE (Scan Previous Track) 0x06
0x09, 0xb5, // USAGE (Scan Next Track) 0x07
0x81, 0x03, // INPUT (Cnst,Var,Abs) padding, 1 bit
0xC0} /// End Collection
};
I have added
uint8_t reportId;
into KEYBOARD_INPUT_REPORT
Then I changed
#define HID_RPT01_SIZE 100
Not sure if I should be changing: #define HID_INT_IN_EP_SIZE 8 or
/* Endpoint Descriptor */
0x07,/*sizeof(USB_EP_DSC)*/
USB_DESCRIPTOR_ENDPOINT, //Endpoint Descriptor
HID_EP | _EP_IN, //EndpointAddress
_INTERRUPT, //Attributes
DESC_CONFIG_WORD(8), //size
0x01,
And I have set
inputReport.reportId = 1;
in my APP_KeyboardTasks, if(HIDTxHandleBusy... code.
But as far as I can tell the keyboard message is now 9 bytes, with a limit of 8 bytes so the lower level needs to split it into two messages. I've done a lot of googling, read Tsuneo and posts from others and so far nothing. Currently it appears to fail to enumerate properly.
I've also tried just modifying the original example - removing the reserved byte and adding the report id into the start of KEYBOARD_INPUT_REPORT, updating the descriptor as follows:
//Class specific descriptor - HID Keyboard with consumer media keyboard
const struct{uint8_t report[HID_RPT01_SIZE];}hid_rpt01={
{ 0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x06, // USAGE (Keyboard)
0xa1, 0x01, // COLLECTION (Application)
0xa1, 0x00, // collection physical
0x85, 0x01, // Report ID
0x05, 0x07, // USAGE_PAGE (Keyboard)
0x19, 0xe0, // USAGE_MINIMUM (Keyboard LeftControl)
0x29, 0xe7, // USAGE_MAXIMUM (Keyboard Right GUI)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x01, // LOGICAL_MAXIMUM (1)
0x75, 0x01, // REPORT_SIZE (1)
0x95, 0x08, // REPORT_COUNT (8)
0x81, 0x02, // INPUT (Data,Var,Abs)
//0x95, 0x01, // REPORT_COUNT (1)
//0x75, 0x08, // REPORT_SIZE (8)
//0x81, 0x03, // INPUT (Cnst,Var,Abs)
0x95, 0x05, // REPORT_COUNT (5)
0x75, 0x01, // REPORT_SIZE (1)
0x05, 0x08, // USAGE_PAGE (LEDs)
0x19, 0x01, // USAGE_MINIMUM (Num Lock)
0x29, 0x05, // USAGE_MAXIMUM (Kana)
0x91, 0x02, // OUTPUT (Data,Var,Abs)
0x95, 0x01, // REPORT_COUNT (1)
0x75, 0x03, // REPORT_SIZE (3)
0x91, 0x03, // OUTPUT (Cnst,Var,Abs)
0x95, 0x06, // REPORT_COUNT (6)
0x75, 0x08, // REPORT_SIZE (8)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x65, // LOGICAL_MAXIMUM (101)
0x05, 0x07, // USAGE_PAGE (Keyboard)
0x19, 0x00, // USAGE_MINIMUM (Reserved (no event indicated))
0x29, 0x65, // USAGE_MAXIMUM (Keyboard Application)
0x81, 0x00, // INPUT (Data,Ary,Abs)
0xc0, //end phy
0xc0} // End Collection
};
Then it enumerates but won't send keypresses.