ipmi: start implementing flashDataFinish
Change-Id: I627f6b788311650637221413a93ce7f1a3f0d0cd
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/flash-ipmi.hpp b/flash-ipmi.hpp
index db7765e..56c32da 100644
--- a/flash-ipmi.hpp
+++ b/flash-ipmi.hpp
@@ -84,9 +84,28 @@
public:
virtual ~UpdateInterface() = default;
+ /**
+ * Prepare to receive a BMC image and then a signature.
+ *
+ * @param[in] length - the size of the flash image.
+ * @return true on success, false otherwise.
+ */
virtual bool start(uint32_t length) = 0;
+
+ /**
+ * Attempt to write the bytes at the offset.
+ *
+ * @param[in] offset - the 0-based byte offset into the flash image.
+ * @param[in] bytes - the bytes to write.
+ * @return true on success, false otherwise.
+ */
virtual bool flashData(uint32_t offset,
const std::vector<uint8_t>& bytes) = 0;
+
+ /**
+ * Called to indicate the host is done sending the flash bytes.
+ */
+ virtual bool flashFinish() = 0;
};
class FlashUpdate : public UpdateInterface
@@ -99,23 +118,12 @@
FlashUpdate(FlashUpdate&&) = default;
FlashUpdate& operator=(FlashUpdate&&) = default;
- /**
- * Prepare to receive a BMC image and then a signature.
- *
- * @param[in] length - the size of the flash image.
- * @return true on success, false otherwise.
- */
bool start(uint32_t length) override;
- /**
- * Attempt to write the bytes at the offset.
- *
- * @param[in] offset - the 0-based byte offset into the flash image.
- * @param[in] bytes - the bytes to write.
- * @return true on success, false otherwise.
- */
bool flashData(uint32_t offset, const std::vector<uint8_t>& bytes) override;
+ bool flashFinish() override;
+
private:
/**
* Tries to close out and delete anything staged.