2011/11/21 Eric Hewett <eric.hew...@gmail.com>: > Hi, > Thanks for your reply > I modified the code following your suggestion with the resulting error > argument 4: <type 'exceptions.TypeError'>: wrong type" > > File: /usr/local/lib/python2.6/dist-packages/usb/backend/libusb10.py, Line: > 548 > > Here are lines 523 -548 of libusb(10).py > @methodtrace(_logger) > def ctrl_transfer(self, > dev_handle, > bmRequestType, > bRequest, > wValue, > wIndex, > data_or_wLength, > timeout): > if usb.util.ctrl_direction(bmRequestType) == usb.util.CTRL_OUT: > buff = data_or_wLength > else: > buff = _interop.as_array((0,) * data_or_wLength) > addr, length = buff.buffer_info() > length *= buff.itemsize > ret = _check(_lib.libusb_control_transfer(dev_handle, > bmRequestType, > bRequest, > wValue, > wIndex, > cast(addr, > POINTER(c_ubyte)), > length, > timeout)) > I wonder whether there is some mismatch between the 2 libraries? > Then I started to reread the documentation especially for the usb.control > module. So I commented out the ctrl_transfer and tried > usb.control.set_feature(dev, msg, None) > I got a familiar error :-) > The debugged program raised the exception ArgumentError > > "argument 4: <type 'exceptions.TypeError'>: wrong type" > File: /usr/local/lib/python2.6/dist-packages/usb/backend/libusb10.py, Line: > 548 > > I am not sure how common this is, but the USB device I am using which is a > Toradex Oak 4-20mA sensor uses Feature Report commands to manipulate its > internals, hence the msg structure. As we are likely several sensors > attached to a single hub, it would be useful to identify individual USB > devices. > kind regards > Eric Hewett >
Could you please post source code? -- Best Regards, Wander Lairson Costa https://github.com/walac https://gitorious.org/~walac ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d _______________________________________________ pyusb-users mailing list pyusb-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pyusb-users