summaryrefslogtreecommitdiff
path: root/android/hal-hidhost.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2013-11-01 15:08:40 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2013-11-01 15:23:26 +0200
commita05dcf3e53e6fce56177f367e2cccb0e9e807635 (patch)
treedbae1703ef2f79c2434a82c016c03d129c078092 /android/hal-hidhost.c
parente01894ce6342028f2339b262ddfdb88a81ce1296 (diff)
downloadbluez-a05dcf3e53e6fce56177f367e2cccb0e9e807635.tar.gz
android/hal-hidhost: Add implemention of .hid_info_cb
Diffstat (limited to 'android/hal-hidhost.c')
-rw-r--r--android/hal-hidhost.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/android/hal-hidhost.c b/android/hal-hidhost.c
index e148dc2b2..c20c78567 100644
--- a/android/hal-hidhost.c
+++ b/android/hal-hidhost.c
@@ -40,6 +40,25 @@ static void handle_conn_state(void *buf)
ev->state);
}
+static void handle_info(void *buf)
+{
+ struct hal_ev_hid_info *ev = buf;
+ bthh_hid_info_t info;
+
+ info.attr_mask = ev->attr;
+ info.sub_class = ev->subclass;
+ info.app_id = ev->app_id;
+ info.vendor_id = ev->vendor;
+ info.product_id = ev->product;
+ info.version = ev->version;
+ info.ctry_code = ev->country;
+ info.dl_len = ev->descr_len;
+ memcpy(info.dsc_list, ev->descr, info.dl_len);
+
+ if (bt_hh_cbacks->hid_info_cb)
+ bt_hh_cbacks->hid_info_cb((bt_bdaddr_t *) ev->bdaddr, info);
+}
+
/* will be called from notification thread context */
void bt_notify_hh(uint16_t opcode, void *buf, uint16_t len)
{
@@ -50,6 +69,9 @@ void bt_notify_hh(uint16_t opcode, void *buf, uint16_t len)
case HAL_EV_HID_CONN_STATE:
handle_conn_state(buf);
break;
+ case HAL_EV_HID_INFO:
+ handle_info(buf);
+ break;
default:
DBG("Unhandled callback opcode=0x%x", opcode);
break;