diff options
-rw-r--r-- | data/qmi-service-dms.json | 8 | ||||
-rw-r--r-- | docs/reference/libqmi-glib/libqmi-glib-docs.xml | 1 | ||||
-rw-r--r-- | src/qmicli/qmicli-dms.c | 48 |
3 files changed, 57 insertions, 0 deletions
diff --git a/data/qmi-service-dms.json b/data/qmi-service-dms.json index c04582b..cebf621 100644 --- a/data/qmi-service-dms.json +++ b/data/qmi-service-dms.json @@ -765,6 +765,14 @@ "prerequisites": [ { "common-ref" : "Success" } ] } ] }, // ********************************************************************************* + { "name" : "Set Firmware ID", + "type" : "Message", + "service" : "DMS", + "id" : "0x003E", + "version" : "1.1", + "output" : [ { "common-ref" : "Operation Result" } ] }, + + // ********************************************************************************* { "name" : "UIM Get CK Status", "type" : "Message", "service" : "DMS", diff --git a/docs/reference/libqmi-glib/libqmi-glib-docs.xml b/docs/reference/libqmi-glib/libqmi-glib-docs.xml index 71d4372..4958114 100644 --- a/docs/reference/libqmi-glib/libqmi-glib-docs.xml +++ b/docs/reference/libqmi-glib/libqmi-glib-docs.xml @@ -94,6 +94,7 @@ <xi:include href="xml/qmi-message-dms-restore-factory-defaults.xml"/> <xi:include href="xml/qmi-message-dms-validate-service-programming-code.xml"/> <xi:include href="xml/qmi-message-dms-uim-get-iccid.xml"/> + <xi:include href="xml/qmi-message-dms-set-firmware-id.xml"/> <xi:include href="xml/qmi-message-dms-uim-get-ck-status.xml"/> <xi:include href="xml/qmi-message-dms-uim-set-ck-protection.xml"/> <xi:include href="xml/qmi-message-dms-uim-unblock-ck.xml"/> diff --git a/src/qmicli/qmicli-dms.c b/src/qmicli/qmicli-dms.c index 27c4614..0f994ec 100644 --- a/src/qmicli/qmicli-dms.c +++ b/src/qmicli/qmicli-dms.c @@ -76,6 +76,7 @@ static gchar *write_user_data_str; static gboolean read_eri_file_flag; static gchar *restore_factory_defaults_str; static gchar *validate_service_programming_code_str; +static gboolean set_firmware_id_flag; static gboolean get_band_capabilities_flag; static gboolean get_factory_sku_flag; static gboolean list_stored_images_flag; @@ -229,6 +230,10 @@ static GOptionEntry entries[] = { "Validate the Service Programming Code", "[(Service Programming Code)]", }, + { "dms-set-firmware-id", 0, 0, G_OPTION_ARG_NONE, &set_firmware_id_flag, + "Set firmware id", + NULL + }, { "dms-get-band-capabilities", 0, 0, G_OPTION_ARG_NONE, &get_band_capabilities_flag, "Get band capabilities", NULL @@ -350,6 +355,7 @@ qmicli_dms_options_enabled (void) read_eri_file_flag + !!restore_factory_defaults_str + !!validate_service_programming_code_str + + set_firmware_id_flag + get_band_capabilities_flag + get_factory_sku_flag + list_stored_images_flag + @@ -2316,6 +2322,36 @@ validate_service_programming_code_ready (QmiClientDms *client, } static void +set_firmware_id_ready (QmiClientDms *client, + GAsyncResult *res) +{ + QmiMessageDmsSetFirmwareIdOutput *output; + GError *error = NULL; + + output = qmi_client_dms_set_firmware_id_finish (client, res, &error); + if (!output) { + g_printerr ("error: operation failed: %s\n", error->message); + g_error_free (error); + operation_shutdown (FALSE); + return; + } + + if (!qmi_message_dms_set_firmware_id_output_get_result (output, &error)) { + g_printerr ("error: couldn't set firmware id: %s\n", error->message); + g_error_free (error); + qmi_message_dms_set_firmware_id_output_unref (output); + operation_shutdown (FALSE); + return; + } + + g_print ("[%s] Firmware id set\n", + qmi_device_get_path_display (ctx->device)); + + qmi_message_dms_set_firmware_id_output_unref (output); + operation_shutdown (TRUE); +} + +static void get_band_capabilities_ready (QmiClientDms *client, GAsyncResult *res) { @@ -3904,6 +3940,18 @@ qmicli_dms_run (QmiDevice *device, return; } + /* Set firmware id? */ + if (set_firmware_id_flag) { + g_debug ("Asynchronously setting firmware id..."); + qmi_client_dms_set_firmware_id (ctx->client, + NULL, + 10, + ctx->cancellable, + (GAsyncReadyCallback)set_firmware_id_ready, + NULL); + return; + } + /* Request to get CK status? */ if (uim_get_ck_status_str) { QmiMessageDmsUimGetCkStatusInput *input; |