2014-11-13 12:14 GMT-02:00 Anatoly Verkhovsky <anv...@gmail.com>:
> Hi,
>

Hi, sorry for the delay, but I was out most of the month.

> I'm writing a driver for a device.  It was originally using MDB ICP, but now
> it ships with a USB to MDB bridge, why they have chosen to do it as HID
> rather then USB Serial i have no idea.  So behind the usb there is a simple
> serial protocol.
>

[snip]

> Here is the gist of my code:
>
> dev = usb.core.find(idVendor=0x155d, idProduct=0x0002)
> # check and remove kernel driver
> dev.set_configuration()
> dev.reset()

iirc, reset is problematic in Windows (maybe a should log a warning
for this), what if you remove it?

> # bmRequestType, bRequest are taken from SnoopyPro trace.
> res = dev.ctrl_transfer(0x22, 0x9, 0, 0, [0x02, 0x85, 0x0a], 1000)

This seems to be a class request, so it is a HID class request?

> data = dev.read(0x82, 32, timeout=10000)
>
> ctrl_transfer fails with USBError(32, 'Pipe error') and
> after couple of retries : USBError(19, 'No such device (it may have been
> disconnected)')

In general, this kind of errors in Windows is due to the reset call.

> i have also tried the whole byte string from the capture
>
> res = dev.ctrl_transfer(0x22, 0x9, 0, 0, [0x03, 0x02, 0x85, 0x0a, 0x05,
> 0x14, 0xff, 0xff], 1000)
>
> to same effect.
>
> So what am i missing?
> Why is the trace saying that host to device message is using function 0x1b
> (Class interface) and device to host is using function 0x08 (control
> transfer), shouldn't it be the other way around?
>
> thanks,
> Anatoli
>
>
> ------------------------------------------------------------------------------
> Comprehensive Server Monitoring with Site24x7.
> Monitor 10 servers for $9/Month.
> Get alerted through email, SMS, voice calls or mobile push notifications.
> Take corrective actions from your mobile device.
> http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
> _______________________________________________
> pyusb-users mailing list
> pyusb-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pyusb-users
>



-- 
Best Regards,
Wander Lairson Costa

------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to