FW Profile - C1 Implementation
|
Declaration of the API for a RT Container. More...
Go to the source code of this file.
Functions | |
void | FwRtStart (FwRtDesc_t rtDesc) |
Start a RT Container. More... | |
void | FwRtStop (FwRtDesc_t rtDesc) |
Stop a RT Container. More... | |
void | FwRtWaitForTermination (FwRtDesc_t rtDesc) |
Blocking function which returns when the Activation Thread has terminated. More... | |
void | FwRtNotify (FwRtDesc_t rtDesc) |
Execute the Notification Procedure of a RT Container. More... | |
FwRtBool_t | FwRtIsNotifPrStarted (FwRtDesc_t rtDesc) |
Check whether the Notification Procedure is started. More... | |
FwRtBool_t | FwRtIsActivPrStarted (FwRtDesc_t rtDesc) |
Check whether the Activation Procedure is started. More... | |
FwRtState_t | FwRtGetContState (FwRtDesc_t rtDesc) |
Return the RT Container state. More... | |
int | FwRtGetErrCode (FwRtDesc_t rtDesc) |
Return the error code of the RT Container. More... | |
FwRtCounterU2_t | FwRtGetNotifCounter (FwRtDesc_t rtDesc) |
Return the value of the notification counter. More... | |
Declaration of the API for a RT Container.
A RT Container consists of:
The Notification Procedure and the Activation Procedure implement the logic defined in the figure below.
This interface offers functions to:
The functions declared in this header file, take a RT Container Descriptor as their argument. This represents the RT Container upon which the functions operate. The functions assume that the container has been fully and correctly configured (this is done through the functions defined in FwRtConfig.h
).
The basic mode of use of the functions defined in this header file is as follows:
FwRtConfig.h
.FwRtStart
.FwRtNotify
.FwRtStop
.After the container has been stopped, it can be re-started.
This file is part of the FW Profile.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
For information on alternative licensing, please contact P&P Software GmbH.
Definition in file FwRtCore.h.
FwRtState_t FwRtGetContState | ( | FwRtDesc_t | rtDesc | ) |
Return the RT Container state.
This function is not thread-safe (but note that it only returns the value of a field of the RT Container descriptor).
rtDesc | the descriptor of the RT Container. |
Definition at line 176 of file FwRtCore.c.
int FwRtGetErrCode | ( | FwRtDesc_t | rtDesc | ) |
Return the error code of the RT Container.
This function is not thread-safe (but note that it only returns the value of a field of the RT Container descriptor).
rtDesc | the descriptor of the RT Container. |
Definition at line 181 of file FwRtCore.c.
FwRtCounterU2_t FwRtGetNotifCounter | ( | FwRtDesc_t | rtDesc | ) |
Return the value of the notification counter.
The value of the notification counter represents the number of pending notifications in the RT Container. This function is not thread-safe (but note that it only returns the value of a field of the RT Container descriptor).
rtDesc | the descriptor of the RT Container. |
Definition at line 186 of file FwRtCore.c.
FwRtBool_t FwRtIsActivPrStarted | ( | FwRtDesc_t | rtDesc | ) |
Check whether the Activation Procedure is started.
This function is not thread-safe (but note that it only returns the value of a field of the RT Container descriptor).
rtDesc | the descriptor of the RT Container. |
Definition at line 171 of file FwRtCore.c.
FwRtBool_t FwRtIsNotifPrStarted | ( | FwRtDesc_t | rtDesc | ) |
Check whether the Notification Procedure is started.
This function is not thread-safe (but note that it only returns the value of a field of the RT Container descriptor).
rtDesc | the descriptor of the RT Container. |
Definition at line 166 of file FwRtCore.c.
void FwRtNotify | ( | FwRtDesc_t | rtDesc | ) |
Execute the Notification Procedure of a RT Container.
This function proceeds as follows:
rtDesc | the descriptor of the RT Container. |
Definition at line 137 of file FwRtCore.c.
void FwRtStart | ( | FwRtDesc_t | rtDesc | ) |
Start a RT Container.
A RT Container can be in two states: STARTED or STOPPED. This function proceeds as follows:
The attributes of the Activation Thread are NULL by default or are those set with function FwRtSetPosixAttr
.
If any of the system calls made by this function returns an error, the container is put in an error state (see FwRtState_t
) and the error code is stored in the errCode
field of the container descriptor.
The Activation Thread is released upon creation and executes the following actions:
while true do { lock container's mutex; wait until Notification Counter is greater than zero; decrement Notification Counter; release container's mutex; execute Activation Procedure;
if (Activation Procedure has terminated) then { put RT Container in STOPPED state; execute Notification Procedure; break; }
if (RT Container is in state STOPPED) then { execute Activation Procedure; execute Notification Procedure; break; } }
Use of this function is subject to the following constraint:
FwRtWaitForTermination
can be used to wait for the Activation Thread to have terminated).rtDesc | the descriptor of the RT Container. |
Definition at line 47 of file FwRtCore.c.
void FwRtStop | ( | FwRtDesc_t | rtDesc | ) |
Stop a RT Container.
A RT Container can be in two states: STARTED or STOPPED. This function proceeds as follows:
If any of the system calls made by this function returns an error, the container is put in an error state (see FwRtState_t
) and the error code is stored in the errCode
field of the container descriptor.
rtDesc | the descriptor of the RT Container. |
Definition at line 97 of file FwRtCore.c.
void FwRtWaitForTermination | ( | FwRtDesc_t | rtDesc | ) |
Blocking function which returns when the Activation Thread has terminated.
This function uses POSIX's pthread_join
to wait until the Activation Thread has terminated.
Use of this function is subject to the following constraints:
rtDesc | the descriptor of the RT Container. |
Definition at line 154 of file FwRtCore.c.