From 981b04355e4219aefe4af1ff4464327d0ddc9fa7 Mon Sep 17 00:00:00 2001 From: Andrei Emeltchenko Date: Fri, 1 Nov 2013 15:41:41 +0200 Subject: [PATCH] android/hal: Handle acl_state_changed event --- android/hal-bluetooth.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/android/hal-bluetooth.c b/android/hal-bluetooth.c index a6228d7b4..d21603566 100644 --- a/android/hal-bluetooth.c +++ b/android/hal-bluetooth.c @@ -248,6 +248,18 @@ static void handle_device_state_changed(void *buf, uint16_t len) device_hal_props_cleanup(props, ev->num_props); } +static void handle_acl_state_changed(void *buf) +{ + struct hal_ev_acl_state_changed *ev = buf; + bt_bdaddr_t *addr = (bt_bdaddr_t *) ev->bdaddr; + + DBG("state %u", ev->state); + + if (bt_hal_cbacks->acl_state_changed_cb) + bt_hal_cbacks->acl_state_changed_cb(ev->status, addr, + ev->state); +} + /* will be called from notification thread context */ void bt_notify_adapter(uint16_t opcode, void *buf, uint16_t len) { @@ -279,6 +291,9 @@ void bt_notify_adapter(uint16_t opcode, void *buf, uint16_t len) case HAL_EV_SSP_REQUEST: handle_ssp_request(buf); break; + case HAL_EV_ACL_STATE_CHANGED: + handle_acl_state_changed(buf); + break; default: DBG("Unhandled callback opcode=0x%x", opcode); break; -- 2.47.3