Hello...

I'm new to python (and pyusb).
I try to port some VUSB device to work with python, but get at trouble 
in beggining. I can't send bytes...
here is my example (stripped from manual...)

import usb.core
import usb.util

from array import *
dev = usb.core.find(idVendor=0x16c0, idProduct=0x05df)
if dev is None:
     raise ValueError('Device not found')
dev.set_configuration()

msg = 'test'
print dev.ctrl_transfer(32+128, 9, 0, 0, msg)

and there is error report

Traceback (most recent call last):
   File "pyusbtest.py", line 13, in <module>
     print dev.ctrl_transfer(32+128, 9, 0, 0, msg)
   File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 711, 
in ctrl_transfer
     self.__get_timeout(timeout)
   File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", 
line 823, in ctrl_transfer
     buff = _interop.as_array((0,) * data_or_wLength)
TypeError: can't multiply sequence by non-int of type 'str'

how to proceed? (python2.7 on ubuntu)
slavko.



------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to