pldm_events: Parse state sensor PDRs from the Host PDR
Parse the State Sensor PDRs from the host firmware and build
the HostStateSensorMap data structure which will be used to
lookup the sensor info for the sensorEventType in the
PlatformEventMessage command. Also clear the HostStateSensorMap
when the host powers off.
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
Change-Id: Id85a73f1a0a1caf4b4155a8d235b3e807383e53a
diff --git a/types.hpp b/types.hpp
new file mode 100644
index 0000000..e194c94
--- /dev/null
+++ b/types.hpp
@@ -0,0 +1,48 @@
+#pragma once
+
+#include <stdint.h>
+
+#include <set>
+#include <string>
+#include <variant>
+#include <vector>
+
+namespace pldm
+{
+
+namespace dbus
+{
+
+using ObjectPath = std::string;
+using Service = std::string;
+using Interface = std::string;
+using Interfaces = std::vector<std::string>;
+using Property = std::string;
+using PropertyType = std::string;
+using Value = std::variant<bool, uint8_t, int16_t, uint16_t, int32_t, uint32_t,
+ int64_t, uint64_t, double, std::string>;
+
+} // namespace dbus
+
+namespace pdr
+{
+
+using TerminusHandle = uint16_t;
+using TerminusID = uint16_t;
+using SensorID = uint16_t;
+using EntityType = uint16_t;
+using EntityInstance = uint16_t;
+using ContainerID = uint16_t;
+using CompositeCount = uint8_t;
+
+//!< Subset of the State Set that is supported by a effecter/sensor
+using PossibleStates = std::set<uint8_t>;
+//!< Subset of the State Set that is supported by each effecter/sensor in a
+//!< composite efffecter/sensor
+using CompositeSensorStates = std::vector<PossibleStates>;
+using EntityInfo = std::tuple<ContainerID, EntityType, EntityInstance>;
+using SensorInfo = std::tuple<EntityInfo, CompositeSensorStates>;
+
+} // namespace pdr
+
+} // namespace pldm