Diff between 9ec2351f61b275517a936f9f54f3782c0d87df43 and a56bec6642fe3cd46977c4d90fe4fe250571e495

Changed Files

File Additions Deletions Status
android/adapter.c +18 -0 modified

Full Patch

diff --git a/android/adapter.c b/android/adapter.c
index 8c5482b..0f174a6 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;