From b8bc9c1b27d1edfb47ff04bb3fbdbbef66923ced Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 6 Nov 2013 10:31:31 +0200 Subject: [PATCH] android/hid: Fix get report buffer size variable name --- android/hal-hidhost.c | 2 +- android/hal-msg.h | 2 +- android/hid.c | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/android/hal-hidhost.c b/android/hal-hidhost.c index ef92fc5c6..f1a2223ec 100644 --- a/android/hal-hidhost.c +++ b/android/hal-hidhost.c @@ -261,7 +261,7 @@ static bt_status_t hh_get_report(bt_bdaddr_t *bd_addr, memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr)); cmd.id = report_id; - cmd.buf = buffer_size; + cmd.buf_size = buffer_size; switch (report_type) { case BTHH_INPUT_REPORT: diff --git a/android/hal-msg.h b/android/hal-msg.h index 41ba649ae..93fb7825b 100644 --- a/android/hal-msg.h +++ b/android/hal-msg.h @@ -285,7 +285,7 @@ struct hal_cmd_hid_get_report { uint8_t bdaddr[6]; uint8_t type; uint8_t id; - uint16_t buf; + uint16_t buf_size; } __attribute__((packed)); #define HAL_OP_HID_SET_REPORT 0x08 diff --git a/android/hid.c b/android/hid.c index 172a94592..224c8f720 100644 --- a/android/hid.c +++ b/android/hid.c @@ -850,20 +850,20 @@ static uint8_t bt_hid_get_report(struct hal_cmd_hid_get_report *cmd, return HAL_STATUS_FAILED; dev = l->data; - req_size = (cmd->buf > 0) ? 4 : 2; + req_size = (cmd->buf_size > 0) ? 4 : 2; req = g_try_malloc0(req_size); if (!req) return HAL_STATUS_NOMEM; req[0] = HID_MSG_GET_REPORT | cmd->type; - if (cmd->buf > 0) + if (cmd->buf_size > 0) req[0] = req[0] | HID_GET_REPORT_SIZE_FIELD; req[1] = cmd->id; - if (cmd->buf > 0) - bt_put_le16(cmd->buf, (req + 2)); + if (cmd->buf_size > 0) + bt_put_le16(cmd->buf_size, (req + 2)); fd = g_io_channel_unix_get_fd(dev->ctrl_io); -- 2.47.3