1 #include <attn/attention.hpp>
2 #include <attn/attn_common.hpp>
3 #include <attn/attn_logging.hpp>
4 #include <sdbusplus/bus.hpp>
5 
6 namespace attn
7 {
8 
9 /**
10  * @brief Handle SBE vital attention
11  *
12  * @param i_attention Attention object
13  * @return 0 indicates that the vital attention was successfully handled
14  *         1 indicates that the vital attention was NOT successfully handled
15  */
16 int handleVital(Attention* i_attention)
17 {
18     int rc = RC_SUCCESS; // assume vital handled
19 
20     trace<level::INFO>("vital handler started");
21 
22     // if vital handling enabled, handle vital attention
23     if (false == (i_attention->getConfig()->getFlag(enVital)))
24     {
25         trace<level::INFO>("vital handling disabled");
26         rc = RC_NOT_HANDLED;
27     }
28     else
29     {
30         // transition host state after analyses
31         transitionHost(HostState::Quiesce);
32 
33         // generate pel
34         eventVital();
35     }
36 
37     return rc;
38 }
39 
40 } // namespace attn
41