From c7d4ffd327d9530d9f216b09f9fd9d25e8ee81e5 Mon Sep 17 00:00:00 2001 From: Ravi kumar Veeramally Date: Fri, 8 Nov 2013 00:10:18 +0200 Subject: [PATCH] android/hid: Handle virtual unplug notification in HID HAL --- android/hal-hidhost.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/android/hal-hidhost.c b/android/hal-hidhost.c index 3c147e8ea..34f9f7760 100644 --- a/android/hal-hidhost.c +++ b/android/hal-hidhost.c @@ -77,6 +77,15 @@ static void handle_get_report(void *buf) ev->data, ev->len); } +static void handle_virtual_unplug(void *buf) +{ + struct hal_ev_hidhost_virtual_unplug *ev = buf; + + if (cbacks->virtual_unplug_cb) + cbacks->virtual_unplug_cb((bt_bdaddr_t *) ev->bdaddr, + ev->status); +} + /* will be called from notification thread context */ void bt_notify_hidhost(uint16_t opcode, void *buf, uint16_t len) { @@ -96,6 +105,9 @@ void bt_notify_hidhost(uint16_t opcode, void *buf, uint16_t len) case HAL_EV_HIDHOST_GET_REPORT: handle_get_report(buf); break; + case HAL_EV_HIDHOST_VIRTUAL_UNPLUG: + handle_virtual_unplug(buf); + break; default: DBG("Unhandled callback opcode=0x%x", opcode); break; -- 2.47.3