diff --git a/doc/comedilib.sgml b/doc/comedilib.sgml
index ef115e0..df377ed 100644
--- a/doc/comedilib.sgml
+++ b/doc/comedilib.sgml
@@ -550,6 +550,7 @@ is only accurate to part-per-thousand.
Commands
+
@@ -697,6 +698,15 @@ to do??
+The typical sequence for executing a command is to first send
+the command through
+[
+once or twice. The test will check that the command is valid for the particular
+device, and often makes some adjustments to the command arguments, which
+can then be read back by the user to see the actual values used. The
+command is executed with
+][. For input/output commands, data
+is read from or written to the device file /dev/comedi[0..3] you are using.
]Libcomedi Reference
@@ -863,10 +873,39 @@ details.
-undocumented
+
+typedef struct comedi_cmd_struct comedi_cmd;
+
+struct comedi_cmd_struct{
+ unsigned int subdev;
+ unsigned int flags;
+
+ unsigned int start_src;
+ unsigned int start_arg;
+
+ unsigned int scan_begin_src;
+ unsigned int scan_begin_arg;
+
+ unsigned int convert_src;
+ unsigned int convert_arg;
+
+ unsigned int scan_end_src;
+ unsigned int scan_end_arg;
+
+ unsigned int stop_src;
+ unsigned int stop_arg;
+
+ unsigned int *chanlist;
+ unsigned int chanlist_len;
+
+ sampl_t *data;
+ unsigned int data_len;
+};
+
-Related functions are described in section XXX.
+More information on using commands can be found in the
+[ section.
]
This structure is defined as part of the Comedi kernel interface.
@@ -920,7 +959,14 @@ Source: /lib/comedi.c
int comedi_command(comedi_t *it, comedi_cmd *cmd);
-undocumented
+Issues the command pointed at by to
+fix up the command before it can be successfully executed with
+ for more information.
+
Source: /lib/comedi.c
@@ -931,7 +977,34 @@ Source: /lib/comedi.c
int comedi_command_test(comedi_t *it, comedi_cmd *cmd);
-undocumented
+
+Tests and fixes up the command pointed at by
+- 0: the command passed the test and can be successfully executed
+ by
[. The one exception
+ to this rule is that the test will allow a NULL chanlist for the command.
+]- 1: invalid trigger. One or more of the trigger sources (the *_src members
+ of the
[ structure) is not
+ supported by the driver.
+]- 2: incompatible triggers. Two or more of the triggers selected are
+ incompatible with each other. For example, a driver might allow either
+ the scan_begin_src or the convert_src to be TRIG_TIMER, but not both.
+
- 3: argument invalid. One or more argument is invalid, for example
+ a timing argument might be in excess of the card's maximum speed. The
+ command test will correct the arguments by modifying the command pointed
+ at by
4: argument fix up. The command underwent minor adjustment and should
+ now be valid. For example, a timing argument might not be exactly achievable
+ by the card so the timing argument will be adjusted to the actual timing
+ the card will use.
+- negative: some other error has occured.
+
+See
+
[ for more information.
+
]
Source: /lib/comedi.c
@@ -1737,8 +1810,6 @@ returns 0. On error, this function returns -1.
- comedi_get_cmd_src_mask()
- comedi_get_cmd_generic_timed()
- comedi_cancel()
-
- comedi_command()
-
- comedi_command_test()
- comedi_poll()
- comedi_get_buffer_contents()
- comedi_mark_buffer_read()