Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
writing coustomized eudev rule
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
parveensunaria
n00b
n00b


Joined: 04 Nov 2016
Posts: 2

PostPosted: Fri Nov 04, 2016 1:54 pm    Post subject: writing coustomized eudev rule Reply with quote

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
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3135

PostPosted: Fri Nov 04, 2016 8:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
parveensunaria
n00b
n00b


Joined: 04 Nov 2016
Posts: 2

PostPosted: Mon Nov 07, 2016 7:14 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum