1 May 2006 04:19
bulk_write & read problems under OSX and Linux
Graeme Gill <graeme2 <at> argyllcms.com>
2006-05-01 02:19:48 GMT
2006-05-01 02:19:48 GMT
Hi, I'm in the process of porting an application that communicates with a harware device using a serial port, over to using USB. The device is pretty simple, it has two end points, and you send ASCII messages to and fro using bulk write and read, very similar to a serial port. I've managed to get it working to some degree using LibUSB-win32, but have number of problems using LibUSB (0.1.12) under OSX & Linux. Under OSX (10.3.9), the problem is that small messages get through successfully, but larger messages have the first packet missing - ie. I expect to receive a 23 byte message, but I get 15 bytes, the first 8 having gone missing. (BTW, libusb.a isn't quite built right - the linker complains about the contents table being out of date, and I have to run ranlib on it to make it work.) Under Linux, (White Box Enterprise Linux release 4), I have a different problem (this is using the same code as used for OSX). Neither bulk read, nor bulk write work, both return error -22 "error submitting URB: Invalid argument". Now of course, I'm not playing with URB's, that's something in libusb linux.c. I've looked at the arguments to the bulk read and write calls, and there doesn't seem anything obviously wrong with these. I do a couple of usb_control_msg() USB_REQ_GET_STATUS(Continue reading)
RSS Feed