Specifications
Comedi
41 / 148
Description
The function comedi_fileno() returns the file descriptor for the device device. This descriptor can then be used as the file
descriptor parameter of read(), write(), etc. This function is intended to mimic the standard C library function fileno().
The returned file descriptor should not be closed, and will become invalid when comedi_close() is called on device.
Return value
A file descriptor, or -1 on error.
5.4.1.10 comedi_find_range
comedi_find_range — search for range
Synopsis
#include <comedilib.h>
int comedi_find_range(comedi_t * device, unsigned int subdevice, unsigned int channel, unsigned int unit, double min, double
max);
Description
The function comedi_find_range() tries to locate the optimal (smallest) range for the channel channel belonging to sub-
device subdevice of the comedi device device, that includes both min and max in units of unit.
Return value
If a matching range is found, the index of the matching range is returned. If no matching range is available, the function returns
-1.
5.4.1.11 comedi_find_subdevice_by_type
comedi_find_subdevice_by_type — search for subdevice type
Synopsis
#include <comedilib.h>
int comedi_find_subdevice_by_type(comedi_t * device, int type, unsigned int start_subdevice);
Description
The function comedi_find_subdevice_by_type() tries to locate a subdevice belonging to comedi device device, hav-
ing type type, starting with the subdevice start_subdevice. The comedi_subdevice_type enum specifies the possible subde-
vice types.
Return value
If it finds a subdevice with the requested type, it returns its index. If there is an error, the function returns -1 and sets the
appropriate error.