tools: bt: add syscall interface
The bt data handler needs a handle to a syscall interface to do things
like opening files and reading their contents.
Change-Id: Iacf26665eea2b0ed77b7ac2fd8d272d7518664d8
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/tools/bt.hpp b/tools/bt.hpp
index d4710ce..f407afa 100644
--- a/tools/bt.hpp
+++ b/tools/bt.hpp
@@ -2,6 +2,7 @@
#include "blob_interface.hpp"
#include "interface.hpp"
+#include "internal/sys.hpp"
namespace host_tool
{
@@ -9,7 +10,10 @@
class BtDataHandler : public DataInterface
{
public:
- explicit BtDataHandler(BlobInterface* blob) : blob(blob){};
+ BtDataHandler(BlobInterface* blob,
+ const internal::Sys* sys = &internal::sys_impl) :
+ blob(blob),
+ sys(sys){};
bool sendContents(const std::string& input, std::uint16_t session) override;
blobs::FirmwareBlobHandler::UpdateFlags supportedType() const override
@@ -19,6 +23,7 @@
private:
BlobInterface* blob;
+ const internal::Sys* sys;
blobs::FirmwareBlobHandler::UpdateFlags flags =
blobs::FirmwareBlobHandler::UpdateFlags::ipmi;
};