Re: HID device with multiple collections does not work

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Am 27.04.20 um 19:18 schrieb Luiz Augusto von Dentz:
Hi Erik,

On Thu, Apr 23, 2020 at 11:07 AM Erik Andresen <erik@xxxxxxxxxxx> wrote:

Hi,


I have a simple bluetooth hid device which does work in Android but not with Linux 4.19/Bluez 5. It does have two collections in its hid description:
0xA1, 0x01,        // Collection (Application)
0x85, 0x02,        //   Report ID (2)
(...)
0xC0,              // End Collection
0xA1, 0x01,        // Collection (Application)
0x85, 0x01,        //   Report ID (1)
(...)
0xC0,              // End Collection

Complete description is attached.

Since there are multiple collections I understand that every report has to be prefixed with the id, so I send
[2,0,0,0x52,0,0,0,0,0] (9 bytes) for the keycode 0x52, ID is 2.

Output from btmon is:
ACL Data RX: Handle 3585 flags 0x02 dlen 16                                                                                                                                                                                                            #2072 [hci0] 485.047387
        ATT: Handle Value Notification (0x1b) len 11
          Handle: 0x0015
            Data: 020000520000000000

This looks good for me so far, unfortunately Linux does not pick it up, in dmesg I get:
drivers/hid/hid-core.c: undefined report_id 0 received

cat /sys/kernel/debug/hid/0005:0000:0000.000­3/events # gives me:
report (size 10) (numbered) = 00 02 00 00 52 00 00 00 00 00
so I get 10 bytes instead the 9 I send

So far I traced it to hog-lib.c, report_value_cb() of bluez where this extra 0 is prepended in the if (hog->has_report_id) block.
report->id is 0 at this point. If I skip this extra addition of the zero or manually set id=2 here it works as expected. Does someone has an idea what I do wrong or what I'm missing?

Afaik each report ID will need to have its own characteristic, at
least that is how HIDS has put the spec, but if I got you right the
report->id is never initialized on report_reference_cb so this might
be how Android is detecting if there is a report ID or not, we should
be able to confiirm this if we have access to the HCI trace when
discovering the services.

thanks for taking a look. I have attached the saved btsnoop from btmon, it contains the full pairing process from scan to connecting. I hope this is what you wanted, if not please let me know. The device in question is the "EB:47:34:30:3F:3E".

greetings,
Erik Andresen

Attachment: banglejs4.btsnoop
Description: Binary data


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux