Safe API Framework 0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Loading...
Searching...
No Matches
FSOU output permission

Files

file  src/oal/fsou/rte_fsou.c
 Implementation of the optional FSOU output-permission OSAdapter seam (ADR-041).

Functions

rte_status_t rte_fsou_grant (uint32_t cycle_id)
 Grants this channel's output permission to the FSOU for one cycle (REQ-FSOU-002).
rte_status_t rte_fsou_revoke (rte_safestate_reason_t reason)
 Withdraws this channel's output permission from the FSOU (REQ-FSOU-002).
bool rte_fsou_is_present (void)
 Tells whether an FSOU OSAdapter is registered.
void rte_fsou_report_presence (void)
 Logs once whether an FSOU is present (REQ-FSOU-003).

Detailed Description

REQ-FSOU-001: rte_osadapter_fsou_register() shall reject a NULL adapter with RTE_STATUS_INVALID_PARAM and shall be setup-only (RTE_STATUS_INVALID_STATE once the setup phase is locked). REQ-FSOU-002: rte_fsou_grant() and rte_fsou_revoke() shall return RTE_STATUS_NOT_INITIALIZED if no OSAdapter is registered, RTE_STATUS_NOT_SUPPORTED if the registered OSAdapter's slot is NULL, and otherwise the OSAdapter's own status. REQ-FSOU-003: rte_fsou_report_presence() shall log whether an FSOU OSAdapter is registered exactly once per process; later calls log nothing.

Function Documentation

◆ rte_fsou_grant()

rte_status_t rte_fsou_grant ( uint32_t cycle_id)

Grants this channel's output permission to the FSOU for one cycle (REQ-FSOU-002).

Parameters
cycle_idCycle the permission is for (the cycle whose checkpoint returned OK, ADR-041).
Returns
RTE_STATUS_NOT_INITIALIZED if no FSOU OSAdapter is registered; RTE_STATUS_NOT_SUPPORTED if the registered OSAdapter's grant slot is NULL; otherwise the OSAdapter's status (RTE_STATUS_OK when granted).

Definition at line 52 of file rte_fsou.c.

◆ rte_fsou_revoke()

rte_status_t rte_fsou_revoke ( rte_safestate_reason_t reason)

Withdraws this channel's output permission from the FSOU (REQ-FSOU-002).

Parameters
reasonWhy the permission is withdrawn (same codes as rte_safestate_enter()).
Returns
RTE_STATUS_NOT_INITIALIZED if no FSOU OSAdapter is registered; RTE_STATUS_NOT_SUPPORTED if the registered OSAdapter's revoke slot is NULL; otherwise the OSAdapter's status (RTE_STATUS_OK when revoked).

Definition at line 73 of file rte_fsou.c.

◆ rte_fsou_is_present()

bool rte_fsou_is_present ( void )

Tells whether an FSOU OSAdapter is registered.

Returns
true if rte_osadapter_fsou_register() succeeded at least once, false otherwise.

Definition at line 94 of file rte_fsou.c.

◆ rte_fsou_report_presence()

void rte_fsou_report_presence ( void )

Logs once whether an FSOU is present (REQ-FSOU-003).

The first call logs "FSOU present" or "no FSOU registered" (rte_log, INFO, tag "FSOU") and latches; every later call logs nothing. Intended caller: the integrator's init, after OSAdapter registration, single-threaded.

Latch: true once the presence line was logged (block scope, MISRA rule 8.9).

Definition at line 99 of file rte_fsou.c.