flash-ipmi: implement flashDataBlock
Change-Id: Ic932e66ceeb58533f4c4902fbaddb0cb760f1590
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/flash-ipmi.hpp b/flash-ipmi.hpp
index 7b60b05..2e6f6f0 100644
--- a/flash-ipmi.hpp
+++ b/flash-ipmi.hpp
@@ -1,5 +1,6 @@
#pragma once
+#include <cstdio>
#include <string>
#include <vector>
@@ -171,6 +172,17 @@
private:
/**
+ * Attempt to write the bytes at the offset.
+ *
+ * @param[in] fd - the file stream pointer.
+ * @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 writeBlock(std::FILE* fd, uint32_t offset,
+ const std::vector<uint8_t>& bytes);
+
+ /**
* Tries to close out everything.
*/
void closeEverything();