diff options
-rw-r--r-- | introspection/mm-modem-gsm-card.xml | 14 | ||||
-rw-r--r-- | introspection/mm-modem-gsm-contacts.xml | 14 | ||||
-rw-r--r-- | introspection/mm-modem-gsm-network.xml | 17 | ||||
-rw-r--r-- | introspection/mm-modem-gsm-sms.xml | 19 | ||||
-rw-r--r-- | src/mm-modem-gsm-card.c | 28 | ||||
-rw-r--r-- | src/mm-modem-gsm-network.c | 31 |
6 files changed, 64 insertions, 59 deletions
diff --git a/introspection/mm-modem-gsm-card.xml b/introspection/mm-modem-gsm-card.xml index 81cc883e..91b0c00e 100644 --- a/introspection/mm-modem-gsm-card.xml +++ b/introspection/mm-modem-gsm-card.xml @@ -34,19 +34,9 @@ </tp:docstring> <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_gsm_modem_get_info"/> - <arg name="manufacturer" type="s" direction="out"> + <arg name="info" type="(sss)" direction="out"> <tp:docstring> - The manufacturer of the card. - </tp:docstring> - </arg> - <arg name="modem" type="s" direction="out"> - <tp:docstring> - The model of the card. - </tp:docstring> - </arg> - <arg name="version" type="s" direction="out"> - <tp:docstring> - The version (revision) of the card. + Structure containing manufacturer, model, and version (revision) of the card. </tp:docstring> </arg> </method> diff --git a/introspection/mm-modem-gsm-contacts.xml b/introspection/mm-modem-gsm-contacts.xml index d1b5dc05..60b06ad4 100644 --- a/introspection/mm-modem-gsm-contacts.xml +++ b/introspection/mm-modem-gsm-contacts.xml @@ -49,19 +49,9 @@ The index of the contact. </tp:docstring> </arg> - <arg name="found_index" type="u" direction="out"> + <arg name="contact" type="(uss)" direction="out"> <tp:docstring> - The index of the contact (same as the passed index). - </tp:docstring> - </arg> - <arg name="name" type="s" direction="out"> - <tp:docstring> - The name of the contact. - </tp:docstring> - </arg> - <arg name="number" type="s" direction="out"> - <tp:docstring> - The number of the contact. + The contact structure containing index, name, and number. </tp:docstring> </arg> </method> diff --git a/introspection/mm-modem-gsm-network.xml b/introspection/mm-modem-gsm-network.xml index 10215ccf..83a14688 100644 --- a/introspection/mm-modem-gsm-network.xml +++ b/introspection/mm-modem-gsm-network.xml @@ -112,19 +112,12 @@ </tp:docstring> <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_gsm_modem_get_reg_info"/> - <arg name="status" type="u" direction="out" tp:type="MM_MODEM_GSM_NETWORK_REG_STATUS"> + <arg name="info" type="(uss)" direction="out"> <tp:docstring> - The network status. - </tp:docstring> - </arg> - <arg name="operator_code" type="s" direction="out"> - <tp:docstring> - The current operator code. - </tp:docstring> - </arg> - <arg name="operator_name" type="s" direction="out"> - <tp:docstring> - The current operator name. + The returned information contains: + * Network status. + * Current operator code. + * Current operator name, </tp:docstring> </arg> </method> diff --git a/introspection/mm-modem-gsm-sms.xml b/introspection/mm-modem-gsm-sms.xml index 4f7acd0c..e710c166 100644 --- a/introspection/mm-modem-gsm-sms.xml +++ b/introspection/mm-modem-gsm-sms.xml @@ -26,24 +26,9 @@ The index of the SMS. </tp:docstring> </arg> - <arg name="found_index" type="u" direction="out"> + <arg name="sms" type="(ussd)" direction="out"> <tp:docstring> - The index of the SMS (same as the passed index). - </tp:docstring> - </arg> - <arg name="number" type="s" direction="out"> - <tp:docstring> - The number the SMS was received from. - </tp:docstring> - </arg> - <arg name="contents" type="s" direction="out"> - <tp:docstring> - The contents of the SMS. - </tp:docstring> - </arg> - <arg name="time" type="d" direction="out"> - <tp:docstring> - The timestamp. + The SMS structure containing index, number, contents and time stamp. </tp:docstring> </arg> </method> diff --git a/src/mm-modem-gsm-card.c b/src/mm-modem-gsm-card.c index ffe4f2eb..85385b25 100644 --- a/src/mm-modem-gsm-card.c +++ b/src/mm-modem-gsm-card.c @@ -75,8 +75,32 @@ info_call_done (MMModemGsmCard *self, if (error) dbus_g_method_return_error (context, error); - else - dbus_g_method_return (context, manufacturer, model, version); + else { + GValueArray *array; + GValue value = { 0, }; + + array = g_value_array_new (3); + + /* Manufacturer */ + g_value_init (&value, G_TYPE_STRING); + g_value_set_string (&value, manufacturer); + g_value_array_append (array, &value); + g_value_unset (&value); + + /* Model */ + g_value_init (&value, G_TYPE_STRING); + g_value_set_string (&value, model); + g_value_array_append (array, &value); + g_value_unset (&value); + + /* Version */ + g_value_init (&value, G_TYPE_STRING); + g_value_set_string (&value, version); + g_value_array_append (array, &value); + g_value_unset (&value); + + dbus_g_method_return (context, array); + } } static void diff --git a/src/mm-modem-gsm-network.c b/src/mm-modem-gsm-network.c index c49aff4b..c302dead 100644 --- a/src/mm-modem-gsm-network.c +++ b/src/mm-modem-gsm-network.c @@ -116,9 +116,30 @@ reg_info_call_done (MMModemGsmNetwork *self, if (error) dbus_g_method_return_error (context, error); else { - dbus_g_method_return (context, status, - oper_code ? oper_code : "", - oper_name ? oper_name : ""); + GValueArray *array; + GValue value = { 0, }; + + array = g_value_array_new (3); + + /* Status */ + g_value_init (&value, G_TYPE_UINT); + g_value_set_uint (&value, (guint32) status); + g_value_array_append (array, &value); + g_value_unset (&value); + + /* Operator code */ + g_value_init (&value, G_TYPE_STRING); + g_value_set_string (&value, oper_code); + g_value_array_append (array, &value); + g_value_unset (&value); + + /* Operator name */ + g_value_init (&value, G_TYPE_STRING); + g_value_set_string (&value, oper_name); + g_value_array_append (array, &value); + g_value_unset (&value); + + dbus_g_method_return (context, array); } } @@ -330,7 +351,9 @@ mm_modem_gsm_network_registration_info (MMModemGsmNetwork *self, { g_return_if_fail (MM_IS_MODEM_GSM_NETWORK (self)); - g_signal_emit (self, signals[REGISTRATION_INFO], 0, status, oper_code, oper_name); + g_signal_emit (self, signals[REGISTRATION_INFO], 0, status, + oper_code ? oper_code : "", + oper_name ? oper_name : ""); } void |