From 09a29322d3887e42416689af28d09ca9ef3b2fdc Mon Sep 17 00:00:00 2001 From: Arik Nemtsov Date: Mon, 2 Apr 2012 22:12:38 +0300 Subject: [PATCH] proximity: reporter: save global D-Bus connection This connection will be used by reporter GATT sub-profiles. --- proximity/reporter.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/proximity/reporter.c b/proximity/reporter.c index bbb97ea1d..c5a3bb8a6 100644 --- a/proximity/reporter.c +++ b/proximity/reporter.c @@ -52,6 +52,8 @@ enum { HIGH_ALERT = 0x02, }; +static DBusConnection *connection; + static void register_link_loss(struct btd_adapter *adapter) { uint16_t start_handle, h; @@ -179,6 +181,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 +195,5 @@ int reporter_init(struct btd_adapter *adapter) void reporter_exit(struct btd_adapter *adapter) { + dbus_connection_unref(connection); } -- 2.47.3