GUsb

In colord, I need to do cancellable asynchronous interrupt transfers to talk to spectrophotometer devices like the X-Rite ColorMunki, and connect up libusb1 with a GMainLoop. It turned out Hans de Goede also needed to do the same kind of integration with his spice work. So, we want to share code to minimize bugs as the GSource code gets kinda hairy.

I’ve created a new project GUsb that wraps libusb1 with several high level wrappers that makes it easy to use in GLib programs. See the README for more details.

Go here if you want to look at the pre-release code — although we’ve not yet had a single tarball release yet, and any applications using GUsb have to define G_USB_API_IS_SUBJECT_TO_CHANGE before they can include gusb.h

If you’re interested in helping out please email either Hans or myself. There’s no mailing list just yet. It works for me; If it breaks for you, you get to keep both pieces (or send patches). There are no Fedora or Ubuntu packages at this point, although after the pending 0.1.0 release I’ll submit the package for Fedora package review for F16+.

Note, nothing depends on this library just yet; it’s too late in the GNOME 3.2 cycle to add new low level deps, and it’s also not even slightly API stable. Comments welcome.

8 responses to “GUsb”

  1. Luis Matos

    Maybe merge this in glib?

  2. Mardy

    Did you forget to remove the GCancellable argument from gusb_device_open()? It doesn’t seem to be used.

  3. Rémi

    Good stuff, I was using libusb directly for a usb gadget of mine, maybe I’ll try gusb instead and see if it works out ok.

    A nice glib+gasync+gcancellable example is always welcome.

  4. J. Félix Ontañón

    Good stuff!

    Is there any plans to provide gobject introspection for managing GUsb? I’d really like to handle GUsb from python.

Bad Behavior has blocked 2769 access attempts in the last 7 days.