rtf_create_rt_handler

Name

rtf_create_rt_handler -- install a handler for realtime fifo data

Synopsis

       #include <rtl_fifo.h>

       int rtf_create_rt_handler(unsigned int fifo, int (* handler)());

DESCRIPTION

rtf_create_rt_handler installs a handler which is executed when rtf_put or rtf_get is called on the specified real-time fifo (RT-FIFO). fifo is an RT-FIFO that must have previously been created with a call to rtf_create. handler is then called whenever that fifo is accessed in RT mode.

Note that the handler is called in the context of the task that uses rtf_put or rtf_get. You can use semaphores to take handler actions asynchronously: use sem_wait(3) in a thread, and post the semaphore from the handler.

The RT-FIFO is a mechanism, implemented as a character device, to communicate between realtime software components (either in threads or handlers), and between realtime software and ordinary Linux processes. The rtf_* functions are used in RT mode; Linux processes use standard character device access functions, such as read(2), write(2) and select(2).

RETURN VALUE

On success, 0 is returned. On failure, a negative value is returned as described below.

ERRORS

-EINVAL

fifo is greater than or equal to RTF_NO, or is not a valid RT-FIFO identifier; or handler is NULL.

SEE ALSO

rtf_create(3), rtf_create_handler(3), rtf_destroy(3), rtf_get(3), rtf_put(3)

©2001 FSMLabs Inc.

All rights reserved.