Added subdevice::subdevice_type() wrapper.
authorFrank Mori Hess <fmhess@speakeasy.net>
Tue, 16 Sep 2008 14:48:14 +0000 (14:48 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Tue, 16 Sep 2008 14:48:14 +0000 (14:48 +0000)
c++/include/comedilib.hpp

index 0e70b6a55b4bb358e0d0dd79868aad7d2c8e757c..16eeec97ef9b5bdca109b347bd17b53cca5854a8 100644 (file)
@@ -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();}