2012/1/30 bibek chitrakar <bibek.chitra...@gmail.com>:
> Hello Wander,
>
> I can write into the device. As you said earlier it was a bulk transfer.
> I have tried with this code. But the return is an array of zeros.
> Does it require a loop or something I am missing.
>
> Code
> #!/usr/bin/python
> import sys
>
> import usb.core
> import usb.util
>
> VENDOR_ID = 0x0dd4
> PRODUCT_ID = 0x01a8
>
> device = usb.core.find(idVendor=VENDOR_ID, idProduct=PRODUCT_ID)
>
> if device is None:
>     sys.exit("Could not find Printer.")
>
> if device.is_kernel_driver_active(0):
>     try:
>         device.detach_kernel_driver(0)
>     except usb.core.USBError as e:
>         sys.exit("Could not detatch kernel driver: %s" % str(e))
>
> try:
>     device.set_configuration()
>     device.reset()

Do not reset the device after set_configuration. Strictly speaking,
reseting the device would put put it in a non-configured state.

[snip]


-- 
Best Regards,
Wander Lairson Costa

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to