From 0d00ee28be0e82227dd6795ab62669944fb7076f Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Thu, 4 Oct 2012 16:43:43 +0200 Subject: [PATCH] api,libmm-glib: use a 'unique-id' as ID of the firmware image, not a 'name' Also, make only the 'unique-id' mandatory. --- cli/mmcli-modem-firmware.c | 14 ++-- .../libmm-glib/libmm-glib-sections.txt | 3 +- ...eedesktop.ModemManager1.Modem.Firmware.xml | 10 +-- libmm-glib/mm-firmware-properties.c | 70 +++++-------------- libmm-glib/mm-firmware-properties.h | 6 +- libmm-glib/mm-modem-firmware.c | 18 ++--- libmm-glib/mm-modem-firmware.h | 4 +- 7 files changed, 43 insertions(+), 82 deletions(-) diff --git a/cli/mmcli-modem-firmware.c b/cli/mmcli-modem-firmware.c index 52f5c0d9..b76fc836 100644 --- a/cli/mmcli-modem-firmware.c +++ b/cli/mmcli-modem-firmware.c @@ -54,7 +54,7 @@ static GOptionEntry entries[] = { }, { "firmware-select", 0, 0, G_OPTION_ARG_STRING, &select_str, "Select a given firmware image", - "[NAME]" + "[Unique ID]" }, { NULL } }; @@ -157,17 +157,15 @@ list_process_reply (MMFirmwareProperties *selected, MMFirmwareProperties *props = MM_FIRMWARE_PROPERTIES (l->data); g_print ("\t[%u] %s%s\n" - "\t\t Type: '%s'\n" - "\t\tVersion: '%s'\n", + "\t\t Type: '%s'\n", i, - mm_firmware_properties_get_name (props), + mm_firmware_properties_get_unique_id (props), ((selected && - g_str_equal (mm_firmware_properties_get_name (props), - mm_firmware_properties_get_name (selected))) ? + g_str_equal (mm_firmware_properties_get_unique_id (props), + mm_firmware_properties_get_unique_id (selected))) ? " (CURRENT)" : ""), mm_firmware_image_type_get_string ( - mm_firmware_properties_get_image_type (props)), - mm_firmware_properties_get_version (props)); + mm_firmware_properties_get_image_type (props))); g_object_unref (props); } g_list_free (result); diff --git a/docs/reference/libmm-glib/libmm-glib-sections.txt b/docs/reference/libmm-glib/libmm-glib-sections.txt index 7fff592a..a1569cf0 100644 --- a/docs/reference/libmm-glib/libmm-glib-sections.txt +++ b/docs/reference/libmm-glib/libmm-glib-sections.txt @@ -532,8 +532,7 @@ mm_modem_firmware_get_type MMFirmwareProperties mm_firmware_properties_get_image_type -mm_firmware_properties_get_name -mm_firmware_properties_get_version +mm_firmware_properties_get_unique_id mm_firmware_properties_new mm_firmware_properties_new_from_dictionary diff --git a/introspection/org.freedesktop.ModemManager1.Modem.Firmware.xml b/introspection/org.freedesktop.ModemManager1.Modem.Firmware.xml index e46478fe..31576518 100644 --- a/introspection/org.freedesktop.ModemManager1.Modem.Firmware.xml +++ b/introspection/org.freedesktop.ModemManager1.Modem.Firmware.xml @@ -34,15 +34,15 @@ will only expose only the mandatory properties. - "name" + "unique-id" - (Required) A user-readable name for the firmware image, given as a + (Required) A user-readable unique ID for the firmware image, given as a string value (signature "s"). "version" - (Required) The version of the firmware, given as a string value + (Optional) The version of the firmware, given as a string value (signature "s"). The format is unspecified; tools attempting to upgrade firmware automatically must understand the versioning scheme used by the modem driver they are @@ -72,7 +72,7 @@ - +