| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Some devices won't answer to a request with a 128-byte data buffer, this
allows the user to specify the size of the request data
buffer. g_usb_device_get_string_descriptor_bytes still uses the default
buffer size (128 bytes).
|
|
|
|
| |
This is requried for the GD32VF103 device.
|
|
|
|
|
| |
Adds a getter for a gusb_device to get the string index for the active
configuration's description.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Sometimes we do care about the USB version number of the device.
|
|
|
|
| |
Sometimes we want to handle this differently...
|
|
|
|
|
|
|
|
| |
I did think of adding this as g_usb_interface_set_alt_setting() but the other
claim() and release() methods are already on the the device object.
This lets us set an alternate setting after we've claimed an interface which
allows us to select non-default targets when flashing DFU-capable devices.
|
|
|
|
| |
This allows us to discover what interfaces are exported by a GUsbDevice.
|
|
|
|
| |
This allows us to get access to the bcdDevice, typically a firmware version.
|
| |
|
|
|
|
| |
This allows us to get the string index for a given interface descriptor.
|
|
|
|
| |
This is slow, but it's not expected to be called 1000's of times.
|
| |
|
| |
|
|
|
|
| |
This allows us to create something more than a flat list of devices.
|
| |
|
|
|
|
|
|
| |
The libusb_set_pollfd_notifiers() function will only work on Linux and we can
use a thread to do exactly the same thing in a cross platform way with a lot
less code.
|
| |
|
|
|
|
| |
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
|
|
| |
Note, this was written by Ceton Corp to support their tuning adapter driver.
|
| |
|
| |
|
|
|
|
|
|
| |
This allows us to later add signals without changing the ABI.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
|
|
|
|
| |
These can be used on most devices to present a more user friendly
description to the end user, ie instead of 04ca:002f, one could
display the device as: Lite-On Technology Corp. USB Multimedia Keyboard
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We are using the contents of the descriptor in various log / GError messages,
so just make sure we have it from the start. We can do this since on
windows and Mac OS X libusb_get_device_descriptor never fails, and on
Linux it will only fail if the device was unplugged since enumerating,
in which case a g_warning will be printed.
Since we create the GUsbDevice on a udev event, the chances of it being
unplugged again already are very very small. And in case it is, we will
simply end up with all 0's in the device descriptor, returning 0x0000
for vid/pid just like before.
In the future this means we will also return 0 for the number of available
configs, which is a problem for apps who actually want to try to do
something with descriptors, but given that this only happens on unplugged
devices it is once more not a real issue since any (to be implemented)
g_usb_device_get_config_descriptor would fail on an unplugged device anyways.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Always doing a set-config on device open is not a good idea, see:
http://libusb.sourceforge.net/api-1.0/caveats.html
So remove the configuration parameter from g_usb_device_open and add a
g_usb_device_set_configuration instead which apps can use if they really
want to do a set_configuration (which most apps should not do).
Also add a g_usb_device_get_configuration method for completeness.
Likewise remove the interface parameter, an app may want to claim more
then one interface. And may even want to do some things which require
the device to be open without claiming any interfaces, like getting the
active configuration.
And add a g_usb_device_claim_interface method to replace the interface
parameter to g_usb_device_open. The new g_usb_device_claim_interface
can also automatically unbind any kernel drivers which are bound to
the interface before claiming it, this is controlled through the
flags parameter, by specifying the
G_USB_DEVICE_CLAIM_INTERFACE_BIND_KERNEL_DRIVER flag.
Also add a g_usb_device_release_interface method for completeness.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
It does not look like libusb_strerror is going upstream any time soon
because of i18n worries, so provide out own implementation for now.
Once libusb_strerror hits upstream, and when compiling against a new enough
libusb, we can turn this into a simple wrapper.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
| |
|
| |
|
| |
|
|
|
|
| |
Return the actual number of bytes transferred, or -1 on error.
|
|
|
|
| |
Renamed the index parameter to idx to avoid conflicting with index(3).
|
| |
|
|
|
|
|
|
| |
transfers
I need to do this in colord for the Pantone ColorMunki hardware.
|
|
|
|
|
| |
We'll be also adding _async() versions too which use a GUsbSource, and hopefully
then we can also do something sane with GCancellable.
|
| |
|
| |
|
| |
|
|
So that we can include our headers from other headers in the form of:
include <gusb/gusb-foo.h>
And still have a working local build.
|