From: Johannes E. <joh...@er...> - 2004-03-18 19:09:58
|
On Thu, Mar 18, 2004, martin f krafft <ma...@ma...> wrote: > I have taken upon me the task of converting a kernel module driver > to a user-space library atop of libusb. Unfortunately I only have > the kernel module source code, but zero support from manufacturer. > > I am trying to write to the device. In the kernel module, this is > done like so: > > usb_bulk_msg(dev, usb_sndbulkpipe(dev, 2), buf, size, &len, 2000); > > which expands to: > > usb_bulk_msg(dev, PIPE_BULK << 30 | dev->devnum << 8 | 2 << 15, > buf, size, &len, 2000); > > when I tried to use libusb's usb_bulk_write like so: > > usb_bulk_write(dev_h, 2, &buf, size, 2000); > > nothing happened, and USB didn't report an error. Something has to happen. You have a timeout atleast. Are you sure you want &buf and not just buf? > I wonder what I am doing wrong. Or is there a different way to do > what I want in libusb? > > I'd really appreciate any help... No, it looks correct to me. JE |