From 8ae5522201b128fb11a4a7366ad144a9558a5eae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Sun, 31 Oct 2021 23:44:05 +0100 Subject: [PATCH] tod-inspector: Support udev devices --- examples/tod-inspector.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/examples/tod-inspector.c b/examples/tod-inspector.c index e2012fdd..6f50dca8 100644 --- a/examples/tod-inspector.c +++ b/examples/tod-inspector.c @@ -47,6 +47,24 @@ id_table_to_string (FpDeviceType device_type, if (entry->vid) value = g_strdup_printf ("%04x:%04x", entry->vid, entry->pid); } + else if (device_type == FP_DEVICE_TYPE_UDEV) + { + if (entry->hid_id.vid) + { + g_autofree gchar *udev_flags = NULL; + + udev_flags = g_flags_to_string (fpi_device_udev_subtype_flags_get_type (), + entry->udev_types); + value = g_strdup_printf ("%s (%04x:%04x) [%s]", + entry->spi_acpi_id, + entry->hid_id.vid, entry->hid_id.pid, + udev_flags); + } + else + { + value = g_strdup (entry->spi_acpi_id); + } + } else { return g_strdup ("Unsupported device type");