mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-09 15:14:17 +00:00
unifying: Show the hardware version when the hardware provides this
This commit is contained in:
parent
55e6d9a74f
commit
b1af7496b1
@ -58,6 +58,7 @@ lu_device_peripheral_fetch_firmware_info (LuDevice *device, GError **error)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
entity_count = msg->data[0];
|
entity_count = msg->data[0];
|
||||||
|
g_debug ("firmware entity count is %u", entity_count);
|
||||||
|
|
||||||
/* get firmware, bootloader, hardware versions */
|
/* get firmware, bootloader, hardware versions */
|
||||||
for (guint8 i = 0; i < entity_count; i++) {
|
for (guint8 i = 0; i < entity_count; i++) {
|
||||||
@ -100,6 +101,8 @@ lu_device_peripheral_fetch_firmware_info (LuDevice *device, GError **error)
|
|||||||
self->cached_fw_entity = i;
|
self->cached_fw_entity = i;
|
||||||
} else if (msg->data[0] == 1) {
|
} else if (msg->data[0] == 1) {
|
||||||
lu_device_set_version_bl (device, version);
|
lu_device_set_version_bl (device, version);
|
||||||
|
} else if (msg->data[0] == 2) {
|
||||||
|
lu_device_set_version_hw (device, version);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@ typedef struct
|
|||||||
gchar *vendor;
|
gchar *vendor;
|
||||||
gchar *version_bl;
|
gchar *version_bl;
|
||||||
gchar *version_fw;
|
gchar *version_fw;
|
||||||
|
gchar *version_hw;
|
||||||
GPtrArray *guids;
|
GPtrArray *guids;
|
||||||
LuDeviceFlags flags;
|
LuDeviceFlags flags;
|
||||||
guint8 hidpp_id;
|
guint8 hidpp_id;
|
||||||
@ -184,6 +185,8 @@ lu_device_to_string (LuDevice *device)
|
|||||||
g_string_append_printf (str, "version-bootloader:\t%s\n", priv->version_bl);
|
g_string_append_printf (str, "version-bootloader:\t%s\n", priv->version_bl);
|
||||||
if (priv->version_fw != NULL)
|
if (priv->version_fw != NULL)
|
||||||
g_string_append_printf (str, "version-firmware:\t%s\n", priv->version_fw);
|
g_string_append_printf (str, "version-firmware:\t%s\n", priv->version_fw);
|
||||||
|
if (priv->version_hw != NULL)
|
||||||
|
g_string_append_printf (str, "version-hardware:\t%s\n", priv->version_hw);
|
||||||
for (guint i = 0; i < priv->guids->len; i++) {
|
for (guint i = 0; i < priv->guids->len; i++) {
|
||||||
const gchar *guid = g_ptr_array_index (priv->guids, i);
|
const gchar *guid = g_ptr_array_index (priv->guids, i);
|
||||||
g_string_append_printf (str, "guid:\t\t\t%s\n", guid);
|
g_string_append_printf (str, "guid:\t\t\t%s\n", guid);
|
||||||
@ -819,6 +822,21 @@ lu_device_set_version_fw (LuDevice *device, const gchar *version_fw)
|
|||||||
priv->version_fw = g_strdup (version_fw);
|
priv->version_fw = g_strdup (version_fw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const gchar *
|
||||||
|
lu_device_get_version_hw (LuDevice *device)
|
||||||
|
{
|
||||||
|
LuDevicePrivate *priv = GET_PRIVATE (device);
|
||||||
|
return priv->version_hw;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
lu_device_set_version_hw (LuDevice *device, const gchar *version_hw)
|
||||||
|
{
|
||||||
|
LuDevicePrivate *priv = GET_PRIVATE (device);
|
||||||
|
g_free (priv->version_hw);
|
||||||
|
priv->version_hw = g_strdup (version_hw);
|
||||||
|
}
|
||||||
|
|
||||||
GPtrArray *
|
GPtrArray *
|
||||||
lu_device_get_guids (LuDevice *device)
|
lu_device_get_guids (LuDevice *device)
|
||||||
{
|
{
|
||||||
@ -1293,6 +1311,7 @@ lu_device_finalize (GObject *object)
|
|||||||
g_free (priv->product);
|
g_free (priv->product);
|
||||||
g_free (priv->vendor);
|
g_free (priv->vendor);
|
||||||
g_free (priv->version_fw);
|
g_free (priv->version_fw);
|
||||||
|
g_free (priv->version_hw);
|
||||||
g_free (priv->version_bl);
|
g_free (priv->version_bl);
|
||||||
|
|
||||||
G_OBJECT_CLASS (lu_device_parent_class)->finalize (object);
|
G_OBJECT_CLASS (lu_device_parent_class)->finalize (object);
|
||||||
|
@ -152,6 +152,9 @@ void lu_device_set_version_bl (LuDevice *device,
|
|||||||
const gchar *lu_device_get_version_fw (LuDevice *device);
|
const gchar *lu_device_get_version_fw (LuDevice *device);
|
||||||
void lu_device_set_version_fw (LuDevice *device,
|
void lu_device_set_version_fw (LuDevice *device,
|
||||||
const gchar *version_fw);
|
const gchar *version_fw);
|
||||||
|
const gchar *lu_device_get_version_hw (LuDevice *device);
|
||||||
|
void lu_device_set_version_hw (LuDevice *device,
|
||||||
|
const gchar *version_hw);
|
||||||
GPtrArray *lu_device_get_guids (LuDevice *device);
|
GPtrArray *lu_device_get_guids (LuDevice *device);
|
||||||
void lu_device_add_guid (LuDevice *device,
|
void lu_device_add_guid (LuDevice *device,
|
||||||
const gchar *guid);
|
const gchar *guid);
|
||||||
|
Loading…
Reference in New Issue
Block a user