diff options
author | Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com> | 2013-11-08 15:23:03 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2013-11-08 15:23:31 +0200 |
commit | 20a830495f8023b8c106b92e6eef9f7546ce4a9e (patch) | |
tree | 36b97da0ba81b1abca167a93468eb568e0febe98 /android/hal-hidhost.c | |
parent | fcd2812197783c3524ff9a0544ac93894b9c443f (diff) | |
download | bluez-20a830495f8023b8c106b92e6eef9f7546ce4a9e.tar.gz |
android/hid: Fill send data command struct in hal-hidhost
Diffstat (limited to 'android/hal-hidhost.c')
-rw-r--r-- | android/hal-hidhost.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/android/hal-hidhost.c b/android/hal-hidhost.c index 94f7e016d..e8570bc9b 100644 --- a/android/hal-hidhost.c +++ b/android/hal-hidhost.c @@ -18,6 +18,7 @@ #include <stdbool.h> #include <stddef.h> #include <string.h> +#include <stdlib.h> #include "hal-log.h" #include "hal.h" @@ -298,7 +299,8 @@ static bt_status_t set_report(bt_bdaddr_t *bd_addr, bthh_report_type_t report_type, char *report) { - struct hal_cmd_hidhost_set_report cmd; + uint8_t buf[BLUEZ_HAL_MTU]; + struct hal_cmd_hidhost_set_report *cmd = (void *) buf; DBG(""); @@ -308,26 +310,26 @@ static bt_status_t set_report(bt_bdaddr_t *bd_addr, if (!bd_addr || !report) return BT_STATUS_PARM_INVALID; - memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr)); - cmd.len = strlen(report); - memcpy(cmd.data, report, cmd.len); + memcpy(cmd->bdaddr, bd_addr, sizeof(cmd->bdaddr)); + cmd->len = strlen(report); + memcpy(cmd->data, report, cmd->len); switch (report_type) { case BTHH_INPUT_REPORT: - cmd.type = HAL_HIDHOST_INPUT_REPORT; + cmd->type = HAL_HIDHOST_INPUT_REPORT; break; case BTHH_OUTPUT_REPORT: - cmd.type = HAL_HIDHOST_OUTPUT_REPORT; + cmd->type = HAL_HIDHOST_OUTPUT_REPORT; break; case BTHH_FEATURE_REPORT: - cmd.type = HAL_HIDHOST_FEATURE_REPORT; + cmd->type = HAL_HIDHOST_FEATURE_REPORT; break; default: return BT_STATUS_PARM_INVALID; } return hal_ipc_cmd(HAL_SERVICE_ID_HIDHOST, HAL_OP_HIDHOST_SET_REPORT, - sizeof(cmd), &cmd, 0, NULL, NULL); + sizeof(*cmd) + cmd->len, buf, 0, NULL, NULL); } static bt_status_t send_data(bt_bdaddr_t *bd_addr, char *data) |