From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Mon, 01 May 2006 19:06:15 +0000 Subject: Re: Accessing usb devices with USBDEVFS Message-Id: <20060501190615.GA27897@kroah.com> List-Id: References: <44525468.5030106@ist-traffic.com> In-Reply-To: <44525468.5030106@ist-traffic.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Mon, May 01, 2006 at 03:00:17PM -0400, Danny Budik wrote: > > >>So is there a way then to read from the /dev/bus/usb? Like I > >>mentioned > >>in the parent post, I am just using fopen, and the functions > >>provided in > >>usbdevice_fs.h and usb.h to read data from the usb device. The > >>device is > >>a proprietary sensor that my company makes. Is there a > >>manual/documentation about how to do this the more "modern" way? > > > >No, that's still the correct way. If you use libusb, none of your > >code > >changes at all. If you are using "raw" usbfs, then just open a > >different file. > > > >Hope this helps, > > > >greg k-h > > > So that brings me to my next question. I guess I didn't know that > libusb existed and wrote my own interface functions. Is it because of > this that whenever I access the USB device, I must be root? Obviously > that's a security issue. In other words, can I read/write to my USB > device as a user using libusb? No, that is what this change in moving the usbfs files from /proc/bus/usb/ to /dev/bus/usb enables now. You can create a simple udev rule to give your device the proper owner:group permissions and then you will not have to be root to use your program. Or you could have mounted usbfs with the proper options, but that would make all usbfs files with that owner:group permissions. libusb just tries to make writing to usbfs devices easier than handling the "raw" usb commands. Hope this helps, greg k-h ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642 _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel