RTEMS 5.2
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Functions
Transient Event

Functions

RTEMS_INLINE_ROUTINE rtems_status_code rtems_event_transient_send (rtems_id id)
 See rtems_event_system_send(). More...
 
RTEMS_INLINE_ROUTINE rtems_status_code rtems_event_transient_receive (rtems_option option_set, rtems_interval ticks)
 See rtems_event_system_receive(). More...
 
RTEMS_INLINE_ROUTINE void rtems_event_transient_clear (void)
 See rtems_event_system_receive(). More...
 

Detailed Description

The transient event can be used by a client task to issue a request to another task or interrupt service (server). The server can send the transient event to the client task to notify about a request completion, see rtems_event_transient_send(). The client task can wait for the transient event reception with rtems_event_transient_receive().

The user of the transient event must ensure that this event is not pending once the request is finished or cancelled. A successful reception of the transient event with rtems_event_transient_receive() will clear the transient event. If a reception with timeout is used the transient event state is undefined after a timeout return status. The transient event can be cleared unconditionally with the non-blocking rtems_event_transient_clear().

msc_inline_mscgraph_1

Suppose you have a task that wants to issue a certain request and then waits for request completion. It can create a request structure and store its task identifier there. Now it can place the request on a work queue of another task (or interrupt handler). Afterwards the task waits for the reception of the transient event. Once the server task is finished with the request it can send the transient event to the waiting task and wake it up.

#include <assert.h>
#include <rtems.h>
typedef struct {
rtems_id task_id;
bool work_done;
} request;
void server(rtems_task_argument arg)
{
request *req = (request *) arg;
req->work_done = true;
sc = rtems_event_transient_send(req->task_id);
assert(sc == RTEMS_SUCCESSFUL);
rtems_task_exit();
}
void issue_request_and_wait_for_completion(void)
{
request req;
req.task_id = rtems_task_self();
req.work_done = false;
rtems_build_name('S', 'E', 'R', 'V'),
1,
&id
);
assert(sc == RTEMS_SUCCESSFUL);
sc = rtems_task_start(id, server, (rtems_task_argument) &req);
assert(sc == RTEMS_SUCCESSFUL);
assert(sc == RTEMS_SUCCESSFUL);
assert(req.work_done);
}
Information for the Assert Handler.
#define RTEMS_DEFAULT_ATTRIBUTES
Definition: attr.h:45
#define rtems_build_name(_C1, _C2, _C3, _C4)
Build Thirty-Two Bit Object Name.
Definition: object.h:93
RTEMS_INLINE_ROUTINE rtems_status_code rtems_event_transient_receive(rtems_option option_set, rtems_interval ticks)
See rtems_event_system_receive().
Definition: event.h:471
RTEMS_INLINE_ROUTINE rtems_status_code rtems_event_transient_send(rtems_id id)
See rtems_event_system_send().
Definition: event.h:459
#define RTEMS_DEFAULT_MODES
Definition: modes.h:52
#define RTEMS_WAIT
Definition: options.h:53
rtems_status_code
Classic API Status.
Definition: status.h:43
@ RTEMS_SUCCESSFUL
Definition: status.h:47
Objects_Id rtems_id
Used to manage and manipulate RTEMS object identifiers.
Definition: types.h:83
rtems_status_code rtems_task_create(rtems_name name, rtems_task_priority initial_priority, size_t stack_size, rtems_mode initial_modes, rtems_attribute attribute_set, rtems_id *id)
RTEMS Task Create.
Definition: taskcreate.c:36
rtems_status_code rtems_task_start(rtems_id id, rtems_task_entry entry_point, rtems_task_argument argument)
RTEMS Start Task.
Definition: taskstart.c:25
rtems_id rtems_task_self(void)
RTEMS Get Self Task Id.
Definition: taskself.c:23
CPU_Uint32ptr rtems_task_argument
Definition: tasks.h:106
#define RTEMS_MINIMUM_STACK_SIZE
Minimum stack size which every thread must exceed.
Definition: rtems.h:151
#define RTEMS_NO_TIMEOUT
Constant for indefinite wait.
Definition: rtems.h:174

Function Documentation

◆ rtems_event_transient_clear()

RTEMS_INLINE_ROUTINE void rtems_event_transient_clear ( void  )

See rtems_event_system_receive().

The system event RTEMS_EVENT_SYSTEM_TRANSIENT will be cleared.

◆ rtems_event_transient_receive()

RTEMS_INLINE_ROUTINE rtems_status_code rtems_event_transient_receive ( rtems_option  option_set,
rtems_interval  ticks 
)

See rtems_event_system_receive().

The system event RTEMS_EVENT_SYSTEM_TRANSIENT will be received.

◆ rtems_event_transient_send()

RTEMS_INLINE_ROUTINE rtems_status_code rtems_event_transient_send ( rtems_id  id)

See rtems_event_system_send().

The system event RTEMS_EVENT_SYSTEM_TRANSIENT will be sent.