All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2 0/3] mmsd: delivery-report flag
@ 2012-08-08 13:21 Ronald Tessier
  2012-08-08 13:21 ` [PATCHv2 1/3] service: Add DBus method to set delivery-report Ronald Tessier
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Ronald Tessier @ 2012-08-08 13:21 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 671 bytes --]

This patch concerns mmsd and is related to delivery-report flag setting.
Describe and implement the SetProperty DBus api.
Add a test script to set/unset the delivery-report flag.

Ronald Tessier (3):
  service: Add DBus method to set delivery-report
  doc: Describe DBus method to set delivery-report
  test: Add a script to set the delivery-report flag

 Makefile.am         |    2 +-
 doc/service-api.txt |   13 +++++++++++++
 src/service.c       |   46 ++++++++++++++++++++++++++++++++++++++++++++++
 test/set-dr         |   25 +++++++++++++++++++++++++
 4 files changed, 85 insertions(+), 1 deletion(-)
 create mode 100755 test/set-dr

--
1.7.9.5


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCHv2 1/3] service: Add DBus method to set delivery-report
  2012-08-08 13:21 [PATCHv2 0/3] mmsd: delivery-report flag Ronald Tessier
@ 2012-08-08 13:21 ` Ronald Tessier
  2012-08-08 17:06   ` Denis Kenzior
  2012-08-08 13:21 ` [PATCHv2 2/3] doc: Describe " Ronald Tessier
  2012-08-08 13:21 ` [PATCHv2 3/3] test: Add a script to set the delivery-report flag Ronald Tessier
  2 siblings, 1 reply; 7+ messages in thread
From: Ronald Tessier @ 2012-08-08 13:21 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2008 bytes --]

---
 src/service.c |   46 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/src/service.c b/src/service.c
index 7243efd..22d19c7 100644
--- a/src/service.c
+++ b/src/service.c
@@ -887,6 +887,48 @@ out:
 	return reply;
 }

+static DBusMessage *set_property(DBusConnection *conn, DBusMessage *dbus_msg,
+								void *data)
+{
+	struct mms_service *service = data;
+	DBusMessageIter iter;
+	DBusMessageIter var;
+	const char *property;
+
+	if (!dbus_message_iter_init(dbus_msg, &iter))
+		return __mms_error_invalid_args(dbus_msg);
+
+	if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
+		return __mms_error_invalid_args(dbus_msg);
+
+	dbus_message_iter_get_basic(&iter, &property);
+	dbus_message_iter_next(&iter);
+
+	if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_VARIANT)
+		return __mms_error_invalid_args(dbus_msg);
+
+	dbus_message_iter_recurse(&iter, &var);
+
+	if (!strcmp(property, "UseDeliveryReports")) {
+		dbus_bool_t value;
+
+		if (dbus_message_iter_get_arg_type(&var) != DBUS_TYPE_BOOLEAN)
+			return __mms_error_invalid_args(dbus_msg);
+
+		dbus_message_iter_get_basic(&var, &value);
+
+		if (service->use_delivery_reports != (gboolean) value) {
+			DBG("use_delivery_reports = %d", value);
+
+			service->use_delivery_reports = value;
+		}
+
+		return g_dbus_create_reply(dbus_msg, DBUS_TYPE_INVALID);
+	}
+
+	return __mms_error_invalid_args(dbus_msg);
+}
+
 static gboolean mms_attachment_is_smil(const struct mms_attachment *part)
 {
 	if (g_str_has_prefix(part->content_type, "application/smil"))
@@ -1023,6 +1065,10 @@ static const GDBusMethodTable service_methods[] = {
 			GDBUS_ARGS({ "number", "s" }, { "count", "s" }),
 			GDBUS_ARGS({ "messages_with_properties", "a(oa{sv}" }),
 			get_conversation) },
+	{ GDBUS_METHOD("SetProperty",
+			GDBUS_ARGS({ "property", "s" }, { "value", "v" }),
+			NULL,
+			set_property) },
 	{ }
 };

--
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCHv2 2/3] doc: Describe DBus method to set delivery-report
  2012-08-08 13:21 [PATCHv2 0/3] mmsd: delivery-report flag Ronald Tessier
  2012-08-08 13:21 ` [PATCHv2 1/3] service: Add DBus method to set delivery-report Ronald Tessier
