View previous topic :: View next topic |
Author |
Message |
parveensunaria n00b
Joined: 04 Nov 2016 Posts: 2
|
Posted: Fri Nov 04, 2016 1:54 pm Post subject: writing coustomized eudev rule |
|
|
Hi All,
I am working on detecting a USB dongle a performing mode switch on the application layer.
For this i dont want to use the default made switch rule given with the eudev package.
So, I am just passing the arguments such as vendor ID and Product ID of the USB and all other parameters which is needed for the mode switch.
The issue is the arguments are not passed correctly and due to this i am not able to perform the mode switch.
Are the pattern for passing the arguments is different from the udev rules that we used to perform earlier.
Can some one give me some lights so that i can follow that and complete my task ASAP.
With Regards,
Parveen |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3135
|
Posted: Fri Nov 04, 2016 8:12 pm Post subject: |
|
|
Why won't you show us some of the things you tried and their results? You know, old-fashioned glass balls have been out of business for ages. |
|
Back to top |
|
|
parveensunaria n00b
Joined: 04 Nov 2016 Posts: 2
|
Posted: Mon Nov 07, 2016 7:14 am Post subject: |
|
|
Hi,
Below is the rule i have written for the USB dongles:
SUBSYSTEM=="usb", ACTION=="add", RUN+="usb_device.sh" DEV_DETECT $env{SUBSYSTEM} $env{ACTION} $attr{devpath} $attr{idvendor} $attr{idproduct} $attr{bInterfaceClass} $attr{bInterfaceSubclass} $attr{bInterfaceProtocol} $attr{bInterfaceNumber}
The script is runned twice and the arguments are passed as:
First time ---> DEV_DETECT usb add 1.4 12d1 1446
Second time-----> DEV_DETECT usb add 08 06 50 00
but the same script was working when we were using udev and the arguments to our application goes as:
First time ---> DEV_DETECT usb add 1.4 12d1 1446
Second time-----> DEV_DETECT usb add 1.4 12d1 1446 08 06 50 00
I have deleted the default usb_modeswitch.rules file.
Do we have any document for writing rules and is this some argument issue. As the value of the arguments are correct but it is passed wrongly and hence the task is not completed.
With Regards,
Parveen |
|
Back to top |
|
|
|