Re: reverse-engineering a usb device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I think the easiest one is to use your linux machine. Insert your card
reader, and issue 'lsusb -v'. 

The buttons on USB devices usually are connected into HID interface. I
guess that's how your SanDisk card reader button communicates too. 

If you look at the `lsusb -v` output you'll see how many interfaces that
it implements. The MSD (Mass Storage Class) is the data channel, which
normally unrelated to buttons or leds on the device.

This page may help you: http://www.frogmouth.net/hid-doco/linux-hid.html
Also, your USB endpoints info can be viewed
in  /sys/class/usb_endpoint/usbdev 

Hope that helps

Regards,
-daniel



On Thu, 2009-02-12 at 21:51 +0100, Christoph Gysin wrote:
> I recently got a SanDisk SDDR-189 card reader. It features a small
> button and comes with a small Windows tool that lets you launch a
> choosen application.
> 
> Since there is support in the linux kernel for the button on Maxtor
> OneTouch harddisk enclosures I figured this would be an interesting
> task implementing the same for my card reader. All that is needed is
> to register en event device, figure out when the button was pressed
> and trigger an event. So I read myself through some introduction to
> usb and event device drivers under linux and looked at the onetouch.c
> example. It seems pretty straightforward so far.
> 
> I now need to figure out how the Windows tool detects the button
> beeing pressed. I found various docs describing how to reverse
> engineer usb devices. I attached the device to a Windows box and ran
> usbsnoop/SnoopyPro to log all traffice to/from the device.
> Unfortunately, as soon as I plug in the device the log gets flooded
> with commands to/from the device, making it impossible to single out
> the command that gets triggered by the button.
> 
> I don't know anything about the usb-storage class, so my question is:
> Is it possible to somehow detect (and filter out) all the commands
> that are used for usb-storage? So that I can reverse engineer what
> command is needed to query the button? Any other approach to get that
> button working is also greatly appreciated.
> 
> I didn't attach the usbsnoop.log because it is huge. If you think it
> might still be useful let me know and I'll upload it somewhere.
> 
> Chris



--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux