From: Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com>
To: <linux-bluetooth@vger.kernel.org>
Cc: Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com>
Subject: [PATCH 2/2] mgmt: Add wrapper for Set LE
Date: Tue, 28 Aug 2012 14:38:34 +0200 [thread overview]
Message-ID: <1346157514-22119-2-git-send-email-andrzej.kaczmarek@tieto.com> (raw)
In-Reply-To: <1346157514-22119-1-git-send-email-andrzej.kaczmarek@tieto.com>
Wrap mgmt_set_mode for Set LE into separate function to be consistent
with other calls and have debug printout.
---
src/mgmt.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/mgmt.c b/src/mgmt.c
index 6dc87e1..19e2972 100644
--- a/src/mgmt.c
+++ b/src/mgmt.c
@@ -251,6 +251,12 @@ static int mgmt_set_ssp(int index, gboolean ssp)
return mgmt_set_mode(index, MGMT_OP_SET_SSP, ssp);
}
+static int mgmt_set_low_energy(int index, gboolean le)
+{
+ DBG("index %d le %d", index, le);
+ return mgmt_set_mode(index, MGMT_OP_SET_LE, le);
+}
+
static inline int mgmt_powered(uint32_t settings)
{
return (settings & MGMT_SETTING_POWERED) != 0;
@@ -343,7 +349,7 @@ static void update_settings(struct btd_adapter *adapter, uint32_t settings)
if (mgmt_low_energy(info->supported_settings) &&
!mgmt_low_energy(settings))
- mgmt_set_mode(index, MGMT_OP_SET_LE, 1);
+ mgmt_set_low_energy(index, TRUE);
}
static int mgmt_update_powered(struct btd_adapter *adapter,
--
1.7.11.3
next prev parent reply other threads:[~2012-08-28 12:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-28 12:38 [PATCH 1/2] mgmt: Add wrapper for Set SSP Andrzej Kaczmarek
2012-08-28 12:38 ` Andrzej Kaczmarek [this message]
2012-09-05 10:00 ` 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=1346157514-22119-2-git-send-email-andrzej.kaczmarek@tieto.com \
--to=andrzej.kaczmarek@tieto.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