From 761ffc3e90b93c11f5c0d79800870ac743663fe3 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Thu, 13 Jul 2006 12:43:14 +0000 Subject: [PATCH] Applied (slightly modified) patch from David MacMahon . Reports specific error string (strerror(errno)) if comedi_open fails (I changed the format slightly from David's). Displays subdevice flags as a hexadecimal number. --- demo/info.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/demo/info.c b/demo/info.c index 7e75427..2885c6e 100644 --- a/demo/info.c +++ b/demo/info.c @@ -47,13 +47,14 @@ int main(int argc,char *argv[]) int n_subdevices,type; int chan,n_chans; int n_ranges; + int subdev_flags; comedi_range *rng; parse_options(argc,argv); it=comedi_open(filename); if(!it){ - fprintf(stderr,"cannot open %s\n",filename); + fprintf(stderr,"cannot open %s: %s\n",filename, strerror(errno)); exit(0); } @@ -69,6 +70,8 @@ int main(int argc,char *argv[]) printf(" type: %d (%s)\n",type,subdevice_types[type]); if(type==COMEDI_SUBD_UNUSED) continue; + subdev_flags = comedi_get_subdevice_flags(it, i); + printf(" flags: 0x%08x\n",subdev_flags); n_chans=comedi_get_n_channels(it,i); printf(" number of channels: %d\n",n_chans); if(!comedi_maxdata_is_chan_specific(it,i)){ -- 2.26.2