2008-03-25 Dan Williams <dcbw@redhat.com>

* introspection/nm-device-cdma.xml
	  introspection/nm-device-gsm.xml
	  introspection/Makefile.am
	  introspection/all.xml
		- Add introspection for CDMA and GSM devices for PropertiesChanged signal

	* src/nm-gsm-device.h
	  src/nm-gsm-device.c
	  src/nm-cdma-device.h
	  src/nm-cdma-device.c
	  src/Makefile.am
		- Implement PropertiesChanged signals

	* libnm-glib/nm-cdma-device.c
	  libnm-glib/nm-cdma-device.c
		- Attach to PropertiesChanged signals



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3499 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams 2008-03-25 11:31:33 +00:00
parent a95ec1b046
commit d60eb8d3ba
10 changed files with 117 additions and 15 deletions

View file

@ -2,6 +2,8 @@ EXTRA_DIST = \
nm-access-point.xml \
nm-device-802-11-wireless.xml \
nm-device-802-3-ethernet.xml \
nm-device-cdma.xml \
nm-device-gsm.xml \
nm-device.xml \
nm-ip4-config.xml \
nm-manager.xml \

View file

@ -30,6 +30,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.</
<xi:include href="nm-device.xml"/>
<xi:include href="nm-device-802-3-ethernet.xml"/>
<xi:include href="nm-device-802-11-wireless.xml"/>
<xi:include href="nm-cdma-device.xml"/>
<xi:include href="nm-gsm-device.xml"/>
<xi:include href="nm-ip4-config.xml"/>
<xi:include href="nm-settings.xml"/>
<xi:include href="nm-exported-connection.xml"/>

View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
<interface name="org.freedesktop.NetworkManager.Device.Cdma">
<signal name="PropertiesChanged">
<arg name="properties" type="a{sv}" tp:type="String_Variant_Map">
<tp:docstring>
A dictionary mapping property names to variant boxed values
</tp:docstring>
</arg>
</signal>
</interface>
</node>

View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
<interface name="org.freedesktop.NetworkManager.Device.Gsm">
<signal name="PropertiesChanged">
<arg name="properties" type="a{sv}" tp:type="String_Variant_Map">
<tp:docstring>
A dictionary mapping property names to variant boxed values
</tp:docstring>
</arg>
</signal>
</interface>
</node>

View file

@ -1,6 +1,8 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
#include "nm-cdma-device.h"
#include "nm-device-private.h"
#include "nm-object-private.h"
G_DEFINE_TYPE (NMCdmaDevice, nm_cdma_device, NM_TYPE_DEVICE)
@ -17,6 +19,19 @@ nm_cdma_device_init (NMCdmaDevice *device)
{
}
static void
register_for_property_changed (NMCdmaDevice *device)
{
NMCdmaDevicePrivate *priv = NM_CDMA_DEVICE_GET_PRIVATE (device);
const NMPropertiesChangedInfo property_changed_info[] = {
{ NULL },
};
nm_object_handle_properties_changed (NM_OBJECT (device),
priv->proxy,
property_changed_info);
}
static GObject*
constructor (GType type,
guint n_construct_params,
@ -37,6 +52,9 @@ constructor (GType type,
NM_DBUS_SERVICE,
nm_object_get_path (NM_OBJECT (object)),
NM_DBUS_INTERFACE_CDMA_DEVICE);
register_for_property_changed (NM_CDMA_DEVICE (object));
return object;
}

View file

@ -83,6 +83,12 @@ nm-device-802-3-ethernet-glue.h: $(top_srcdir)/introspection/nm-device-802-3-eth
nm-device-802-11-wireless-glue.h: $(top_srcdir)/introspection/nm-device-802-11-wireless.xml
dbus-binding-tool --prefix=nm_device_802_11_wireless --mode=glib-server --output=nm-device-802-11-wireless-glue.h $(top_srcdir)/introspection/nm-device-802-11-wireless.xml
nm-cdma-device-glue.h: $(top_srcdir)/introspection/nm-device-cdma.xml
dbus-binding-tool --prefix=nm_cdma_device --mode=glib-server --output=nm-cdma-device-glue.h $(top_srcdir)/introspection/nm-device-cdma.xml
nm-gsm-device-glue.h: $(top_srcdir)/introspection/nm-device-gsm.xml
dbus-binding-tool --prefix=nm_gsm_device --mode=glib-server --output=nm-gsm-device-glue.h $(top_srcdir)/introspection/nm-device-gsm.xml
nm-ip4-config-glue.h: $(top_srcdir)/introspection/nm-ip4-config.xml
dbus-binding-tool --prefix=nm_ip4_config --mode=glib-server --output=nm-ip4-config-glue.h $(top_srcdir)/introspection/nm-ip4-config.xml
@ -95,6 +101,8 @@ built_sources = \
nm-device-interface-glue.h \
nm-device-802-3-ethernet-glue.h \
nm-device-802-11-wireless-glue.h \
nm-cdma-device-glue.h \
nm-gsm-device-glue.h \
nm-ip4-config-glue.h \
nm-active-connection-glue.h \
$(NULL)

