COMEDI_COMMAND_TEST(3)

πŸ’– COMEDI_COMMAND_TEST β€” bestie edition πŸ’–

okay so this is a page from the Comedi reference manual, and today we're deep-diving comedi_command_test. it's giving "let me check your vibe before you commit" energy and honestly? iconic.


✨ NAME ✨

comedi_command_test β€” test streaming input/output configuration πŸ¦‹


✨ SYNOPSIS ✨

#include <comedilib.h>

int comedi_command_test(comedi_t * device, comedi_cmd * command);

✨ DESCRIPTION ✨

okay so here's the tea β˜• β€” comedi_command_test takes the command structure that command points at, gives it a full vibe check, and hands you back an integer telling you exactly which testing stages it slayed through. πŸŽ€

and here's the part that's lowkey important: it does not just read your struct, bestie β€” it edits it. if any elements of the comedi_cmd structure are invalid, they may get modified on the way out. specifically:

  • the source elements? modified to strip out any invalid source triggers. bye girl πŸ’…
  • the argument elements? adjusted or rounded to the nearest valid value. glow-up fr fr.

✨ RETURN VALUE ✨

the return value is basically a progress report, and here's what each number means:

  • 0 β€” valid command. we ate. πŸ‘‘
  • 1 β€” one of the ..._src members of the command had an unsupported trigger in it. the bits that correspond to those unsupported triggers get zeroed. πŸ’€
  • 2 β€” either that particular combo of ..._src settings isn't supported by the driver, or one of the ..._src members has the bit for multiple trigger sources set at the same time. pick one struggle, bestie 😭
  • 3 β€” one of the ..._arg members is set outside the range of allowable values. think: an argument for a TRIG_TIMER source that exceeds the board's max speed. the invalid ..._arg members get adjusted to valid values.
  • 4 β€” one of the ..._arg members needed adjustment. for example, the argument of a TRIG_TIMER source may have been rounded to the nearest timing period your board actually supports. rounding is self-care ✨
  • 5 β€” some aspect of the command's chanlist is unsupported by the board. like, some analog input boards insist every channel in the chanlist use the same input range. make it make sense πŸ™ˆ
and if it fails? -1 comes back. not the vibe, but at least it's honest. πŸ’€

✨ AUTHORS ✨

the legends who built this 🫢:

  • David Schleef <ds@schleef.org> β€” Author.
  • Frank Mori Hess <fmhess@users.sourceforge.net> β€” Author.
  • Herman Bruyninckx <Herman.Bruyninckx@mech.kuleuven.ac.be> β€” Author.
  • Bernd Porr <tech@linux-usb-daq.co.uk> β€” Author.
  • Ian Abbott <abbotti@mev.co.uk> β€” Author.
  • Γ‰ric Piel <piel@delmic.com> β€” Author.

Copyright Β© 1998-2003 David Schleef Copyright Β© 2001-2003, 2005, 2008 Frank Mori Hess Copyright Β© 2002-2003 Herman Bruyninckx Copyright Β© 2012 Bernd Porr Copyright Β© 2012 Ian Abbott Copyright Β© 2012, 2015 Γ‰ric Piel

this document is part of Comedilib. and for the purposes of this document specifically, when the license says "source code", it means the XML source. noted, bestie πŸŽ€

this library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, version 2.1 of the License. 🌈

this library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. see the GNU Lesser General Public License for more details. πŸ‘‘

you should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. πŸ’Œ


ok that's the whole page, no skips, no cuts, every single bit is there πŸ’…

and that's a wrap on the Comedi manual, dated 03/20/2026 β€” stay hydrated, read your licenses, and go test those commands before you commit to them. periodt. πŸ¦‹βœ¨πŸ’–

πŸ“¦ where this page comes from