[Interest] USB support
Roland Hughes
roland at logikalsolutions.com
Tue Apr 17 16:39:26 CEST 2018
On 04/17/2018 09:15 AM, Thiago Macieira wrote:
> On Monday, 16 April 2018 17:16:43 PDT Roland Hughes wrote:
>> All,
>>
>> I know the answer may well be RTFD, but, has raw USB communications been
>> more integrated or are the libusb examples from 2008 "current"?
> Nothing changed since 2008. You need to run as root anyway, so it's not a
> functionality you should expect to see in Qt any time soon.
Interesting.
I don't see any mention of needing to be root here:
http://www.dreamincode.net/forums/topic/148707-introduction-to-using-libusb-10/
And the current "official" site http://libusb.info
It is user-mode: No special privilege or elevation is required for the
application to communicate with a device.
Of course, root, for an embedded system, isn't much of an issue. One
would think that being a member of plugdev would give you USB access
much like being a member of dialout gives you access to serial port.
It does appear there should be some kind of support already there if one
built the webengine
roland at roland-I5-HP-Compaq-8300-Elite-SFF-PC:/$ sudo find -iname libusb
./home/roland/qt5.7.1/qt-everywhere-opensource-src-5.7.1/qtwebengine/src/3rdparty/chromium/third_party/libusb
./home/roland/qt5.7.1/qt-everywhere-opensource-src-5.7.1/qtwebengine/src/3rdparty/chromium/third_party/libusb/src/libusb
Not sure if that is still around in 5.xx or 6.x but 5.7.1 appears to
have included libusb 1.0.17
/* This file is parsed by m4 and windres and RC.EXE so please keep it simple. */
#include "version_nano.h"
#ifndef LIBUSB_MAJOR
#define LIBUSB_MAJOR 1
#endif
#ifndef LIBUSB_MINOR
#define LIBUSB_MINOR 0
#endif
#ifndef LIBUSB_MICRO
#define LIBUSB_MICRO 17
#endif
#ifndef LIBUSB_NANO
#define LIBUSB_NANO 0
#endif
/* LIBUSB_RC is the release candidate suffix. Should normally be empty. */
#ifndef LIBUSB_RC
#define LIBUSB_RC ""
#endif
ah
https://github.com/libusb/libusb/wiki/FAQ#Can_I_run_libusb_applications_on_Linux_without_root_privilege
Can I run libusb applications on Linux without root privilege?
Yes.
The standard solution is to use udev rules. Here are some links to udev
related websites.
* udev homepage
<http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev/udev.html>
* Debian's udev overview <http://wiki.debian.org/udev>
* Writing udev rules <http://www.reactivated.net/udevrules.php>
* Proper place to ask questions about udev rules
<http://vger.kernel.org/vger-lists.html#linux-hotplug>
<https://github.com/libusb/libusb/wiki/FAQ#how-can-i-run-libusb-applications-under-mac-os-x-if-there-is-already-a-kernel-extension-installed-for-the-device>
Should prove to be an interesting experiment. I imagine a few dozen
people have written their own QObject based wrapper class for that
library but getting code contributed is monumentally impossible so they
are all one-offs.
--
Roland Hughes, President
Logikal Solutions
(630)-205-1593
http://www.theminimumyouneedtoknow.com
http://www.infiniteexposure.net
http://www.johnsmith-book.com
http://www.logikalblog.com
http://www.interestingauthors.com/blog
http://lesedi.us/
http://onedollarcontentstore.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20180417/82a68c45/attachment.html>
More information about the Interest
mailing list