add handler logic to handle SysEntityName
Add handler logic to handler for SysEntityName such that it splits the
true IPMI processing from the business logic.
Tested: Only ran unit-tests (added new ones).
Change-Id: I6d672a80f85843ff98c2c7e5daf4689932ff96f9
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/handler.hpp b/handler.hpp
index a068fce..be5f4d0 100644
--- a/handler.hpp
+++ b/handler.hpp
@@ -49,6 +49,20 @@
* @throw IpmiException on failure.
*/
virtual void psuResetDelay(std::uint32_t delay) const = 0;
+
+ /**
+ * Return the entity name.
+ * On the first call to this method it'll build the list of entities.
+ * @todo Consider moving the list building to construction time (and ignore
+ * failures).
+ *
+ * @param[in] id - the entity id value
+ * @param[in] instance - the entity instance
+ * @return the entity's name
+ * @throw IpmiException on failure.
+ */
+ virtual std::string getEntityName(std::uint8_t id,
+ std::uint8_t instance) = 0;
};
class Handler : public HandlerInterface
@@ -61,6 +75,7 @@
std::int64_t getRxPackets(const std::string& name) const override;
VersionTuple getCpldVersion(unsigned int id) const override;
void psuResetDelay(std::uint32_t delay) const override;
+ std::string getEntityName(std::uint8_t id, std::uint8_t instance) override;
};
extern Handler handlerImpl;