📄 frontend.tex
字号:
int open(const char *deviceName, int flags);}{ This system call opens a named frontend device (/dev/dvb/adapter0/frontend0) for subsequent use. Usually the first thing to do after a successful open is to find out the frontend type with FE\_GET\_INFO. The device can be opened in read-only mode, which only allows monitoring of device status and statistics, or read/write mode, which allows any kind of use (e.g. performing tuning operations.) In a system with multiple front-ends, it is usually the case that multiple devices cannot be open in read/write mode simultaneously. As long as a front-end device is opened in read/write mode, other open() calls in read/write mode will either fail or block, depending on whether non-blocking or blocking mode was specified. A front-end device opened in blocking mode can later be put into non-blocking mode (and vice versa) using the F\_SETFL command of the fcntl system call. This is a standard system call, documented in the Linux manual page for fcntl. When an open() call has succeeded, the device will be ready for use in the specified mode. This implies that the corresponding hardware is powered up, and that other front-ends may have been powered down to make that possible. }{ const char *deviceName & Name of specific video device.\\ int flags & A bit-wise OR of the following flags:\\ & \hspace{1em} O\_RDONLY read-only access\\ & \hspace{1em} O\_RDWR read/write access\\ & \hspace{1em} O\_NONBLOCK open in non-blocking mode \\ & \hspace{1em} (blocking mode is the default)\\ }{ ENODEV & Device driver not loaded/available.\\ EINTERNAL & Internal error.\\ EBUSY & Device or resource busy.\\ EINVAL & Invalid argument.\\}\function{close()}{ int close(int fd);}{ This system call closes a previously opened front-end device. After closing a front-end device, its corresponding hardware might be powered down automatically. }{ int fd & File descriptor returned by a previous call to open().\\ }{ EBADF & fd is not a valid open file descriptor.\\}\ifunction{FE\_READ\_STATUS}{ int ioctl(int fd, int request = FE\_READ\_STATUS, fe\_status\_t *status);}{ This ioctl call returns status information about the front-end. This call only requires read-only access to the device. }{ int fd & File descriptor returned by a previous call to open().\\ int request & Equals FE\_READ\_STATUS for this command.\\ struct fe\_status\_t *status & Points to the location where the front-end status word is to be stored. }{ EBADF& fd is not a valid open file descriptor.\\ EFAULT& status points to invalid address.\\}\ifunction{FE\_READ\_BER}{ int ioctl(int fd, int request = FE\_READ\_BER, uint32\_t *ber);}{ This ioctl call returns the bit error rate for the signal currently received/demodulated by the front-end. For this command, read-only access to the device is sufficient. }{ int fd & File descriptor returned by a previous call to open().\\ int request & Equals FE\_READ\_BER for this command.\\ uint32\_t *ber & The bit error rate is stored into *ber.\\ }{ EBADF& fd is not a valid open file descriptor.\\ EFAULT& ber points to invalid address.\\ ENOSIGNAL& There is no signal, thus no meaningful bit error rate. Also returned if the front-end is not turned on.\\ ENOSYS& Function not available for this device.}\ifunction{FE\_READ\_SNR}{ int ioctl(int fd, int request = FE\_READ\_SNR, int16\_t *snr);}{ This ioctl call returns the signal-to-noise ratio for the signal currently received by the front-end. For this command, read-only access to the device is sufficient. }{ int fd & File descriptor returned by a previous call to open().\\ int request & Equals FE\_READ\_SNR for this command.\\ int16\_t *snr& The signal-to-noise ratio is stored into *snr.\\}{ EBADF& fd is not a valid open file descriptor.\\ EFAULT& snr points to invalid address.\\ ENOSIGNAL& There is no signal, thus no meaningful signal strength value. Also returned if front-end is not turned on.\\ ENOSYS& Function not available for this device.}\ifunction{FE\_READ\_SIGNAL\_STRENGTH}{ int ioctl( int fd, int request = FE\_READ\_SIGNAL\_STRENGTH, int16\_t *strength);}{This ioctl call returns the signal strength value for the signal currently received by the front-end. For this command, read-only access to the device is sufficient.}{int fd & File descriptor returned by a previous call to open().\\int request & Equals FE\_READ\_SIGNAL\_STRENGTH for this command.\\int16\_t *strength & The signal strength value is stored into *strength.\\}{ EBADF& fd is not a valid open file descriptor.\\ EFAULT& status points to invalid address.\\ ENOSIGNAL& There is no signal, thus no meaningful signal strength value. Also returned if front-end is not turned on.\\ ENOSYS& Function not available for this device.}\ifunction{FE\_READ\_UNCORRECTED\_BLOCKS}{ int ioctl( int fd, int request = FE\_READ\_UNCORRECTED\_BLOCKS, uint32\_t *ublocks); }{ This ioctl call returns the number of uncorrected blocks detected by the device driver during its lifetime. For meaningful measurements, the increment in block count during a specific time interval should be calculated. For this command, read-only access to the device is sufficient.\\ Note that the counter will wrap to zero after its maximum count has been reached.}{int fd & File descriptor returned by a previous call to open().\\int request & Equals FE\_READ\_UNCORRECTED\_BLOCKS for this command.\\uint32\_t *ublocks & The total number of uncorrected blocks seenby the driver so far.}{ EBADF& fd is not a valid open file descriptor.\\ EFAULT& ublocks points to invalid address.\\ ENOSYS& Function not available for this device.}\ifunction{FE\_SET\_FRONTEND}{ int ioctl(int fd, int request = FE\_SET\_FRONTEND, struct dvb\_frontend\_parameters *p);}{ This ioctl call starts a tuning operation using specified parameters. The result of this call will be successful if the parameters were valid and the tuning could be initiated. The result of the tuning operation in itself, however, will arrive asynchronously as an event (see documentation for FE\_GET\_EVENT and FrontendEvent.) If a new FE\_SET\_FRONTEND operation is initiated before the previous one was completed, the previous operation will be aborted in favor of the new one. This command requires read/write access to the device. }{ int fd & File descriptor returned by a previous call to open().\\ int request & Equals FE\_SET\_FRONTEND for this command.\\ struct dvb\_frontend\_parameters *p& Points to parameters for tuning operation.\\ }{ EBADF& fd is not a valid open file descriptor.\\ EFAULT& p points to invalid address.\\ EINVAL& Maximum supported symbol rate reached.\\}\ifunction{FE\_GET\_FRONTEND}{ int ioctl(int fd, int request = FE\_GET\_FRONTEND, struct dvb\_frontend\_parameters *p);}{ This ioctl call queries the currently effective frontend parameters. For this command, read-only access to the device is sufficient. }{ int fd & File descriptor returned by a previous call to open().\\ int request & Equals FE\_SET\_FRONTEND for this command.\\ struct dvb\_frontend\_parameters *p& Points to parameters for tuning operation.\\ }{ EBADF& fd is not a valid open file descriptor.\\ EFAULT& p points to invalid address.\\ EINVAL& Maximum supported symbol rate reached.\\}\ifunction{FE\_GET\_EVENT}{ int ioctl(int fd, int request = QPSK\_GET\_EVENT, struct dvb\_frontend\_event *ev);}{ This ioctl call returns a frontend event if available. If an event is not available, the behavior depends on whether the device is in blocking or non-blocking mode. In the latter case, the call fails immediately with errno set to EWOULDBLOCK. In the former case, the call blocks until an event becomes available.\\ The standard Linux poll() and/or select() system calls can be used with the device file descriptor to watch for new events. For select(), the file descriptor should be included in the exceptfds argument, and for poll(), POLLPRI should be specified as the wake-up condition. Since the event queue allocated is rather small (room for 8 events), the queue must be serviced regularly to avoid overflow. If an overflow happens, the oldest event is discarded from the queue, and an error (EOVERFLOW) occurs the next time the queue is read. After reporting the error condition in this fashion, subsequent FE\_GET\_EVENT calls will return events from the queue as usual.\\ For the sake of implementation simplicity, this command requires read/write access to the device. }{ int fd & File descriptor returned by a previous call to open().\\ int request & Equals FE\_GET\_EVENT for this command.\\ struct dvb\_frontend\_event *ev & Points to the location where the event,\\ & if any, is to be stored. }{ EBADF& fd is not a valid open file descriptor.\\ EFAULT& ev points to invalid address.\\ EWOULDBLOCK & There is no event pending, and the device is in non-blocking mode.\\ EOVERFLOW &\\& Overflow in event queue - one or more events were lost.\\}\ifunction{FE\_GET\_INFO}{\label{fegetinfo} int ioctl(int fd, int request = FE\_GET\_INFO, struct dvb\_frontend\_info *info);}{ This ioctl call returns information about the front-end. This call only requires read-only access to the device. }{ int fd & File descriptor returned by a previous call to open().\\ int request & Equals FE\_GET\_INFO for this command.\\ struct dvb\_frontend\_info *info & Points to the location where the front-end information is to be stored. }{ EBADF& fd is not a valid open file descriptor.\\ EFAULT& info points to invalid address.\\}\ifunction{FE\_DISEQC\_RESET\_OVERLOAD}{ int ioctl(int fd, int request = FE\_DISEQC\_RESET\_OVERLOAD);}{ If the bus has been automatically powered off due to power overload, this ioctl call restores the power to the bus. The call requires read/write access to the device. This call has no effect if the device is manually powered off. Not all DVB adapters support this ioctl. }{ int fd & File descriptor returned by a previous call to open().\\ int request & Equals FE\_DISEQC\_RESET\_OVERLOAD for this command.\\ }{ EBADF & fd is not a valid file descriptor.\\ EPERM & Permission denied (needs read/write access).\\ EINTERNAL & Internal error in the device driver.\\}\ifunction{FE\_DISEQC\_SEND\_MASTER\_CMD}{int ioctl(int fd, int request = FE\_DISEQC\_SEND\_MASTER\_CMD, struct dvb\_diseqc\_master\_cmd *cmd);}{ This ioctl call is used to send a a DiSEqC command.\\ }{ int fd & File descriptor returned by a previous call to open().\\ int request & Equals FE\_DISEQC\_SEND\_MASTER\_CMD for this command.\\ struct dvb\_diseqc\_master\_cmd *cmd & Pointer to the command to be transmitted.\\ }{ EBADF & fd is not a valid file descriptor.\\ EFAULT & Seq points to an invalid address.\\ EINVAL & The data structure referred to by seq is invalid in some way.\\ EPERM & Permission denied (needs read/write access).\\ EINTERNAL & Internal error in the device driver.\\}\ifunction{FE\_DISEQC\_RECV\_SLAVE\_REPLY}{int ioctl(int fd, int request = FE\_DISEQC\_RECV\_SLAVE\_REPLY, struct dvb\_diseqc\_slave\_reply *reply);}{This ioctl call is used to receive reply to a DiSEqC 2.0 command.\\ }{ int fd & File descriptor returned by a previous call to open().\\ int request & Equals FE\_DISEQC\_RECV\_SLAVE\_REPLY for this command.\\ struct dvb\_diseqc\_slave\_reply *reply & Pointer to the command to be received.\\ }{ EBADF & fd is not a valid file descriptor.\\ EFAULT & Seq points to an invalid address.\\ EINVAL & The data structure referred to by seq is invalid in some way.\\ EPERM & Permission denied (needs read/write access).\\ EINTERNAL & Internal error in the device driver.\\}\ifunction{FE\_DISEQC\_SEND\_BURST}{int ioctl(int fd, int request = FE\_DISEQC\_SEND\_BURST, fe\_sec\_mini\_cmd\_t burst);}{This ioctl call is used to send a 22KHz tone burst.\\ }{ int fd & File descriptor returned by a previous call to open().\\ int request & Equals FE\_DISEQC\_SEND\_BURST for this command.\\ fe\_sec\_mini\_cmd\_t burst & burst A or B.\\ }{ EBADF & fd is not a valid file descriptor.\\ EFAULT & Seq points to an invalid address.\\ EINVAL & The data structure referred to by seq is invalid in some way.\\ EPERM & Permission denied (needs read/write access).\\ EINTERNAL & Internal error in the device driver.\\}\ifunction{FE\_SET\_TONE}{int ioctl(int fd, int request = FE\_SET\_TONE, fe\_sec\_tone\_mode\_t tone);}{This call is used to set the generation of the continuous 22kHz tone. This call requires read/write permissions.}{int fd & File descriptor returned by a previous call to open().\\int request & Equals FE\_SET\_TONE for this command.\\fe\_sec\_tone\_mode\_t tone & The requested tone generation mode (on/off).\\}{ENODEV & Device driver not loaded/available.\\EBUSY & Device or resource busy.\\EINVAL & Invalid argument.\\EPERM & File not opened with read permissions.\\EINTERNAL & Internal error in the device driver.\\}\ifunction{FE\_SET\_VOLTAGE}{int ioctl(int fd, int request = FE\_SET\_VOLTAGE, fe\_sec\_voltage\_t voltage);}{This call is used to set the bus voltage.This call requires read/write permissions.}{int fd & File descriptor returned by a previous call to open().\\int request & Equals FE\_SET\_VOLTAGE for this command.\\fe\_sec\_voltage\_t voltage & The requested bus voltage.\\}{ENODEV & Device driver not loaded/available.\\EBUSY & Device or resource busy.\\EINVAL & Invalid argument.\\EPERM & File not opened with read permissions.\\EINTERNAL & Internal error in the device driver.\\}\ifunction{FE\_ENABLE\_HIGH\_LNB\_VOLTAGE}{int ioctl(int fd, int request = FE\_ENABLE\_HIGH\_LNB\_VOLTAGE, int high);}{If high != 0 enables slightly higher voltages instead of 13/18V(to compensate for long cables).This call requires read/write permissions.Not all DVB adapters support this ioctl.}{int fd & File descriptor returned by a previous call to open().\\int request & Equals FE\_SET\_VOLTAGE for this command.\\int high & The requested bus voltage.\\}{ENODEV & Device driver not loaded/available.\\EBUSY & Device or resource busy.\\EINVAL & Invalid argument.\\EPERM & File not opened with read permissions.\\EINTERNAL & Internal error in the device driver.\\}%%% Local Variables: %%% mode: latex%%% TeX-master: "dvbapi"%%% End:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -