firmware: add write method
The write() method is how the different firmware handlers will receive
data from the update process.
Change-Id: I550a25f69272bae917309956fef798bc3d4eed2e
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/image_handler.hpp b/image_handler.hpp
index f09e7a2..28675ce 100644
--- a/image_handler.hpp
+++ b/image_handler.hpp
@@ -1,8 +1,10 @@
#pragma once
+#include <cstdint>
#include <functional>
#include <memory>
#include <string>
+#include <vector>
namespace blobs
{
@@ -22,6 +24,16 @@
* @return bool - returns true on success.
*/
virtual bool open(const std::string& path) = 0;
+
+ /**
+ * write data to the staged file.
+ *
+ * @param[in] offset - 0-based offset into the file.
+ * @param[in] data - the data to write.
+ * @return bool - returns true on success.
+ */
+ virtual bool write(std::uint32_t offset,
+ const std::vector<std::uint8_t>& data) = 0;
};
struct HandlerPack