From: David Schleef Date: Thu, 1 Mar 2001 21:58:37 +0000 (+0000) Subject: bufconfig support X-Git-Tag: r0_7_15~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=93c44d29a1736a51957ebed0706c6a96e8f56066;p=comedilib.git bufconfig support --- diff --git a/lib/get.c b/lib/get.c index da061a1..e7ea066 100644 --- a/lib/get.c +++ b/lib/get.c @@ -150,3 +150,49 @@ comedi_range * comedi_get_range(comedi_t *it,unsigned int subdevice,unsigned int +int comedi_get_buffer_size(comedi_t *it,unsigned int subd) +{ + comedi_bufconfig bc; + int ret; + + memset(&bc,0,sizeof(bc)); + + bc.subdevice = subd; + + ret = ioctl(it->fd, COMEDI_BUFCONFIG, &bc); + if(ret<0)return -1; + + return bc.size; +} + +int comedi_get_max_buffer_size(comedi_t *it,unsigned int subd) +{ + comedi_bufconfig bc; + int ret; + + memset(&bc,0,sizeof(bc)); + + bc.subdevice = subd; + + ret = ioctl(it->fd, COMEDI_BUFCONFIG, &bc); + if(ret<0)return -1; + + return bc.maximum_size; +} + +int comedi_set_buffer_size(comedi_t *it,unsigned int subd,int size) +{ + comedi_bufconfig bc; + int ret; + + memset(&bc,0,sizeof(bc)); + + bc.subdevice = subd; + bc.size = size; + + ret = ioctl(it->fd, COMEDI_BUFCONFIG, &bc); + if(ret<0)return -1; + + return bc.size; +} +