RTE RBC 2oo2 Reference Application 0.1.0 build 0006685
SIL 4 2oo2 Dual-Site Fault-Tolerant ERTMS Radio Block Centre Reference Architecture
Loading...
Searching...
No Matches
app_main_common.h File Reference

Process-wide runtime setup shared by every one of this example's binaries (main.c for A/B, main_c.c for C) - OSAdapter registration, checksum/watchdog/log init, signal handlers, and the REBOOT safe-state handler. Split out so this ~70-line sequence is written once instead of duplicated across both main() entry points now that C has its own binary (see CMakeLists.txt). More...

#include "rte/utils/status/rte_status.h"
Include dependency graph for app_main_common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

rte_status_t app_main_common_init (int argc, char **argv)
 Runs this process's one-time runtime setup, common to every role: unbuffered stdout, POSIX OSAdapter registration, reboot argv capture, CRC-64 init, watchdog manager init, best-effort log init, best-effort default signal handlers, and the REBOOT safe-state handler registration - see this file's own header and each step's own inline doc in app_main_common.c for why each is fatal or best-effort.

Detailed Description

Process-wide runtime setup shared by every one of this example's binaries (main.c for A/B, main_c.c for C) - OSAdapter registration, checksum/watchdog/log init, signal handlers, and the REBOOT safe-state handler. Split out so this ~70-line sequence is written once instead of duplicated across both main() entry points now that C has its own binary (see CMakeLists.txt).

Definition in file app_main_common.h.

Function Documentation

◆ app_main_common_init()

rte_status_t app_main_common_init ( int argc,
char ** argv )

Runs this process's one-time runtime setup, common to every role: unbuffered stdout, POSIX OSAdapter registration, reboot argv capture, CRC-64 init, watchdog manager init, best-effort log init, best-effort default signal handlers, and the REBOOT safe-state handler registration - see this file's own header and each step's own inline doc in app_main_common.c for why each is fatal or best-effort.

Parameters
argcThis process's own argc, forwarded to rte_posix_osadapter_reboot_set_argv() so a later REBOOT re-execs with the same command line.
argvThis process's own argv, same reason as argc.
Returns
RTE_STATUS_OK if every fatal step succeeded (best-effort steps only log a warning and never fail this call); the first fatal step's own failure status otherwise - the caller should print nothing further and return a non-zero exit code.

Global functions

Definition at line 85 of file app_main_common.c.