tools: implement blob read
Implement blob read. This isn't currently used by the flash update
process however, it is useful.
Tested: Verified it read back bytes written to another blob handler.
Change-Id: Ib1590448d0bfaa3d4fde20ae8bae353c9107e5c4
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/tools/blob_interface.hpp b/tools/blob_interface.hpp
index 07525c9..61ee5eb 100644
--- a/tools/blob_interface.hpp
+++ b/tools/blob_interface.hpp
@@ -76,6 +76,19 @@
* @param[in] session - the session to close.
*/
virtual void closeBlob(std::uint16_t session) = 0;
+
+ /**
+ * Read bytes from a blob.
+ *
+ * @param[in] session - the session id.
+ * @param[in] offset - the offset to which to write the bytes.
+ * @param[in] length - the number of bytes to read.
+ * @return the bytes read
+ * @throws BlobException on failure.
+ */
+ virtual std::vector<std::uint8_t> readBytes(std::uint16_t session,
+ std::uint32_t offset,
+ std::uint32_t length) = 0;
};
} // namespace host_tool