@ 2012-08-08 13:21 ` Ronald Tessier
  2012-08-08 17:06   ` Denis Kenzior
  2012-08-08 13:21 ` [PATCHv2 3/3] test: Add a script to set the delivery-report flag Ronald Tessier
  2 siblings, 1 reply; 7+ messages in thread
From: Ronald Tessier @ 2012-08-08 13:21 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1087 bytes --]

---
 doc/service-api.txt |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/doc/service-api.txt b/doc/service-api.txt
index 02396ff..25f2d0d 100644
--- a/doc/service-api.txt
+++ b/doc/service-api.txt
@@ -82,6 +82,12 @@ Methods		array{object,dict} GetMessages()

 			Possible Errors: [service].Error.InvalidArguments

+		void SetProperty(string name, variant value)
+
+			Changes the value of the specified property.
+
+			Possible Errors: [service].Error.InvalidArguments
+

 Signals		MessageAdded(object path, dict properties)

@@ -94,3 +100,10 @@ Signals		MessageAdded(object path, dict properties)
 			Signal that is sent when a message has been removed.
 			The object path is no longer accessible after this
 			signal and only emitted for reference.
+
+Properties	boolean UseDeliveryReports
+
+			This property controls whether MMS Status Reports,
+			sometimes better known as Delivery Reports are to be
+			used.  If enabled, all outgoing MMS messages will be
+			flagged to request a status report from the MMSC.
--
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCHv2 3/3] test: Add a script to set the delivery-report flag
  2012-08-08 13:21 [PATCHv2 0/3] mmsd: delivery-report flag Ronald Tessier
  2012-08-08 13:21 ` [PATCHv2 1/3] service: Add DBus method to set delivery-report Ronald Tessier
  2012-08-08 13:21 ` [PATCHv2 2/3] doc: Describe " Ronald Tessier
@ 2012-08-08 13:21 ` Ronald Tessier
  2012-08-08 17:07   ` Denis Kenzior
  2 siblings, 1 reply; 7+ messages in thread
From: Ronald Tessier @ 2012-08-08 13:21 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1415 bytes --]

---
 Makefile.am |    2 +-
 test/set-dr |   25 +++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)
 create mode 100755 test/set-dr

diff --git a/Makefile.am b/Makefile.am
index 3ae0749..6130ba2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -52,7 +52,7 @@ CLEANFILES = src/builtin.h

 test_scripts = test/monitor-mms test/get-services test/send-message \
 		test/delete-message test/mark-message-read test/get-messages \
-		test/get-conversation
+		test/get-conversation test/set-dr

 doc_files = doc/architecture.txt doc/consumer.txt doc/manager-api.txt \
 				doc/service-api.txt doc/message-api.txt \
diff --git a/test/set-dr b/test/set-dr
new file mode 100755
index 0000000..2143807
--- /dev/null
+++ b/test/set-dr
@@ -0,0 +1,25 @@
+#!/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')
+
+if len(sys.argv) > 1:
+	allowed = dbus.Boolean(int(sys.argv[1]))
+else:
+	allowed = dbus.Boolean(1)
+
+print "Setting delivery report use for %s...(UseDeliveryReports=%d)" %\
+	(path, allowed)
+
+service.SetProperty("UseDeliveryReports", allowed)
--
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCHv2 1/3] service: Add DBus method to set delivery-report
  2012-08-08 13:21 ` [PATCHv2 1/3] service: Add DBus method to set delivery-report Ronald Tessier
@ 2012-08-08 17:06   ` Denis Kenzior
  0 siblings, 0 replies; 7+ messages in thread
From: Denis Kenzior @ 2012-08-08 17:06 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 237 bytes --]

Hi Ronald,

On 08/08/2012 08:21 AM, Ronald Tessier wrote:
> ---
>   src/service.c |   46 ++++++++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 46 insertions(+)
>

Patch has been applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCHv2 2/3] doc: Describe DBus method to set delivery-report
  2012-08-08 13:21 ` [PATCHv2 2/3] doc: Describe " Ronald Tessier
@ 2012-08-08 17:06   ` Denis Kenzior
  0 siblings, 0 replies; 7+ messages in thread
From: Denis Kenzior @ 2012-08-08 17:06 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 783 bytes --]

Hi Ronald,

On 08/08/2012 08:21 AM, Ronald Tessier wrote:
> ---
>   doc/service-api.txt |   13 +++++++++++++
>   1 file changed, 13 insertions(+)
>

I applied this patch, but see below.

> diff --git a/doc/service-api.txt b/doc/service-api.txt
> index 02396ff..25f2d0d 100644
> --- a/doc/service-api.txt
> +++ b/doc/service-api.txt
> @@ -82,6 +82,12 @@ Methods		array{object,dict} GetMessages()
>
>   			Possible Errors: [service].Error.InvalidArguments
>
> +		void SetProperty(string name, variant value)
> +
> +			Changes the value of the specified property.
> +
> +			Possible Errors: [service].Error.InvalidArguments
> +

You are still missing GetProperties doc additions and implementation. 
Please send these as separate patches.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCHv2 3/3] test: Add a script to set the delivery-report flag
  2012-08-08 13:21 ` [PATCHv2 3/3] test: Add a script to set the delivery-report flag Ronald Tessier
@ 2012-08-08 17:07   ` Denis Kenzior
  0 siblings, 0 replies; 7+ messages in thread
From: Denis Kenzior @ 2012-08-08 17:07 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 358 bytes --]

Hi Ronald,

On 08/08/2012 08:21 AM, Ronald Tessier wrote:
> ---
>   Makefile.am |    2 +-
>   test/set-dr |   25 +++++++++++++++++++++++++
>   2 files changed, 26 insertions(+), 1 deletion(-)
>   create mode 100755 test/set-dr
>

Patch has been applied.  However, I renamed the script to 
set-use-delivery-reports afterwards.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-08-08 17:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-08 13:21 [PATCHv2 0/3] mmsd: delivery-report flag Ronald Tessier
2012-08-08 13:21 ` [PATCHv2 1/3] service: Add DBus method to set delivery-report Ronald Tessier
2012-08-08 17:06   ` Denis Kenzior
2012-08-08 13:21 ` [PATCHv2 2/3] doc: Describe " Ronald Tessier
2012-08-08 17:06   ` Denis Kenzior
2012-08-08 13:21 ` [PATCHv2 3/3] test: Add a script to set the delivery-report flag Ronald Tessier
2012-08-08 17:07   ` 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.