libx52  0.3.2
Saitek X52/X52Pro drivers for Linux/Unix
Enumerations | Functions
Miscellaneous

Enumerations

enum  libx52_error_code {
  LIBX52_SUCCESS = 0 , LIBX52_ERROR_INIT_FAILURE , LIBX52_ERROR_OUT_OF_MEMORY , LIBX52_ERROR_INVALID_PARAM ,
  LIBX52_ERROR_NOT_SUPPORTED , LIBX52_ERROR_TRY_AGAIN , LIBX52_ERROR_OUT_OF_RANGE , LIBX52_ERROR_USB_FAILURE ,
  LIBX52_ERROR_IO , LIBX52_ERROR_PERM , LIBX52_ERROR_NO_DEVICE , LIBX52_ERROR_NOT_FOUND ,
  LIBX52_ERROR_BUSY , LIBX52_ERROR_TIMEOUT , LIBX52_ERROR_OVERFLOW , LIBX52_ERROR_PIPE ,
  LIBX52_ERROR_INTERRUPTED
}
 LibX52 Error codes. More...
 
enum  libx52_feature { LIBX52_FEATURE_LED }
 Feature support for libx52. More...
 

Functions

int libx52_update (libx52_device *x52)
 Update the X52. More...
 
int libx52_vendor_command (libx52_device *x52, uint16_t index, uint16_t value)
 Write a raw vendor control packet. More...
 
int libx52_check_feature (libx52_device *x52, libx52_feature feature)
 Check if the device supports the given feature. More...
 

Detailed Description

Miscellaneous functionality

Enumeration Type Documentation

◆ libx52_error_code

LibX52 Error codes.

Error codes returned by libx52

Enumerator
LIBX52_SUCCESS 

No error, indicates success

LIBX52_ERROR_INIT_FAILURE 

Initialization failure

LIBX52_ERROR_OUT_OF_MEMORY 

Out of memory

LIBX52_ERROR_INVALID_PARAM 

Invalid parameter(s)

LIBX52_ERROR_NOT_SUPPORTED 

Not supported

LIBX52_ERROR_TRY_AGAIN 

No change necessary, try again

LIBX52_ERROR_OUT_OF_RANGE 

Clock time value or timezone out of range

LIBX52_ERROR_USB_FAILURE 

Error encountered during USB interaction

LIBX52_ERROR_IO 

Input/output error

LIBX52_ERROR_PERM 

Insufficient permissions

LIBX52_ERROR_NO_DEVICE 

No such device

LIBX52_ERROR_NOT_FOUND 

Entry not found

LIBX52_ERROR_BUSY 

Busy

LIBX52_ERROR_TIMEOUT 

Timeout

LIBX52_ERROR_OVERFLOW 

Overflow

LIBX52_ERROR_PIPE 

Pipe error

LIBX52_ERROR_INTERRUPTED 

Operation interrupted

◆ libx52_feature

Feature support for libx52.

Each flag is passed to libx52_check_feature to determine if the connected device has the given feature. This list of features is only limited to those which differ between the supported devices.

Enumerator
LIBX52_FEATURE_LED 

Individual LED control

Function Documentation

◆ libx52_check_feature()

int libx52_check_feature ( libx52_device x52,
libx52_feature  feature 
)

Check if the device supports the given feature.

This will check if the connected device supports the requested feature. It will return LIBX52_SUCCESS if it does support it, LIBX52_ERROR_NOT_SUPPORTED if it does not, and another libx52_error_code on errors.

Parameters
[in]x52Pointer to the device context
[in]featureFeature identifier (libx52_feature)
Returns
libx52_error_code indicating status

◆ libx52_update()

int libx52_update ( libx52_device x52)

Update the X52.

All the libx52_set functions only set the internal data structures, but do not actually write anything to the joystick. This function writes the saved data to the joystick and updates the internal data structures as necessary.

Parameters
[in]x52Pointer to the device context
Returns
libx52_error_code indicating status

◆ libx52_vendor_command()

int libx52_vendor_command ( libx52_device x52,
uint16_t  index,
uint16_t  value 
)

Write a raw vendor control packet.

This function sends the control packet immediately to the hardware, without having to wait for a call to libx52_update.

This can be used to debug issues seen on the hardware, however, it is NOT recommended for use by end users, as it can potentially damage the hardware.

Parameters
[in]x52Pointer to the device context
[in]indexwIndex in the USB packet
[in]valuewValue in the USB packet
Returns
libx52_error_code indicating status