Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | trivial: Fix up a gtk-doc comment | Richard Hughes | 2022-10-26 | 1 | -1/+1 |
| | |||||
* | Export g_usb_device_has_tag() | Richard Hughes | 2022-10-26 | 1 | -2/+13 |
| | |||||
* | trivial: Fix up clang-format issue | Richard Hughes | 2022-09-13 | 1 | -1/+1 |
| | |||||
* | Allow adding tags to the JSON device event | Richard Hughes | 2022-09-13 | 1 | -0/+65 |
| | | | | This allows us to see which phase of the emulation should be used. | ||||
* | Include the created time in the JSON event | Richard Hughes | 2022-09-13 | 1 | -0/+10 |
| | |||||
* | Allow emulating failed events | Richard Hughes | 2022-09-12 | 1 | -0/+34 |
| | | | | | This is required to emulate devices that just reset (without completing the current transfer) when asked to reset. | ||||
* | Do not copy event data when not-required | Richard Hughes | 2022-09-10 | 1 | -3/+48 |
| | | | | | This will prevent crashes if the caller is casting from a const buffer to a mutable buffer. | ||||
* | Save device events when required | Richard Hughes | 2022-09-08 | 1 | -5/+407 |
| | | | | | | This allows us to simulate an entire context of devices, simulating responses as if the hardware is connected. This allows building rich device-specific unit tests in programs like fwupd, without having to have the hardware attached. | ||||
* | trivial: Ignore more requests when emulating a device | Richard Hughes | 2022-09-06 | 1 | -0/+20 |
| | |||||
* | trivial: Use a unique JSON key name for the ID | Richard Hughes | 2022-09-06 | 1 | -4/+5 |
| | |||||
* | trivial: Use a boolean flag for cache control | Richard Hughes | 2022-09-06 | 1 | -2/+10 |
| | | | | There's no point keep asking the device for BOS descriptors when it has none. | ||||
* | trivial: Check the handle before getting BOS descriptors | Richard Hughes | 2022-09-06 | 1 | -0/+4 |
| | |||||
* | trivial: Fix up some docgen headers | Richard Hughes | 2022-09-06 | 1 | -24/+0 |
| | |||||
* | Skip some functionality when emulating | Richard Hughes | 2022-09-05 | 1 | -0/+12 |
| | |||||
* | Include the platform ID in the JSON file | Richard Hughes | 2022-09-05 | 1 | -0/+10 |
| | |||||
* | Serialize the GUsbDevice to and from JSON format | Richard Hughes | 2022-09-05 | 1 | -10/+236 |
| | | | | This allows us to write tests that mock up entire devices. | ||||
* | Cache the list of interfaces and descriptors | Richard Hughes | 2022-09-05 | 1 | -94/+101 |
| | | | | | This can speed up device enumeration, and also allows us to emulate the interfaces or descriptors in the future. | ||||
* | trivial: Use @self for instance data | Richard Hughes | 2022-09-05 | 1 | -247/+243 |
| | |||||
* | Use G_DECLARE_DERIVABLE_TYPE to reduce boilerplate | Richard Hughes | 2022-09-05 | 1 | -96/+125 |
| | |||||
* | Reformat the code using clang-format | Richard Hughes | 2022-09-04 | 1 | -650/+624 |
| | | | | | This frees up mental energy when reviewing patches and is something I should have done a long time ago. | ||||
* | Add support for getting BOS descriptors | Richard Hughes | 2022-09-04 | 1 | -0/+103 |
| | |||||
* | Use g_autoptr() in a lot more places | Richard Hughes | 2022-09-04 | 1 | -14/+7 |
| | | | | We started using this several months ago and nobody even noticed. | ||||
* | trivial: Remove some duplicate header includes | Richard Hughes | 2022-06-16 | 1 | -2/+0 |
| | |||||
* | Only include the start year in the copyright header | Richard Hughes | 2022-06-16 | 1 | -1/+1 |
| | | | | | The end year is legally and functionally redundant, and more importantly causes cherry-pick conflicts when trying to maintain old branches. | ||||
* | Add g_usb_device_get_string_descriptor_bytes_fullmaster | Ricardo Cañuelo | 2021-09-30 | 1 | -8/+39 |
| | | | | | | | 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). | ||||
* | Do not depend on libusb_get_port_number() to fix DragonFlyBSD compile | Richard Hughes | 2021-05-21 | 1 | -1/+10 |
| | |||||
* | Do not depend on libusb_get_parent() to fix FreeBSD compile | Richard Hughes | 2021-05-21 | 1 | -0/+9 |
| | |||||
* | device: Reference the libusb device when set | Marco Trevisan (Treviño) | 2021-04-13 | 1 | -3/+13 |
| | | | | | | | | | We used to reference a device during the initable init vfunc, however it's better to do it when the device is actually set as an object property. In this way, the device is always unreffed when the object is disposed, without having to care about the ordering. | ||||
* | device: Do not double-reference USB devices | Marco Trevisan (Treviño) | 2021-04-13 | 1 | -2/+0 |
| | | | | | | | | | | | Currently gusb-device adds two references to an internal libusb device, causing a memory leak on destruction. In fact, we add a reference when the device is constructed and when the device is inited. To avoid this and ensure that libusb will cleanup all the devices on context destruction, only reference on device initialization. | ||||
* | Add g_usb_device_get_string_descriptor_bytes() | Richard Hughes | 2021-01-27 | 1 | -0/+41 |
| | | | | This is requried for the GD32VF103 device. | ||||
* | device: Fix cancellation if cancellable is already cancelled | Benjamin Berg | 2020-10-01 | 1 | -27/+42 |
| | | | | | | | | | | | libusb can only handle cancellation if the transfer is already in-flight. However, g_cancellable_connect will immediately call the callback and then libusb_cancel_transfer when the cancellable is already cancelled at the time the transfer is submitted. Move the cancellation registration to after transfer submission to avoid ordering issues. Also avoid even submitting the transfer if the cancellable is already cancelled to begin with. | ||||
* | trivial: Fix up typos spotted by codespell | Richard Hughes | 2020-09-24 | 1 | -6/+6 |
| | |||||
* | Add a way to get iConfiguration | Benson Leung | 2020-07-29 | 1 | -0/+30 |
| | | | | | Adds a getter for a gusb_device to get the string index for the active configuration's description. | ||||
* | trivial: Add some missing 'Since: ' values | Richard Hughes | 2020-02-20 | 1 | -0/+4 |
| | |||||
* | Include the USB bus in the generated platform_id | Richard Hughes | 2020-02-14 | 1 | -11/+6 |
| | | | | | | | | | | | The existing logic here was unsound; the recursion only checked the string for length 0 after it had gone up the tree to the parent, and so would never match. This meant if you had identical devices with the same port hierarchy on different USB busses they had the *same* physical ID. This really upsets projects like fwupd which use the physical ID to stay the same on device replug (which worked fine), but also dedupe devices with the same physical ID, which is what broke here. | ||||
* | trivial: Use spaces and tabs consistently | Richard Hughes | 2020-01-21 | 1 | -156/+156 |
| | |||||
* | trivial: Use SPDX-License-Identifier tags | Richard Hughes | 2020-01-21 | 1 | -14/+1 |
| | |||||
* | Add g_usb_device_get_spec() | Richard Hughes | 2019-11-15 | 1 | -0/+19 |
| | | | | Sometimes we do care about the USB version number of the device. | ||||
* | trivial: Remove untrue statement | Richard Hughes | 2019-11-15 | 1 | -1/+0 |
| | |||||
* | gi: made actual_length introspection annotations | grindhold | 2019-09-26 | 1 | -3/+3 |
| | | | | | | the actual_length parameter of GUsbDevice's transfer-methods should be out parameters. otherwise the generated vala bindings will cause programs to segfault. | ||||
* | trivial: Fix some typos spotted using codespell | Richard Hughes | 2019-04-08 | 1 | -1/+1 |
| | |||||
* | trivial: Fix two -Wswitch-default warnings | Richard Hughes | 2017-12-19 | 1 | -0/+2 |
| | |||||
* | Replace libusb-1.0/libusb.h with libusb.h | Ting-Wei Lan | 2017-12-19 | 1 | -1/+1 |
| | | | | | | | FreeBSD doesn't have the libusb-1.0 directory, and required include arguments should be provided by pkg-config. Signed-off-by: Richard Hughes <richard@hughsie.com> | ||||
* | trivial: Be less vocal when using G_USB_CONTEXT_FLAGS_AUTO_OPEN_DEVICES | Richard Hughes | 2017-07-24 | 1 | -6/+2 |
| | |||||
* | Add g_usb_context_set_flags() | Richard Hughes | 2017-07-23 | 1 | -15/+33 |
| | | | | This allows us to auto-open devices as they are hotplugged. | ||||
* | Fix a memory leak when using g_usb_device_control_transfer_async() | Richard Hughes | 2017-03-24 | 1 | -5/+6 |
| | |||||
* | trivial: Fix compile warning with GCC6 | Richard Hughes | 2016-03-10 | 1 | -1/+1 |
| | |||||
* | Revert "Allow getting the GUsbContext from the GUsbDevice" | Richard Hughes | 2015-11-25 | 1 | -4/+1 |
| | | | | | | This reverts commit 7561b53eed51776b393e0b5e270cb07d637835a9. It's a layering violation, and I've found a better way to do this now. | ||||
* | Add a PERMISSION_DENIED error enum | Richard Hughes | 2015-11-20 | 1 | -6/+13 |
| | | | | Sometimes we want to handle this differently... | ||||
* | trivial: Remove typo that meant we only returned one interface | Richard Hughes | 2015-11-16 | 1 | -1/+0 |
| |