linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mikel Astiz <mikel.astiz.oss@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Mikel Astiz <mikel.astiz@bmw-carit.de>
Subject: [RFC BlueZ v0 4/5] Propagate disconnect reason to device
Date: Mon, 14 May 2012 17:33:03 +0200	[thread overview]
Message-ID: <1337009584-17181-5-git-send-email-mikel.astiz.oss@gmail.com> (raw)
In-Reply-To: <1337009584-17181-1-git-send-email-mikel.astiz.oss@gmail.com>

From: Mikel Astiz <mikel.astiz@bmw-carit.de>

Internally propagate disconnect reason in order to make it public in the
D-Bus API.
---
 src/adapter.c |    2 +-
 src/device.c  |    3 ++-
 src/device.h  |    3 ++-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/adapter.c b/src/adapter.c
index b9a90dd..4ed32a7 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -3001,7 +3001,7 @@ void adapter_remove_connection(struct btd_adapter *adapter,
 		return;
 	}
 
-	device_remove_connection(device, connection);
+	device_remove_connection(device, connection, reason);
 
 	adapter->connections = g_slist_remove(adapter->connections, device);
 
diff --git a/src/device.c b/src/device.c
index 82dc2ca..b2b9d54 100644
--- a/src/device.c
+++ b/src/device.c
@@ -915,7 +915,8 @@ void device_add_connection(struct btd_device *device, DBusConnection *conn)
 					DBUS_TYPE_BOOLEAN, &device->connected);
 }
 
-void device_remove_connection(struct btd_device *device, DBusConnection *conn)
+void device_remove_connection(struct btd_device *device, DBusConnection *conn,
+								uint8_t reason)
 {
 	if (!device->connected) {
 		char addr[18];
diff --git a/src/device.h b/src/device.h
index 51140c7..f77d3aa 100644
--- a/src/device.h
+++ b/src/device.h
@@ -91,7 +91,8 @@ gboolean device_is_authenticating(struct btd_device *device);
 gboolean device_is_authorizing(struct btd_device *device);
 void device_set_authorizing(struct btd_device *device, gboolean auth);
 void device_add_connection(struct btd_device *device, DBusConnection *conn);
-void device_remove_connection(struct btd_device *device, DBusConnection *conn);
+void device_remove_connection(struct btd_device *device, DBusConnection *conn,
+								uint8_t reason);
 void device_request_disconnect(struct btd_device *device, DBusMessage *msg);
 
 typedef void (*disconnect_watch) (struct btd_device *device, gboolean removal,
-- 
1.7.7.6


  parent reply	other threads:[~2012-05-14 15:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-14 15:32 [RFC BlueZ v0 0/5] ACL disconnect reason Mikel Astiz
2012-05-14 15:33 ` [RFC BlueZ v0 1/5] doc: Add D-Bus signal to provide " Mikel Astiz
2012-05-14 15:33 ` [RFC BlueZ v0 2/5] Use defines instead of magic numbers Mikel Astiz
2012-07-18 11:49   ` Mikel Astiz
2012-07-18 12:23     ` Johan Hedberg
2012-05-14 15:33 ` [RFC BlueZ v0 3/5] Propagate disconnect reason to adapter Mikel Astiz
2012-05-14 15:33 ` Mikel Astiz [this message]
2012-05-14 15:33 ` [RFC BlueZ v0 5/5] Send D-Bus signal to propagate disconnect reason Mikel Astiz
2012-05-14 17:00 ` [RFC BlueZ v0 0/5] ACL " Luiz Augusto von Dentz
2012-05-15  6:46   ` Mikel Astiz
2012-05-15  8:10     ` Luiz Augusto von Dentz
2012-05-15  8:45       ` Mikel Astiz
2012-05-15  9:58         ` Luiz Augusto von Dentz
2012-05-16  7:12           ` Mikel Astiz
2012-05-16 14:28             ` Mike
2012-05-17 13:41               ` Luiz Augusto von Dentz
2012-05-17 14:00                 ` Mike

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=1337009584-17181-5-git-send-email-mikel.astiz.oss@gmail.com \
    --to=mikel.astiz.oss@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=mikel.astiz@bmw-carit.de \
    /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).