bufconfig support
This commit is contained in:
parent
e5a7e10668
commit
93c44d29a1
1 changed files with 46 additions and 0 deletions
46
lib/get.c
46
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue