firmware: implement canHandleBlob
Implement the canHandleBlob method. For any blob_id specific command
from the manager level, it'll ask each handler if they support that
blob_id before passing it down. The call is made against only the first
handler that responds in the affirmative.
If the client creates a new blob_id via an action, they are expected to
again enumerate the blobs to verify the operation -- although they don't
need to. Any action that creates or deletes a blob_id will update the
firmwares list.
Operations are single-threaded.
Change-Id: Id3cedb33013e59ea52a7878478557822bf29e33f
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/firmware_handler.hpp b/firmware_handler.hpp
index f9a8983..05bd84d 100644
--- a/firmware_handler.hpp
+++ b/firmware_handler.hpp
@@ -22,13 +22,25 @@
class FirmwareBlobHandler : public GenericBlobInterface
{
public:
+ /**
+ * Create a FirmwareBlobHandler.
+ *
+ * @param[in] firmwares - list of blobs_ids to support.
+ * @param[in] transports - bitmask of transports to support.
+ */
static std::unique_ptr<GenericBlobInterface>
CreateFirmwareBlobHandler(const std::vector<std::string>& firmwares,
std::uint32_t transports);
+ /**
+ * Create a FirmwareBlobHandler.
+ *
+ * @param[in] firmwares - list of blobs_ids to support.
+ * @param[in] transports - bitmask of transports to support.
+ */
FirmwareBlobHandler(const std::vector<std::string>& firmwares,
std::uint32_t transports) :
- baseFirmwares(firmwares),
+ firmwares(firmwares),
transports(transports)
{
}
@@ -56,7 +68,7 @@
bool expire(uint16_t session) override;
private:
- std::vector<std::string> baseFirmwares;
+ std::vector<std::string> firmwares;
std::uint32_t transports;
};