diff options
author | José Bollo <jose.bollo@iot.bzh> | 2016-05-03 17:05:36 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2016-05-04 11:55:38 +0200 |
commit | 3d705a894b13759904b0601f8cdef1f2c226d8cc (patch) | |
tree | 0db4d06afe4db4877c4268209ef5857e162cc2f4 /plugins/afm-main-plugin/afm-main-plugin.c | |
parent | 5dd6480727cc1ecb12483fc4d971d73176505748 (diff) |
Removing legacy dbus-1 library
Change-Id: I1c1d17cd702e12ed961ed90d1489bc12b074bd55
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'plugins/afm-main-plugin/afm-main-plugin.c')
-rw-r--r-- | plugins/afm-main-plugin/afm-main-plugin.c | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/plugins/afm-main-plugin/afm-main-plugin.c b/plugins/afm-main-plugin/afm-main-plugin.c index 21e27e82..c6408a51 100644 --- a/plugins/afm-main-plugin/afm-main-plugin.c +++ b/plugins/afm-main-plugin/afm-main-plugin.c @@ -23,7 +23,6 @@ #include "afb-plugin.h" -#include "utils-sbus.h" #include "utils-jbus.h" static const char _added_[] = "added"; @@ -331,39 +330,23 @@ static const struct AFB_plugin plug_desc = { .apis = plug_apis }; -static struct sbus_itf sbusitf; - const struct AFB_plugin *pluginRegister(const struct AFB_interface *itf) { int rc; - struct afb_pollmgr pollmgr; - struct sbus *sbus; + struct sd_bus *sbus; /* records the interface */ assert (interface == NULL); interface = itf; evmgr = afb_daemon_get_evmgr(itf->daemon); - /* creates the sbus for session */ - pollmgr = afb_daemon_get_pollmgr(itf->daemon); - sbusitf.wait = pollmgr.itf->wait; - sbusitf.open = pollmgr.itf->open; - sbusitf.on_readable = pollmgr.itf->on_readable; - sbusitf.on_writable = pollmgr.itf->on_writable; - sbusitf.on_hangup = pollmgr.itf->on_hangup; - sbusitf.close = pollmgr.itf->close; - sbus = sbus_session(&sbusitf, pollmgr.closure); - if (sbus == NULL) { - fprintf(stderr, "ERROR: %s:%d: can't connect to DBUS session\n", __FILE__, __LINE__); - return NULL; - } - /* creates the jbus for accessing afm-user-daemon */ + sbus = afb_daemon_get_user_bus(itf->daemon); + if (sbus == NULL) + return NULL; jbus = create_jbus(sbus, "/org/AGL/afm/user"); - if (jbus == NULL) { - sbus_unref(sbus); + if (jbus == NULL) return NULL; - } /* records the signal handler */ rc = jbus_on_signal_s(jbus, _changed_, application_list_changed, NULL); |