NXP BLE HID: Keyboard HID is not working when used with consumer HID functions

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

NXP BLE HID: Keyboard HID is not working when used with consumer HID functions

2,423 Views
pvelayu1
Contributor II

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.

0 Kudos
Reply
8 Replies

2,056 Views
Sebastian_Del_Rio
NXP Employee
NXP Employee

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

0 Kudos
Reply

2,056 Views
pvelayu1
Contributor II

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.

pastedImage_7.png

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!

0 Kudos
Reply

2,056 Views
Sebastian_Del_Rio
NXP Employee
NXP Employee

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.

 pastedImage_2.png

 

Best regards,

Sebastian

0 Kudos
Reply

2,055 Views
pvelayu1
Contributor II

The files in which I have implemented for the keyboard-consumer hid, have been attached for your reference to make sure that you have a quick flow with what I need.

0 Kudos
Reply

2,056 Views
xing_chang
NXP Employee
NXP Employee

Hi pvelayu1@visteon.com‌,

You need to define 2 CHARACTERISTICs, and the modified code is attached.

2,055 Views
pvelayu1
Contributor II

Hi Chang,

I have done the changes you have suggested and it is working fine now.

Thank you so much for your support.XingChang nxf53124

Regards,

Prakash V

0 Kudos
Reply

2,056 Views
Sebastian_Del_Rio
NXP Employee
NXP Employee

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:

pastedImage_1.png

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

0 Kudos
Reply

2,056 Views
pvelayu1
Contributor II

Hi Sebastian.  I have attached the snoop log for the issue with keyboard usage page when tried with keyboard and consumer combined report map.  Please look into it.

0 Kudos
Reply