New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 880746 link

Starred by 1 user

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Newblue: uhid interface for HID devices

Project Member Reported by josephsih@chromium.org, Sep 5

Issue description

Create the bridge between btleHid and the kernel.
 
When I tried to pair and connect to BLE keyboards, there are some issues. For example, in Logitech K780, report IDs my be duplicated between input report and output report. We need to fix or work around the issues caused by peripheral devices.
Cc: shijinabraham@chromium.org
Project Member

Comment 3 by bugdroid1@chromium.org, Dec 15

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/newblue/+/7d530f771880cd0b6ff8132cd243a6b771dd6fc9

commit 7d530f771880cd0b6ff8132cd243a6b771dd6fc9
Author: Joseph Hwang <josephsih@chromium.org>
Date: Sat Dec 15 10:18:43 2018

uhid: implement the uhid interface to kernel

This uhid program provides the callback functions to create and destroy
a uhid device, and the function to send input reports to uhid in kernel.

Notes:
1. This program only works for a remote mouse for now.
2. Every connection to a remote mouse should have its own device data.
   Assume there is only one connection for now. Should extend the
   program to support multiple connections.

BUG=chromium:880746
TEST=None. Will be tested with the patch -- uhid: test BLE mouse

Then scp uhid_test to a Minnie. Run uhid_test on Minnie and watch that
the cursor moves around.

Change-Id: I396b6cb3f51598588b1f2d30d19f6a4d0152c4f6
Reviewed-on: https://chromium-review.googlesource.com/1188179
Commit-Ready: Shyh-In Hwang <josephsih@chromium.org>
Tested-by: Sonny Sasaka <sonnysasaka@chromium.org>
Tested-by: Shyh-In Hwang <josephsih@chromium.org>
Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>

[add] https://crrev.com/7d530f771880cd0b6ff8132cd243a6b771dd6fc9/uhid.h
[modify] https://crrev.com/7d530f771880cd0b6ff8132cd243a6b771dd6fc9/Android.mk
[modify] https://crrev.com/7d530f771880cd0b6ff8132cd243a6b771dd6fc9/Makefile
[modify] https://crrev.com/7d530f771880cd0b6ff8132cd243a6b771dd6fc9/test.c
[add] https://crrev.com/7d530f771880cd0b6ff8132cd243a6b771dd6fc9/uhid.c

Project Member

Comment 4 by bugdroid1@chromium.org, Dec 15

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/newblue/+/6e0c7e00005b3b18015e146ffbed18d36df199b2

commit 6e0c7e00005b3b18015e146ffbed18d36df199b2
Author: Joseph Hwang <josephsih@chromium.org>
Date: Sat Dec 15 10:18:43 2018

btleHid: conditionally allow duplicate report IDs

Some keyboards, e.g., Logitech K780, use the same report ID
in both input report type and output report type.
Let's be tolerant and relax a little bit on checking the
report ID. Hence, we enforce the report ID uniqueness of the
same report type instead of in the same peripheral device.

An example log snippet of Logitech K780 shows that the report
IDs reused among the report characteristics of both input report
type (0x01) and output report type (0x02):

D@ btleHid.c:836: HID: prereq read do - deciding how to proceed
D@ btleHid.c:639: id 30, first handle 0x003a, last handle 0x0000
D@ btleHid.c:652: handle 0x003b, report ID 0x11, report type 0x02
D@ btleHid.c:652: handle 0x0037, report ID 0x11, report type 0x01
W@ btleHid.c:657: HID report with handle 0x0037 has a report ID of 0x11,
but so does the one at 0x003b
D@ btleHid.c:652: handle 0x0033, report ID 0x04, report type 0x01
D@ btleHid.c:652: handle 0x002f, report ID 0x03, report type 0x01
D@ btleHid.c:652: handle 0x002c, report ID 0x01, report type 0x02
D@ btleHid.c:652: handle 0x0028, report ID 0x01, report type 0x01
W@ btleHid.c:657: HID report with handle 0x0028 has a report ID of 0x01,
but so does the one at 0x002c

BUG=chromium:880746
TEST=None. Will be tested together with another CL.

Change-Id: I9d4417752743c1dee4f7d5ae5d0aeb7206446650
Reviewed-on: https://chromium-review.googlesource.com/1229537
Commit-Ready: Shyh-In Hwang <josephsih@chromium.org>
Tested-by: Sonny Sasaka <sonnysasaka@chromium.org>
Tested-by: Shyh-In Hwang <josephsih@chromium.org>
Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>
Reviewed-by: Dmitry Grinberg <dmitrygr@google.com>

[modify] https://crrev.com/6e0c7e00005b3b18015e146ffbed18d36df199b2/btleHid.c

Project Member

Comment 5 by bugdroid1@chromium.org, Dec 15

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/newblue/+/b7e5bd6dd93e788484a6f230e750034e462a94d4

commit b7e5bd6dd93e788484a6f230e750034e462a94d4
Author: Joseph Hwang <josephsih@chromium.org>
Date: Sat Dec 15 10:18:44 2018

test.c: pair and connect to a BLE mouse or keyboard

When pairing, the test program checks if the target device is
a HID device. If yes, it pairs and connects to the device.

Note that some keyboards may not work correctly yet as they
suffer from some other issues.

This CL is mostly motivated by Sonny's and Dmitry's test code.

BUG=chromium:880746
TEST=Follow the steps below:
On your host:
- Build and deploy newblue ot the DUT.

On the DUT:
  $ restart bluetoothd

  # To pair and connect to a Microsoft "Designer Mouse",
  # long press the button on the bottom of the mouse until
  # the LED flashes.
  $ ./new_blue_test hidtest "Designer Mouse"

  # To pair and connect to a Logitech "Keyboard K780",
  # long press F1, F2, or F3 button on K780 until the white
  # LED on that button blinks quickly.
  $ ./new_blue_test hidtest "Keyboard K780"
  # On success, it would prompt you to enter 6-digit passkey as follows:
  # I@ test.c:494: ######## Please enter 003196 with the keyboard with
  # R-C7:B8:7B:47:7D:97
  # On the keyboard, type 003196 and press ENTER.

Change-Id: Ib0a7156fb7a8cf023fd7104c6c60e50699876e47
Reviewed-on: https://chromium-review.googlesource.com/1229538
Commit-Ready: Shyh-In Hwang <josephsih@chromium.org>
Tested-by: Sonny Sasaka <sonnysasaka@chromium.org>
Tested-by: Shyh-In Hwang <josephsih@chromium.org>
Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>

[modify] https://crrev.com/b7e5bd6dd93e788484a6f230e750034e462a94d4/test.c

Sign in to add a comment