linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Findind input event device path with libudev
@ 2011-11-16 12:02 Nuno Santos
  2011-11-16 14:44 ` Nuno Santos
  0 siblings, 1 reply; 3+ messages in thread
From: Nuno Santos @ 2011-11-16 12:02 UTC (permalink / raw)
  To: linux-input

Hi,

I found an example on how to use libudev to iterate over devices present 
in the system to find its precise path since the path can be different 
everytime we plug a device into the system.

http://www.signal11.us/oss/udev/

In this example, the type of device searched is hidraw, however I have 
already tried input, event, etc and none of this match criterias in the 
following function:

|*udev_enumerate_add_match_subsystem*(enumerate,*"hidraw"*);|


Only hidraw seems to work.

Can I use this technic to found the path a of input event device?

Thanks,

With my best regards,

Nuno


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Findind input event device path with libudev
  2011-11-16 12:02 Findind input event device path with libudev Nuno Santos
@ 2011-11-16 14:44 ` Nuno Santos
  2011-11-16 19:12   ` Antonio Ospite
  0 siblings, 1 reply; 3+ messages in thread
From: Nuno Santos @ 2011-11-16 14:44 UTC (permalink / raw)
  To: linux-input

Hi,

After digging a little bit around this i found that my problem is with 
this function:

dev = udev_device 
*udev_device_get_parent_with_subsystem_devtype(dev,"usb","usb_device");

dev is always null. He can't find me the usb device for my input device. 
Maybe i'm not specifiying subsystem and dev type correctly.

If I make several calls to udev_device_get_parent I can get to the 
correct device.

Does anyone knows what should be the correct subsystem and dev type pair 
to find the parent usb device for an input device?

Thanks,

Nuno

On 11/16/2011 12:02 PM, Nuno Santos wrote:
> Hi,
>
> I found an example on how to use libudev to iterate over devices 
> present in the system to find its precise path since the path can be 
> different everytime we plug a device into the system.
>
> http://www.signal11.us/oss/udev/
>
> In this example, the type of device searched is hidraw, however I have 
> already tried input, event, etc and none of this match criterias in 
> the following function:
>
> |*udev_enumerate_add_match_subsystem*(enumerate,*"hidraw"*);|
>
>
> Only hidraw seems to work.
>
> Can I use this technic to found the path a of input event device?
>
> Thanks,
>
> With my best regards,
>
> Nuno
>
> -- 
> To unsubscribe from this list: send the line "unsubscribe linux-input" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Findind input event device path with libudev
  2011-11-16 14:44 ` Nuno Santos
@ 2011-11-16 19:12   ` Antonio Ospite
  0 siblings, 0 replies; 3+ messages in thread
From: Antonio Ospite @ 2011-11-16 19:12 UTC (permalink / raw)
  To: Nuno Santos; +Cc: linux-input

[-- Attachment #1: Type: text/plain, Size: 1053 bytes --]

On Wed, 16 Nov 2011 14:44:08 +0000
Nuno Santos <nsantos@edigma.com> wrote:

> Hi,
> 
> After digging a little bit around this i found that my problem is with 
> this function:
> 
> dev = udev_device 
> *udev_device_get_parent_with_subsystem_devtype(dev,"usb","usb_device");
> 
> dev is always null. He can't find me the usb device for my input device. 
> Maybe i'm not specifiying subsystem and dev type correctly.
> 
> If I make several calls to udev_device_get_parent I can get to the 
> correct device.
> 
> Does anyone knows what should be the correct subsystem and dev type pair 
> to find the parent usb device for an input device?
> 

You can find out the most specific subsystem and devtype yourself using:

	udevadm monitor

and then plugging the device in.

Regards,
   Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-16 19:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-16 12:02 Findind input event device path with libudev Nuno Santos
2011-11-16 14:44 ` Nuno Santos
2011-11-16 19:12   ` Antonio Ospite

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).