diff options
author | Szymon Janc <szymon.janc@tieto.com> | 2014-07-02 09:58:11 +0200 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2014-07-02 11:09:27 +0300 |
commit | 661e7ae5d5d602e6ad291ffed2701677c8935e68 (patch) | |
tree | 0621e1c7c7a8d6d3913e764c47cbe60a16668aad /android/hidhost.c | |
parent | f88613527fcccc0dbe4b3eef7361b6b5b339b855 (diff) | |
download | bluez-661e7ae5d5d602e6ad291ffed2701677c8935e68.tar.gz |
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.
Diffstat (limited to 'android/hidhost.c')
-rw-r--r-- | android/hidhost.c | 13 |
1 files changed, 12 insertions, 1 deletions
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: |