View file

@ -7,16 +7,11 @@
#include "nm-device-private.h"
#include "nm-setting-cdma.h"
#include "nm-utils.h"
#include "nm-properties-changed-signal.h"
#include "nm-cdma-device-glue.h"
G_DEFINE_TYPE (NMCdmaDevice, nm_cdma_device, NM_TYPE_SERIAL_DEVICE)
enum {
PROP_0,
PROP_MONITOR_IFACE,
LAST_PROP
};
#define NM_CDMA_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_CDMA_DEVICE, NMCdmaDevicePrivate))
typedef struct {
@ -26,6 +21,22 @@ typedef struct {
guint pending_id;
} NMCdmaDevicePrivate;
enum {
PROP_0,
PROP_MONITOR_IFACE,
LAST_PROP
};
enum {
PROPERTIES_CHANGED,
LAST_SIGNAL
};
static guint signals[LAST_SIGNAL] = { 0 };
NMCdmaDevice *
nm_cdma_device_new (const char *udi,
const char *data_iface,
@ -417,4 +428,12 @@ nm_cdma_device_class_init (NMCdmaDeviceClass *klass)
"Monitoring interface",
NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
/* Signals */
signals[PROPERTIES_CHANGED] =
nm_properties_changed_signal_new (object_class,
G_STRUCT_OFFSET (NMCdmaDeviceClass, properties_changed));
dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass),
&dbus_glib_nm_cdma_device_object_info);
}

View file

@ -22,6 +22,9 @@ typedef struct {
typedef struct {
NMSerialDeviceClass parent;
/* Signals */
void (*properties_changed) (NMCdmaDevice *device, GHashTable *properties);
} NMCdmaDeviceClass;
GType nm_cdma_device_get_type (void);

View file

@ -7,15 +7,12 @@
#include "nm-device-private.h"
#include "nm-setting-gsm.h"
#include "nm-utils.h"
#include "nm-properties-changed-signal.h"
#include "nm-gsm-device-glue.h"
G_DEFINE_TYPE (NMGsmDevice, nm_gsm_device, NM_TYPE_SERIAL_DEVICE)
enum {
PROP_0,
PROP_MONITOR_IFACE,
LAST_PROP
};
#define NM_GSM_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_GSM_DEVICE, NMGsmDevicePrivate))
typedef enum {
NM_GSM_SECRET_NONE = 0,
@ -23,8 +20,6 @@ typedef enum {
NM_GSM_SECRET_PUK
} NMGsmSecret;
#define NM_GSM_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_GSM_DEVICE, NMGsmDevicePrivate))
typedef struct {
char *monitor_iface;
NMSerialDevice *monitor_device;
@ -33,6 +28,20 @@ typedef struct {
guint pending_id;
} NMGsmDevicePrivate;
enum {
PROP_0,
PROP_MONITOR_IFACE,
LAST_PROP
};
enum {
PROPERTIES_CHANGED,
LAST_SIGNAL
};
static guint signals[LAST_SIGNAL] = { 0 };
static void enter_pin (NMSerialDevice *device, gboolean retry);
static void automatic_registration (NMSerialDevice *device);
@ -725,4 +734,12 @@ nm_gsm_device_class_init (NMGsmDeviceClass *klass)
"Monitoring interface",
NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
/* Signals */
signals[PROPERTIES_CHANGED] =
nm_properties_changed_signal_new (object_class,
G_STRUCT_OFFSET (NMGsmDeviceClass, properties_changed));
dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass),
&dbus_glib_nm_gsm_device_object_info);
}

View file

@ -22,6 +22,9 @@ typedef struct {
typedef struct {
NMSerialDeviceClass parent;
/* Signals */
void (*properties_changed) (NMGsmDevice *device, GHashTable *properties);
} NMGsmDeviceClass;
GType nm_gsm_device_get_type (void);