Added comedi::subdevice::reset wrapper for comedi_reset().
authorFrank Mori Hess <fmhess@speakeasy.net>
Wed, 25 Jun 2008 15:14:23 +0000 (15:14 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Wed, 25 Jun 2008 15:14:23 +0000 (15:14 +0000)
c++/include/comedilib.hpp

index 0b845da136c74642ef4606dc4a2de570bfee4cc3..497565b02d3c8704521c3d489bbe7f3b4e13e04a 100644 (file)
@@ -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);