aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-07-13 12:38:56 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-08-29 17:26:40 +0200
commitb4dedcf944e6483563666b81aa803176f7a2a392 (patch)
tree892ebf41bdff96a5c5355080ccdb9fa755834093 /src
parent12fb2312bb9899e0c8167103266dac5efe3efe77 (diff)
broadband-modem-qmi: load device ID using QMI
Diffstat (limited to 'src')
-rw-r--r--src/mm-broadband-modem-qmi.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/mm-broadband-modem-qmi.c b/src/mm-broadband-modem-qmi.c
index 63d210b6..e34b1a23 100644
--- a/src/mm-broadband-modem-qmi.c
+++ b/src/mm-broadband-modem-qmi.c
@@ -509,6 +509,48 @@ modem_load_equipment_identifier (MMIfaceModem *self,
}
/*****************************************************************************/
+/* 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)));
+ mm_dbg ("loaded device identifier: %s", device_identifier);
+ return device_identifier;
+}
+
+static void
+modem_load_device_identifier (MMIfaceModem *self,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ GSimpleAsyncResult *result;
+ gchar *device_identifier;
+
+ mm_dbg ("loading 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);
+}
+
+/*****************************************************************************/
/* First initialization step */
typedef struct {
@@ -713,6 +755,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;
}
static void