Method

FwupdPluginDevicebuild_instance_id

Declaration [src]

gboolean
fu_device_build_instance_id (
  FuDevice* self,
  GError** error,
  const gchar* subsystem,
  ...
)

Description [src]

Creates an instance ID from a prefix and some 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); if (!fu_device_build_instance_id(dev, &error, “NVME”, “VID”, “PID”, NULL)) g_warning(“failed to add ID: %s”, error->message);

Available since:1.7.7

Parameters

error GError**
 

Optional return location for an error.

 The argument can be NULL.
 The data is owned by the caller of the function.
subsystem const gchar*
 

Subsystem, e.g. NVME

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

Pairs of string key values, ending with NULL.

Return value

Returns: gboolean
 

TRUE if the instance ID was added.