Hi. I am trying to send volume up and down hid commands to phone from KW36Z NXP board through BLE HID.
I am using Keyboard for report ID 1 and consumer for report ID 2.
For the first three seconds I am sending Volume Down command through report id 1(Keyboard usage page), and for the next three seconds I am sending Volume Up command through report id 2 (Consumer usage page).
However, for the first three seconds there is no volume decrease is seen on the phone, but for the next three seconds the volume gets increased.
If I try Keyboard and Consumer Hid separately it is working. But when I am using both as two reports, only consumer Hid is working.
Please anyone suggest any solution for this issue. Thanks in advance.
Hello Prakash, I hope you're doing well!
As I'm understanding you:
You're trying to connect a KW36 and a keyboard to another, central device at the same time as multiple connections, am I understanding you correctly?
Are you sure the device you're trying to connect to supports multiple connections?
Best regards,
Sebsatian
Hi Sebastian,
I am doing well,Hope you too.
Actually you have mistaken the context
As per my requirement,I need to send functions(for eg:volume up/down/mute) in Keyboard usage page and some in Consumer usage page(as given in the below table) in the same BLE HID code to control the phone. So, I tried to implement both the usage pages in one report map and It worked for functions implemented in consumer usage page, but unfortunately it doesn't work for functions implemented in keyboard usage page.
I used the HID codes given in the following link: http://www.freebsddiary.org/APC/usb_hid_usages.php. Please, provide some solution to make it work for combined keyboard and consumer usage pages.
Below is the report map that I used to implement BLE HID:
Report Map used to implement combined keyboard and consumer functions :
CHARACTERISTIC(char_report_map, 0x2A4B, (gGattCharPropRead_c)
VALUE(value_report_map, 0x2A4B, (gPermissionFlagReadable_c), 94, 0x05,0x01,0x09,0x06, 0xA1, 0x01, 0x85, 0x01, 0x05, 0x07,0x19, 0xE0,0x29, 0xE7,0x15, 0x00,0x25,0x01,0x75, 0x01,0x95, 0x08,0x81, 0x02,0x95, 0x01,0x75, 0x08,0x81, 0x01,0x95, 0x05,0x75, 0x01,0x05, 0x08,0x19,0x01,0x29, 0x05,0x91, 0x02,0x95, 0x01,0x75, 0x03,0x91, 0x01,0x95, 0x06,0x75, 0x08,0x15, 0x00,0x25, 0xA4,0x05, 0x07,0x19, 0x00,0x29, 0xA4,0x81, 0x00,0xC0, 0x05,0x0C,0x09,0x01,0xA1,0x01,0x85,0x02,0x05,0x0C,0x19,0x00,0x2A,0xFF,0x03,0x95,0x01,0x75,0x10,0x15,0x00,0x27,0xFF,0x03,0x00,0x00,0x81,0x00,0xC0)
But when I try this sequence as below:
-> i.e.First I will use report map of keyboard alone without report id as shown below and test hid keyboard,keyboard works fine.
Report Map used to implement only keyboard functions :
CHARACTERISTIC(char_report_map, 0x2A4B, (gGattCharPropRead_c) )
VALUE(value_report_map, 0x2A4B, (gPermissionFlagReadable_c), 63, 0x05,0x01,0x09,0x06, 0xA1, 0x01, 0x05, 0x07,0x19, 0xE0,0x29, 0xE7,0x15, 0x00,0x25,0x01,0x75, 0x01,0x95, 0x08,0x81, 0x02,0x95, 0x01,0x75, 0x08,0x81, 0x01,0x95, 0x05,0x75, 0x01,0x05, 0x08,0x19,0x01,0x29, 0x05,0x91, 0x02,0x95, 0x01,0x75, 0x03,0x91, 0x01,0x95, 0x06,0x75, 0x08,0x15, 0x00,0x25, 0xA4,0x05, 0x07,0x19, 0x00,0x29, 0xA4,0x81, 0x00,0xC0)
-> Then I tried using report map of consumer collection without report id as shown below and tested consumer collection alone,it works, but when I add these two as one report map to test both at a time with the sequence mentioned in my previous comment,consumer control only works but keyboard doesn't.
Report Map used to implement only consumer functions :
CHARACTERISTIC(char_report_map, 0x2A4B, (gGattCharPropRead_c) )
VALUE(value_report_map, 0x2A4B, (gPermissionFlagReadable_c), 26,0x05,0x0C,0x09,0x01,0xA1,0x01,0x05,0x0C,0x19,0x00,0x2A,0xFF,0x03,0x95,0x01,0x75,0x10,0x15,0x00,0x27,0xFF,0x03,0x00,0x00,0x81,0x00,0xC0)
One more thing, I am having a HCI snoop log collected from phone side, but I'm unsure of how to attach it here as there is no option to attach file,how to attach file?
Can u provide your support here ?
Many thanks in advance!
Hi Prakash,
Just a heads up, I'm doing some tests about your problem, but I will get back to you as soon as possible.
To attach an archive, you have to click on the "Advanced Editor" button when creating a reply, you'll see the option there.
Best regards,
Sebastian
Hi pvelayu1@visteon.com,
You need to define 2 CHARACTERISTICs, and the modified code is attached.
Hi Prakash,
With the provided information, I think that maybe the problem lies with the registration of your multiple reports. It seems like each device needs a separate Report I/O Characteristic.
The BLE HID Service document shows some diagrams explaining this:
This diagram here also shows the mapping from USB HID to the HID service used by BLE. Could you please take a look at the HID service document found here and compare with the implementation in the HID device example provided?
Also, it may be useful to you to compare with an HID USB example implementing an HID composite device, like the one included in the K64's SDK. That one might be a good reference for what you're trying to do.
The path is: <SDK_2.5.0_FRDM-K64F\boards\frdmk64f\usb_examples\usb_device_composite_cdc_msc>
Best regards,
Sebastian