Asynchronous acquisition API
[Level 2 API]

Collaboration diagram for Asynchronous acquisition API:


Functions

int a4l_async_read (a4l_desc_t *dsc, void *buf, size_t nbyte, unsigned long ms_timeout)
 Perform asynchronous read operation on the analog input subdevice.
int a4l_async_write (a4l_desc_t *dsc, void *buf, size_t nbyte, unsigned long ms_timeout)
 Perform asynchronous write operation on the analog input subdevice.


Function Documentation

int a4l_async_read ( a4l_desc_t dsc,
void *  buf,
size_t  nbyte,
unsigned long  ms_timeout 
)

Perform asynchronous read operation on the analog input subdevice.

The function a4l_async_read() is only useful for acquisition configured through an Analogy command.

Parameters:
[in] dsc Device descriptor filled by a4l_open() (and optionally a4l_fill_desc())
[out] buf Input buffer
[in] nbyte Number of bytes to read
[in] ms_timeout The number of miliseconds to wait for some data to be available. Passing A4L_INFINITE causes the caller to block indefinitely until some data is available. Passing A4L_NONBLOCK causes the function to return immediately without waiting for any available data
Returns:
Number of bytes read, otherwise negative error code:
  • -EINVAL is returned if some argument is missing or wrong, the descriptor should be checked; check also the kernel log
  • -ENOENT is returned if the device's reading subdevice is idle (no command was sent)
  • -EFAULT is returned if a user <-> kernel transfer went wrong
  • -EINTR is returned if calling task has been unblocked by a signal

References a4l_poll(), a4l_sys_read(), a4l_descriptor::fd, and a4l_descriptor::idx_read_subd.

int a4l_async_write ( a4l_desc_t dsc,
void *  buf,
size_t  nbyte,
unsigned long  ms_timeout 
)

Perform asynchronous write operation on the analog input subdevice.

The function a4l_async_write() is only useful for acquisition configured through an Analogy command.

Parameters:
[in] dsc Device descriptor filled by a4l_open() (and optionally a4l_fill_desc())
[in] buf Ouput buffer
[in] nbyte Number of bytes to write
[in] ms_timeout The number of miliseconds to wait for some free area to be available. Passing A4L_INFINITE causes the caller to block indefinitely until some data is available. Passing A4L_NONBLOCK causes the function to return immediately without waiting any available space to write data.
Returns:
Number of bytes written, otherwise negative error code:
  • -EINVAL is returned if some argument is missing or wrong, the descriptor should be checked; check also the kernel log
  • -ENOENT is returned if the device's reading subdevice is idle (no command was sent)
  • -EFAULT is returned if a user <-> kernel transfer went wrong
  • -EINTR is returned if calling task has been unblocked by a signal

References a4l_poll(), a4l_sys_write(), a4l_descriptor::fd, and a4l_descriptor::idx_write_subd.


Generated on Tue Mar 8 13:02:08 2011 for Xenomai API by  doxygen 1.5.6