FuUsbDevice

FuUsbDevice

Functions

Types and Values

Description

Functions

fu_usb_device_new ()

FuDevice *
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_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_open ()

gboolean
fu_usb_device_open (FuUsbDevice *device,
                    GError **error);

Closes a USB device, optionally running a object-specific vfunc.

Parameters

device

A FuUsbDevice

 

error

A GError, or NULL

 

Returns

TRUE for success

Since: 1.0.2


fu_usb_device_close ()

gboolean
fu_usb_device_close (FuUsbDevice *device,
                     GError **error);

fu_usb_device_probe ()

gboolean
fu_usb_device_probe (FuUsbDevice *device,
                     GError **error);

Probes a USB device, setting parameters on the object that does not need the device open or the interface claimed. If the device is not compatible then an error should be returned.

Parameters

device

A FuUsbDevice

 

error

A GError, or NULL

 

Returns

TRUE for success

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

Types and Values

FU_TYPE_USB_DEVICE

#define FU_TYPE_USB_DEVICE (fu_usb_device_get_type ())

HID_REPORT_GET

#define HID_REPORT_GET					0x01

HID_REPORT_SET

#define HID_REPORT_SET					0x09

HID_REPORT_TYPE_INPUT

#define HID_REPORT_TYPE_INPUT				0x01

HID_REPORT_TYPE_OUTPUT

#define HID_REPORT_TYPE_OUTPUT				0x02

HID_REPORT_TYPE_FEATURE

#define HID_REPORT_TYPE_FEATURE				0x03

HID_FEATURE

#define HID_FEATURE					0x0300

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;