[PATCH 2/2] qmicli: report which new images the firmware expects to download

Bjørn Mork bjorn at mork.no
Fri Aug 19 14:29:29 UTC 2016


Signed-off-by: Bjørn Mork <bjorn at mork.no>
---
 src/qmicli/qmicli-dms.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/src/qmicli/qmicli-dms.c b/src/qmicli/qmicli-dms.c
index 485b73400af1..5ff7dddccc9c 100644
--- a/src/qmicli/qmicli-dms.c
+++ b/src/qmicli/qmicli-dms.c
@@ -2799,6 +2799,7 @@ select_stored_image_ready (QmiClientDms *client,
 {
     QmiMessageDmsSetFirmwarePreferenceOutput *output;
     GError *error = NULL;
+    GArray *array;
 
     output = qmi_client_dms_set_firmware_preference_finish (client, res, &error);
     if (!output) {
@@ -2829,6 +2830,25 @@ select_stored_image_ready (QmiClientDms *client,
              "\n",
              qmi_device_get_path_display (ctx->device));
 
+    /* do we need to download a new modem and/or pri image? */
+    if (qmi_message_dms_set_firmware_preference_output_get_image_download_list (output, &array, &error)) {
+        guint i;
+        GString *images;
+        QmiDmsFirmwareImageType *type;
+
+        images = g_string_new ("");
+        for (i = 0; i < array->len; i++) {
+            type = &g_array_index (array, QmiDmsFirmwareImageType, i);
+            g_string_append (images, qmi_dms_firmware_image_type_get_string (*type));
+            if (i < array->len -1)
+                g_string_append (images, ", ");
+        }
+        if (array->len)
+            g_print ("\tAfter reset, the modem will wait in QDL mode for new firmware.\n"
+                     "\tImages to download: '%s'\n\n", images->str);
+        g_string_free (images, TRUE);
+    }
+
     qmi_message_dms_set_firmware_preference_output_unref (output);
     operation_shutdown (TRUE);
 }
-- 
2.9.3



More information about the libqmi-devel mailing list