Top | ![]() |
![]() |
![]() |
![]() |
#define | G_USB_CONTEXT_ERROR |
struct | GUsbContext |
struct | GUsbContextClass |
enum | GUsbContextError |
enum | GUsbContextFlags |
GUsbContextPrivate |
GUsbContext *
g_usb_context_new (GError **error
);
Creates a new context for accessing USB devices.
Since: 0.1.0
void g_usb_context_set_flags (GUsbContext *context
,GUsbContextFlags flags
);
Sets the flags to use for the context. These should be set before
g_usb_context_enumerate()
is called.
Since: 0.2.11
GUsbContextFlags
g_usb_context_get_flags (GUsbContext *context
);
Sets the flags to use for the context.
Since: 0.2.11
GUsbSource * g_usb_context_get_source (GUsbContext *context
,GMainContext *main_ctx
);
g_usb_context_get_source
is deprecated and should not be used in newly-written code.
This function does nothing.
Since: 0.1.0
GMainContext *
g_usb_context_get_main_context (GUsbContext *context
);
Gets the internal GMainContext to use for syncronous methods.
By default the value is set to the value of g_main_context_default()
Since: 0.2.5
void g_usb_context_set_main_context (GUsbContext *context
,GMainContext *main_ctx
);
Sets the internal GMainContext to use for syncronous methods.
Since: 0.2.5
void
g_usb_context_enumerate (GUsbContext *context
);
Enumerates all the USB devices and adds them to the context.
You only need to call this function once, and any subsequent calls are silently ignored.
Since: 0.2.2
void g_usb_context_set_debug (GUsbContext *context
,GLogLevelFlags flags
);
Sets the debug flags which control what is logged to the console.
Using G_LOG_LEVEL_INFO
will output to standard out, and everything
else logs to standard error.
Since: 0.1.0
GPtrArray *
g_usb_context_get_devices (GUsbContext *context
);
Since: 0.2.2
GUsbDevice * g_usb_context_find_by_bus_address (GUsbContext *context
,guint8 bus
,guint8 address
,GError **error
);
Finds a device based on its bus and address values.
Since: 0.2.2
GUsbDevice * g_usb_context_find_by_vid_pid (GUsbContext *context
,guint16 vid
,guint16 pid
,GError **error
);
Finds a device based on its bus and address values.
Since: 0.2.2
GUsbDevice * g_usb_context_find_by_platform_id (GUsbContext *context
,const gchar *platform_id
,GError **error
);
Finds a device based on its platform id value.
Since: 0.2.4
GUsbDevice * g_usb_context_wait_for_replug (GUsbContext *context
,GUsbDevice *device
,guint timeout_ms
,GError **error
);
Waits for the device to be replugged. It may come back with a different VID:PID.
Warning: This is syncronous and blocks until the device comes back or the timeout triggers.
Since: 0.2.9