diff options
Diffstat (limited to 'src/devices/wwan/nm-device-modem.c')
-rw-r--r-- | src/devices/wwan/nm-device-modem.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/devices/wwan/nm-device-modem.c b/src/devices/wwan/nm-device-modem.c index ec7cabea9b..df7d1446d7 100644 --- a/src/devices/wwan/nm-device-modem.c +++ b/src/devices/wwan/nm-device-modem.c @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2009 - 2011 Red Hat, Inc. + * Copyright (C) 2009 - 2019 Red Hat, Inc. */ #include "nm-default.h" @@ -40,6 +40,7 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE ( PROP_MODEM, PROP_CAPABILITIES, PROP_CURRENT_CAPABILITIES, + PROP_DEVICE_ID, ); typedef struct { @@ -47,6 +48,7 @@ typedef struct { NMDeviceModemCapabilities caps; NMDeviceModemCapabilities current_caps; gboolean rf_enabled; + char *device_id; } NMDeviceModemPrivate; struct _NMDeviceModem { @@ -722,6 +724,9 @@ get_property (GObject *object, guint prop_id, case PROP_CURRENT_CAPABILITIES: g_value_set_uint (value, priv->current_caps); break; + case PROP_DEVICE_ID: + g_value_set_string (value, priv->device_id); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -745,6 +750,10 @@ set_property (GObject *object, guint prop_id, case PROP_CURRENT_CAPABILITIES: priv->current_caps = g_value_get_uint (value); break; + case PROP_DEVICE_ID: + /* construct-only */ + priv->device_id = g_value_dup_string (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -779,6 +788,7 @@ nm_device_modem_new (NMModem *modem) NM_DEVICE_MODEM_MODEM, modem, NM_DEVICE_MODEM_CAPABILITIES, caps, NM_DEVICE_MODEM_CURRENT_CAPABILITIES, current_caps, + NM_DEVICE_MODEM_DEVICE_ID, nm_modem_get_device_id (modem), NULL); } @@ -792,6 +802,8 @@ dispose (GObject *object) g_clear_object (&priv->modem); } + g_clear_pointer (&priv->device_id, g_free); + G_OBJECT_CLASS (nm_device_modem_parent_class)->dispose (object); } @@ -804,6 +816,7 @@ static const NMDBusInterfaceInfoExtended interface_info_device_modem = { .properties = NM_DEFINE_GDBUS_PROPERTY_INFOS ( NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE_L ("ModemCapabilities", "u", NM_DEVICE_MODEM_CAPABILITIES), NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE_L ("CurrentCapabilities", "u", NM_DEVICE_MODEM_CURRENT_CAPABILITIES), + NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE ("DeviceId", "s", NM_DEVICE_MODEM_DEVICE_ID), ), ), .legacy_property_changed = TRUE, @@ -861,5 +874,11 @@ nm_device_modem_class_init (NMDeviceModemClass *klass) G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); + obj_properties[PROP_DEVICE_ID] = + g_param_spec_string (NM_DEVICE_MODEM_DEVICE_ID, "", "", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS); + g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties); } |