blob: f09e7a25467c7f05283ff0836d4b7309566e7136 [file] [log] [blame]
Patrick Venture25528b42018-11-06 18:29:43 -08001#pragma once
2
Patrick Venturea78e39f2018-11-06 18:37:06 -08003#include <functional>
4#include <memory>
5#include <string>
6
Patrick Venture25528b42018-11-06 18:29:43 -08007namespace blobs
8{
9
10/**
11 * Each image update mechanism must implement the ImageHandlerInterface.
12 */
13class ImageHandlerInterface
14{
15 public:
16 virtual ~ImageHandlerInterface() = default;
17
18 /**
19 * open the firmware update mechanism.
20 *
Patrick Venturea78e39f2018-11-06 18:37:06 -080021 * @param[in] path - the path passed to the handler (the blob_id).
Patrick Venture25528b42018-11-06 18:29:43 -080022 * @return bool - returns true on success.
23 */
Patrick Venturea78e39f2018-11-06 18:37:06 -080024 virtual bool open(const std::string& path) = 0;
25};
26
27struct HandlerPack
28{
29 std::string blobName;
30 ImageHandlerInterface* handler;
Patrick Venture25528b42018-11-06 18:29:43 -080031};
32
33} // namespace blobs