at75c1222 ETC-unknow, at75c1222 Datasheet - Page 19

no-image

at75c1222

Manufacturer Part Number
at75c1222
Description
Manufacturer
ETC-unknow
Datasheet
Description
Return Values
Example
2664A–INTAP–07/02
The /dev/g729encoder0 virtual file must be opened prior to any encoding operation on
the G729 encoder device driver. This is done with the open method, the same as for any
regular file. The main operation performed by the open method of the device driver is to
load and initialize the corresponding DSP software in the DSP subsystem.
When this initialization is successful, the open system call converts the file “path” name
("/dev/g729encoder0" in this case) into a file descriptor. This file descriptor is a non-neg-
ative integer which will be used in subsequent I/O operations such as read, ioctl, etc.
“flags” should be O_RDONLY which request opening the file in read-only mode.
“flags” may also be bitwise-or'd with O_NONBLOCK. In this case, neither the open nor
any subsequent operations on the file descriptor which is returned will cause the calling
process to wait.
Open() returns the new file descriptor, or -1 if an error occurred. In the latter case, the
global variable errno is set appropriately to reflect the cause of error. Possible values of
errno are:
This opens the G.729 encoder device driver in read mode. It selects non blocking I/O for
read operations. The file descriptor is returned in “fd”. If “fd” is positive, the G729
encoder device is readily available for read operations.
ENODEV: This indicates that the underlying hardware does not exist or is not
supported. One reason can be corruption of the binary DSP software which could
not be loaded into the DSP subsystem.
EBUSY: The underlying hardware is busy. Most probably there is another process
using the same resource.
ENOMEM: A memory allocation requested by the driver failed. This happens when
the system memory is full.
int fd = open("/dev/g729encoder0", O_RDONLY | O_NONBLOCK);
AT75C1222
19

Related parts for at75c1222