From: Frank Mori Hess Date: Tue, 16 Sep 2008 14:48:14 +0000 (+0000) Subject: Added subdevice::subdevice_type() wrapper. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4d61d75531592566347b8d951639c70eaaa39bf4;p=comedilib.git Added subdevice::subdevice_type() wrapper. --- diff --git a/c++/include/comedilib.hpp b/c++/include/comedilib.hpp index 0e70b6a..16eeec9 100644 --- a/c++/include/comedilib.hpp +++ b/c++/include/comedilib.hpp @@ -633,6 +633,19 @@ namespace comedi } return result; } + comedi_subdevice_type subdevice_type() const + { + int retval = comedi_get_subdevice_type(comedi_handle(), index()); + if(retval < 0) + { + std::ostringstream message; + message << __PRETTY_FUNCTION__ << ": comedi_get_subdevice_type() failed."; + std::cerr << message.str() << std::endl; + comedi_perror("comedi_get_subdevice_type"); + throw std::runtime_error(message.str()); + } + return comedi_subdevice_type(retval); + } private: comedi_t* comedi_handle() const {return dev().comedi_handle();}