summaryrefslogtreecommitdiffstats
path: root/types.hpp
diff options
context:
space:
mode:
authorTom Joseph <tomjoseph@in.ibm.com>2017-09-06 19:23:00 +0530
committerTom Joseph <tomjoseph@in.ibm.com>2017-09-14 18:48:00 +0530
commit816e92b59fa52dcd997099a81e2f43a3512fca1e (patch)
tree7329e332662cc0a969fd8234b50bfbbbf2224899 /types.hpp
parentcc941e150007d56b2d7f2fc0c8248e6d74dd659d (diff)
downloadphosphor-host-ipmid-816e92b59fa52dcd997099a81e2f43a3512fca1e.tar.gz
phosphor-host-ipmid-816e92b59fa52dcd997099a81e2f43a3512fca1e.zip
sensor: Add function to map dbus info to assertion status
Change-Id: I30aae9abd7905ae3299856d798d41e10859fed7f Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
Diffstat (limited to 'types.hpp')
-rw-r--r--types.hpp37
1 files changed, 36 insertions, 1 deletions
diff --git a/types.hpp b/types.hpp
index ae88faa..330a8a6 100644
--- a/types.hpp
+++ b/types.hpp
@@ -6,7 +6,6 @@
#include <string>
#include <sdbusplus/server.hpp>
-#include "sensorhandler.h"
namespace ipmi
{
@@ -39,6 +38,42 @@ struct Values
Value deassert;
};
+/**
+ * @struct SetSensorReadingReq
+ *
+ * IPMI Request data for Set Sensor Reading and Event Status Command
+ */
+struct SetSensorReadingReq
+{
+ uint8_t number;
+ uint8_t operation;
+ uint8_t reading;
+ uint8_t assertOffset0_7;
+ uint8_t assertOffset8_14;
+ uint8_t deassertOffset0_7;
+ uint8_t deassertOffset8_14;
+ uint8_t eventData1;
+ uint8_t eventData2;
+ uint8_t eventData3;
+} __attribute__((packed));
+
+/**
+ * @struct GetReadingResponse
+ *
+ * IPMI response data for Get Sensor Reading command.
+ */
+struct GetReadingResponse
+{
+ uint8_t reading; //!< Sensor reading.
+ uint8_t operation; //!< Sensor scanning status / reading state.
+ uint8_t assertOffset0_7; //!< Discrete assertion states(0-7).
+ uint8_t assertOffset8_14; //!< Discrete assertion states(8-14).
+} __attribute__((packed));
+
+constexpr auto inventoryRoot = "/xyz/openbmc_project/inventory";
+
+using GetSensorResponse = std::array<uint8_t, sizeof(GetReadingResponse)>;
+
using OffsetValueMap = std::map<Offset,Values>;
using DbusPropertyMap = std::map<DbusProperty,OffsetValueMap>;
OpenPOWER on IntegriCloud