Method

FwupdPluginDevicebuild_instance_id_strv

Declaration [src]

gboolean
fu_device_build_instance_id_strv (
  FuDevice* self,
  const gchar* subsystem,
  gchar** keys,
  GError** error
)

Description [src]

Creates an instance ID from a prefix and an array of key values. If the key value cannot be found, the parent and then proxy is also queried.

If any of the key values remain unset then no instance ID is added.

fu_device_add_instance_str(dev, “VID”, “1234”); fu_device_add_instance_u16(dev, “PID”, 5678); const gchar *keys[] = {“VID”, “PID”, NULL}; if (!fu_device_build_instance_id_strv(dev, “NVME”, keys, &error)) g_warning(“failed to add ID: %s”, error->message);

Available since:2.0.14

Parameters

subsystem const gchar*
 

Subsystem, e.g. NVME

 The data is owned by the caller of the function.
 The value is a NUL terminated UTF-8 string.
keys gchar**
 

NULL terminated array of string keys.

 The argument can be NULL.
 The data is owned by the caller of the function.
 The value is a NUL terminated UTF-8 string.
error GError **
  The return location for a GError*, or NULL.

Return value

Returns: gboolean
 

TRUE if the instance ID was added.