libx52  0.3.2
Saitek X52/X52Pro drivers for Linux/Unix
X52 daemon socket communication protocol

The X52 daemon creates a Unix domain stream socket, by default at /var/run/x52d.cmd and listens for connection requests from clients at this location. This can be overridden by passing the -s flag when starting the daemon.

Protocol Overview

x52d requires that clients send it commands as a series of NUL terminated strings, without any interleaving space. The command should be sent in a single send call, and the client may expect a response in a single recv call.

The send call must send exactly the number of bytes in the command text. Extra bytes will be treated as additional arguments, which would cause the command to fail. It is recommended that the recv call uses a 1024 byte buffer to read the data. Responses will never exceed this length.

Responses

The daemon sends the response as a series of NUL terminated strings, without any interleaving space. The first string is always one of the following:

  • OK
  • ERR
  • DATA

This determines whether the request was successful or not, and subsequent strings describe the action, error or requested data.

Examples

Reloading configuration

  • send config\0reload\0
  • recv OK\0config\0reload\0

Reading mouse speed

  • send config\0get\0mouse\0speed\0
  • recv DATA\0mouse\0speed\010\0

Sending an invalid command

  • send config reload
  • recv ERR\0Unknown command 'config reload'\0

Commands

x52d commands are arranged in a hierarchical fashion as follows:

<command-group> [<sub-command-group> [<sub-command-group> [...]]] <command> [<arguments>]

The list of supported commands are shown below: