Safe API Framework
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Loading...
Searching...
No Matches
sapi_dual_types.c
Go to the documentation of this file.
1
8
10
12
14
16
18
19
22{
23 const char *result;
24
25 switch (state)
26 {
28 result = "IDLE";
29 break;
31 result = "UNKNOWN";
32 break;
34 result = "ONLINE";
35 break;
37 result = "HOTSTANDBY";
38 break;
40 result = "COLDSTANDBY";
41 break;
42 default:
43 /* Defensive only - not reachable through the public enum. */
44 result = "UNKNOWN_STATE";
45 break;
46 }
47 return result;
48}
49
51{
52 const char *result;
53
54 switch (status)
55 {
57 result = "DOWN";
58 break;
60 result = "DEGRADED";
61 break;
63 result = "FULL";
64 break;
65 default:
66 /* Defensive only - not reachable through the public enum. */
67 result = "UNKNOWN_STATUS";
68 break;
69 }
70 return result;
71}
sapi_dual_state_t
State of one instance in a dual (two-redundant-instance) relationship, as decided by sapi_dual_negoti...
const char * sapi_dual_state_to_string(sapi_dual_state_t state)
Returns a short, static, human-readable string for a sapi_dual_state_t. Intended for diagnostics/logg...
sapi_dual_channel_status_t
Aggregate connection status of a sapi_dual_channel_t across all of its configured redundant links (AD...
const char * sapi_dual_channel_status_to_string(sapi_dual_channel_status_t status)
Returns a short, static, human-readable string for a sapi_dual_channel_status_t. Same diagnostics-onl...
@ SAPI_DUAL_STATE_IDLE
@ SAPI_DUAL_STATE_ONLINE
@ SAPI_DUAL_STATE_COLDSTANDBY
@ SAPI_DUAL_STATE_HOTSTANDBY
@ SAPI_DUAL_STATE_UNKNOWN
@ SAPI_DUAL_CHANNEL_STATUS_FULL
@ SAPI_DUAL_CHANNEL_STATUS_DOWN
@ SAPI_DUAL_CHANNEL_STATUS_DEGRADED
Shared enums for the sapi_dual module (ADR-020): dual-instance state negotiation and the redundant,...