summaryrefslogtreecommitdiff
path: root/gusb/gusb-device.h
Commit message (Collapse)AuthorAgeFilesLines
* Add g_usb_device_get_string_descriptor_bytes_fullmasterRicardo Cañuelo2021-09-301-7/+12
| | | | | | | 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).
* Add g_usb_device_get_string_descriptor_bytes()Richard Hughes2021-01-271-0/+15
| | | | This is requried for the GD32VF103 device.
* Add a way to get iConfigurationBenson Leung2020-07-291-0/+1
| | | | | Adds a getter for a gusb_device to get the string index for the active configuration's description.
* trivial: Define a G_USB_DEVICE_CLAIM_INTERFACE_NONE rather than using '0'Richard Hughes2020-01-211-0/+1
|
* trivial: Use spaces and tabs consistentlyRichard Hughes2020-01-211-2/+2
|
* Use '#pragma once' to reduce boilerplateRichard Hughes2020-01-211-4/+1
|
* trivial: Use SPDX-License-Identifier tagsRichard Hughes2020-01-211-14/+1
|
* Add g_usb_device_get_spec()Richard Hughes2019-11-151-0/+1
| | | | Sometimes we do care about the USB version number of the device.
* Add a PERMISSION_DENIED error enumRichard Hughes2015-11-201-0/+1
| | | | Sometimes we want to handle this differently...
* Add g_usb_device_set_interface_alt()Richard Hughes2015-11-101-0/+4
| | | | | | | | 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.
* Add g_usb_device_get_interfaces()Richard Hughes2015-11-101-0/+9
| | | | This allows us to discover what interfaces are exported by a GUsbDevice.
* Add g_usb_device_get_release()Richard Hughes2015-11-101-1/+2
| | | | This allows us to get access to the bcdDevice, typically a firmware version.
* Include all the USB device class codesRichard Hughes2015-05-051-1/+28
|
* Add g_usb_device_get_custom_index()Richard Hughes2015-04-291-0/+7
| | | | This allows us to get the string index for a given interface descriptor.
* Add g_usb_device_get_children()Richard Hughes2015-01-051-0/+1
| | | | This is slow, but it's not expected to be called 1000's of times.
* Add g_usb_device_get_port_number()Richard Hughes2015-01-051-0/+1
|
* device: Add g_usb_device_get_vid_as_str()Richard Hughes2015-01-051-0/+2
|
* Add g_usb_device_get_parent()Richard Hughes2015-01-051-0/+1
| | | | This allows us to create something more than a flat list of devices.
* device: add get_device_subclass and get_device_protocol methodsIgnacio Casal Quinteiro2014-12-231-0/+2
|
* Use a thread to process libusb1 eventsRichard Hughes2014-11-251-1/+1
| | | | | | 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.
* Add g_usb_device_get_device_class()Richard Hughes2014-11-191-0/+1
|
* Rename inconsistently named gusb_* symbols to g_usb_*Evan Nemerson2012-06-101-1/+1
| | | | Signed-off-by: Richard Hughes <richard@hughsie.com>
* Add g_usb_device_reset() to reset a connected deviceRichard Hughes2012-05-311-0/+3
| | | | Note, this was written by Ceton Corp to support their tuning adapter driver.
* Add a missing error enum valueRichard Hughes2011-11-131-0/+1
|
* Add g_usb_device_get_platform_id which returns the sysfs path on LinuxRichard Hughes2011-10-101-0/+2
|
* Add padding to GUsb*Class structsHans de Goede2011-09-071-0/+8
| | | | | | This allows us to later add signals without changing the ABI. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* gusb-device: Add functions to get string descriptorsHans de Goede2011-09-061-0/+8
| | | | | | | | 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>
* gusb-device: drop g_usb_device_get_descriptorHans de Goede2011-09-061-2/+1
| | | | | | | | | | | | | | | | | | | | | 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>
* gusb-device: Move setting config / claiming of interface to their own methodsHans de Goede2011-09-061-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Provide our own gusb_strerror functionHans de Goede2011-09-061-0/+1
| | | | | | | | | | 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>
* Ensure the new async methods return the correct exit codes on failureRichard Hughes2011-09-011-0/+1
|
* g_usb_device_control_transfer_finish: LikewiseDebarshi Ray2011-08-311-1/+1
|
* g_usb_device_bulk_transfer_finish: LikewiseDebarshi Ray2011-08-311-1/+1
|
* g_usb_device_interrupt_transfer_finish: Change return type to gssizeDebarshi Ray2011-08-311-1/+1
| | | | Return the actual number of bytes transferred, or -1 on error.
* Add asynchronous control transferDebarshi Ray2011-08-271-1/+18
| | | | Renamed the index parameter to idx to avoid conflicting with index(3).
* Add asynchronous bulk transferDebarshi Ray2011-08-251-0/+13
|
* Add g_usb_device_interrupt_transfer_async() to be able to do asyncronous ↵Richard Hughes2011-08-191-0/+13
| | | | | | transfers I need to do this in colord for the Pantone ColorMunki hardware.
* Add functionality to GUsbDevice to do sync bulk, control and interrupt transfersRichard Hughes2011-08-161-0/+67
| | | | | We'll be also adding _async() versions too which use a GUsbSource, and hopefully then we can also do something sane with GCancellable.
* Add g_usb_device_open() and g_usb_device_close()Richard Hughes2011-08-161-9/+13
|
* Add some more detailed error codes to GUsbDeviceRichard Hughes2011-08-161-1/+7
|
* Add the ability to get elements of the device descriptor from GUsbDeviceRichard Hughes2011-08-111-0/+4
|
* Rename libgusb to gusbHans de Goede2011-08-101-0/+71
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.