[libhid-discuss] Talking to an HID device from user account in Linux

Sarah Mount s.mount at wlv.ac.uk
Wed May 6 14:30:17 UTC 2009


2009/4/2 Ali Asad <Asad.Ali at gemalto.com>:
>

<snip>

>
> I am now looking for a 'seamless' way for the end-users of this device to apply this udev rule on their Linux systems. They do this once and on each subsequent use the application works from use account. I can have my application write the rules file to /etc/udev/rules.d directory but for this I would need root access. What is the best way for a C application to ask user to type the root password and then use it to gain root access. Once this is done, the application can then write the rules file.
>

If you are using Makefiles, then store the udev rule in the source
distribution of your program and copy it to /etc/wherever as part of
the "INSTALL" target in the makefile. Usually 'make install' is run as
root or with sudo.

Sarah

> -----Original Message-----
> From: libhid-discuss-bounces+asad.ali=gemalto.com at lists.alioth.debian.org [mailto:libhid-discuss-bounces+asad.ali=gemalto.com at lists.alioth.debian.org] On Behalf Of Xiaofan Chen
> Sent: Tuesday, March 31, 2009 12:15 AM
> To: libhid-discuss at lists.alioth.debian.org
> Subject: Re: [libhid-discuss] Talking to an HID device from user account in Linux
>
> On Tue, Mar 31, 2009 at 12:47 PM, Peter Stuge <stuge-libhid at cdy.org> wrote:
>>> This technique would be orthogonal to the approach of using libhid
>>> to create our own device driver, but I want to explore all options.
>>
>> Then you could also look into hiddev and/or hidraw. They can be used
>> to communicate with HID devices at a higher level than USB.
>>
>> CONFIG_HID_DEV /usr/src/linux/Documentation/usb/hiddev.txt
>> CONFIG_HIDRAW http://cateee.net/lkddb/web-lkddb/HIDRAW.html (brief)
>>
>> hiddev may come with restrictions on which non-HID-class things your
>> device can do however - but still worth looking into.
>
> You may still need to write a udev rule even if you use the hiddev
> or hidraw interface unless the system has already udev rules
> in place.
>
> I am not familiar with hiddev but there is an example here.
> http://openprog.altervista.org/OP_eng.html
>
> Last time it is said that hiddev is not a good option for generic
> HID device but hidraw might be an option.
> http://osdir.com/ml/lib.libusb.devel.general/2007-04/msg00233.html
>
> Xiaofan
>
> _______________________________________________
> libhid-discuss mailing list
> libhid-discuss at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/libhid-discuss
> http://libhid.alioth.debian.org/
>
> _______________________________________________
> libhid-discuss mailing list
> libhid-discuss at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/libhid-discuss
> http://libhid.alioth.debian.org/
>



-- 
Sarah Mount, Senior Lecturer, University of Wolverhampton
Web:  http://www.wlv.ac.uk/~in0316/
Book: http://www.pythonforrookies.org/
WSN: http://www.fieldsensing.org.uk/
Photos: http://flickr.com/photos/sarahmount/

This email, together with any attachment, is for the exclusive and
confidential use of the addressee(s) and may contain legally
privileged information.  Any use, disclosure or reproduction without
the sender's explicit consent is unauthorised and may be unlawful.

Any e-mail including its content and any attachments may be monitored
and used by The University of Wolverhampton for reasons of security
and for monitoring internal compliance with the University's policy on
internet use. E-mail blocking software may also be used.  The
University cannot guarantee that this message or any attachment is
virus free or has not been intercepted and amended.

If you believe you have received this message in error please notify
the sender by email, telephone or fax and destroy the message and any
copies.
Sent from Wolverhampton, United Kingdom



More information about the libhid-discuss mailing list