From: Szymon Janc Date: Thu, 31 Oct 2013 02:55:47 +0000 (+0000) Subject: android: Add support for handling cancel bond command X-Git-Tag: android-x86-4.4-r3~7087 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=a56bec6642fe3cd46977c4d90fe4fe250571e495;p=android-x86%2Fexternal-bluetooth-bluez.git android: Add support for handling cancel bond command --- diff --git a/android/adapter.c b/android/adapter.c index 8c5482b97..0f174a65b 100644 --- a/android/adapter.c +++ b/android/adapter.c @@ -626,6 +626,19 @@ static bool create_bond(void *buf, uint16_t len) return true; } +static bool cancel_bond(void *buf, uint16_t len) +{ + struct hal_cmd_cancel_bond *cmd = buf; + struct mgmt_addr_info cp; + + cp.type = BDADDR_BREDR; + android2bdaddr(cmd->bdaddr, &cp.bdaddr); + + return mgmt_reply(adapter->mgmt, MGMT_OP_CANCEL_PAIR_DEVICE, + adapter->index, sizeof(cp), &cp, NULL, NULL, + NULL) > 0; +} + void bt_adapter_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf, uint16_t len) { @@ -668,6 +681,11 @@ void bt_adapter_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf, goto error; break; + case HAL_OP_CANCEL_BOND: + if (!cancel_bond(buf, len)) + goto error; + + break; default: DBG("Unhandled command, opcode 0x%x", opcode); goto error;