Xenomai  3.0.8
Asynchronous acquisition 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. More...
 
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. More...
 

Detailed Description

Function Documentation

◆ a4l_async_read()

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]dscDevice descriptor filled by a4l_open() (and optionally a4l_fill_desc())
[out]bufInput buffer
[in]nbyteNumber of bytes to read
[in]ms_timeoutThe 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

◆ a4l_async_write()

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]dscDevice descriptor filled by a4l_open() (and optionally a4l_fill_desc())
[in]bufOuput buffer
[in]nbyteNumber of bytes to write
[in]ms_timeoutThe 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