From: Ronald Tessier <ronald.tessier@linux.intel.com>
To: ofono@ofono.org
Subject: [PATCH 1/3] service: Add DBus method to get service properties
Date: Thu, 09 Aug 2012 17:51:41 +0200 [thread overview]
Message-ID: <1344527503-9965-2-git-send-email-ronald.tessier@linux.intel.com> (raw)
In-Reply-To: <1344527503-9965-1-git-send-email-ronald.tessier@linux.intel.com>
[-- Attachment #1: Type: text/plain, Size: 1268 bytes --]
---
src/service.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/src/service.c b/src/service.c
index 22d19c7..db9c514 100644
--- a/src/service.c
+++ b/src/service.c
@@ -887,6 +887,31 @@ out:
return reply;
}
+static DBusMessage *get_properties(DBusConnection *conn,
+ DBusMessage *msg, void *data)
+{
+ struct mms_service *service = data;
+ DBusMessage *reply;
+ DBusMessageIter iter;
+ DBusMessageIter dict;
+
+ reply = dbus_message_new_method_return(msg);
+ if (reply == NULL)
+ return NULL;
+
+ dbus_message_iter_init_append(reply, &iter);
+
+ mms_dbus_dict_open(&iter, &dict);
+
+ mms_dbus_dict_append_basic(&dict, "UseDeliveryReports",
+ DBUS_TYPE_BOOLEAN,
+ &service->use_delivery_reports);
+
+ mms_dbus_dict_close(&iter, &dict);
+
+ return reply;
+}
+
static DBusMessage *set_property(DBusConnection *conn, DBusMessage *dbus_msg,
void *data)
{
@@ -1069,6 +1094,10 @@ static const GDBusMethodTable service_methods[] = {
GDBUS_ARGS({ "property", "s" }, { "value", "v" }),
NULL,
set_property) },
+ { GDBUS_METHOD("GetProperties",
+ NULL,
+ GDBUS_ARGS({ "properties", "a{sv}" }),
+ get_properties) },
{ }
};
--
1.7.9.5
next prev parent reply other threads:[~2012-08-09 15:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-09 15:51 [PATCH 0/3] mmsd: Add GetProperties method Ronald Tessier
2012-08-09 15:51 ` Ronald Tessier [this message]
2012-08-09 6:43 ` [PATCH 1/3] service: Add DBus method to get service properties Denis Kenzior
2012-08-09 15:51 ` [PATCH 2/3] doc: Describe GetProperties in service-api Ronald Tessier
2012-08-09 6:43 ` Denis Kenzior
2012-08-09 15:51 ` [PATCH 3/3] test: Add a test script to get service properties Ronald Tessier
2012-08-09 6:44 ` Denis Kenzior
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=1344527503-9965-2-git-send-email-ronald.tessier@linux.intel.com \
--to=ronald.tessier@linux.intel.com \
--cc=ofono@ofono.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