1 May 2008 02:50
Re: usb_bulk_read vs. openusb_bulk_xfer
Xiaofan Chen <xiaofanc <at> gmail.com>
2008-05-01 00:50:30 GMT
2008-05-01 00:50:30 GMT
On Thu, May 1, 2008 at 2:05 AM, Michael Lewis <milewis1 <at> gmail.com> wrote:
> On Wed, Apr 30, 2008 at 11:21 AM, adamlah <adamlah <at> gmail.com> wrote:
>
> >
> > Using libusb my code is something like this..
> >
> > const int bulklen = 65536;
> > char bulk[bulklen]
> > while {
> > int ret = usb_bulk_read(udev, 0x82, bulk, bulklen, 500);
> > write(1, bulk, ret);
> > }
> >
> > I get a whole bunch of output to the screen. Now, converting this to
> openusb
> > I have something like..
> >
> > openusb_bulk_request_t bulk;
> > memset(&bulk, 0, sizeof(bulk));
> > memset(bulkrd, 0, buflen);
> > while {
> > ret = openusb_bulk_xfer(devh, 0, 0x82, &bulk);
> > for (i=0; i<bulk.result.transferred_bytes; i++) {
> > printf("%02x ", (unsigned char)bulkrd[1]);
> > }
> > }
> >
> > I get nothing. bulkrd is always empty and bulk.result.transferred_bytes is
> > always 0. I've spent hours trying to sort this bit out and I was wondering
> > if anyone could offer me any advice?
(Continue reading)
RSS Feed