Commit graph

29 commits

Author SHA1 Message Date
Ian Abbott
235338eb7e demo/cmd: limit options.n_chan to N_CHANS
If the '-n' option sets options.n_chan to something higher than N_CHANS
(256), reduce it to avoid overrunning the chanlist[] array.
2016-11-08 14:52:44 +00:00
Ian Abbott
c2cf7c8018 demo/cmd: check subdevice exists and supports 'read' commands
Check the subdevice actually exists and that it claims to support 'read'
commands (SDF_CMD_READ subdevice flag set), bailing out early if not.
2016-11-08 14:15:35 +00:00
Ian Abbott
b7cb7f2331 demo/cmd: bail out if fail to prepare command
Check return value of prepare_cmd_lib() and exit if less than 0.

Also change prepare_cmd_lib() to write its error message to stderr
instead of stdout.
2016-11-08 13:48:56 +00:00
Ian Abbott
4329a08403 demo/cmd: default to the 'read' subdevice instead of subdevice 0
If the '-s' option has not been specified, default to using the current
'read' subdevice if there is one instead of defaulting to subdevice 0.
Fall back to using subdevice 0 if there is no 'read' subdevice.
2016-11-08 13:38:36 +00:00
Ian Abbott
80d809282c demo: update demo programs to set read or write subdevice
Attempt to make the streaming command demos work if the specified
subdevice is not the default 'read' or 'write' subdevice (depending on
the direction of the command).

This uses the new comedi_set_read_subdevice() and
comedi_set_write_subdevice() functions.

Changing the read or write subdevice is currently supported only by the
Linux "in-tree" version of Comedi since kernel version 3.19.
2016-05-13 17:19:10 +01:00
Frank Mori Hess
c1082cee65 Fixed comedi_get_cmd_generic_timed() by adding a chanlist_len
parameter.  Old version is still available in library, thanks to the
magic of the version_script.
2007-08-02 19:46:44 +00:00
Frank Mori Hess
3d1ae7facd Removed duplicate declaration. 2007-08-02 18:44:39 +00:00
Frank Mori Hess
fbdf65b4f5 Made parse_options() write options to a struct instead of passing
them through global variables.
2007-01-03 21:14:53 +00:00
Ian Abbott
c17577318d Applied patch from David MacMahon <davidm -at- astro -dot- berkeley -dot- edu>.
Adds physical units support to comedilib demo programs.
I changed one of the format strings to help line up values better in the
'cmd' example.
2006-07-20 11:51:54 +00:00
Frank Mori Hess
caedc7bf15 Made cmd demo work with SDF_LSAMPL subdevices. 2005-12-28 17:11:35 +00:00
David Schleef
af2f7409a2 Changes to make it a little more robust 2002-03-18 21:50:40 +00:00
Frank Mori Hess
52a2615b4c included string.h for declaration of memset. 2002-01-08 20:38:16 +00:00
David Schleef
3298f1fcc5 Fix includes 2001-07-30 20:38:54 +00:00
David Schleef
7973a0f2ad Change prototype of comedi_get_cmd_generic_timed 2001-07-15 22:39:54 +00:00
David Schleef
8139bc3558 Replace <string.h> 2001-07-15 19:57:08 +00:00
David Schleef
b668811b9c Changed main.c to common.c 2001-07-14 00:53:30 +00:00
David Schleef
68e8bf7b0d Major fixes and added inline documentation. It's actually somewhat
decent now.
2001-07-14 00:50:15 +00:00
David Schleef
d9e3023ff0 Fix previous bugus check-ins. 2001-06-27 22:11:59 +00:00
Frank Mori Hess
7263bf6d2c explicitly initialized value, subdevice, channel, aref and range in main.c 2001-05-14 00:04:08 +00:00
David Schleef
01a017f515 5 new demos
cmd uses main.c
removal of direct ioctl calls
2001-03-01 21:57:00 +00:00
Frank Mori Hess
c7a45f3edf added some comments, including advice on how to make interrupt handler run at hard real time priority 2001-02-15 21:01:13 +00:00
David Schleef
79a511162d Cleanup of example programs 2000-10-19 06:28:27 +00:00
David Schleef
31a3da0f21 added comment 2000-09-05 18:47:18 +00:00
David Schleef
e7a0f5f10c changes 2000-09-05 18:10:55 +00:00
David Schleef
14152fb380 added documentation 2000-09-03 02:15:20 +00:00
David Schleef
bb5cead91f more features 2000-08-09 21:08:17 +00:00
David Schleef
748980971d many random changes 2000-05-27 00:56:45 +00:00
David Schleef
6e6de1271a Expanded 2000-03-06 08:34:44 +00:00
David Schleef
b4bba38d0f Initial revision 2000-02-02 05:14:23 +00:00