From: Szymon Janc <szymon.janc@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Szymon Janc <szymon.janc@tieto.com>
Subject: [PATCH 08/14] android: Add support for handling remove bond command
Date: Thu, 31 Oct 2013 02:55:48 +0000 [thread overview]
Message-ID: <1383188154-22905-9-git-send-email-szymon.janc@tieto.com> (raw)
In-Reply-To: <1383188154-22905-1-git-send-email-szymon.janc@tieto.com>
---
android/adapter.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/android/adapter.c b/android/adapter.c
index 0f174a6..0a91149 100644
--- a/android/adapter.c
+++ b/android/adapter.c
@@ -639,6 +639,26 @@ static bool cancel_bond(void *buf, uint16_t len)
NULL) > 0;
}
+static bool remove_bond(void *buf, uint16_t len)
+{
+ struct hal_cmd_remove_bond *cmd = buf;
+ struct mgmt_cp_unpair_device cp;
+
+ cp.disconnect = 1;
+ cp.addr.type = BDADDR_BREDR;
+ android2bdaddr(cmd->bdaddr, &cp.addr.bdaddr);
+
+ if (mgmt_send(adapter->mgmt, MGMT_OP_UNPAIR_DEVICE,
+ adapter->index, sizeof(cp), &cp,
+ NULL, NULL, NULL) == 0)
+ return false;
+
+ send_bond_state_change(&cp.addr.bdaddr, HAL_STATUS_SUCCESS,
+ HAL_BOND_STATE_NONE);
+
+ return true;
+}
+
void bt_adapter_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf,
uint16_t len)
{
@@ -686,6 +706,11 @@ void bt_adapter_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf,
goto error;
break;
+ case HAL_OP_REMOVE_BOND:
+ if (!remove_bond(buf, len))
+ goto error;
+
+ break;
default:
DBG("Unhandled command, opcode 0x%x", opcode);
goto error;
--
1.8.4.rc3
next prev parent reply other threads:[~2013-10-31 2:55 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-31 2:55 [PATCH 00/14] android: Initial support for pairing Szymon Janc
2013-10-31 2:55 ` [PATCH 01/14] android: Add missing bonding state definitions to IPC specification Szymon Janc
2013-10-31 2:55 ` [PATCH 02/14] android: Add missing bond state definition to IPC header Szymon Janc
2013-10-31 2:55 ` [PATCH 03/14] android: Add support for handling new link key mgmt event Szymon Janc
2013-10-31 2:55 ` [PATCH 04/14] android: Make load_link_keys function load keys Szymon Janc
2013-10-31 2:55 ` [PATCH 05/14] android: Set default IO capability on daemon start Szymon Janc
2013-10-31 2:55 ` [PATCH 06/14] android: Add support for handling create bond command Szymon Janc
2013-10-31 2:55 ` [PATCH 07/14] android: Add support for handling cancel " Szymon Janc
2013-10-31 8:50 ` Johan Hedberg
2013-10-31 2:55 ` Szymon Janc [this message]
2013-10-31 8:48 ` [PATCH 08/14] android: Add support for handling remove " Johan Hedberg
2013-10-31 2:55 ` [PATCH 09/14] android: Add support for sending pin code request Szymon Janc
2013-10-31 2:55 ` [PATCH 10/14] android: Add initial support for sending SSP request event Szymon Janc
2013-10-31 2:55 ` [PATCH 11/14] android: Add support for entry variant in " Szymon Janc
2013-10-31 2:55 ` [PATCH 12/14] android: Add support for notify " Szymon Janc
2013-10-31 2:55 ` [PATCH 13/14] android: Add support for handling pin reply command Szymon Janc
2013-10-31 2:55 ` [PATCH 14/14] android: Add support for handling SSP " Szymon Janc
2013-10-31 8:52 ` Johan Hedberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1383188154-22905-9-git-send-email-szymon.janc@tieto.com \
--to=szymon.janc@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=szymon.janc@tieto.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox