diff options
author | Dan Williams <dcbw@redhat.com> | 2013-11-26 09:39:26 -0600 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2014-01-23 17:34:12 -0600 |
commit | 3964d06b648908e9887bc5e00e58db59e167cfb8 (patch) | |
tree | 55964c39400532095adbabaf3daf77bc3e1e490a | |
parent | 69fc0d7c87e2284f1c90f3d41fffe9e91349e6be (diff) | |
download | NetworkManager-3964d06b648908e9887bc5e00e58db59e167cfb8.tar.gz |
api/wimax: add Nsps (Network Service Providers) property
Helps out bindings.
-rw-r--r-- | introspection/nm-device-wimax.xml | 7 | ||||
-rw-r--r-- | src/devices/wimax/nm-device-wimax.c | 20 | ||||
-rw-r--r-- | src/devices/wimax/nm-device-wimax.h | 1 |
3 files changed, 28 insertions, 0 deletions
diff --git a/introspection/nm-device-wimax.xml b/introspection/nm-device-wimax.xml index 6e414087fa..b48ffe94ed 100644 --- a/introspection/nm-device-wimax.xml +++ b/introspection/nm-device-wimax.xml @@ -14,6 +14,13 @@ </tp:docstring> </method> + <property name="Nsps" type="ao" access="read"> + <tp:docstring> + List of object paths of Network Service Providers (NSPs) visible to this + WiMAX device. + </tp:docstring> + </property> + <property name="HwAddress" type="s" access="read"> <tp:docstring> Hardware address of the device. diff --git a/src/devices/wimax/nm-device-wimax.c b/src/devices/wimax/nm-device-wimax.c index 6d0eed92e9..995d3cf01b 100644 --- a/src/devices/wimax/nm-device-wimax.c +++ b/src/devices/wimax/nm-device-wimax.c @@ -44,6 +44,7 @@ #include "nm-rfkill-manager.h" #include "iwmxsdk.h" #include "nm-enum-types.h" +#include "nm-dbus-glib-types.h" static gboolean impl_device_get_nsp_list (NMDeviceWimax *device, GPtrArray **list, GError **error); @@ -53,6 +54,7 @@ G_DEFINE_TYPE (NMDeviceWimax, nm_device_wimax, NM_TYPE_DEVICE) enum { PROP_0, + PROP_NSPS, PROP_ACTIVE_NSP, PROP_CENTER_FREQ, PROP_RSSI, @@ -231,6 +233,7 @@ remove_all_nsps (NMDeviceWimax *self) priv->nsp_list = g_slist_remove (priv->nsp_list, nsp); g_signal_emit (self, signals[NSP_REMOVED], 0, nsp); + g_object_notify (G_OBJECT (self), NM_DEVICE_WIMAX_NSPS); g_object_unref (nsp); } @@ -1023,6 +1026,7 @@ wmx_scan_result_cb (struct wmxsdk *wmxsdk, priv->nsp_list = g_slist_append (priv->nsp_list, nsp); nm_wimax_nsp_export_to_dbus (nsp); g_signal_emit (self, signals[NSP_ADDED], 0, nsp); + g_object_notify (G_OBJECT (self), NM_DEVICE_WIMAX_NSPS); nm_device_recheck_available_connections (NM_DEVICE (self)); } } @@ -1313,8 +1317,16 @@ get_property (GObject *object, guint prop_id, { NMDeviceWimax *self = NM_DEVICE_WIMAX (object); NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (self); + GPtrArray *array; + GSList *iter; switch (prop_id) { + case PROP_NSPS: + array = g_ptr_array_sized_new (4); + for (iter = priv->nsp_list; iter; iter = g_slist_next (iter)) + g_ptr_array_add (array, g_strdup (nm_wimax_nsp_get_dbus_path (NM_WIMAX_NSP (iter->data)))); + g_value_take_boxed (value, array); + break; case PROP_ACTIVE_NSP: if (priv->current_nsp) g_value_set_boxed (value, nm_wimax_nsp_get_dbus_path (priv->current_nsp)); @@ -1404,6 +1416,14 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *klass) device_class->state_changed = device_state_changed; /* Properties */ + g_object_class_install_property + (object_class, PROP_NSPS, + g_param_spec_boxed (NM_DEVICE_WIMAX_NSPS, + "Network access points", + "Network access points", + DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH, + G_PARAM_READABLE)); + g_object_class_install_property (object_class, PROP_ACTIVE_NSP, g_param_spec_boxed (NM_DEVICE_WIMAX_ACTIVE_NSP, "Active NSP", diff --git a/src/devices/wimax/nm-device-wimax.h b/src/devices/wimax/nm-device-wimax.h index 1baf5b2e9b..938c8d06c9 100644 --- a/src/devices/wimax/nm-device-wimax.h +++ b/src/devices/wimax/nm-device-wimax.h @@ -43,6 +43,7 @@ typedef enum NM_WIMAX_ERROR_NSP_NOT_FOUND, /*< nick=NspNotFound >*/ } NMWimaxError; +#define NM_DEVICE_WIMAX_NSPS "nsps" #define NM_DEVICE_WIMAX_ACTIVE_NSP "active-nsp" #define NM_DEVICE_WIMAX_CENTER_FREQUENCY "center-frequency" #define NM_DEVICE_WIMAX_RSSI "rssi" |