On Sun, Apr 03, 2011 at 08:38:37PM -0700, Ping Cheng wrote:
> On Sun, Apr 3, 2011 at 7:51 PM, Peter Hutterer 
> <peter.hutte...@who-t.net>wrote:
> 
> > On Sun, Apr 03, 2011 at 07:23:34PM -0700, Ping Cheng wrote:
> > > On Sun, Apr 3, 2011 at 6:35 PM, Peter Hutterer <peter.hutte...@who-t.net
> > >wrote:
> > >
> > > >  >
> > > > > What information can the user use for Uniq to associate the devices,
> > > > which
> > > > > we do not have in the driver? Both devices have the same product ID
> > and
> > > > > name.
> > > >
> > > > I only have one Bamboo, but the test code below gives me the right
> > answer.
> > > > argv[1,2] are the two device nodes (/dev/input/eventX and
> > > > /dev/input/eventY).
> > > >
> > > > static struct udev_device *udev_from_file(struct udev *udev, const char
> > > > *filename)
> > > > {
> > > >    struct stat st;
> > > >    stat(filename, &st);
> > > >    return udev_device_new_from_devnum(udev, 'c', st.st_rdev);
> > > > }
> > > >
> > > > int main(int argc, char** argv)
> > > > {
> > > >    int rc = 1;
> > > >    struct udev *udev = NULL;
> > > >    struct udev_device *dev1, *dev2 = NULL;
> > > >    struct udev_device *parent1, *parent2;
> > > >    const char *syspath1, *syspath2;
> > > >
> > > >    if (argc < 3)
> > > >        goto out;
> > > >
> > > >    udev = udev_new();
> > > >    dev1 = udev_from_file(udev, argv[1]);
> > > >    dev2 = udev_from_file(udev, argv[2]);
> > > >
> > > >    if (!dev1 || !dev2)
> > > >        goto out;
> > > >
> > > >    parent1 = udev_device_get_parent_with_subsystem_devtype(dev1, "usb",
> > > > "usb_device");
> > > >    parent2 = udev_device_get_parent_with_subsystem_devtype(dev2, "usb",
> > > > "usb_device");
> > > >
> > > >    syspath1 = udev_device_get_syspath(parent1);
> > > >    syspath2 = udev_device_get_syspath(parent2);
> > > >
> > >
> > >
> > > This looks very promising. So, we do not need anything from the user.
> > > Everything could be done inside the driver. Are you going to make a
> > patch?
> >
> > can't right now, got too many other things on my slate, sorry.
> >
> 
> That's fine. I may be able to get to it after next week.
> 
> Can you test the code with two of your Intuos4's? If we get "Nope, different
> devices" for two identical devices, we are ready to move forward. Otherwise,
> ...
> 
> I will not be in the office next whole week. So, I do not have two identical
> devices to play with.

yeah, as expected, it says that the devices are different.

Cheers,
  Peter

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to