summaryrefslogtreecommitdiffstats
path: root/telephony-binding/gdbus/ofono_manager.c
diff options
context:
space:
mode:
authorMatt Porter <mporter@konsulko.com>2017-08-08 09:05:14 -0400
committerMatt Porter <mporter@konsulko.com>2017-08-08 09:29:57 -0400
commite598975c8374effa043eb83dcae1c08749f3ea91 (patch)
tree0312c5c04060a1baabf51b9a976ca67234a50e95 /telephony-binding/gdbus/ofono_manager.c
parent597ed5434f369ab614fa2ce543aab3f49101b5f1 (diff)
telephony-binding: convert to v2 binding
Convert the telephony-binding to the v2 binding format. Also move to AFB_ message macros and remove propagation of the interface struct. Bug-AGL: SPEC-814 Change-Id: Ic9ce86f59af01ce00cece4e29cd5fe36afa7d74c Signed-off-by: Matt Porter <mporter@konsulko.com>
Diffstat (limited to 'telephony-binding/gdbus/ofono_manager.c')
-rw-r--r--telephony-binding/gdbus/ofono_manager.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/telephony-binding/gdbus/ofono_manager.c b/telephony-binding/gdbus/ofono_manager.c
index bb99a43..49a2452 100644
--- a/telephony-binding/gdbus/ofono_manager.c
+++ b/telephony-binding/gdbus/ofono_manager.c
@@ -18,6 +18,7 @@
#include <string.h>
+#define AFB_BINDING_VERSION 2
#include <afb/afb-binding.h>
#include "ofono_manager.h"
@@ -34,9 +35,8 @@ struct ofono_manager_modem
static OrgOfonoManager *manager;
static struct ofono_manager_modem default_modem;
-static const struct afb_binding_interface *interface;
-int ofono_manager_init(const struct afb_binding_interface *iface)
+int ofono_manager_init()
{
GVariant *out_arg = NULL, *next, *value;
GError *error = NULL;
@@ -44,10 +44,8 @@ int ofono_manager_init(const struct afb_binding_interface *iface)
GVariantIter *iter, *iter2 = NULL;
int ret = 0;
- interface = iface;
-
if (manager) {
- ERROR(interface, "Ofono Manager already initialized\n");
+ AFB_ERROR("Ofono Manager already initialized\n");
return -1;
}
@@ -56,7 +54,7 @@ int ofono_manager_init(const struct afb_binding_interface *iface)
"org.ofono", "/", NULL, NULL);
if (!manager) {
- ERROR(interface, "Ofono Manager not initialized\n");
+ AFB_ERROR("Ofono Manager not initialized\n");
return -1;
}
@@ -91,7 +89,7 @@ int ofono_manager_init(const struct afb_binding_interface *iface)
const gchar *ofono_manager_get_default_modem_path(void)
{
if (!manager) {
- ERROR(interface, "Ofono Manager not initialized\n");
+ AFB_ERROR("Ofono Manager not initialized\n");
}
return default_modem.path;
@@ -100,7 +98,7 @@ const gchar *ofono_manager_get_default_modem_path(void)
const gchar *ofono_manager_get_default_modem_name(void)
{
if (!manager) {
- ERROR(interface, "Ofono Manager not initialized\n");
+ AFB_ERROR("Ofono Manager not initialized\n");
}
return default_modem.name;
@@ -109,7 +107,7 @@ const gchar *ofono_manager_get_default_modem_name(void)
const gchar *ofono_manager_get_default_modem_type(void)
{
if (!manager) {
- ERROR(interface, "Ofono Manager not initialized\n");
+ AFB_ERROR("Ofono Manager not initialized\n");
}
return default_modem.type;
@@ -118,7 +116,7 @@ const gchar *ofono_manager_get_default_modem_type(void)
gboolean ofono_manager_get_default_modem_powered(void)
{
if (!manager) {
- ERROR(interface, "Ofono Manager not initialized\n");
+ AFB_ERROR("Ofono Manager not initialized\n");
}
return default_modem.powered;
@@ -127,7 +125,7 @@ gboolean ofono_manager_get_default_modem_powered(void)
gboolean ofono_manager_get_default_modem_online(void)
{
if (!manager) {
- ERROR(interface, "Ofono Manager not initialized\n");
+ AFB_ERROR("Ofono Manager not initialized\n");
}
return default_modem.online;