add handler logic to handle SysCpldVersion
Add handler logic to handler for SysCpldVersion such that it splits the
true IPMI processing from the business logic.
Tested: Only ran unit-tests (added new ones).
Change-Id: I09d95d8be8fbe75648b3332af898336b00074c2f
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/handler.hpp b/handler.hpp
index e2e10fa..735ee15 100644
--- a/handler.hpp
+++ b/handler.hpp
@@ -9,6 +9,9 @@
namespace ipmi
{
+using VersionTuple =
+ std::tuple<std::uint8_t, std::uint8_t, std::uint8_t, std::uint8_t>;
+
class HandlerInterface
{
public:
@@ -29,6 +32,15 @@
* @throw IpmiException on failure.
*/
virtual std::int64_t getRxPackets(const std::string& name) const = 0;
+
+ /**
+ * Return the values from a cpld version file.
+ *
+ * @param[in] id - the cpld id number.
+ * @return the quad of numbers as a tuple (maj,min,pt,subpt)
+ * @throw IpmiException on failure.
+ */
+ virtual VersionTuple getCpldVersion(unsigned int id) const = 0;
};
class Handler : public HandlerInterface
@@ -39,6 +51,7 @@
std::tuple<std::uint8_t, std::string> getEthDetails() const override;
std::int64_t getRxPackets(const std::string& name) const override;
+ VersionTuple getCpldVersion(unsigned int id) const override;
};
extern Handler handlerImpl;