From: Gustavo Padovan <gustavo@padovan.org>
To: linux-bluetooth@vger.kernel.org
Cc: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Subject: [PATCH 8/9] adapter: forbid properties to be set during Pairing Session
Date: Tue, 11 Jun 2013 11:56:26 +0100 [thread overview]
Message-ID: <1370948187-3702-8-git-send-email-gustavo@padovan.org> (raw)
In-Reply-To: <1370948187-3702-1-git-send-email-gustavo@padovan.org>
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
If one or more pairing session is ongoing the following properties can't
be set: Pairable, PairableTimeout, Discoverable and DiscoverableTimeout.
---
src/adapter.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/src/adapter.c b/src/adapter.c
index 9e11f02..8bb9788 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -2108,6 +2108,13 @@ static void property_set_discoverable(const GDBusPropertyTable *property,
{
struct btd_adapter *adapter = user_data;
+ if (adapter->pairing) {
+ g_dbus_pending_property_error(id,
+ ERROR_INTERFACE ".PermissionDenied",
+ "Pairing session ongoing");
+ return;
+ }
+
property_set_mode(adapter, MGMT_SETTING_DISCOVERABLE, iter, id);
}
@@ -2131,6 +2138,13 @@ static void property_set_discoverable_timeout(
struct btd_adapter *adapter = user_data;
dbus_uint32_t value;
+ if (adapter->pairing) {
+ g_dbus_pending_property_error(id,
+ ERROR_INTERFACE ".PermissionDenied",
+ "Pairing session ongoing");
+ return;
+ }
+
dbus_message_iter_get_basic(iter, &value);
adapter->discoverable_timeout = value;
@@ -2160,6 +2174,13 @@ static void property_set_pairable(const GDBusPropertyTable *property,
{
struct btd_adapter *adapter = user_data;
+ if (adapter->pairing) {
+ g_dbus_pending_property_error(id,
+ ERROR_INTERFACE ".PermissionDenied",
+ "Pairing session ongoing");
+ return;
+ }
+
property_set_mode(adapter, MGMT_SETTING_PAIRABLE, iter, id);
}
@@ -2182,6 +2203,13 @@ static void property_set_pairable_timeout(const GDBusPropertyTable *property,
struct btd_adapter *adapter = user_data;
dbus_uint32_t value;
+ if (adapter->pairing) {
+ g_dbus_pending_property_error(id,
+ ERROR_INTERFACE ".PermissionDenied",
+ "Pairing session ongoing");
+ return;
+ }
+
dbus_message_iter_get_basic(iter, &value);
adapter->pairable_timeout = value;
--
1.8.1.4
next prev parent reply other threads:[~2013-06-11 10:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-11 10:56 [PATCH 1/9] adapter: fix setting of discoverable timeout Gustavo Padovan
2013-06-11 10:56 ` [PATCH 2/9] adapter: remove unused toggle_discoverable Gustavo Padovan
2013-06-11 10:56 ` [PATCH 3/9] adapter: rename discovery_client to watch_client Gustavo Padovan
2013-06-11 10:56 ` [PATCH 4/9] adapter: rename compare_discovery_sender Gustavo Padovan
2013-06-11 10:56 ` [PATCH 5/9] doc: add EnablePairing() and DisablePairing() Gustavo Padovan
2013-06-16 11:42 ` Marcel Holtmann
2013-06-11 10:56 ` [PATCH 6/9] adapter: " Gustavo Padovan
2013-06-11 10:56 ` [PATCH 7/9] adapter: add Pairing property to report ongoing Pairing Session Gustavo Padovan
2013-06-11 10:56 ` Gustavo Padovan [this message]
2013-06-11 10:56 ` [PATCH 9/9] test: add pairing command to test-adapter Gustavo Padovan
2013-06-17 8:49 ` [PATCH 1/9] adapter: fix setting of discoverable timeout 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=1370948187-3702-8-git-send-email-gustavo@padovan.org \
--to=gustavo@padovan.org \
--cc=gustavo.padovan@collabora.co.uk \
--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).