libx52  0.3.2
Saitek X52/X52Pro drivers for Linux/Unix
Configuration management

The config commands deal with x52d configuration subsystem, and have the following subcommands.

Load configuration

The config load subgroup allows you to load a configuration from a given file (discarding anything that was already in memory), or reload the configuration from the command-line specified configuration file (or default configuration file if no option was given on the command line.)

Load from file

Arguments

  • config
  • load
  • path-to-file

Returns

  • OK
  • config
  • load
  • path-to-file

Error

  • ERR
  • Invalid file '/none' for 'config load' command

Reload system configuration

Arguments

  • config
  • reload

Returns

  • OK
  • config
  • reload

Save configuration

The config save subgroup requests the x52d daemon to save the current state of the configuration to disk. This is either the system configuration file, or may be a user specified configuration file. Note that this will be created with the permissions of the running daemon, which may be running as root.

Dump configuration to file

Arguments

  • config
  • dump
  • path-to-file

Returns

  • OK
  • config
  • dump
  • path-to-file

Error

  • ERR
  • Invalid file '/none' for 'config dump' command

Save system configuration

Arguments

  • config
  • save

Returns

  • OK
  • config
  • save

Retrieve configuration parameter

The config get command requests a specific configuration value, given the section and the key. Refer to X52 driver daemon for the section and key names, as these are derived from the base configuration.

Arguments

  • config
  • get
  • section
  • key

Returns

  • DATA
  • section
  • key
  • value

Example

DATA\0mouse\0enabled\0true\0

Error example

ERR\0Error getting 'foo.bar'\0

Set configuration parameter

The config set command requests the x52d daemon to set the given (section, key) parameter to the given value. The daemon will treat it the same way as if it was being read from the configuration file, i.e., it will follow identical parsing logic, including ignoring unknown keys and not reporting errors for them.

A side effect of this is that the client could request a set for any arbitrary section and key pair, and if that pair was not recognized, it would be ignored, but the daemon would still send an OK response.

This will set the value within the configuration memory structures, and will immediately invoke the relevant callback to update the rest of the threads or device state.

Arguments

  • config
  • set
  • section
  • key
  • value

Returns

  • OK
  • config
  • set
  • section
  • key
  • value

Error example

ERR\0Error 22 setting 'led.fire'='none': Invalid argument\0