From 3be8272df51ed3df43945bef434acb9008af23e5 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Fri, 24 Jan 2014 19:53:42 +0100 Subject: [PATCH] android/bluetooth: Handle device unpaired mgmt event --- android/bluetooth.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/android/bluetooth.c b/android/bluetooth.c index ce69459d4..339fd7739 100644 --- a/android/bluetooth.c +++ b/android/bluetooth.c @@ -1294,7 +1294,19 @@ static void mgmt_auth_failed_event(uint16_t index, uint16_t length, static void mgmt_device_unpaired_event(uint16_t index, uint16_t length, const void *param, void *user_data) { + const struct mgmt_ev_device_unpaired *ev = param; + + if (length < sizeof(*ev)) { + error("Too small device unpaired event (%u bytes)", length); + return; + } + DBG(""); + + /* TODO should device be disconnected ? */ + + set_device_bond_state(&ev->addr.bdaddr, HAL_STATUS_SUCCESS, + HAL_BOND_STATE_NONE); } static void register_mgmt_handlers(void) -- 2.47.3