diff options
author | Szymon Janc <szymon.janc@gmail.com> | 2013-12-30 23:56:20 +0100 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2013-12-31 11:34:32 +0200 |
commit | 47e30d43c56818c272b09abc15436039918078b8 (patch) | |
tree | 853974084241fd91c9baf2f9e73a3ba5028dbf28 /android/hal-hidhost.c | |
parent | 33c2a480a8bdeaf077d77bdc43bc660015b3edbe (diff) | |
download | bluez-47e30d43c56818c272b09abc15436039918078b8.tar.gz |
android/hidhost: Move set_report parameter check to daemon
HAL library is to be as simple as possible and parameters values should
be verified by daemon for robustness anyway. Move this check to daemon.
Diffstat (limited to 'android/hal-hidhost.c')
-rw-r--r-- | android/hal-hidhost.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/android/hal-hidhost.c b/android/hal-hidhost.c index 371250ace..fd3ad2da3 100644 --- a/android/hal-hidhost.c +++ b/android/hal-hidhost.c @@ -294,19 +294,8 @@ static bt_status_t set_report(bt_bdaddr_t *bd_addr, cmd->len = strlen(report); memcpy(cmd->data, report, cmd->len); - switch (report_type) { - case BTHH_INPUT_REPORT: - cmd->type = HAL_HIDHOST_INPUT_REPORT; - break; - case BTHH_OUTPUT_REPORT: - cmd->type = HAL_HIDHOST_OUTPUT_REPORT; - break; - case BTHH_FEATURE_REPORT: - cmd->type = HAL_HIDHOST_FEATURE_REPORT; - break; - default: - return BT_STATUS_PARM_INVALID; - } + /* type match IPC type */ + cmd->type = report_type; return hal_ipc_cmd(HAL_SERVICE_ID_HIDHOST, HAL_OP_HIDHOST_SET_REPORT, sizeof(*cmd) + cmd->len, buf, 0, NULL, NULL); |