Add Asserted property for IERR

Add "Asserted" property in dbus to make other daemon(for example,
phosphor-ipmi-host) could know whether the error is asserted or not.

Tested:
Case 1.
Enable meson option 'dynamic-sensors' and 'hybrid-sensors' to
phosphor-ipmi-host and set option 'sensor-yaml-gen' to location of
"ipmi-sensors.yaml".
The configuration for IERR sensor in ipmi-sensors.yaml:
```
0x08:
  entityID: 0x41
  entityInstance: 2
  interfaces:
    xyz.openbmc_project.HostErrorMonitor.Processor.IERR:
      Asserted:
        Offsets:
          0x00:
            assert: true
            type: bool
  mutability: Mutability::Read
  path: /xyz/openbmc_project/host_error_monitor/processor/IERR
  readingType: assertion
  sensorNamePattern: nameLeaf
  sensorReadingType: 0x6F
  sensorType: 0x07
  serviceInterface: org.freedesktop.DBus.Properties
```

Result:
IERR is not triggered:
root@qbmc:~# ipmitool sdr elist | grep IERR
IERR             | 06h | ok  | 65.2 |
IERR is triggered:
root@qbmc:~# ipmitool sdr elist | grep IERR
IERR             | 06h | ok  | 65.2 | IERR

Case 2.
Only set option 'sensor-yaml-gen' to location of "ipmi-sensors.yaml" and
set option 'invsensor-yaml-gen' to location of
"ipmi-inventory-sensors.yaml".
The configuration for IERR sensor in "ipmi-sensors.yaml":
```
0xF6:
  entityID: 0x03
  entityInstance: 2
  interfaces:
   xyz.openbmc_project.HostErrorMonitor.Processor.IERR:
      Asserted:
        Offsets:
          0x00:
            type: bool
            assert: true
            deassert: false
  mutability: Mutability::Write|Mutability::Read
  path: /xyz/openbmc_project/host_error_monitor/processor/IERR
  readingType: assertion
  sensorNamePattern: nameLeaf
  sensorReadingType: 0x6f
  sensorType: 0x07
  serviceInterface: org.freedesktop.DBus.Properties
```
The configuration for IERR sensor in ipmi-inventory-sensors.yaml:
```
/xyz/openbmc_project/host_error_monitor/processor/IERR:
    eventReadingType: 0x6F
    offset: 0x00
    sensorID: 0xF6
    sensorType: 0x07
```

Result:
IERR is not triggered:
root@qbmc:~# ipmitool sdr elist | grep IERR
IERR             | F6h | ok  |  3.2 |
IERR is triggered:
root@gbmc:~# ipmitool sdr elist | grep IERR
IERR             | F6h | ok  |  3.2 | IERR

Signed-off-by: JinFuLin <JeffLin2@quantatw.com>
Change-Id: Ib7a16097c68b558c55562ed91b51000ea3278361
diff --git a/include/error_monitors/ierr_monitor.hpp b/include/error_monitors/ierr_monitor.hpp
index 025f899..c648432 100644
--- a/include/error_monitors/ierr_monitor.hpp
+++ b/include/error_monitors/ierr_monitor.hpp
@@ -30,6 +30,7 @@
     const static host_error_monitor::base_gpio_poll_monitor::AssertValue
         assertValue =
             host_error_monitor::base_gpio_poll_monitor::AssertValue::lowAssert;
+    std::shared_ptr<sdbusplus::asio::dbus_interface> assertIERR;
     const static constexpr size_t ierrPollingTimeMs = 100;
     const static constexpr size_t ierrTimeoutMs = 2000;
     const static constexpr size_t ierrTimeoutMsMax =
@@ -42,6 +43,8 @@
 
     static const constexpr char* callbackMgrPath =
         "/xyz/openbmc_project/CallbackManager";
+    static const constexpr char* assertPath =
+        "/xyz/openbmc_project/host_error_monitor/processor/IERR";
 
     void logEvent()
     {
@@ -357,6 +360,7 @@
             assertHandler();
 
         setLED();
+        assertIERR->set_property("Asserted", true);
 
         beep(conn, beepCPUIERR);
 
@@ -388,6 +392,7 @@
     void deassertHandler() override
     {
         unsetLED();
+        assertIERR->set_property("Asserted", false);
     }
 
     void setLED()
@@ -451,6 +456,11 @@
             [this](std::size_t& resp) { return getTimeoutMs(); });
         hostErrorTimeoutIface->initialize();
 
+        assertIERR = server.add_interface(
+            assertPath, "xyz.openbmc_project.HostErrorMonitor.Processor.IERR");
+        assertIERR->register_property("Asserted", false);
+        assertIERR->initialize();
+
         if (valid)
         {
             startPolling();