* [PATCH 0/3] mmsd: Add GetProperties method
@ 2012-08-09 15:51 Ronald Tessier
2012-08-09 15:51 ` [PATCH 1/3] service: Add DBus method to get service properties Ronald Tessier
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Ronald Tessier @ 2012-08-09 15:51 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 601 bytes --]
This patch concerns mmsd and is related to delivery-report flag setting.
Describe and implement the GetProperties DBus api.
Add a test script to retrieve service properties.
Ronald Tessier (3):
service: Add DBus method to get service properties
doc: Describe GetProperties in service-api
test: Add a test script to get service properties
doc/service-api.txt | 7 +++++++
src/service.c | 29 +++++++++++++++++++++++++++++
test/get-properties | 26 ++++++++++++++++++++++++++
3 files changed, 62 insertions(+)
create mode 100755 test/get-properties
--
1.7.9.5
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 1/3] service: Add DBus method to get service properties 2012-08-09 15:51 [PATCH 0/3] mmsd: Add GetProperties method Ronald Tessier @ 2012-08-09 15:51 ` Ronald Tessier 2012-08-09 6:43 ` Denis Kenzior 2012-08-09 15:51 ` [PATCH 2/3] doc: Describe GetProperties in service-api Ronald Tessier 2012-08-09 15:51 ` [PATCH 3/3] test: Add a test script to get service properties Ronald Tessier 2 siblings, 1 reply; 7+ messages in thread From: Ronald Tessier @ 2012-08-09 15:51 UTC (permalink / raw) To: ofono [-- 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 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] service: Add DBus method to get service properties 2012-08-09 15:51 ` [PATCH 1/3] service: Add DBus method to get service properties Ronald Tessier @ 2012-08-09 6:43 ` Denis Kenzior 0 siblings, 0 replies; 7+ messages in thread From: Denis Kenzior @ 2012-08-09 6:43 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 220 bytes --] Hi Ronald, On 08/09/2012 10:51 AM, Ronald Tessier wrote: > --- > src/service.c | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > Patch has been applied, thanks. Regards, -Denis ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] doc: Describe GetProperties in service-api 2012-08-09 15:51 [PATCH 0/3] mmsd: Add GetProperties method Ronald Tessier 2012-08-09 15:51 ` [PATCH 1/3] service: Add DBus method to get service properties Ronald Tessier @ 2012-08-09 15:51 ` 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 2 siblings, 1 reply; 7+ messages in thread From: Ronald Tessier @ 2012-08-09 15:51 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 723 bytes --] --- doc/service-api.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/service-api.txt b/doc/service-api.txt index 25f2d0d..1bf820e 100644 --- a/doc/service-api.txt +++ b/doc/service-api.txt @@ -36,6 +36,13 @@ Methods array{object,dict} GetMessages() Possible Errors: [service].Error.InvalidArguments [service].Error.TransientFailure + dict GetProperties() + + Returns properties for the manager object. See + the properties section for available properties. + + Possible Errors: [service].Error.NotImplemented + object SendMessage(array{string} recipients, string smil, array{string id, string content-type, string filename}) -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] doc: Describe GetProperties in service-api 2012-08-09 15:51 ` [PATCH 2/3] doc: Describe GetProperties in service-api Ronald Tessier @ 2012-08-09 6:43 ` Denis Kenzior 0 siblings, 0 replies; 7+ messages in thread From: Denis Kenzior @ 2012-08-09 6:43 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 205 bytes --] Hi Ronald, On 08/09/2012 10:51 AM, Ronald Tessier wrote: > --- > doc/service-api.txt | 7 +++++++ > 1 file changed, 7 insertions(+) > Patch has been applied, thanks. Regards, -Denis ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/3] test: Add a test script to get service properties 2012-08-09 15:51 [PATCH 0/3] mmsd: Add GetProperties method Ronald Tessier 2012-08-09 15:51 ` [PATCH 1/3] service: Add DBus method to get service properties Ronald Tessier 2012-08-09 15:51 ` [PATCH 2/3] doc: Describe GetProperties in service-api Ronald Tessier @ 2012-08-09 15:51 ` Ronald Tessier 2012-08-09 6:44 ` Denis Kenzior 2 siblings, 1 reply; 7+ messages in thread From: Ronald Tessier @ 2012-08-09 15:51 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 994 bytes --] --- test/get-properties | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 test/get-properties diff --git a/test/get-properties b/test/get-properties new file mode 100755 index 0000000..8887fcb --- /dev/null +++ b/test/get-properties @@ -0,0 +1,26 @@ +#!/usr/bin/python + +import sys +import dbus + +bus = dbus.SessionBus() + +manager = dbus.Interface(bus.get_object('org.ofono.mms', '/org/ofono/mms'), + 'org.ofono.mms.Manager') + +services = manager.GetServices() +path = services[0][0] + +service = dbus.Interface(bus.get_object('org.ofono.mms', path), + 'org.ofono.mms.Service') + +properties = service.GetProperties() + +for p in properties: + if len(properties[p].__str__()) > 0: + print "%s Service Manager rule is: %s" %\ + (p, properties[p]) + print "------------------------------------------" \ + "-----------------" + else: + print "%s Service Manager rule disabled" % (p) -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] test: Add a test script to get service properties 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 0 siblings, 0 replies; 7+ messages in thread From: Denis Kenzior @ 2012-08-09 6:44 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 1215 bytes --] Hi Ronald, On 08/09/2012 10:51 AM, Ronald Tessier wrote: > --- > test/get-properties | 26 ++++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) > create mode 100755 test/get-properties > > diff --git a/test/get-properties b/test/get-properties > new file mode 100755 > index 0000000..8887fcb > --- /dev/null > +++ b/test/get-properties > @@ -0,0 +1,26 @@ > +#!/usr/bin/python > + > +import sys > +import dbus > + > +bus = dbus.SessionBus() > + > +manager = dbus.Interface(bus.get_object('org.ofono.mms', '/org/ofono/mms'), > + 'org.ofono.mms.Manager') > + > +services = manager.GetServices() > +path = services[0][0] > + > +service = dbus.Interface(bus.get_object('org.ofono.mms', path), > + 'org.ofono.mms.Service') > + > +properties = service.GetProperties() > + > +for p in properties: > + if len(properties[p].__str__())> 0: > + print "%s Service Manager rule is: %s" %\ > + (p, properties[p]) > + print "------------------------------------------" \ > + "-----------------" > + else: > + print "%s Service Manager rule disabled" % (p) Please model this script after list-modems in ofono. Name it list-services. Regards, -Denis ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-08-09 15:51 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-08-09 15:51 [PATCH 0/3] mmsd: Add GetProperties method Ronald Tessier 2012-08-09 15:51 ` [PATCH 1/3] service: Add DBus method to get service properties Ronald Tessier 2012-08-09 6:43 ` 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
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.