summaryrefslogtreecommitdiffstats
path: root/sensorhandler.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'sensorhandler.hpp')
-rw-r--r--sensorhandler.hpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/sensorhandler.hpp b/sensorhandler.hpp
index 1d455f3..0338597 100644
--- a/sensorhandler.hpp
+++ b/sensorhandler.hpp
@@ -8,6 +8,7 @@
// IPMI commands for net functions.
enum ipmi_netfn_sen_cmds
{
+ IPMI_CMD_PLATFORM_EVENT = 0x2,
IPMI_CMD_GET_DEVICE_SDR_INFO = 0x20,
IPMI_CMD_GET_DEVICE_SDR = 0x21,
IPMI_CMD_RESERVE_DEVICE_SDR_REPO = 0x22,
@@ -48,6 +49,28 @@ struct dbus_interface_t
char interface[MAX_DBUS_PATH];
};
+struct PlatformEventRequest
+{
+ uint8_t eventMessageRevision;
+ uint8_t sensorType;
+ uint8_t sensorNumber;
+ uint8_t eventDirectionType;
+ uint8_t data[3];
+};
+
+static constexpr char const* ipmiSELPath = "/xyz/openbmc_project/Logging/IPMI";
+static constexpr char const* ipmiSELAddInterface =
+ "xyz.openbmc_project.Logging.IPMI";
+static const std::string ipmiSELAddMessage = "SEL Entry";
+
+static constexpr int selSystemEventSizeWith3Bytes = 8;
+static constexpr int selSystemEventSizeWith2Bytes = 7;
+static constexpr int selSystemEventSizeWith1Bytes = 6;
+static constexpr int selIPMBEventSize = 7;
+static constexpr uint8_t directionMask = 0x80;
+static constexpr uint8_t byte3EnableMask = 0x30;
+static constexpr uint8_t byte2EnableMask = 0xC0;
+
int set_sensor_dbus_state_s(uint8_t, const char*, const char*);
int set_sensor_dbus_state_y(uint8_t, const char*, const uint8_t);
int find_openbmc_path(uint8_t, dbus_interface_t*);
OpenPOWER on IntegriCloud