Results 1 to 3 of 3
Hi I have an application in which USB should get detected and signal has to be recieved, My question is should that be handled in driver
I have heard about ...
- 02-25-2009 #1Just Joined!
- Join Date
- Feb 2009
- Posts
- 1
USB detection
Hi I have an application in which USB should get detected and signal has to be recieved, My question is should that be handled in driver
I have heard about the message being sent from kernel space to user space; is it that which has to be done,.. I went through lot of material which explains about /sbin/hotplug but couldnot get that to work....
anybody can give me suggestions or better stuffs to read or help in anyway ??
- 02-26-2009 #2Linux Newbie
- Join Date
- Feb 2009
- Posts
- 99
I don't know is that suit for you or not.
are you using udevd device controller?
if that.
try command
udevinfo -a -p $(udevinfo -q path -n /dev/sda1) <-- try to find your USB DISK uuid.
so add one file in
/etc/udev/rules.d/75-custom.rules
KERNEL=="sd[a-z][0-9]", SYSFS{serial}==" input your UUID here", PROGRAM=="input your script here."
try it.
- 02-26-2009 #3Just Joined!
- Join Date
- Feb 2009
- Posts
- 45
Answer:
This only works when the device in question actually uses the USB block device kernel interface, which I very much doubt. For what itʼs worth, it could use any of the many USB interfaces for which a kernel module exists (i.e. the HID or even input subsystem), as «kewl» didnʼt specify what the device actually is.
Originally Posted by signmem
If it already is a HID device, then the hiddev kernel driver automatically registeres with the device on connection time and creates a character device node interface at «/dev/hiddev$NO». HID documentation is available at ¹ and «Documentation/usb/hiddev.txt» in your kernel source directory. It is easy to determine if a device is a HIDdev device: if the invocation of «dmesg» mentions something about “hiddev” on its last lines after you plugged the device in question in, then it is most likely a HID device.
Originally Posted by kewl
If neither case above applies, which means that the device has no associated kernel interface / driver (i.e. because itʼs custom made), then no USB related kernel driver registeres with the device and one is free to communicate with the device in userspace. The easiest way to accomplish this would probably be «libusb»². However the usage of «libusb» requires some knowledge of USB. In the case this knowledge is not sufficient, I recommend reading each ³, ⁴ and ², in that order.
Footnotes:
- USB – HID Specification 1.11
- Home: SourceForge.net: libusb home. Documentation: libusb Developers Guide offers a plethora of neccessary information.
- USB Revision 3.0 Specification
- Programming Guide for Linux USB Device Drivers


Reply With Quote