libx52/lib/libx52
nirenjan b6ebdef7ef Handle time out of range in libx52_set_clock
Prior to this change, the assumption was that localtime/gmtime would
never fail, regardless of the time value provided to it. However,
testing on an Ubuntu 20.04 machine revealed that the representable
range of time_t was about 56 bits, values that exceed a 56 bit
representation would cause localtime/gmtime to return a NULL pointer.

This change replaces the use of localtime/gmtime with their
corresponding thread-safe variants, and checks the return value against
NULL. If it matches a NULL value, then it will return an error and not
update the clocks.
2020-06-04 15:34:03 -07:00
..
doc Update Doxygen documentation 2020-05-31 08:45:34 -07:00
Makefile.am Remove consolidated API documentation page 2020-05-28 16:27:44 -07:00
README.md Reorganize source layout 2017-07-27 17:56:51 -07:00
libx52.h Handle time out of range in libx52_set_clock 2020-06-04 15:34:03 -07:00
libx52.pc.in Generate pkg-config file for libx52 2020-04-16 22:10:48 -07:00
x52_commands.h Add SPDX license identifiers in all files 2018-04-18 12:19:29 -07:00
x52_common.h Let libx52_init also translate libusb error codes 2018-07-17 16:00:19 -07:00
x52_control.c Add connect/disconnect methods to libx52 2020-05-23 02:18:40 -07:00
x52_core.c Add connect/disconnect methods to libx52 2020-05-23 02:18:40 -07:00
x52_date_time.c Handle time out of range in libx52_set_clock 2020-06-04 15:34:03 -07:00
x52_mfd_led.c Add SPDX license identifiers in all files 2018-04-18 12:19:29 -07:00
x52_strerror.c Add gettext support to libx52 2020-05-19 08:07:10 -07:00

README.md

X52 Pro MFD library

This is a library which communicates using libusb-1.0 with the Saitek X52 Pro HOTAS. The library provides several functions to control the LEDs and MFD of the above HOTAS.

Supported functions

  • Set the LED state of all LEDs
  • Write text to each of the MFD lines
  • Set the date/time on the MFD
  • Make the clutch and hat LEDs blink
  • Display the "SHIFT" indicator in the MFD

Note that when writing text to the MFD, the line length is limited to 16 characters. While you can pass a longer string, the library will only consider the first 16 characters for writing to the display.