FuUdevDevice: fwupd Reference Manual

## FuUdevDevice FuUdevDevice — a udev device |

## Functions

FuUdevDevice * | fu_udev_device_new ()
GUdevDevice * | fu_udev_device_get_dev ()
const gchar * | fu_udev_device_get_sysfs_path ()
const gchar * | fu_udev_device_get_subsystem ()
guint16 | fu_udev_device_get_vendor ()
guint16 | fu_udev_device_get_model ()
guint8 | fu_udev_device_get_revision ()
gboolean | fu_udev_device_set_physical_id ()

## Types and Values

#define | FU_TYPE_UDEV_DEVICE
struct | FuUdevDeviceClass
| FuUdevDevice

## Description

An object that represents a udev device.

See also: FuDevice

## Functions

### fu_udev_device_new ()

    FuUdevDevice *
    fu_udev_device_new (GUdevDevice *udev_device);

Creates a new FuUdevDevice.

#### Parameters

udev_device | A GUdevDevice |

#### Returns

a FuUdevDevice.

[transfer full]

Since: 1.1.2

### fu_udev_device_get_dev ()

    GUdevDevice *
    fu_udev_device_get_dev (FuUdevDevice *self);

Gets the GUdevDevice.

#### Parameters

self | A FuUdevDevice |

#### Returns

a GUdevDevice, or `NULL`.

[transfer none]

Since: 1.1.2

### fu_udev_device_get_sysfs_path ()

    const gchar *
    fu_udev_device_get_sysfs_path (FuUdevDevice *self);

Gets the device sysfs path, e.g. "/sys/devices/pci0000:00/0000:00:14.0".

#### Parameters

self | A GUdevDevice |

#### Returns

a local path, or NULL if unset or invalid

Since: 1.1.2

### fu_udev_device_get_subsystem ()

    const gchar *
    fu_udev_device_get_subsystem (FuUdevDevice *self);

Gets the device subsystem, e.g. "pci".

#### Parameters

self | A GUdevDevice |

#### Returns

a subsystem, or NULL if unset or invalid

Since: 1.1.2

### fu_udev_device_get_vendor ()

    guint16
    fu_udev_device_get_vendor (FuUdevDevice *self);

Gets the device vendor code.

#### Parameters

self | A GUdevDevice |

#### Returns

a vendor code, or 0 if unset or invalid

Since: 1.1.2

### fu_udev_device_get_model ()

    guint16
    fu_udev_device_get_model (FuUdevDevice *self);

Gets the device device code.

#### Parameters

self | A GUdevDevice |

#### Returns

a vendor code, or 0 if unset or invalid

Since: 1.1.2

### fu_udev_device_get_revision ()

    guint8
    fu_udev_device_get_revision (FuUdevDevice *self);

Gets the device revision.

#### Parameters

self | A GUdevDevice |

#### Returns

a vendor code, or 0 if unset or invalid

Since: 1.1.2

### fu_udev_device_set_physical_id ()

    gboolean
    fu_udev_device_set_physical_id (FuUdevDevice *self,
                                    const gchar *subsystem,
                                    GError **error);

Sets the physical ID from the device subsystem. Plugins should choose the subsystem that is "deepest" in the udev tree, for instance choosing 'usb' over 'pci' for a mouse device.

#### Parameters

self | A GUdevDevice |
subsystem | A subsystem string, e.g. `usb` |
error | A GError, or `NULL` |

#### Returns

`TRUE` if the physical device was set.

Since: 1.1.2

## Types and Values

### FU_TYPE_UDEV_DEVICE

    #define FU_TYPE_UDEV_DEVICE (fu_udev_device_get_type ())

### struct FuUdevDeviceClass

    struct FuUdevDeviceClass {
    	FuDeviceClass parent_class;
    	gboolean	 (*probe)			(FuUdevDevice *device,
    							 GError		**error);
    	gpointer __reserved[31];
    };

### FuUdevDevice

    typedef struct _FuUdevDevice FuUdevDevice;