aboutsummaryrefslogtreecommitdiff
path: root/libmm-glib/mm-modem-simple.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2011-12-28 14:43:32 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-15 14:14:39 +0100
commitfa5064ece35a1af500d03b1709f793b8432f6f4b (patch)
treeb9c364c94fdf1930ee3bb62343514fce2147e640 /libmm-glib/mm-modem-simple.c
parentf58a23c9c20c1a4a4a1987e8e0d9b3d988eaee59 (diff)
libmm-glib: implement handling of GetStatus() calls in the Simple interface
Diffstat (limited to 'libmm-glib/mm-modem-simple.c')
-rw-r--r--libmm-glib/mm-modem-simple.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/libmm-glib/mm-modem-simple.c b/libmm-glib/mm-modem-simple.c
index d4e059d8..bec8c23d 100644
--- a/libmm-glib/mm-modem-simple.c
+++ b/libmm-glib/mm-modem-simple.c
@@ -245,3 +245,53 @@ mm_modem_simple_disconnect_sync (MMModemSimple *self,
cancellable,
error);
}
+
+MMModemSimpleStatusProperties *
+mm_modem_simple_get_status_finish (MMModemSimple *self,
+ GAsyncResult *res,
+ GError **error)
+{
+ MMCommonSimpleProperties *properties;
+ GVariant *dictionary = NULL;
+
+ g_return_val_if_fail (MM_GDBUS_IS_MODEM_SIMPLE (self), NULL);
+
+ if (!mm_gdbus_modem_simple_call_get_status_finish (self, &dictionary, res, error))
+ return NULL;
+
+ properties = mm_common_simple_properties_new_from_dictionary (dictionary, error);
+ g_variant_unref (dictionary);
+ return (MMModemSimpleStatusProperties *)properties;
+}
+
+void
+mm_modem_simple_get_status (MMModemSimple *self,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_return_if_fail (MM_GDBUS_IS_MODEM_SIMPLE (self));
+
+ mm_gdbus_modem_simple_call_get_status (self,
+ cancellable,
+ callback,
+ user_data);
+}
+
+MMModemSimpleStatusProperties *
+mm_modem_simple_get_status_sync (MMModemSimple *self,
+ GCancellable *cancellable,
+ GError **error)
+{
+ MMCommonSimpleProperties *properties;
+ GVariant *dictionary = NULL;
+
+ g_return_val_if_fail (MM_GDBUS_IS_MODEM_SIMPLE (self), NULL);
+
+ if (!mm_gdbus_modem_simple_call_get_status_sync (self, &dictionary, cancellable, error))
+ return NULL;
+
+ properties = mm_common_simple_properties_new_from_dictionary (dictionary, error);
+ g_variant_unref (dictionary);
+ return (MMModemSimpleStatusProperties *)properties;
+}