broadband-modem: let subclasses create their own device IDs

This commit is contained in:
Aleksander Morgado
2012-08-29 17:26:40 +02:00
parent 81fe9f84ec
commit 12fb2312bb
2 changed files with 30 additions and 14 deletions
+24 -14
View File
@@ -695,20 +695,10 @@ modem_load_device_identifier_finish (MMIfaceModem *self,
}
g_assert (ctx != NULL);
device_identifier = mm_create_device_identifier (
mm_base_modem_get_vendor_id (MM_BASE_MODEM (self)),
mm_base_modem_get_product_id (MM_BASE_MODEM (self)),
((DeviceIdentifierContext *)ctx)->ati,
((DeviceIdentifierContext *)ctx)->ati1,
mm_gdbus_modem_get_equipment_identifier (
MM_GDBUS_MODEM (MM_BROADBAND_MODEM (self)->priv->modem_dbus_skeleton)),
mm_gdbus_modem_get_revision (
MM_GDBUS_MODEM (MM_BROADBAND_MODEM (self)->priv->modem_dbus_skeleton)),
mm_gdbus_modem_get_model (
MM_GDBUS_MODEM (MM_BROADBAND_MODEM (self)->priv->modem_dbus_skeleton)),
mm_gdbus_modem_get_manufacturer (
MM_GDBUS_MODEM (MM_BROADBAND_MODEM (self)->priv->modem_dbus_skeleton)));
device_identifier = (mm_broadband_modem_create_device_identifier (
MM_BROADBAND_MODEM (self),
((DeviceIdentifierContext *)ctx)->ati,
((DeviceIdentifierContext *)ctx)->ati1));
mm_dbg ("loaded device identifier: %s", device_identifier);
return device_identifier;
}
@@ -7627,6 +7617,26 @@ mm_broadband_modem_take_and_convert_to_current_charset (MMBroadbandModem *self,
return mm_utf8_take_and_convert_to_charset (str, self->priv->modem_current_charset);
}
gchar *
mm_broadband_modem_create_device_identifier (MMBroadbandModem *self,
const gchar *ati,
const gchar *ati1)
{
return (mm_create_device_identifier (
mm_base_modem_get_vendor_id (MM_BASE_MODEM (self)),
mm_base_modem_get_product_id (MM_BASE_MODEM (self)),
ati,
ati1,
mm_gdbus_modem_get_equipment_identifier (
MM_GDBUS_MODEM (MM_BROADBAND_MODEM (self)->priv->modem_dbus_skeleton)),
mm_gdbus_modem_get_revision (
MM_GDBUS_MODEM (MM_BROADBAND_MODEM (self)->priv->modem_dbus_skeleton)),
mm_gdbus_modem_get_model (
MM_GDBUS_MODEM (MM_BROADBAND_MODEM (self)->priv->modem_dbus_skeleton)),
mm_gdbus_modem_get_manufacturer (
MM_GDBUS_MODEM (MM_BROADBAND_MODEM (self)->priv->modem_dbus_skeleton))));
}
/*****************************************************************************/
MMBroadbandModem *
+6
View File
@@ -92,4 +92,10 @@ gchar *mm_broadband_modem_take_and_convert_to_utf8 (MMBroadbandModem *self,
gchar *mm_broadband_modem_take_and_convert_to_current_charset (MMBroadbandModem *self,
gchar *str);
/* Create a unique device identifier string using the ATI and ATI1 replies and some
* additional internal info */
gchar *mm_broadband_modem_create_device_identifier (MMBroadbandModem *self,
const gchar *ati,
const gchar *ati1);
#endif /* MM_BROADBAND_MODEM_H */