From: Szymon Janc <szymon.janc@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Bastien Nocera <hadess@hadess.net>, Szymon Janc <szymon.janc@gmail.com>
Subject: [PATCH 7/7] client: Add unblock command
Date: Wed, 8 Jan 2014 01:02:28 +0100 [thread overview]
Message-ID: <1389139348-3552-8-git-send-email-szymon.janc@gmail.com> (raw)
In-Reply-To: <1389139348-3552-1-git-send-email-szymon.janc@gmail.com>
---
client/main.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/client/main.c b/client/main.c
index 9f9231a..5791e95 100644
--- a/client/main.c
+++ b/client/main.c
@@ -909,6 +909,35 @@ static void cmd_block(const char *arg)
g_free(str);
}
+static void cmd_unblock(const char *arg)
+{
+ GDBusProxy *proxy;
+ dbus_bool_t blocked;
+ char *str;
+
+ if (!arg || !strlen(arg)) {
+ rl_printf("Missing device address argument\n");
+ return;
+ }
+
+ proxy = find_proxy_by_address(dev_list, arg);
+ if (!proxy) {
+ rl_printf("Device %s not available\n", arg);
+ return;
+ }
+
+ blocked = FALSE;
+
+ str = g_strdup_printf("%s unblock", arg);
+
+ if (g_dbus_proxy_set_property_basic(proxy, "Blocked",
+ DBUS_TYPE_BOOLEAN, &blocked,
+ generic_callback, str, g_free) == TRUE)
+ return;
+
+ g_free(str);
+}
+
static void remove_device_reply(DBusMessage *message, void *user_data)
{
DBusError error;
@@ -1150,6 +1179,8 @@ static const struct {
dev_generator },
{ "block", "<dev>", cmd_block, "Block device",
dev_generator },
+ { "unblock", "<dev>", cmd_unblock, "Unblock device",
+ dev_generator },
{ "remove", "<dev>", cmd_remove, "Remove device",
dev_generator },
{ "connect", "<dev>", cmd_connect, "Connect device",
--
1.8.5.2
next prev parent reply other threads:[~2014-01-08 0:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-08 0:02 [PATCH 0/7] sixaxis: Don't mark USB plugged device as trusted Szymon Janc
2014-01-08 0:02 ` [PATCH 1/7] " Szymon Janc
2014-01-08 0:02 ` [PATCH 2/7] input: Fix crash on authorization reply with first sixaxis connection Szymon Janc
2014-01-08 0:02 ` [PATCH 3/7] input: Fix check if device is sixaxis in auth_callback Szymon Janc
2014-01-08 0:02 ` [PATCH 4/7] input: Fix connecting new trusted sixaxis device Szymon Janc
2014-01-08 0:02 ` [PATCH 5/7] client: Add untrust command Szymon Janc
2014-01-08 0:02 ` [PATCH 6/7] client: Add block command Szymon Janc
2014-01-08 0:02 ` Szymon Janc [this message]
2014-01-09 15:57 ` [PATCH 0/7] sixaxis: Don't mark USB plugged device as trusted 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=1389139348-3552-8-git-send-email-szymon.janc@gmail.com \
--to=szymon.janc@gmail.com \
--cc=hadess@hadess.net \
--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