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