From 83058293b93f0be8fb9a7e055f19512b04d6d3dc Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Thu, 13 Nov 2008 14:17:15 +0000 Subject: [PATCH] Added C++ wrapper for comedi_get_buffer_contents(). --- c++/include/comedilib.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/c++/include/comedilib.hpp b/c++/include/comedilib.hpp index 16eeec9..a999ec4 100644 --- a/c++/include/comedilib.hpp +++ b/c++/include/comedilib.hpp @@ -405,6 +405,19 @@ namespace comedi } return retval; } + unsigned get_buffer_contents() const + { + int retval = comedi_get_buffer_contents(comedi_handle(), index()); + if(retval < 0) + { + std::ostringstream message; + message << __PRETTY_FUNCTION__ << ": comedi_get_buffer_contents() failed."; + std::cerr << message.str() << std::endl; + comedi_perror("comedi_get_buffer_contents"); + throw std::runtime_error(message.str()); + } + return retval; + } void get_clock_source(unsigned *clock, unsigned *period_ns) const { int retval = comedi_get_clock_source(comedi_handle(), index(), clock, period_ns); -- 2.26.2