我在使用Bluenrg-ms做ble hid设备时,分别单独实现了键盘和鼠标的功能,但是当我像usb hid 设备一样在report map(也就是报告描述符)中同时加入用report id 区分时,ble 设备不能同时识别,请问如何解决? 以下是我的报告描述符:
- static uint8_t hid_report[] =
- {
-
- #if use_keybord
- 0x05, 0x01, // USAGE_PAGE (Generic Desktop)
- 0x09, 0x06, // USAGE (Keyboard)
- //表示应用集合,必须要以 END_COLLECTION 来结束它,见最后的 END_COLLECTION
- 0xa1, 0x01, // COLLECTION (Application)
- //#if FEATURE_SUPPORT_MULTIMEDIA_KEYBOARD //复合设备
- // 0x85, HIDS_KB_REPORT_ID, // REPORT_ID (1)
- // //他也需要一字节
- //#endif
- 0x05, 0x07, // USAGE_PAGE (Keyboard)
- // bitmap of modifiers
- 0x75, 0x01, // Report Size (1),
- 0x95, 0x08, // Report Count (8),
- 0x19, 0xE0, // Usage Minimum (224),
- 0x29, 0xE7, // Usage Maximum (231),
- 0x15, 0x00, // Logical Minimum (0),
- 0x25, 0x01, // Logical Maximum (1),
- 0x81, 0x02, // Input (Data, Variable, Absolute), ;Modifier byte
-
-
- // 1 Reserved byte
- 0x95, 0x01, // REPORT_COUNT (1)
- 0x75, 0x08, // REPORT_SIZE (8)
- 0x81, 0x01, // INPUT (Cnst,Ary,Abs)
-
- // LEDs for num lock etc
- 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)
-
- // Reserved 3 bits
- 0x95, 0x01, // REPORT_COUNT (1)
- 0x75, 0x03, // REPORT_SIZE (3)
- 0x91, 0x03, // OUTPUT (Cnst,Var,Abs)
- /* Slots for 6 keys that can be pressed down at the same time */
- 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
- #endif
- #if use_mouse
- 0x05, 0x01, // USAGE_PAGE (Generic Desktop)
- 0x09, 0x02, // USAGE (Mouse)
- 0xa1, 0x01, // COLLECTION (Application)
- #if FEATURE_SUPPORT_MULTIMEDIA_KEYBOARD //复合设备
- 0x85, HIDS_MM_KB_REPORT_ID, // REPORT_ID (2)
- #endif
- 0x09, 0x01, // USAGE (Pointer) 鼠标指针的控制
- 0xa1, 0x00, // COLLECTION (Physical)
- 0x05, 0x09, // Usage Page (Buttons)
- 0x19, 0x01, // Usage Minimum (1)
- 0x29, 0x03, // Usage Maximum (3)
- 0x15, 0x00, // Logical Minimum (0)
- 0x25, 0x01, // Logical Maximum (1)
- 0x95, 0x03, // Report Count (3)
- 0x75, 0x01, // Report Size (1)
- 0x81, 0x02, // Input(Data, Variable, Absolute); 3 button bits
-
- 0x95, 0x01, // Report Count(1)
- 0x75, 0x05, // Report Size(5)
- 0x81, 0x03, // Input(Constant); 5 bit padding
-
- 0x75, 0x08, // Report Size (8)
- 0x95, 0x03, // Report Count (3)
- 0x05, 0x01, // Usage Page (Generic Desktop)
- 0x09, 0x30, // Usage (X)
- 0x09, 0x31, // Usage (Y)
- 0x09, 0x38, // Usage (Wheel)
- 0x15, 0x81, // Logical Minimum (-127)
- 0x25, 0x7F, // Logical Maximum (127)
- 0x81, 0x06, // Input(Data, Variable, Relative); 3 position bytes (X,Y,Wheel)
- 0xc0, // END_COLLECTION
- 0xc0 // END_COLLECTION
- #endif
- };
复制代码
|