From 661e7ae5d5d602e6ad291ffed2701677c8935e68 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Wed, 2 Jul 2014 09:58:11 +0200 Subject: [PATCH] android/hidhost: Use bt_hog_send_report in bt_hid_set_report If bt_hid_set_report is called for a HoG device send data using bt_hog_send_report. --- android/hidhost.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/android/hidhost.c b/android/hidhost.c index 0c0d69d0a..4b718c6d8 100644 --- a/android/hidhost.c +++ b/android/hidhost.c @@ -1228,7 +1228,7 @@ static void bt_hid_set_report(const void *buf, uint16_t len) dev = l->data; - if (!(dev->ctrl_io)) { + if (!dev->ctrl_io && !dev->hog) { status = HAL_STATUS_FAILED; goto failed; } @@ -1250,6 +1250,16 @@ static void bt_hid_set_report(const void *buf, uint16_t len) goto failed; } + if (dev->hog) { + if (bt_hog_send_report(dev->hog, req + 1, req_size - 1, + cmd->type) < 0) { + status = HAL_STATUS_FAILED; + goto failed; + } + + goto done; + } + fd = g_io_channel_unix_get_fd(dev->ctrl_io); if (write(fd, req, req_size) < 0) { @@ -1261,6 +1271,7 @@ static void bt_hid_set_report(const void *buf, uint16_t len) dev->last_hid_msg = HID_MSG_SET_REPORT; +done: status = HAL_STATUS_SUCCESS; failed: -- 2.47.3