iface-modem-simple: implement GetStatus()

This commit is contained in:
Aleksander Morgado
2011-12-28 13:59:48 +01:00
parent ba1a448717
commit 93880155f0
2 changed files with 27 additions and 4 deletions

View File

@@ -18,6 +18,7 @@
#include <ModemManager.h> #include <ModemManager.h>
#include <libmm-common.h> #include <libmm-common.h>
#include "mm-common-simple-properties.h"
#include "mm-bearer-list.h" #include "mm-bearer-list.h"
#include "mm-sim.h" #include "mm-sim.h"
#include "mm-iface-modem.h" #include "mm-iface-modem.h"
@@ -495,10 +496,23 @@ handle_disconnect (MmGdbusModemSimple *skeleton,
/*****************************************************************************/ /*****************************************************************************/
static gboolean static gboolean
handle_get_status (MmGdbusModemSimple *object, handle_get_status (MmGdbusModemSimple *skeleton,
GDBusMethodInvocation *invocation) 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, MM_GDBUS_TYPE_MODEM_SIMPLE_SKELETON,
G_PARAM_READWRITE)); 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; initialized = TRUE;
} }

View File

@@ -24,7 +24,8 @@
#define MM_IS_IFACE_MODEM_SIMPLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_IFACE_MODEM_SIMPLE)) #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_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; typedef struct _MMIfaceModemSimple MMIfaceModemSimple;