Scubapro Aladin Square

Linus Torvalds torvalds at linux-foundation.org
Tue Nov 14 12:33:32 PST 2017


On Tue, Nov 14, 2017 at 12:15 PM, Jef Driesen <jef at libdivecomputer.org> wrote:
>
> In of you previous emails, you asked Vincent to patch the
>
>         if (io->packet_size < 64) {
>
> to a
>
>         if (1) {

Oh, my bad.

That was actually an earlier "let's try to avoid the report byte", and
I'd forgotten entirely about that (and it was pointless, since the
hidusb.c code actually removes the report byte anyway for libusb).

But yes, if Vincent has that code, then that explains why he might get
the smaller size.

Vincent, please remove that particular broken test patch if you have it.

> Ah that explains the difference. In upstream libdivecomputer the buffer is
> one byte larger:
>
> unsigned char buf[TX_PACKET_SIZE + 1];

And that may actually end up being relevant.

It makes no sense that the receiver cares about the number of padding
bytes, but the code originally always padded out to the full USB HID
packet size of 64 bytes.

The whole confusion between 32/33 is all kinds of crazy, but yes,
maybe some broken other end really wants to see 32 bytes plus report
byte.

So Vincent, also do change that

    unsigned char buf[TX_PACKET_SIZE];

in src/scubapro_g2.c to have the "+1" while you're at it, and see if
that matters..

             Linus


More information about the subsurface mailing list