diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2011-12-28 13:59:48 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-03-15 14:14:39 +0100 |
commit | 93880155f0e38b54a0886c7cebb05075293c86f4 (patch) | |
tree | 6401a64a4c4753329e7624811483d7840ff04aaa | |
parent | ba1a448717d29885492ac1e9644df19324e7bfd0 (diff) |
iface-modem-simple: implement GetStatus()
-rw-r--r-- | src/mm-iface-modem-simple.c | 28 | ||||
-rw-r--r-- | src/mm-iface-modem-simple.h | 3 |
2 files changed, 27 insertions, 4 deletions
diff --git a/src/mm-iface-modem-simple.c b/src/mm-iface-modem-simple.c index 5499fff3..a83bafc7 100644 --- a/src/mm-iface-modem-simple.c +++ b/src/mm-iface-modem-simple.c @@ -18,6 +18,7 @@ #include <ModemManager.h> #include <libmm-common.h> +#include "mm-common-simple-properties.h" #include "mm-bearer-list.h" #include "mm-sim.h" #include "mm-iface-modem.h" @@ -495,10 +496,23 @@ handle_disconnect (MmGdbusModemSimple *skeleton, /*****************************************************************************/ static gboolean -handle_get_status (MmGdbusModemSimple *object, - GDBusMethodInvocation *invocation) +handle_get_status (MmGdbusModemSimple *skeleton, + GDBusMethodInvocation *invocation, + MMIfaceModemSimple *self) { - return FALSE; + MMCommonSimpleProperties *properties = NULL; + GVariant *dictionary; + + g_object_get (self, + MM_IFACE_MODEM_SIMPLE_STATUS, &properties, + NULL); + + dictionary = mm_common_simple_properties_get_dictionary (properties); + mm_gdbus_modem_simple_complete_get_status (skeleton, invocation, dictionary); + g_variant_unref (dictionary); + + g_object_unref (properties); + return TRUE; } /*****************************************************************************/ @@ -573,6 +587,14 @@ iface_modem_simple_init (gpointer g_iface) MM_GDBUS_TYPE_MODEM_SIMPLE_SKELETON, G_PARAM_READWRITE)); + g_object_interface_install_property + (g_iface, + g_param_spec_object (MM_IFACE_MODEM_SIMPLE_STATUS, + "Simple status", + "Compilation of status values", + MM_TYPE_COMMON_SIMPLE_PROPERTIES, + G_PARAM_READWRITE)); + initialized = TRUE; } diff --git a/src/mm-iface-modem-simple.h b/src/mm-iface-modem-simple.h index fb942094..5b9b8af6 100644 --- a/src/mm-iface-modem-simple.h +++ b/src/mm-iface-modem-simple.h @@ -24,7 +24,8 @@ #define MM_IS_IFACE_MODEM_SIMPLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_IFACE_MODEM_SIMPLE)) #define MM_IFACE_MODEM_SIMPLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), MM_TYPE_IFACE_MODEM_SIMPLE, MMIfaceModemSimple)) -#define MM_IFACE_MODEM_SIMPLE_DBUS_SKELETON "iface-modem-simple-dbus-skeleton" +#define MM_IFACE_MODEM_SIMPLE_DBUS_SKELETON "iface-modem-simple-dbus-skeleton" +#define MM_IFACE_MODEM_SIMPLE_STATUS "iface-modem-simple-status" typedef struct _MMIfaceModemSimple MMIfaceModemSimple; |