.\"Copyright 2011 (c) EPFL .TH EGD_GET_CAP 3 2011 "EPFL" "EEGDEV library manual" .SH NAME egd_get_cap - Query various information about the device capabilities .SH SYNOPSIS .LP .B #include .sp .BI "int egd_get_cap(const struct eegdev* " dev ", int " cap ", void* " val ");" .br .SH DESCRIPTION .LP \fBegd_get_cap\fP() returns the information about the capability specified by \fIcap\fP of the recording device referenced by \fIdev\fP by the mean of the pointer \fIval\fP. .LP The type of pointer passed through \fIval\fP is dependent on the requested capability \fIcap\fP which can be one the following (The expected type pointed by \fIval\fP is provided in parenthesis): .TP \fBEGD_CAP_FS\fP (\fBint\fP) Sampling frequency that is currently set. The same value is returned by the function. .TP \fBEGD_CAP_TYPELIST\fP (\fBconst int*\fP) Array of sensor types sampled by the device terminated by \-1. These values became valid as argument for \fBegd_sensor_name\fP(3) when opening the device \fIdev\fP if they were not yet before. The number of elements in the array (excluding the \-1 element) is provided by the return value of the function. .TP \fBEGD_CAP_DEVTYPE\fP (\fBconst char*\fP) Null terminated string describing the type of the recording device (Manufacturer and model if \fIdev\fP refers to actual hardware). The length of string (excluding the null character) is provided by the return value of the function. .TP \fBEGD_DEVID\fP (\fBconst char*\fP) Null-terminated string describing the model of the recording device (or an unique identifier of the resource). The length of string (excluding the null character) is provided by the return value of the function. .SH "RETURN VALUE" .LP In case of success, the function returns a positive value depending on the requested capability. Otherwise, \-1 is returned and \fIerrno\fP is set accordingly. .SH ERRORS .LP \fBegd_get_cap\fP() will fail if: .TP .B EINVAL \fIdev\fP is NULL, \fIcap\fP is not valid value or \fIval\fP is NULL while \fIcap\fP is not \fBEGD_CAP_FS\fP. .SH "SEE ALSO" .BR egd_sensor_name (3)