comedi_strerror return a const char*.
/* logging */
int comedi_loglevel(int loglevel);
void comedi_perror(const char *s);
-char *comedi_strerror(int errnum);
+const char *comedi_strerror(int errnum);
int comedi_errno(void);
int comedi_fileno(comedi_t *it);
int comedi_set_other_source(comedi_t *device, unsigned subdevice, unsigned channel,
unsigned other, unsigned source);
int comedi_set_routing(comedi_t *device, unsigned subdevice, unsigned channel, unsigned routing);
+int comedi_get_hardware_buffer_size(comedi_t *device, unsigned subdevice, enum comedi_io_direction direction);
#endif
}
EXPORT_ALIAS_DEFAULT(_comedi_strerror,comedi_strerror,0.7.18);
-char* _comedi_strerror(int errnum)
+const char* _comedi_strerror(int errnum)
{
if(errnum<COMEDI_NOERROR || errnum>=COMEDI_NOERROR+n_errors)
return strerror(errnum);
if(comedi_do_insn(device, &insn) >= 0) return 0;
else return -1;
}
+
+EXPORT_ALIAS_DEFAULT(_comedi_get_hardware_buffer_size,comedi_get_hardware_buffer_size,0.9.0);
+int _comedi_get_hardware_buffer_size(comedi_t *device, unsigned subdevice, enum comedi_io_direction direction)
+{
+ comedi_insn insn;
+ lsampl_t data[3];
+
+ memset(&insn, 0, sizeof(comedi_insn));
+ insn.insn = INSN_CONFIG;
+ insn.subdev = subdevice;
+ insn.data = data;
+ insn.n = sizeof(data) / sizeof(data[0]);
+ memset(insn.data, 0, insn.n * sizeof(insn.data[0]));
+ data[0] = INSN_CONFIG_GET_HARDWARE_BUFFER_SIZE;
+ data[1] = direction;
+
+ if(comedi_do_insn(device, &insn) >= 0) return data[2];
+ else return -1;
+}
comedi_internal_trigger;
comedi_set_other_source;
comedi_set_routing;
+ comedi_get_hardware_buffer_size;
} v0.8.0;