/* */ #include #include #include #include #include #include #include #include #include #include #include "comedi_test.h" char *filename="/dev/comedi0"; int verbose_flag; comedi_t *device; int subdevice; int channel; int aref; int range; int test_info(void); int test_mode0_read(void); int test_insn_read(void); int test_cmd_probe_src_mask(void); int test_cmd_probe_fast_1chan(void); int test_cmd_read_fast_1chan(void); struct test_struct{ char *name; int (*do_test)(void); }; struct test_struct tests[]={ { "info", test_info }, { "mode0_read", test_mode0_read }, { "insn_read", test_insn_read }, { "cmd_probe_src_mask", test_cmd_probe_src_mask }, { "cmd_probe_fast_1chan", test_cmd_probe_fast_1chan }, { "cmd_read_fast_1chan", test_cmd_read_fast_1chan }, }; static int n_tests = sizeof(tests)/sizeof(tests[0]); int main(int argc, char *argv[]) { int c; int i; while (1) { c = getopt(argc, argv, "f"); if (c == -1) break; switch (c) { case 'f': filename = argv[optind]; break; default: printf("bad option\n"); exit(1); } } device = comedi_open(filename); if(!device){ printf("E: comedi_open(\"%s\"): %s\n",filename,strerror(errno)); } for(subdevice=0;subdevice