[PATCH 07/14] android: Add support for handling cancel bond command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 android/adapter.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

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;
-- 
1.8.4.rc3

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux