summaryrefslogtreecommitdiffstats
path: root/dcmihandler.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'dcmihandler.hpp')
-rw-r--r--dcmihandler.hpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/dcmihandler.hpp b/dcmihandler.hpp
index bd2c6e1..4e95eba 100644
--- a/dcmihandler.hpp
+++ b/dcmihandler.hpp
@@ -14,6 +14,7 @@ enum Commands
{
// Get capability bits
GET_CAPABILITIES = 0x01,
+ GET_POWER_READING = 0x02,
GET_POWER_LIMIT = 0x03,
SET_POWER_LIMIT = 0x04,
APPLY_POWER_LIMIT = 0x05,
@@ -427,6 +428,47 @@ namespace temp_readings
uint8_t instanceStart);
}
+/** @brief Read power reading from power reading sensor object
+ *
+ * @param[in] bus - dbus connection
+ *
+ * @return total power reading
+ */
+int64_t getPowerReading(sdbusplus::bus::bus& bus);
+
+/** @struct GetPowerReadingRequest
+ *
+ * DCMI Get Power Reading command request.
+ * Refer DCMI specification Version 1.1 Section 6.6.1
+ */
+struct GetPowerReadingRequest
+{
+ uint8_t groupID; //!< Group extension identification.
+ uint8_t mode; //!< Mode
+ uint8_t modeAttribute; //!< Mode Attributes
+} __attribute__((packed));
+
+/** @struct GetPowerReadingResponse
+ *
+ * DCMI Get Power Reading command response.
+ * Refer DCMI specification Version 1.1 Section 6.6.1
+ */
+struct GetPowerReadingResponse
+{
+ uint8_t groupID; //!< Group extension identification.
+ uint16_t currentPower; //!< Current power in watts
+ uint16_t minimumPower; //!< Minimum power over sampling duration
+ //!< in watts
+ uint16_t maximumPower; //!< Maximum power over sampling duration
+ //!< in watts
+ uint16_t averagePower; //!< Average power over sampling duration
+ //!< in watts
+ uint32_t timeStamp; //!< IPMI specification based time stamp
+ uint32_t timeFrame; //!< Statistics reporting time period in milli
+ //!< seconds.
+ uint8_t powerReadingState; //!< Power Reading State
+} __attribute__((packed));
+
} // namespace dcmi
#endif
OpenPOWER on IntegriCloud