Page 1 of 1

Force feedback bitmap command sends extra bytes

Posted: Fri Apr 20, 2012 7:39 pm
by twlbean
I am using the USB interface, and sending the force feedback bitmap command. The problem I am seeing is that the response is 76 bytes. Per the documentation, I expect to get 74 bytes - (18 bits * 4 bytes) + CRC.

If I simply skip the first 2 bytes (0x41, 0x00) of the response, things appear to work.

Per the documentation of the force feedback bitmap command:

Code: Select all

UFDB1 - 0x00000000
UFDB2 - 0xFC000000
UFDB3 - 0x00000FFF
Any ideas what might be happening?

Re: Force feedback bitmap command sends extra bytes

Posted: Mon Apr 23, 2012 4:29 pm
by phussey
Although the CRC is only 16-bits, the CCU ships all values using 32-bit values including the CRC.

The additional 2 bytes are null bytes in the CRC value (16-bit value shipped as a 32).

Re: Force feedback bitmap command sends extra bytes

Posted: Mon Apr 23, 2012 6:20 pm
by twlbean
RMP Wizard wrote:Although the CRC is only 16-bits, the CCU ships all values using 32-bit values including the CRC.

The additional 2 bytes are null bytes in the CRC value (16-bit value shipped as a 32).
Thanks - that solved my problem. I also discovered that the 2 null bytes in the CRC value must also be included in the buffer passed to the CRC checksum routine otherwise the checksum will fail.