Top | ![]() |
![]() |
![]() |
![]() |
#define | DFU_TYPE_DEVICE |
enum | DfuDeviceOpenFlags |
enum | DfuDeviceQuirks |
enum | DfuDeviceAttributes |
struct | DfuDeviceClass |
DfuDevice |
This object allows two things:
Downloading from the host to the device, optionally with verification using a DFU or DfuSe firmware file.
Uploading from the device to the host to a DFU or DfuSe firmware file. The file format is chosen automatically, with DfuSe being chosen if the device contains more than one target.
See also: DfuTarget, DfuFirmware
DfuDevice *
dfu_device_new (GUsbDevice *dev
);
Creates a new DFU device object.
Since: 0.5.4
gboolean dfu_device_open (DfuDevice *device
,DfuDeviceOpenFlags flags
,GCancellable *cancellable
,GError **error
);
Opens a DFU-capable device.
Since: 0.5.4
gboolean dfu_device_close (DfuDevice *device
,GError **error
);
Closes a DFU device.
Since: 0.5.4
const gchar *
dfu_device_get_platform_id (DfuDevice *device
);
Gets the platform ID which normally corresponds to the port in some way.
Since: 0.5.4
GPtrArray *
dfu_device_get_targets (DfuDevice *device
);
Gets all the targets for this device.
Since: 0.5.4
DfuTarget * dfu_device_get_target_by_alt_setting (DfuDevice *device
,guint8 alt_setting
,GError **error
);
Gets a target with a specific alternative setting.
Since: 0.5.4
DfuTarget * dfu_device_get_target_by_alt_name (DfuDevice *device
,const gchar *alt_name
,GError **error
);
Gets a target with a specific alternative name.
Since: 0.5.4
const gchar *
dfu_device_get_display_name (DfuDevice *device
);
Gets the display name to use for the device.
Since: 0.5.4
const gchar *
dfu_device_get_serial_number (DfuDevice *device
);
Gets the serial number for the device.
Since: 0.7.3
guint16
dfu_device_get_runtime_vid (DfuDevice *device
);
Gets the runtime vendor ID.
Since: 0.5.4
guint16
dfu_device_get_runtime_pid (DfuDevice *device
);
Gets the runtime product ID.
Since: 0.5.4
guint16
dfu_device_get_runtime_release (DfuDevice *device
);
Gets the runtime release number in BCD format.
Since: 0.5.4
gboolean dfu_device_reset (DfuDevice *device
,GError **error
);
Resets the USB device.
Since: 0.5.4
gboolean dfu_device_attach (DfuDevice *device
,GError **error
);
Move device from DFU mode to runtime.
Since: 0.5.4
gboolean dfu_device_wait_for_replug (DfuDevice *device
,guint timeout
,GCancellable *cancellable
,GError **error
);
Waits for a DFU device to disconnect and reconnect. This does rely on a DfuContext being set up before this is called.
device |
||
timeout |
the maximum amount of time to wait |
|
cancellable |
a GCancellable, or |
|
error |
a GError, or |
Since: 0.5.4
DfuFirmware * dfu_device_upload (DfuDevice *device
,DfuTargetTransferFlags flags
,GCancellable *cancellable
,GError **error
);
Uploads firmware from the target to the host.
device |
||
flags |
flags to use, e.g. |
|
cancellable |
a GCancellable, or |
|
error |
a GError, or |
Since: 0.5.4
gboolean dfu_device_download (DfuDevice *device
,DfuFirmware *firmware
,DfuTargetTransferFlags flags
,GCancellable *cancellable
,GError **error
);
Downloads firmware from the host to the target, optionally verifying the transfer.
device |
||
firmware |
||
flags |
flags to use, e.g. |
|
cancellable |
a GCancellable, or |
|
error |
a GError, or |
Since: 0.5.4
gboolean dfu_device_refresh (DfuDevice *device
,GCancellable *cancellable
,GError **error
);
Refreshes the cached properties on the DFU device.
Since: 0.5.4
gboolean dfu_device_detach (DfuDevice *device
,GCancellable *cancellable
,GError **error
);
Detaches the device putting it into DFU-mode.
Since: 0.5.4
gboolean dfu_device_abort (DfuDevice *device
,GCancellable *cancellable
,GError **error
);
Aborts any upload or download in progress.
Since: 0.5.4
gboolean dfu_device_clear_status (DfuDevice *device
,GCancellable *cancellable
,GError **error
);
Clears any error status on the DFU device.
Since: 0.5.4
guint8
dfu_device_get_interface (DfuDevice *device
);
Gets the interface number.
Since: 0.5.4
DfuMode
dfu_device_get_mode (DfuDevice *device
);
Gets the device mode.
Since: 0.5.4
DfuState
dfu_device_get_state (DfuDevice *device
);
Gets the device state.
Since: 0.5.4
DfuStatus
dfu_device_get_status (DfuDevice *device
);
Gets the device status.
Since: 0.5.4
guint16
dfu_device_get_transfer_size (DfuDevice *device
);
Gets the transfer size in bytes.
Since: 0.5.4
guint16
dfu_device_get_version (DfuDevice *device
);
Gets the DFU specification version supported by the device.
Since: 0.7.2
guint
dfu_device_get_timeout (DfuDevice *device
);
Gets the device timeout.
Since: 0.5.4
gboolean
dfu_device_can_upload (DfuDevice *device
);
Gets if the device can upload.
Since: 0.5.4
gboolean
dfu_device_can_download (DfuDevice *device
);
Gets if the device can download.
Since: 0.5.4
gboolean dfu_device_has_attribute (DfuDevice *device
,DfuDeviceAttributes attribute
);
Returns if an attribute set for the device.
[skip]
Since: 0.5.4
gboolean dfu_device_has_quirk (DfuDevice *device
,DfuDeviceQuirks quirk
);
Returns if a device has a specific quirk
[skip]
Since: 0.5.4
void dfu_device_set_transfer_size (DfuDevice *device
,guint16 transfer_size
);
Sets the transfer size in bytes.
Since: 0.5.4
The workarounds for different devices.
No device quirks |
||
Ignore the device download timeout |
||
Force DFU mode |
||
Ignore invalid version numbers |
||
Fix up the protocol number |
||
Accept the same VID:PID when changing modes |
||
Do not do GetStatus when uploading |
||
No DFU runtime interface is provided |
||
An upload or download is required for attach |
||
Device has broken DFU runtime support |
The device DFU attributes.
struct DfuDeviceClass { GObjectClass parent_class; void (*status_changed) (DfuDevice *device, DfuStatus status); void (*state_changed) (DfuDevice *device, DfuState state); void (*percentage_changed) (DfuDevice *device, guint percentage); void (*action_changed) (DfuDevice *device, DfuAction action); };