Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jul 2010 10:59:25 +0200
From:      Peer Stritzinger <peerst@gmail.com>
To:        Hans Petter Selasky <hselasky@freebsd.org>
Cc:        freebsd-usb@freebsd.org
Subject:   Re: read(2) always returns 0 when reading from /dev/usb/n.m.k bulk IN endpoint
Message-ID:  <AANLkTimEW37MMVnlwJjF48ChV8FEWi8deX9cxoX-F4yM@mail.gmail.com>
In-Reply-To: <AANLkTikQ4bShI8vgjMjoFn7y6fw1qqXYCZFKInmQ5Pm7@mail.gmail.com>
References:  <AANLkTikOoAnGG4TN-lZf8VC3bF48u-oEXoSR3E8TOyiH@mail.gmail.com> <201007122020.02934.hselasky@freebsd.org> <AANLkTikQ4bShI8vgjMjoFn7y6fw1qqXYCZFKInmQ5Pm7@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

FYI: just tried using the short xfer ioctl, but the behavior didn't change.

  in = open (argv[0], O_RDONLY);
  ioctl(in, USB_SET_RX_SHORT_XFER, 1);
  n = read(in, buf, NBUF);

now trying libusb for this.

-- Peer

On Mon, Jul 12, 2010 at 10:41 PM, Peer Stritzinger <peerst@gmail.com> wrote:

> Hi,
>
> On Mon, Jul 12, 2010 at 8:20 PM, Hans Petter Selasky <hselasky@freebsd.org
> > wrote:
>
>> On Monday 12 July 2010 19:22:28 Peer Stritzinger wrote:
>> > However the read always returns 0.
>> >
>> > Tried different buffer sizes etc.
>> Hi,
>>
>> Maybe you are missing to set the short transfer OK flag.
>>
>> Else I recommend using LibUSB.
>>
>> --HPS
>>
>
> Did'nt set this flag (not doing any ioctls on the ugen device at all).
>
> However I did try matching either the max packetlen, or the read buffer
> size with the actual bytes sent, so I thought it shouldn't matter.
>
> I'll move on to libusb and not waste any more time with the raw interfaces.
>
> Thanks
> -- Peer
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimEW37MMVnlwJjF48ChV8FEWi8deX9cxoX-F4yM>