From b4fd07f2cfd9d283feff101c3b629c2b2fa40c6e Mon Sep 17 00:00:00 2001 From: David Schleef Date: Sat, 18 May 2002 22:48:19 +0000 Subject: [PATCH] Add comedi_get_read/write_subdevice() --- include/comedilib.h | 2 ++ lib/get.c | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/include/comedilib.h b/include/comedilib.h index 3e0fe7b..b2eafdc 100644 --- a/include/comedilib.h +++ b/include/comedilib.h @@ -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); diff --git a/lib/get.c b/lib/get.c index 85f5d35..0063a70 100644 --- 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) { -- 2.26.2