From: Romain A. <r.a...@gm...> - 2010-01-20 15:55:23
|
Hi, this my first time in this mailing list, I'm trying to reverse a device that has no support for Linux, I'm new to pyusb and have a problem with my script. I sniffed the USBlog from a virtual machine running windows and my working device here's the log: f53ed800 355026092 S Co:2:002:0 s 40 02 0002 0000 0000 0 f53ed800 355027800 C Co:2:002:0 0 0 f53ed800 355075185 S Bo:2:002:2 -115 3 = 00ffff If the device receive the 0x00, 0xFF, 0xFF sequence, it then send it's data Here's my code (mainly used the examples on the pyusb website) ------------------------ import usb.core import usb.util # find our device dev = usb.core.find(idVendor=0x10c4, idProduct=0x0002) # was it found? if dev is None: raise ValueError('Device not found') # set the active configuration. With no arguments, the first # configuration will be the active one dev.set_configuration() msg = [0x00, 0xFF, 0xFF] sent_bytes = dev.write(0x02, msg, 0, 100) ------------------------ and here's the output f341b700 484297497 S Co:2:003:0 s 00 09 0001 0000 0000 0 f341b700 484299102 C Co:2:003:0 0 0 f341b700 484312389 S Bo:2:003:2 -115 3 = 00ffff The 0x00, 0xFF, 0xFF sequence is correctly sent but the device doesn't send it's data, we can see in the first line of both log that the ControlOutput is not the same, I think this is my problem. I don't know how to change 09 0001 0000 0000 to 40 02 0002 0000 0000 Hope someone can help me, Cheers, Romain |