From: Frank Mori Hess Date: Wed, 25 Jun 2008 15:14:23 +0000 (+0000) Subject: Added comedi::subdevice::reset wrapper for comedi_reset(). X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0b4cf53b45e81b47da49803bc1c9b2f7660dfc09;p=comedilib.git Added comedi::subdevice::reset wrapper for comedi_reset(). --- diff --git a/c++/include/comedilib.hpp b/c++/include/comedilib.hpp index 0b845da..497565b 100644 --- a/c++/include/comedilib.hpp +++ b/c++/include/comedilib.hpp @@ -509,6 +509,18 @@ namespace comedi } return cRange; } + void reset() const + { + int retval = comedi_reset(comedi_handle(), index()); + if(retval < 0) + { + std::ostringstream message; + message << __PRETTY_FUNCTION__ << ": comedi_reset() failed."; + std::cerr << message.str() << std::endl; + comedi_perror("comedi_reset"); + throw std::runtime_error(message.str()); + } + } void set_buffer_size(unsigned num_bytes) const { int retval = comedi_set_buffer_size(comedi_handle(), index(), num_bytes);