Hello,
My device is a smart watch and I am trying to implement a HID over GATT profile to send multimedia keys (play, pause, next, previous, volume up, etc.). From the sdk examples I found the hogp that implements a mouse and keyboard but I have some problems event with that if I set the protocol mode to HIDS_PROTOCOL_MODE_REPORT. The handler of the characteristics that is written is not the proper one unless I set it in HIDS_PROTOCOL_MODE_BOOT. With that I can see that the android phone receives the new values with an app. (Should I see a mouse?)
Is there an example that sends media keys? How should I configure the hopg so that it sends multimedia events?
Thanks in advance,
Marius.
Keywords:
Device:
Hi cmarius,
I dont quite get the first question, what kind of problems you have ? If you set the HIDS_PROTOCOL_MODE_REPORT that means that the device will use the report map from the "Report Map" characteristic and if you set the HIDS_PROTOCOL_MODE_BOOT that means that the device will use as a mapping a fixed default report map (supported by a boot host role) and notify the peer device via the "Boot Mouse/Keyboard Input report". So if you have any issues with using the HIDS_PROTOCOL_MODE_REPORT i would say that the report map that you have placed in the "Report Map" characteristic is the first thing you should have a look. What kind of reports the host will use (either the custom report map or the boot is left on the host).
Regarding the second question, there is no example from Dialog on the 68x that will emulate multimedia buttons and functions, but in order to implement that you will have to provide the proper HID mapping in order for the peer device to be able to understand the button presses and map them to the corresponding functionallities. So what you will have to do is to check the HID specification and check how the appropriate report map is, that will support multimedia buttons. After creating the report map that supports the multimedia buttons then you should create a new characteristic that would be mapped to that specific report map (that depends on how you will implement the mapping), the example as is supports a standard keyboard and a standard mouse with a wheel.
Thanks MT_Dialog
Thanks for the reply. The problem with HIDS_PROTOCOL_MODE_REPORT was that the notifications were not enabled and thus I was not supposed to receive any data.
When I tried to enable the notifications on Report Characteristic I get disconnected and with error: Need BLUETOOTH PRIVILEGED permission from Android. It appears that now it is reserved only for google or system applications since it can be a security leak.
Hi cmarius,
Yes, if you are trying to do that via a generic BLE application you wont be able to do so, the bluetooth app checks for BLUETOOTH_PRIVILEGED permission when the operation refers to HID UUIDs and this permission is only available for privileged system apps and can't be granted to user apps.
Thanks MT_dialog