firmware: enable fileOpen state
At any point, only one file can be open. The firmware update handler
will allow either the firmware image or the hash file to be open at
once, but not both. And not any other combination of blob_ids.
Change-Id: I8f7cfbe570647549ea04ca66a2d423c40e2e6aeb
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/firmware_handler.cpp b/firmware_handler.cpp
index 10f427a..09f8b10 100644
--- a/firmware_handler.cpp
+++ b/firmware_handler.cpp
@@ -239,7 +239,6 @@
if (path == hashBlobID)
{
/* 2c) are they opening the /flash/hash ? (to start the process) */
-
curr = &activeHash;
active = &activeHashBlobID;
}
@@ -289,6 +288,8 @@
blobIDs.push_back(*active);
+ fileOpen = true;
+
return true;
}
@@ -390,6 +391,10 @@
*/
bool FirmwareBlobHandler::close(uint16_t session)
{
+ fileOpen = false;
+
+ /* TODO: implement other aspects of closing out a session. */
+
return false;
}