Make containerId optional in the event json file

During the PDR exchange, normalization causes the container IDs of
remote entities to change. Therefore, checking for a predefined
container ID from a remote terminus for sensor events does not provide
any benefit. This commit adds support for optionally skipping the check
for remote container id for sensor events when needed.

Tested:
Unit tests passed.

Change-Id: I871044815194b7aed507c105ae04f1418e084de1
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
diff --git a/libpldmresponder/event_parser.cpp b/libpldmresponder/event_parser.cpp
index 611c7ec..b006d56 100644
--- a/libpldmresponder/event_parser.cpp
+++ b/libpldmresponder/event_parser.cpp
@@ -49,7 +49,7 @@
         {
             StateSensorEntry stateSensorEntry{};
             stateSensorEntry.containerId =
-                static_cast<uint16_t>(entry.value("containerID", 0));
+                static_cast<uint16_t>(entry.value("containerID", 0xFFFF));
             stateSensorEntry.entityType =
                 static_cast<uint16_t>(entry.value("entityType", 0));
             stateSensorEntry.entityInstance =
@@ -59,6 +59,10 @@
             stateSensorEntry.stateSetid =
                 static_cast<uint16_t>(entry.value("stateSetId", 0));
 
+            // container id is not found in the json
+            stateSensorEntry.skipContainerId =
+                (stateSensorEntry.containerId == 0xFFFF) ? true : false;
+
             pldm::utils::DBusMapping dbusInfo{};
 
             auto dbus = entry.value("dbus", emptyJson);