Scubapro Aladin Square

Jef Driesen jef at libdivecomputer.org
Tue Nov 14 12:46:47 PST 2017


On 14-11-17 21:33, Linus Torvalds wrote:
> On Tue, Nov 14, 2017 at 12:15 PM, Jef Driesen <jef at libdivecomputer.org> wrote:
>> 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.

For the G2 on windows, the output packet size is 32 bytes, not 64 bytes. The 
input size is indeed 64 bytes. At least that's what the Windows api tells us. (I 
confirmed that by patched hidapi to log those numbers.) And since it wants the 
report id prepended, the total input packet size is 33 bytes. Anything else 
results in an invalid parameter error.

I don't know for sure for the Square, but since it worked, I assume it's the 
same there.

Jef


More information about the subsurface mailing list