FuUsbDevice

FuUsbDevice — a USB device

Functions

Types and Values

Description

An object that represents a USB device.

See also: FuDevice

Functions

G_USB_CHECK_VERSION()

#define G_USB_CHECK_VERSION(a,c,b) 0

fu_usb_device_new ()

FuUsbDevice *
fu_usb_device_new (GUsbDevice *usb_device);

Creates a new FuUsbDevice.

Parameters

usb_device

A GUsbDevice

 

Returns

a FuUsbDevice.

[transfer full]

Since: 1.0.2


fu_usb_device_get_vid ()

guint16
fu_usb_device_get_vid (FuUsbDevice *self);

Gets the device vendor code.

Parameters

self

A FuUsbDevice

 

Returns

integer, or 0x0 if unset or invalid

Since: 1.1.2


fu_usb_device_get_pid ()

guint16
fu_usb_device_get_pid (FuUsbDevice *self);

Gets the device product code.

Parameters

self

A FuUsbDevice

 

Returns

integer, or 0x0 if unset or invalid

Since: 1.1.2


fu_usb_device_get_spec ()

guint16
fu_usb_device_get_spec (FuUsbDevice *self);

Gets the string USB revision for the device.

Parameters

self

A FuUsbDevice

 

Returns

a specification revision in BCD format, or 0x0 if not supported

Since: 1.3.4


fu_usb_device_get_dev ()

GUsbDevice *
fu_usb_device_get_dev (FuUsbDevice *device);

Gets the GUsbDevice.

Parameters

device

A FuUsbDevice

 

Returns

a GUsbDevice, or NULL.

[transfer none]

Since: 1.0.2


fu_usb_device_set_dev ()

void
fu_usb_device_set_dev (FuUsbDevice *device,
                       GUsbDevice *usb_device);

Sets the GUsbDevice to use.

Parameters

device

A FuUsbDevice

 

usb_device

A GUsbDevice, or NULL

 

Since: 1.0.2


fu_usb_device_is_open ()

gboolean
fu_usb_device_is_open (FuUsbDevice *device);

Finds out if a USB device is currently open.

Parameters

device

A FuUsbDevice

 

Returns

TRUE if the device is open.

Since: 1.0.3


fu_usb_device_find_udev_device ()

GUdevDevice *
fu_usb_device_find_udev_device (FuUsbDevice *device,
                                GError **error);

Gets the matching GUdevDevice for the GUsbDevice.

Parameters

device

A FuUsbDevice

 

error

A GError, or NULL

 

Returns

a GUdevDevice, or NULL if unset or invalid.

[transfer full]

Since: 1.3.2

Types and Values

GUsbContext

typedef GObject GUsbContext;

GUsbDevice

typedef GObject GUsbDevice;

FU_TYPE_USB_DEVICE

#define FU_TYPE_USB_DEVICE (fu_usb_device_get_type ())

struct FuUsbDeviceClass

struct FuUsbDeviceClass {
	FuDeviceClass parent_class;
	gboolean	 (*open)		(FuUsbDevice		*device,
						 GError			**error);
	gboolean	 (*close)		(FuUsbDevice		*device,
						 GError			**error);
	gboolean	 (*probe)		(FuUsbDevice		*device,
						 GError			**error);
	gpointer __reserved[28];
};

FuUsbDevice

typedef struct _FuUsbDevice FuUsbDevice;