tools: implement blob close

Implement blob close call.

Change-Id: If7c845e1e3b542e6f0253136eb8b6fd40bc96f3d
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/tools/blob_handler.cpp b/tools/blob_handler.cpp
index 486f133..06d11e5 100644
--- a/tools/blob_handler.cpp
+++ b/tools/blob_handler.cpp
@@ -238,4 +238,23 @@
     return session;
 }
 
+void BlobHandler::closeBlob(std::uint16_t session)
+{
+    std::vector<std::uint8_t> request, resp;
+    auto addrSession = reinterpret_cast<std::uint8_t*>(&session);
+    std::copy(addrSession, addrSession + sizeof(session),
+              std::back_inserter(request));
+
+    try
+    {
+        resp = sendIpmiPayload(BlobOEMCommands::bmcBlobClose, request);
+    }
+    catch (const BlobException& b)
+    {
+        std::fprintf(stderr, "Received failure on close: %s\n", b.what());
+    }
+
+    return;
+}
+
 } // namespace host_tool