From 39253a72b3274620c8f2a86e50d52c50d49db523 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Mon, 31 Mar 2008 17:08:33 +0000 Subject: [PATCH] Added wrappers for comedi_get_hardware_buffer_size and comedi_find_range. --- c++/include/comedilib.hpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/c++/include/comedilib.hpp b/c++/include/comedilib.hpp index 95b5703..0b845da 100644 --- a/c++/include/comedilib.hpp +++ b/c++/include/comedilib.hpp @@ -378,6 +378,20 @@ namespace comedi throw std::runtime_error(message.str()); } } + unsigned find_range(unsigned channel, unsigned unit, double min, double max) + { + int retval = comedi_find_range(comedi_handle(), index(), channel, + unit, min, max); + if(retval < 0) + { + std::ostringstream message; + message << __PRETTY_FUNCTION__ << ": comedi_find_range() failed."; + std::cerr << message.str() << std::endl; + comedi_perror("comedi_find_range"); + throw std::runtime_error(message.str()); + } + return retval; + } unsigned flags() const { int retval = comedi_get_subdevice_flags(comedi_handle(), index()); @@ -404,6 +418,19 @@ namespace comedi } return result; } + unsigned hardware_buffer_size(enum comedi_io_direction direction) const + { + int retval = comedi_get_hardware_buffer_size(comedi_handle(), index(), direction); + if(retval < 0) + { + std::ostringstream message; + message << __PRETTY_FUNCTION__ << ": comedi_get_hardware_buffer_size() failed."; + std::cerr << message.str() << std::endl; + comedi_perror("comedi_get_hardware_buffer_size"); + throw std::runtime_error(message.str()); + } + return retval; + } unsigned index() const {return _index;}; void internal_trigger(unsigned trig_num) const { -- 2.26.2