Add comedi_get_read/write_subdevice()
authorDavid Schleef <ds@schleef.org>
Sat, 18 May 2002 22:48:19 +0000 (22:48 +0000)
committerDavid Schleef <ds@schleef.org>
Sat, 18 May 2002 22:48:19 +0000 (22:48 +0000)
include/comedilib.h
lib/get.c

index 3e0fe7b13805dc24ceeee2dc45736fddfe4ca032..b2eafdcafcaf3a478d890c246e36a16da2734428 100644 (file)
@@ -185,6 +185,8 @@ enum comedi_oor_behavior {
 
 enum comedi_oor_behavior comedi_set_global_oor_behavior(enum comedi_oor_behavior behavior);
 
+int comedi_get_read_subdevice(comedi_t *dev);
+int comedi_get_write_subdevice(comedi_t *dev);
 
 
 
index 85f5d35a4b05eb177d4f5c3909d7dee3a4e3a71c..0063a70c33b83f486519f1e59bb3ec5b0ea2f1d7 100644 (file)
--- a/lib/get.c
+++ b/lib/get.c
@@ -96,6 +96,21 @@ int comedi_find_subdevice_by_type(comedi_t *it,int type,unsigned int subd)
        return -1;
 }
 
+int comedi_get_read_subdevice(comedi_t *dev)
+{
+       if(!valid_dev(dev))
+               return -1;
+
+       return dev->devinfo.read_subdevice;
+}
+
+int comedi_get_write_subdevice(comedi_t *dev)
+{
+       if(!valid_dev(dev))
+               return -1;
+
+       return dev->devinfo.write_subdevice;
+}
 
 int comedi_get_n_channels(comedi_t *it,unsigned int subd)
 {