Author Topic: usb sniffer and mouse  (Read 10742 times)

clement2011

  • Member
  • ***
  • Posts: 19
usb sniffer and mouse
« 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



Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: usb sniffer and mouse
« Reply #1 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

clement2011

  • Member
  • ***
  • Posts: 19
Re: usb sniffer and mouse
« Reply #2 on: December 06, 2011, 08:45:36 pm »
Is PID and VID can be used in this situation.
Thanks a lot.




Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: usb sniffer and mouse
« Reply #3 on: December 06, 2011, 10:44:38 pm »
What situation? For what purpose do you want to use the PID and VID?

Jan

clement2011

  • Member
  • ***
  • Posts: 19
Re: usb sniffer and mouse
« Reply #4 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.


Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: usb sniffer and mouse
« Reply #5 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