summaryrefslogtreecommitdiff
path: root/gusb/gusb-context.c
Commit message (Collapse)AuthorAgeFilesLines
* Lower the libusb dep to fix compile on FreeBSDRichard Hughes2021-05-211-3/+18
| | | | | | | | | | | FreeBSD is not a supported platform of libusb. The native USB access library on FreeBSD is libusb20, which provides both the non-portable FreeBSD-specific API and wrapper functions that are mostly compatible eith libusb 1.0 API. It is an integral part of FreeBSD and the version included in the oldest supported FreeBSD release reports 1.0.9 in its libusb-1.0.pc. Based on a patch by Ting-Wei Lan <lantw@src.gnome.org>, many thanks.
* trivial: Use spaces and tabs consistentlyRichard Hughes2020-01-211-79/+79
|
* trivial: Remove useless gtk-doc comment sectionsRichard Hughes2020-01-211-6/+0
|
* trivial: Use SPDX-License-Identifier tagsRichard Hughes2020-01-211-14/+1
|
* Fix high number of wakeups when checking the GUsbContextRichard Hughes2020-01-201-2/+2
| | | | | | | | | | | In 985b9e4ec39ac521e7398a8e3017c96f2c4d75ec I mistakenly thought this was the timeout for the added/removed context checking, which was Windows-specific. It actually was the main context event thread, which is running all the time. Switch the poll timeout to be 2s, (still down from the default 60s!) which is a better compromise between battery life and context shutdown performance. Fixes https://github.com/hughsie/libgusb/issues/24
* Use a 1ms timeout in the Windows event threadRichard Hughes2019-12-031-1/+5
| | | | | This avoids blocking for multiple seconds when trying to destroy the context, which could happen quite a few times in the self tests.
* Do not use deprecated libusb APIRichard Hughes2019-12-031-0/+8
|
* trivial: Fix some typos spotted using codespellRichard Hughes2019-04-081-3/+3
|
* Allow changing the path to usb.ids fileTing-Wei Lan2017-12-191-1/+1
| | | | | | FreeBSD uses /usr/local/share/usbids/usb.ids instead. Signed-off-by: Richard Hughes <richard@hughsie.com>
* Replace libusb-1.0/libusb.h with libusb.hTing-Wei Lan2017-12-191-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_DEVICESRichard Hughes2017-07-241-1/+0
|
* Add g_usb_context_set_flags()Richard Hughes2017-07-231-0/+44
| | | | This allows us to auto-open devices as they are hotplugged.
* Correctly detect removed devices when using g_usb_context_rescan()Richard Hughes2017-03-241-3/+3
|
* trivial: Return the replugged device when using g_usb_context_get_devices()Richard Hughes2016-03-111-3/+8
|
* trivial: Use the defined main context when waiting for replugRichard Hughes2016-03-111-1/+1
|
* Add g_usb_context_wait_for_replug()Richard Hughes2016-03-101-1/+127
|
* Add missing element-type annotations.Robert Ancell2015-08-031-1/+1
| | | | | | This allows g_usb_context_get_devices, usb_device_list_get_devices and g_usb_device_get_children to be used in languages that use gobject introspection like Vala, Python etc.
* trivial: Fix up style of new method to match the codebaseRichard Hughes2015-06-081-1/+6
|
* Allow setting the GMainContext when used for sync methodsRichard Hughes2015-05-261-0/+41
|
* Remove the cleanup attributes from the rest of the codeIgnacio Casal Quinteiro2015-01-081-12/+36
|
* Revert "Use __attribute__(cleanup) in more places"Ignacio Casal Quinteiro2015-01-081-6/+13
| | | | This reverts commit cdbd7e6cc165c39580e72ac1415d233f5eaa7101.
* Use __attribute__(cleanup) in more placesRichard Hughes2015-01-061-13/+6
|
* Add g_usb_context_find_by_platform_id()Richard Hughes2015-01-051-0/+46
|
* context: Load usb.ids if requiredRichard Hughes2015-01-051-0/+123
|
* Generate the platform ID in the device itselfRichard Hughes2015-01-051-24/+1
| | | | It's just cleaner this way.
* Don't filter out hub devices when getting the device listRichard Hughes2014-12-311-5/+0
| | | | Sometimes it's the hub we want to enumerate...
* context: use g_object_notify_by_pspecIgnacio Casal Quinteiro2014-12-261-1/+1
|
* context: do not leak errorIgnacio Casal Quinteiro2014-12-261-0/+1
|
* context: use g_object_class_install_propertiesIgnacio Casal Quinteiro2014-12-261-11/+12
|
* context: use G_DEFINE_QUARKIgnacio Casal Quinteiro2014-12-261-16/+9
|
* context: minor optmization of the rescanIgnacio Casal Quinteiro2014-12-241-5/+5
| | | | | Add the devices after removing the ones that do not exists anymore, this way we avoid checking the new ones.
* context: use dispose since it makes more senseIgnacio Casal Quinteiro2014-12-241-11/+14
| | | | | Basically if there is an error some of those variables might not be set so better check them before finalizing them.
* context: properly notify the debug-level propertyIgnacio Casal Quinteiro2014-12-241-5/+11
|
* context: there is not need to use gotosIgnacio Casal Quinteiro2014-12-241-14/+20
|
* Remove useless commentsIgnacio Casal Quinteiro2014-12-241-70/+20
|
* Add guards for public methodsIgnacio Casal Quinteiro2014-12-241-3/+19
|
* device: make it implement initableIgnacio Casal Quinteiro2014-12-231-1/+8
|
* context: use an atomic int to handle the event thread loopIgnacio Casal Quinteiro2014-12-231-4/+6
|
* Put some consistency to method parametersIgnacio Casal Quinteiro2014-12-231-27/+34
|
* context: make it implement GInitableIgnacio Casal Quinteiro2014-12-221-34/+53
|
* Use G_DEFINE_WITH_PRIVATEIgnacio Casal Quinteiro2014-12-221-6/+2
|
* Make the platform ID persistent across re-plugRichard Hughes2014-12-041-4/+27
| | | | | This was technically a regression since the gudev days as some tools require the platform ID to be persistent across re-plug.
* Correctly terminate the libusb event threadRichard Hughes2014-11-261-2/+2
|
* Use a thread to process libusb1 eventsRichard Hughes2014-11-251-67/+447
| | | | | | 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.
* Do not use deprecated GLib functionalityRichard Hughes2013-02-211-5/+4
|
* Rename inconsistently named gusb_* symbols to g_usb_*Evan Nemerson2012-06-101-1/+1
| | | | Signed-off-by: Richard Hughes <richard@hughsie.com>
* Ensure that there is only one GUsbSource for each GUsbContextDebarshi Ray2011-09-081-1/+40
| | | | | | | | | | As a result, g_usb_source_{new,destroy} have been moved to a private header, and are called from the get_source and finalize methods of GUsbContext. Note that the GUsbSource is lazy allocated and only created when g_usb_context_get_source is called for the first time for a particular GUsbContext.
* Provide our own gusb_strerror functionHans de Goede2011-09-061-4/+2
| | | | | | | | | | 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>
* Prepare for a release in two weeks timeRichard Hughes2011-08-191-4/+4
|
* trivial: Remove several trailing commas in enumsRichard Hughes2011-08-191-1/+1
|