Linux bluetooth development
 help / color / mirror / Atom feed
From: Sheldon Demario <sheldon.demario@openbossa.org>
To: linux-bluetooth@vger.kernel.org
Cc: Sheldon Demario <sheldon.demario@openbossa.org>
Subject: [PATCH 5/7] Add transport option to interactive gatttool
Date: Fri, 21 Jan 2011 10:46:24 -0300	[thread overview]
Message-ID: <1295617586-3398-5-git-send-email-sheldon.demario@openbossa.org> (raw)
In-Reply-To: <1295617586-3398-1-git-send-email-sheldon.demario@openbossa.org>

---
 attrib/igatttool.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/attrib/igatttool.c b/attrib/igatttool.c
index 29290ed..e0d8b44 100644
--- a/attrib/igatttool.c
+++ b/attrib/igatttool.c
@@ -137,6 +137,23 @@ static void cmd_exit(char **cmd)
 	g_main_loop_quit(main_loop);
 }
 
+static void cmd_transport(char **cmd)
+{
+	if (cmd[1] == NULL)
+		return;
+
+	if (conn_state != STATE_DISCONNECTED)
+		return;
+
+	if (strcasecmp(cmd[1], "le") == 0)
+		opt_le = TRUE;
+	else if (strcasecmp(cmd[1], "br") == 0)
+		opt_le = FALSE;
+
+	rl_set_prompt(get_prompt());
+	rl_redisplay();
+}
+
 static void cmd_psm(char **opt)
 {
 	if (opt[1] == NULL)
@@ -158,6 +175,7 @@ static struct {
 	{ "connect",	cmd_connect,	"<bdaddr>",	"Connect"},
 	{ "disconnect",	cmd_disconnect,	NULL,		"Disconnect"},
 	{ "exit",	cmd_exit,	NULL,		"Exit"},
+	{ "transport",	cmd_transport,	"<LE | BR>",	"Set transport"},
 	{ "psm",	cmd_psm,	"<psm>",	"Set psm"},
 	{ NULL, NULL, NULL, NULL}
 };
-- 
1.7.1


  parent reply	other threads:[~2011-01-21 13:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-21 13:46 [PATCH 1/7] Create a file to hold the generic code from gatttool Sheldon Demario
2011-01-21 13:46 ` [PATCH 2/7] Move do_connect from gatttool to gtcommon Sheldon Demario
2011-01-21 13:46 ` [PATCH 3/7] Initial version of igatttool - a interactive gatttool Sheldon Demario
2011-01-21 13:46 ` [PATCH 4/7] Add psm option to " Sheldon Demario
2011-01-21 13:46 ` Sheldon Demario [this message]
2011-01-21 17:50   ` [PATCH 5/7] Add transport " Anderson Lizardo
2011-01-21 13:46 ` [PATCH 6/7] Add autoconf macro for " Sheldon Demario
2011-01-21 13:46 ` [PATCH 7/7] Initial primary service discovery in igatttool Sheldon Demario

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=1295617586-3398-5-git-send-email-sheldon.demario@openbossa.org \
    --to=sheldon.demario@openbossa.org \
    --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