Byte swapping u16 data in HID report

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
I'm looking into fixing the Sixaxis controller (hid-sony.c) so that the
accelerometers and gyro data are reported via a joystick axis.

I have patched the HID descriptor so that the values are seen, however
they are reported high byte first (0x2FF -> 0x02, 0xFF) which appears to
be contrary to the HID spec.
--
5.8 Format of Multibyte Numeric Values
Multibyte numeric values in reports are represented in little-endian
format, with the least significant byte at the lowest address.
--

I'm working on the assumption that the data can be 'fixed' before it is
parsed. Would intercepting 'hid_get_report()' be a good place and how can
I locate the actual data bytes to do a 'bswap16()'.

I'm thinking something like:
--
	if (sc->quirks & SIXAXIS_CONTROLLER_USB) {
		hdev->hid_get_report = sixaxis_hid_get_report;
	}
--

Any suggestions/comments?
Simon.



--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux