RTE RBC 2oo2 Reference Application
0.1.0 build 0006685
SIL 4 2oo2 Dual-Site Fault-Tolerant ERTMS Radio Block Centre Reference Architecture
Toggle main menu visibility
Loading...
Searching...
No Matches
ab_gp_fsm_stub.c
Go to the documentation of this file.
1
5
6
#include "
ab_gp_fsm_stub.h
"
7
8
#include "rte/oal/log/rte_log.h"
9
#include "rte/utils/string/rte_string.h"
10
11
bool
ab_gp_fsm_stub_log
(
const
char
*fsm_tag,
const
char
*impl_note,
12
const
ab_gp_ertms_train_context_t
*ctx,
ab_gp_event_t
event)
13
{
14
char
storage[160];
15
rte_string_t line;
16
const
char
*out_cstr = NULL;
17
18
if
(rte_string_init(&line, storage,
sizeof
(storage)) != RTE_STATUS_OK)
19
{
20
return
false
;
21
}
22
(void)rte_string_copy(&line,
"train="
);
23
(void)rte_string_append_u32(&line, (ctx != NULL) ? (uint32_t)ctx->
train_id
: 0U);
24
(void)rte_string_concat(&line,
" event="
);
25
(void)rte_string_append_u32(&line, (uint32_t)event);
26
(void)rte_string_concat(&line,
" "
);
27
(void)rte_string_concat(&line, (fsm_tag != NULL) ? fsm_tag :
"?"
);
28
(void)rte_string_concat(&line,
" state machine not implemented yet ("
);
29
(void)rte_string_concat(&line, (impl_note != NULL) ? impl_note :
""
);
30
(void)rte_string_concat(&line,
")"
);
31
32
if
(rte_string_c_str(&line, &out_cstr) == RTE_STATUS_OK)
33
{
34
rte_log_write(RTE_LOG_LEVEL_INFO,
"GP_FSM_STUB"
, out_cstr);
35
}
36
return
false
;
37
}
ab_gp_event_t
ab_gp_event_t
Every event any GP procedure state machine reacts to. One per distinct real trigger in ertms_procedur...
Definition
ab_gp_event.h:53
ab_gp_fsm_stub_log
bool ab_gp_fsm_stub_log(const char *fsm_tag, const char *impl_note, const ab_gp_ertms_train_context_t *ctx, ab_gp_event_t event)
Logs (INFO) that a not-yet-implemented per-entity FSM received an event, and returns false (nothing c...
Definition
ab_gp_fsm_stub.c:11
ab_gp_fsm_stub.h
Shared "this per-entity FSM is a placeholder" handler.
ab_gp_ertms_train_context_t
Complete ERTMS state and procedure context for one train slot.
Definition
ab_gp_ertms_types.h:235
ab_gp_ertms_train_context_t::train_id
uint8_t train_id
Definition
ab_gp_ertms_types.h:236
src
application
AB
GP
state_machines
ab_gp_fsm_stub.c
Generated by
1.18.0