Xenomai  3.1
Collaboration diagram for Basic Syscall API:

Functions

int a4l_sys_open (const char *fname)
 Open an Analogy device. More...
 
int a4l_sys_close (int fd)
 Close an Analogy device. More...
 
int a4l_sys_read (int fd, void *buf, size_t nbyte)
 Read from an Analogy device. More...
 
int a4l_sys_write (int fd, void *buf, size_t nbyte)
 Write to an Analogy device. More...
 

Detailed Description

Function Documentation

◆ a4l_sys_close()

int a4l_sys_close ( int  fd)

Close an Analogy device.

Parameters
[in]fdFile descriptor as returned by a4l_sys_open()
Returns
0 on success, otherwise a negative error code.

Referenced by a4l_close(), and a4l_open().

◆ a4l_sys_open()

int a4l_sys_open ( const char *  fname)

Open an Analogy device.

Parameters
[in]fnameDevice name
Returns
Positive file descriptor value on success, otherwise a negative error code.

Referenced by a4l_open().

◆ a4l_sys_read()

int a4l_sys_read ( int  fd,
void *  buf,
size_t  nbyte 
)

Read from an Analogy device.

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

Parameters
[in]fdFile descriptor as returned by a4l_sys_open()
[out]bufInput buffer
[in]nbyteNumber of bytes to read
Returns
Number of bytes read. Otherwise:
  • -EINVAL is returned if some argument is missing or wrong (Please, type "dmesg" for more info)
  • -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_sys_write()

int a4l_sys_write ( int  fd,
void *  buf,
size_t  nbyte 
)

Write to an Analogy device.

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

Parameters
[in]fdFile descriptor as returned by a4l_sys_open()
[in]bufOutput buffer
[in]nbyteNumber of bytes to write
Returns
Number of bytes written. Otherwise:
  • -EINVAL is returned if some argument is missing or wrong (Please, type "dmesg" for more info)
  • -ENOENT is returned if the device's writing 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