---
 src/location-reporting.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/location-reporting.c b/src/location-reporting.c
index 6a3e03c4..d787f0c0 100644
--- a/src/location-reporting.c
+++ b/src/location-reporting.c
@@ -64,7 +64,6 @@ static const char *location_reporting_type_to_string(
 
 static DBusMessage *location_reporting_get_properties(DBusConnection *conn,
                                                DBusMessage *msg, void *data)
-
 {
        struct ofono_location_reporting *lr = data;
        DBusMessage *reply;
@@ -74,7 +73,7 @@ static DBusMessage 
*location_reporting_get_properties(DBusConnection *conn,
        dbus_bool_t value;
 
        reply = dbus_message_new_method_return(msg);
-       if (reply == NULL)
+       if (lr == NULL || reply == NULL)
                return NULL;
 
        dbus_message_iter_init_append(reply, &iter);
@@ -88,11 +87,25 @@ static DBusMessage 
*location_reporting_get_properties(DBusConnection *conn,
        type = location_reporting_type_to_string(lr->driver->type);
        ofono_dbus_dict_append(&dict, "Type", DBUS_TYPE_STRING, &type);
 
+       if (lr->driver && lr->driver->get_properties)
+               lr->driver->get_properties(lr, &dict);
+
        dbus_message_iter_close_container(&iter, &dict);
 
        return reply;
 }
 
+static DBusMessage *location_reporting_set_property(DBusConnection *conn,
+                                       DBusMessage *msg, void *data)
+{
+       struct ofono_location_reporting *lr = data;
+
+       if (!lr || !lr->driver || !lr->driver->set_property)
+               return __ofono_error_not_available(msg);
+
+       return lr->driver->set_property(lr, msg);
+}
+
 static void client_remove(struct ofono_location_reporting *lr)
 {
        DBusConnection *conn = ofono_dbus_get_connection();
@@ -243,6 +256,9 @@ static const GDBusMethodTable location_reporting_methods[] 
= {
        { GDBUS_METHOD("GetProperties",
                        NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
                        location_reporting_get_properties) },
+       { GDBUS_ASYNC_METHOD("SetProperty",
+                       GDBUS_ARGS({ "property", "s" }, { "value", "v" }),
+                       NULL, location_reporting_set_property) },
        { GDBUS_ASYNC_METHOD("Request",
                        NULL, GDBUS_ARGS({ "fd", "h" }),
                        location_reporting_request) },
-- 
2.17.1

_______________________________________________
ofono mailing list
[email protected]
https://lists.ofono.org/mailman/listinfo/ofono

Reply via email to