From: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
To: linux-bluetooth@vger.kernel.org
Cc: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Subject: [RFC 1/5] android/client/health: Introduce close_channel API.
Date: Fri, 27 Jun 2014 00:30:42 +0300 [thread overview]
Message-ID: <1403818246-20205-2-git-send-email-ravikumar.veeramally@linux.intel.com> (raw)
In-Reply-To: <1403818246-20205-1-git-send-email-ravikumar.veeramally@linux.intel.com>
In order to run PTS MDL disconnect and reconnect, HAL api does
not support it. This close simply shutdown the fd, remote device
will be notified like data channel is closed not deleted. So ready
for reconnection.
---
android/client/if-hl.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/android/client/if-hl.c b/android/client/if-hl.c
index 34e8b27..949c574 100644
--- a/android/client/if-hl.c
+++ b/android/client/if-hl.c
@@ -275,6 +275,34 @@ static void destroy_channel_p(int argc, const char **argv)
EXEC(if_hl->destroy_channel, channel_id);
}
+/* close_channel */
+
+static void close_channel_p(int argc, const char **argv)
+{
+ uint32_t app_id;
+ uint8_t mdep_cfg_index;
+
+ RETURN_IF_NULL(if_hl);
+
+ if (argc <= 2) {
+ haltest_error("No app id is specified");
+ return;
+ }
+
+ if (argc <= 3) {
+ haltest_error("No mdep_cfg_index is specified");
+ return;
+ }
+
+ app_id = (uint32_t) atoi(argv[2]);
+ mdep_cfg_index = (uint8_t) atoi(argv[3]);
+
+ if (app_info[app_id][mdep_cfg_index][2] >= 0) {
+ shutdown(app_info[app_id][mdep_cfg_index][2], SHUT_RDWR);
+ app_info[app_id][mdep_cfg_index][2] = -1;
+ }
+}
+
/* cleanup */
static void cleanup_p(int argc, const char **argv)
@@ -295,6 +323,7 @@ static struct method methods[] = {
STD_METHODH(unregister_application, "<app_id>"),
STD_METHODH(connect_channel, "<app_id> <bd_addr> <mdep_cfg_index>"),
STD_METHODH(destroy_channel, "<channel_id>"),
+ STD_METHODH(close_channel, "<app_id> <mdep_cfg_index>"),
STD_METHOD(cleanup),
END_METHOD
};
--
1.9.1
next prev parent reply other threads:[~2014-06-26 21:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-26 21:30 [RFC 0/5] Implement MDL disconnect and reconnect Ravi kumar Veeramally
2014-06-26 21:30 ` Ravi kumar Veeramally [this message]
2014-06-26 21:30 ` [RFC 2/5] android/health: Implement mdl_closed_cb callback Ravi kumar Veeramally
2014-06-26 21:30 ` [RFC 3/5] android/health: Fix deleting channels queue Ravi kumar Veeramally
2014-06-26 21:30 ` [RFC 4/5] android/health: Implement mdl reconnect Ravi kumar Veeramally
2014-06-26 21:30 ` [RFC 5/5] android/health: Implement destroy_channel call Ravi kumar Veeramally
2014-06-27 14:13 ` Andrei Emeltchenko
2014-06-27 13:32 ` [RFC 0/5] Implement MDL disconnect and reconnect 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=1403818246-20205-2-git-send-email-ravikumar.veeramally@linux.intel.com \
--to=ravikumar.veeramally@linux.intel.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).