diff --git a/group__x52dcomm.html b/group__x52dcomm.html index cef2e91..7f8c9b1 100644 --- a/group__x52dcomm.html +++ b/group__x52dcomm.html @@ -161,7 +161,7 @@ Functions
Send a command to the daemon and retrieve the response.
-The client sends the command and parameters as a single NULL terminated string, and retrieves the response in the same manner. Depending on the result, the return status is either a positive integer or -1, and errno
is set accordingly.
The client sends the command and parameters as a series of NUL terminated strings, and retrieves the response in the same manner. Depending on the result, the return status is either a positive integer or -1, and errno
is set accordingly.
buffer
should contain sufficient space to accomodate the returned response string.
This is a blocking function and will not return until either a response is received from the server, or an exception condition occurs.
Most libx52 functions to update the joystick state do not directly write to the connected joystick, but only update internal data structures within the device context. In order to actually update the joystick, the application must call libx52_update. This function writes the updates to the joystick and resets any internal state.
Example
@@ -105,11 +105,11 @@ Joystick UpdatesMost libx52 functions return a standard libx52_error_code integer value that indicates the status of the operation. As long as the operation succeeded, the function will return LIBX52_SUCCESS. Other values returned indicate a failure of some sort.
libx52_strerror can convert the return code into a descriptive string that may be displayed to users.
-libx52_strerror automatically handles internationalization. As long as your application sets up the locale correctly, and the error strings have been translated to that locale, the returned strings will correspond to the translated values for your locale.
diff --git a/pages.html b/pages.html index abd6108..e0e3c0a 100644 --- a/pages.html +++ b/pages.html @@ -68,14 +68,16 @@ $(function() {
+ libx52
+ 0.2.3
+
+ Saitek X52/X52Pro drivers for Linux/Unix
+ |
+
The config
commands deal with x52d configuration subsystem, and have the following subcommands.
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.)
Arguments
+config
load
Returns
+OK
config
load
Error
+ERR
Invalid file '/none' for 'config load' command
Arguments
+config
reload
Returns
+OK
config
reload
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.
Arguments
+config
dump
Returns
+OK
config
dump
Error
+ERR
Invalid file '/none' for 'config dump' command
Arguments
+config
save
Returns
+OK
config
save
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
Returns
+DATA
Example
+Error example
+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.
Finally, this will only set the value within the configuration memory structures, and will not invoke any callback to update the rest of the threads or device state. The client will need to call the apply
subcommand to actually invoke the necessary callbacks.
Arguments
+config
set
Returns
+OK
config
set
Error example
+The config apply
command will invoke all the callbacks and ensure that the configuration is applied to the running state.
Arguments
+config
apply
Returns
+OK
config
apply
x52ctl - Command line controller to X52 daemon
-x52ctl [-i] [-s socket-path] [command]
x52ctl is a program that can be used to communicate with the X52 daemon. It can be used either as a one-shot program that can be run from another program or script, or it can be run interactively.
Commands are sent to the running daemon, and responses are written to standard output.
-If not running interactively, then you must specify a command, or the program will exit with a failure exit code. If running interactively, the program will request input and send that to the daemon, until the user either enters the string "quit", or terminates input by using Ctrl+D.
+If not running interactively, then you must specify a command, or the program will exit with a failure exit code. If running interactively, the program will request input and send that to the daemon, until the user either enters the string "quit", or terminates input by using Ctrl+D.
+-i
Run in interactive mode. Any additional non-option arguments are ignored.-s < socket-path >
Use the socket at the given path. If this is not specified, then it uses a default socket. -c
- Path to configuration file-p
- Path to PID file-o
- Configuration override - only applied during startup-s
- Path to command socket (see X52 daemon socket communication protocol)
+ libx52
+ 0.2.3
+
+ Saitek X52/X52Pro drivers for Linux/Unix
+ |
+
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.
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.
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.
+config\0reload\0
OK\0config\0reload\0
config\0get\0mouse\0speed\0
DATA\0mouse\0speed\010\0
config reload
ERR\0Unknown command 'config reload'\0
x52d commands are arranged in a hierarchical fashion as follows:
+The list of supported commands are shown below:
+ +