Patrick Venture | 25528b4 | 2018-11-06 18:29:43 -0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Patrick Venture | a78e39f | 2018-11-06 18:37:06 -0800 | [diff] [blame^] | 3 | #include <functional> |
| 4 | #include <memory> |
| 5 | #include <string> |
| 6 | |
Patrick Venture | 25528b4 | 2018-11-06 18:29:43 -0800 | [diff] [blame] | 7 | namespace blobs |
| 8 | { |
| 9 | |
| 10 | /** |
| 11 | * Each image update mechanism must implement the ImageHandlerInterface. |
| 12 | */ |
| 13 | class ImageHandlerInterface |
| 14 | { |
| 15 | public: |
| 16 | virtual ~ImageHandlerInterface() = default; |
| 17 | |
| 18 | /** |
| 19 | * open the firmware update mechanism. |
| 20 | * |
Patrick Venture | a78e39f | 2018-11-06 18:37:06 -0800 | [diff] [blame^] | 21 | * @param[in] path - the path passed to the handler (the blob_id). |
Patrick Venture | 25528b4 | 2018-11-06 18:29:43 -0800 | [diff] [blame] | 22 | * @return bool - returns true on success. |
| 23 | */ |
Patrick Venture | a78e39f | 2018-11-06 18:37:06 -0800 | [diff] [blame^] | 24 | virtual bool open(const std::string& path) = 0; |
| 25 | }; |
| 26 | |
| 27 | struct HandlerPack |
| 28 | { |
| 29 | std::string blobName; |
| 30 | ImageHandlerInterface* handler; |
Patrick Venture | 25528b4 | 2018-11-06 18:29:43 -0800 | [diff] [blame] | 31 | }; |
| 32 | |
| 33 | } // namespace blobs |