Patrick Venture | af69625 | 2018-12-11 10:22:14 -0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Patrick Venture | 8a55dcb | 2018-12-12 21:12:58 -0800 | [diff] [blame] | 3 | #include "firmware_handler.hpp" |
| 4 | |
Patrick Venture | af69625 | 2018-12-11 10:22:14 -0800 | [diff] [blame] | 5 | #include <cstdint> |
| 6 | #include <string> |
| 7 | |
| 8 | class DataInterface |
| 9 | { |
| 10 | public: |
| 11 | virtual ~DataInterface() = default; |
| 12 | |
| 13 | /** |
| 14 | * Given an open session to either /flash/image, /flash/tarball, or |
| 15 | * /flash/hash, this method will configure, and send the data, but not close |
| 16 | * the session. |
| 17 | * |
| 18 | * @param[in] input - path to file to send. |
| 19 | * @param[in] session - the session ID to use. |
| 20 | * @return bool on success. |
| 21 | */ |
| 22 | virtual bool sendContents(const std::string& input, |
| 23 | std::uint16_t session) = 0; |
Patrick Venture | 8a55dcb | 2018-12-12 21:12:58 -0800 | [diff] [blame] | 24 | |
| 25 | /** |
| 26 | * Return the supported data interface for this. |
| 27 | * |
| 28 | * @return the enum value corresponding to the supported type. |
| 29 | */ |
| 30 | virtual blobs::FirmwareBlobHandler::UpdateFlags supportedType() const = 0; |
Patrick Venture | af69625 | 2018-12-11 10:22:14 -0800 | [diff] [blame] | 31 | }; |