Hi,
I am using HIDEmuKbd project to test BLE capabilities for a new device. I tested all of the functionalities of emulated hid keyboard with succes on SmartRF06 + CC2650EM-7ID.
Now I need to send feature reports to the device in order to control SmartRF06 LED outputs according to my needs, maintaining the HID emulated keyboard functionalities linked to the four board buttons (I associated a different key to each button and it is working well).
I added a second Top Level Collection to avoid windows exclusive access to HID device with usage page 0x01 and usage 0x06 (keyboard). So my new report descriptor is the following:
static CONST uint8 hidReportMap[] = { 0x05, 0x01, // USAGE_PAGE (Generic Desktop) 0x09, 0x06, // USAGE (Keyboard) 0xa1, 0x01, // COLLECTION (Application) 0x05, 0x07, // USAGE_PAGE (Keyboard) 0x85, 0x01, // REPORT_ID (1) 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, 0x01, // INPUT (Cnst,Ary,Abs) 0x95, 0x05, // REPORT_COUNT (5) 0x75, 0x01, // REPORT_SIZE (1) 0x05, 0x08, // USAGE_PAGE (LEDs) 0x85, 0x01, // REPORT_ID (1) 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 0x06, 0x00, 0xff, // USAGE_PAGE (Vendor Defined Page 1) 0x09, 0x01, // USAGE (Vendor Usage 1) 0xa1, 0x01, // COLLECTION (Application) 0x85, 0x02, // REPORT_ID (2) 0x09, 0x01, // USAGE (Vendor Usage 1) 0x15, 0x00, // LOGICAL_MINIMUM (0) 0x25, 0x01, // LOGICAL_MAXIMUM (1) 0x75, 0x01, // REPORT_SIZE (1) 0x95, 0x08, // REPORT_COUNT (8) 0xb1, 0x02, // FEATURE (Data,Var,Abs) 0xc0 // END_COLLECTION };
The report descriptor has been defined and tested with HID Descriptor Tool 2.4 from usb.org.
My system is the following:
- Windows 7 Professional SP1
- BT receiver: ASUS USB-BT400 with most recent driver installed
- SmartRF06 + CC2650EM-7ID with original HIDEmuKbdStack (loaded without modifications) and HIDEmuKbd on which I am working
- ble_cc26xx_2_00_00_42893
- CCS 6.1.0.00104
Windows correctly detects the keyboard and another HID device in Device Manager.
Then I checked the HID devices with HClient and both top level collections are listed as follow:
Now using hid.dll funcions I found device #13 and I opened the handle with CreateFile.
When I use HidD_SetFeature to send feature report with id = 2, it results in a fail with last error code ERROR_BUSY (0xAA).
Has anybody suggestions to solve this issue?
Thanks
Luca