linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arik Nemtsov <arik@wizery.com>
To: <linux-bluetooth@vger.kernel.org>
Cc: Arik Nemtsov <arik@wizery.com>
Subject: [PATCH v7 2/6] proximity: reporter: save global D-Bus connection
Date: Mon,  2 Apr 2012 14:17:20 +0300	[thread overview]
Message-ID: <1333365444-9029-2-git-send-email-arik@wizery.com> (raw)
In-Reply-To: <1333365444-9029-1-git-send-email-arik@wizery.com>

This connection will be used by reporter GATT sub-profiles.
---
 proximity/reporter.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/proximity/reporter.c b/proximity/reporter.c
index bbb97ea..87242d2 100644
--- a/proximity/reporter.c
+++ b/proximity/reporter.c
@@ -40,6 +40,7 @@
 #include "attrib-server.h"
 #include "reporter.h"
 
+static DBusConnection *connection;
 #define IMMEDIATE_ALERT_SVC_UUID	0x1802
 #define LINK_LOSS_SVC_UUID		0x1803
 #define TX_POWER_SVC_UUID		0x1804
@@ -179,6 +180,9 @@ int reporter_init(struct btd_adapter *adapter)
 		return -ENOTSUP;
 	}
 
+	connection = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
+	if (connection == NULL)
+		return -EIO;
 	DBG("Proximity Reporter for adapter %p", adapter);
 
 	register_link_loss(adapter);
@@ -190,4 +194,5 @@ int reporter_init(struct btd_adapter *adapter)
 
 void reporter_exit(struct btd_adapter *adapter)
 {
+	dbus_connection_unref(connection);
 }
-- 
1.7.5.4


  reply	other threads:[~2012-04-02 11:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-02 11:17 [PATCH v7 1/6] att: add remote btd_device to ATT read/write callbacks Arik Nemtsov
2012-04-02 11:17 ` Arik Nemtsov [this message]
2012-04-02 14:55   ` [PATCH v7 2/6] proximity: reporter: save global D-Bus connection Johan Hedberg
2012-04-02 18:37     ` Arik Nemtsov
2012-04-02 11:17 ` [PATCH v7 3/6] proximity: reporter: move definitions to .h and add util function Arik Nemtsov
2012-04-02 11:17 ` [PATCH v7 4/6] proximity: link loss: implement link loss server Arik Nemtsov
2012-04-02 11:17 ` [PATCH v7 5/6] proximity: immediate alert: implement immediate alert server Arik Nemtsov
2012-04-02 11:17 ` [PATCH v7 6/6] proximity: reporter: implement D-Bus API Arik Nemtsov
2012-04-02 14:54 ` [PATCH v7 1/6] att: add remote btd_device to ATT read/write callbacks Johan Hedberg
2012-04-02 18:35   ` Arik Nemtsov

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=1333365444-9029-2-git-send-email-arik@wizery.com \
    --to=arik@wizery.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;
as well as URLs for NNTP newsgroup(s).