broadband-modem-mbim: implement device identifier loading
This commit is contained in:
@@ -221,6 +221,46 @@ modem_load_equipment_identifier (MMIfaceModem *self,
|
||||
g_object_unref (result);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Device identifier loading (Modem interface) */
|
||||
|
||||
static gchar *
|
||||
modem_load_device_identifier_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
gchar *device_identifier;
|
||||
|
||||
if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error))
|
||||
return NULL;
|
||||
|
||||
device_identifier = g_strdup (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)));
|
||||
return device_identifier;
|
||||
}
|
||||
|
||||
static void
|
||||
modem_load_device_identifier (MMIfaceModem *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
GSimpleAsyncResult *result;
|
||||
gchar *device_identifier;
|
||||
|
||||
result = g_simple_async_result_new (G_OBJECT (self),
|
||||
callback,
|
||||
user_data,
|
||||
modem_load_device_identifier);
|
||||
|
||||
/* Just use dummy ATI/ATI1 replies, all the other internal info should be
|
||||
* enough for uniqueness */
|
||||
device_identifier = mm_broadband_modem_create_device_identifier (MM_BROADBAND_MODEM (self), "", "");
|
||||
g_simple_async_result_set_op_res_gpointer (result,
|
||||
device_identifier,
|
||||
(GDestroyNotify)g_free);
|
||||
g_simple_async_result_complete_in_idle (result);
|
||||
g_object_unref (result);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Create Bearer (Modem interface) */
|
||||
|
||||
@@ -516,6 +556,8 @@ iface_modem_init (MMIfaceModem *iface)
|
||||
iface->load_revision_finish = modem_load_revision_finish;
|
||||
iface->load_equipment_identifier = modem_load_equipment_identifier;
|
||||
iface->load_equipment_identifier_finish = modem_load_equipment_identifier_finish;
|
||||
iface->load_device_identifier = modem_load_device_identifier;
|
||||
iface->load_device_identifier_finish = modem_load_device_identifier_finish;
|
||||
|
||||
/* Create MBIM-specific SIM */
|
||||
iface->create_sim = create_sim;
|
||||
|
Reference in New Issue
Block a user