- From: Jan Gukelberger <g.u.g.i_at_gmx.de>
- Date: Sun, 24 Apr 2005 18:08:30 +0200
Hi,
I think I've found a bug in comedi_get_cmd_generic_timed.
Have a look at comedilib/lib/cmd.c lines 175ff:
-----------8<----------------------8<----------------------8<-----------
if(!s->cmd_timed){
s->cmd_timed = malloc(sizeof(comedi_cmd));
ret = __generic_timed(it,subd,s->cmd_timed,ns);
if(ret<0){
s->cmd_mask_errno = errno;
return -1;
}
}
*cmd=*s->cmd_timed;
-----------8<----------------------8<----------------------8<-----------
__generic_timed is only called the first time the app uses
get_cmd_generic_timed.
Thus, the ns argument of subsequent queries is simply ignored and all
queries yield the result of the first query.
This makes it impossible to produce commands for different sampling
rates within one program (well, you have to manipulate the cmd struct
manually).
Trivial patch attached.
Regards,
Jan
Attachments
- text/x-patch attachment: cmd.c.diff
Received on 2005-04-24Z15:08:30