Top | ![]() |
![]() |
![]() |
![]() |
DfuContext * | dfu_context_new () |
DfuContext * | dfu_context_new_with_context () |
gboolean | dfu_context_enumerate () |
GPtrArray * | dfu_context_get_devices () |
guint | dfu_context_get_timeout () |
void | dfu_context_set_timeout () |
DfuDevice * | dfu_context_get_device_by_vid_pid () |
DfuDevice * | dfu_context_get_device_by_platform_id () |
DfuDevice * | dfu_context_get_device_default () |
This object allows discovering and monitoring hotpluggable DFU devices.
When using DfuContext the device is given some time to re-enumerate after a detach or reset. This allows client programs to continue using the DfuDevice without dealing with the device hotplug and the GUsbDevice changing. Using this object may be easier than using GUsbContext directly.
Please be aware that after device detach or reset the number of DfuTarget objects may be different and so need to be re-requested.
DfuContext *
dfu_context_new (void
);
Creates a new DFU context object.
Since: 0.5.4
DfuContext *
dfu_context_new_with_context (GUsbContext *usb_ctx
);
Creates a new DFU context object.
Since: 0.7.6
gboolean dfu_context_enumerate (DfuContext *context
,GError **error
);
Opens a DFU-capable context.
Since: 0.5.4
GPtrArray *
dfu_context_get_devices (DfuContext *context
);
Gets all the DFU-capable devices on the system.
Since: 0.5.4
guint
dfu_context_get_timeout (DfuContext *context
);
Gets the wait-for-replug timeout.
Since: 0.5.4
void dfu_context_set_timeout (DfuContext *context
,guint timeout
);
Sets the wait-for-replug timeout. This is the longest we will wait for a device to re-enumerate after disconnecting. Using longer values will result in any UI not updating in a good time, but using too short values will result in devices being removed and re-added as different DfuDevice's.
Since: 0.5.4
DfuDevice * dfu_context_get_device_by_vid_pid (DfuContext *context
,guint16 vid
,guint16 pid
,GError **error
);
Finds a device in the context with a specific vendor:product ID. An error is returned if more than one device matches.
Since: 0.5.4
DfuDevice * dfu_context_get_device_by_platform_id (DfuContext *context
,const gchar *platform_id
,GError **error
);
Finds a device in the context with a specific platform ID.
Since: 0.5.4
DfuDevice * dfu_context_get_device_default (DfuContext *context
,GError **error
);
Gets the default device in the context. An error is returned if more than one device exists.
Since: 0.5.4