oem-ampere: eventManager: Trigger `CrashCapture` signal in BERT

Trigger `CrashCapture...Bert` D-Bus signal when the CPER event is Ampere
BERT. This signal notifies Ampere Crash Capture service to get BERT data
from EEPROM.

Change-Id: I2941d241fbd86bcf0ccb2b1b55d3b2bea3f038e1
Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com>
diff --git a/oem/ampere/event/oem_event_manager.cpp b/oem/ampere/event/oem_event_manager.cpp
index c3c8fb6..b9fd114 100644
--- a/oem/ampere/event/oem_event_manager.cpp
+++ b/oem/ampere/event/oem_event_manager.cpp
@@ -918,6 +918,29 @@
 
     addCperSELLog(tid, eventId, &ampHdr);
 
+    /* isBert at bit 12 of TypeId */
+    if (ampHdr.TypeId & 0x0800)
+    {
+        lg2::info("Ampere SoC BERT is triggered.");
+        std::variant<std::string> value(
+            "com.ampere.CrashCapture.Trigger.TriggerAction.Bert");
+        try
+        {
+            auto& bus = pldm::utils::DBusHandler::getBus();
+            auto method =
+                bus.new_method_call("com.ampere.CrashCapture.Trigger",
+                                    "/com/ampere/crashcapture/trigger",
+                                    pldm::utils::dbusProperties, "Set");
+            method.append("com.ampere.CrashCapture.Trigger", "TriggerActions",
+                          value);
+            bus.call_noreply(method);
+        }
+        catch (const std::exception& e)
+        {
+            lg2::error("call BERT trigger error - {ERROR}", "ERROR", e);
+        }
+    }
+
     return PLDM_SUCCESS;
 }