tools: return data or throw exception on ipmi resp
When the IPMI_CC is non-zero, throw an exception and include the code,
otherwise if the response buffer is non-null, return the bytes received.
Change-Id: Id81281d7fd79f3075fcdd4bbf86ffdd83d8a3721
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/tools/ipmi_interface.hpp b/tools/ipmi_interface.hpp
index 932d2e8..082af9c 100644
--- a/tools/ipmi_interface.hpp
+++ b/tools/ipmi_interface.hpp
@@ -12,7 +12,9 @@
* Send an IPMI packet to the BMC.
*
* @param[in] data - a vector of the IPMI packet contents.
- * @return non-zero on failure.
+ * @return the bytes returned.
+ * @throws IpmiException on failure.
*/
- virtual int sendPacket(const std::vector<std::uint8_t>& data) = 0;
+ virtual std::vector<std::uint8_t>
+ sendPacket(const std::vector<std::uint8_t>& data) = 0;
};