@@ -941,28 +941,15 @@ static int ioctl_disconnect(struct input_device *idev, uint32_t flags)
static int uhid_connadd(struct input_device *idev, struct hidp_connadd_req *req)
{
int err;
- struct uhid_event ev;
if (idev->uhid_created)
return 0;
- /* create uHID device */
- memset(&ev, 0, sizeof(ev));
- ev.type = UHID_CREATE;
- strncpy((char *) ev.u.create.name, req->name, sizeof(ev.u.create.name));
- ba2strlc(&idev->src, (char *) ev.u.create.phys);
- ba2strlc(&idev->dst, (char *) ev.u.create.uniq);
- ev.u.create.vendor = req->vendor;
- ev.u.create.product = req->product;
- ev.u.create.version = req->version;
- ev.u.create.country = req->country;
- ev.u.create.bus = BUS_BLUETOOTH;
- ev.u.create.rd_data = req->rd_data;
- ev.u.create.rd_size = req->rd_size;
-
- err = bt_uhid_send(idev->uhid, &ev);
+ err = bt_uhid_create(idev->uhid, req->name, &idev->src, &idev->dst,
+ req->vendor, req->product, req->version,
+ req->country, req->rd_data, req->rd_size);
if (err < 0) {
- error("bt_uhid_send: %s", strerror(-err));
+ error("bt_uhid_create: %s", strerror(-err));
return err;
}
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> This makes use of bt_uhid_create instead of directly submitting UHID_CREATE since it can track UHID_START by itself. Fixes: https://github.com/bluez/bluez/issues/771 --- profiles/input/device.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-)