PORTS Forum

Ports and Interfaces => USB => Topic started by: clement2011 on December 06, 2011, 03:52:12 am

Title: usb sniffer and mouse
Post by: clement2011 on December 06, 2011, 03:52:12 am
Hi:

I encounter a problem when trying to connect to usb mouse via usb lib.
The problem is about createfile, the error message shows "Failed to create device file".
The confuse come to me, why the sniffer like bus hound can get the message from mouse, but
I can't. What is the difference between these two subject, sniffer and Createfile. Thanks


Title: Re: usb sniffer and mouse
Post by: Jan Axelson on December 06, 2011, 10:07:31 am
Protocol analyzers use drivers that access the data at a lower level compared to applications.

See Raw Input for a way to read mouse data from an application.

Jan
Title: Re: usb sniffer and mouse
Post by: clement2011 on December 06, 2011, 08:45:36 pm
Is PID and VID can be used in this situation.
Thanks a lot.



Title: Re: usb sniffer and mouse
Post by: Jan Axelson on December 06, 2011, 10:44:38 pm
What situation? For what purpose do you want to use the PID and VID?

Jan
Title: Re: usb sniffer and mouse
Post by: clement2011 on December 07, 2011, 02:43:30 am
I hope to retrieve the data from the HID device, after getting the packets, try to analyze these data.
However, some device like mouse, I can not get that. I didn't know the exact problem, if the data
format is 7 bytes, the data received event can not be trigger. However, the sniffer like bus hound can work.
Thanks.

Title: Re: usb sniffer and mouse
Post by: Jan Axelson on December 07, 2011, 09:25:48 am
Windows doesn't allow applications to open handles to system mice and keyboards. Use Raw Input instead. Do a web search for more info on Raw Input.

Jan