linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Szymon Janc <szymon.janc@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Szymon Janc <szymon.janc@gmail.com>
Subject: [PATCH 5/5] android/gatt: Implement disconnect test command
Date: Mon, 26 May 2014 23:53:28 +0200	[thread overview]
Message-ID: <1401141208-26912-6-git-send-email-szymon.janc@gmail.com> (raw)
In-Reply-To: <1401141208-26912-1-git-send-email-szymon.janc@gmail.com>

---
 android/gatt.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/android/gatt.c b/android/gatt.c
index 6eb4440..af3af08 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -3445,6 +3445,7 @@ failed:
 static void handle_client_test_command(const void *buf, uint16_t len)
 {
 	const struct hal_cmd_gatt_client_test_command *cmd = buf;
+	struct gatt_app *app;
 	bdaddr_t bdaddr;
 	bt_uuid_t uuid;
 	uint8_t status;
@@ -3475,6 +3476,13 @@ static void handle_client_test_command(const void *buf, uint16_t len)
 		status = handle_connect(test_client_if, &bdaddr);
 		break;
 	case GATT_CLIENT_TEST_CMD_DISCONNECT:
+		app = queue_find(gatt_apps, match_app_by_id,
+						INT_TO_PTR(test_client_if));
+		if (app)
+			app_disconnect_devices(app);
+
+		status = HAL_STATUS_SUCCESS;
+		break;
 	case GATT_CLIENT_TEST_CMD_DISCOVER:
 	case GATT_CLIENT_TEST_CMD_PAIRING_CONFIG:
 	default:
-- 
2.0.0.rc4


  parent reply	other threads:[~2014-05-26 21:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-26 21:53 [PATCH 0/5] android: GATT client test interface Szymon Janc
2014-05-26 21:53 ` [PATCH 1/5] android/gatt: Add initial implementation of client test command Szymon Janc
2014-05-26 21:53 ` [PATCH 2/5] android/gatt: Factor out unregistering client into helper function Szymon Janc
2014-05-26 21:53 ` [PATCH 3/5] android/gatt: Implement enable test command Szymon Janc
2014-05-26 21:53 ` [PATCH 4/5] android/gatt: Implement connect " Szymon Janc
2014-05-26 21:53 ` Szymon Janc [this message]
2014-05-28 12:45 ` [PATCH 0/5] android: GATT client test interface Szymon Janc

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=1401141208-26912-6-git-send-email-szymon.janc@gmail.com \
    --to=szymon.janc@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).