[PATCH 06/11] Made it possible to ask for status report via SendMessage method parameters. True=status report on, false=off.
Aki Niemi
aki.niemi at nokia.com
Thu May 27 04:32:45 PDT 2010
On Thu, 2010-05-27 at 12:54 +0200, ext pasi.miettinen at ixonos.com wrote:
> diff --git a/src/sms.c b/src/sms.c
> index b4a5364..d079ece 100644
> --- a/src/sms.c
> +++ b/src/sms.c
> @@ -400,6 +400,7 @@ static DBusMessage *sms_send_message(DBusConnection *conn, DBusMessage *msg,
> struct ofono_sms *sms = data;
> const char *to;
> const char *text;
> + gboolean ask_status_report;
> GSList *msg_list;
> int ref_offset;
> struct tx_queue_entry *entry;
> @@ -407,13 +408,14 @@ static DBusMessage *sms_send_message(DBusConnection *conn, DBusMessage *msg,
>
> if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &to,
> DBUS_TYPE_STRING, &text,
> + DBUS_TYPE_BOOLEAN, &ask_status_report,
> DBUS_TYPE_INVALID))
> return __ofono_error_invalid_args(msg);
>
> if (valid_phone_number_format(to) == FALSE)
> return __ofono_error_invalid_format(msg);
>
> - msg_list = sms_text_prepare(text, 0, TRUE, &ref_offset);
> + msg_list = sms_text_prepare(text, 0, TRUE, &ref_offset, ask_status_report);
>
> if (!msg_list)
> return __ofono_error_invalid_format(msg);
> @@ -453,7 +455,7 @@ static GDBusMethodTable sms_manager_methods[] = {
> G_DBUS_METHOD_FLAG_ASYNC },
> { "SetProperty", "sv", "", sms_set_property,
> G_DBUS_METHOD_FLAG_ASYNC },
> - { "SendMessage", "ss", "", sms_send_message,
> + { "SendMessage", "ssb", "", sms_send_message,
> G_DBUS_METHOD_FLAG_ASYNC },
> { }
> };
I don't like this being an argument to SendMessage(). I think it needs
to be exposed, but as a property instead. Is there a use case for
setting this per message? I think majority of current phones either
provide a global setting for this, or set it on by default.
Cheers,
Aki
More information about the ofono
mailing list