Patrick Venture | fa6c4d9 | 2018-11-02 18:34:53 -0700 | [diff] [blame^] | 1 | #include "config.h" |
| 2 | |
Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 3 | #include "firmware_handler.hpp" |
| 4 | |
Patrick Venture | fa6c4d9 | 2018-11-02 18:34:53 -0700 | [diff] [blame^] | 5 | #include <string> |
| 6 | #include <vector> |
| 7 | |
Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 8 | namespace blobs |
| 9 | { |
| 10 | |
Patrick Venture | fa6c4d9 | 2018-11-02 18:34:53 -0700 | [diff] [blame^] | 11 | std::vector<std::string> supportedFirmware = { |
| 12 | "/flash/hash", |
| 13 | #ifdef ENABLE_STATIC_LAYOUT |
| 14 | "/flash/image", |
| 15 | #endif |
| 16 | }; |
| 17 | |
Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 18 | bool FirmwareBlobHandler::canHandleBlob(const std::string& path) |
| 19 | { |
| 20 | return false; |
| 21 | } |
| 22 | std::vector<std::string> FirmwareBlobHandler::getBlobIds() |
| 23 | { |
Patrick Venture | fa6c4d9 | 2018-11-02 18:34:53 -0700 | [diff] [blame^] | 24 | /* |
| 25 | * Grab the list of supported firmware. |
| 26 | * If there's an open session, add that to this list. |
| 27 | */ |
| 28 | std::vector<std::string> blobs = supportedFirmware; |
| 29 | |
| 30 | /* |
| 31 | * If there's an open firmware session, it'll add "/flash/active/image", |
| 32 | * and if the hash has started, "/flash/active/hash" regardless of |
| 33 | * mechanism. |
| 34 | */ |
| 35 | |
| 36 | return blobs; |
Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 37 | } |
| 38 | bool FirmwareBlobHandler::deleteBlob(const std::string& path) |
| 39 | { |
| 40 | return false; |
| 41 | } |
| 42 | bool FirmwareBlobHandler::stat(const std::string& path, struct BlobMeta* meta) |
| 43 | { |
| 44 | return false; |
| 45 | } |
| 46 | bool FirmwareBlobHandler::open(uint16_t session, uint16_t flags, |
| 47 | const std::string& path) |
| 48 | { |
| 49 | return false; |
| 50 | } |
| 51 | std::vector<uint8_t> FirmwareBlobHandler::read(uint16_t session, |
| 52 | uint32_t offset, |
| 53 | uint32_t requestedSize) |
| 54 | { |
| 55 | return {}; |
| 56 | } |
| 57 | bool FirmwareBlobHandler::write(uint16_t session, uint32_t offset, |
| 58 | const std::vector<uint8_t>& data) |
| 59 | { |
| 60 | return false; |
| 61 | } |
| 62 | bool FirmwareBlobHandler::writeMeta(uint16_t session, uint32_t offset, |
| 63 | const std::vector<uint8_t>& data) |
| 64 | { |
| 65 | return false; |
| 66 | } |
| 67 | bool FirmwareBlobHandler::commit(uint16_t session, |
| 68 | const std::vector<uint8_t>& data) |
| 69 | { |
| 70 | return false; |
| 71 | } |
| 72 | bool FirmwareBlobHandler::close(uint16_t session) |
| 73 | { |
| 74 | return false; |
| 75 | } |
| 76 | bool FirmwareBlobHandler::stat(uint16_t session, struct BlobMeta* meta) |
| 77 | { |
| 78 | return false; |
| 79 | } |
| 80 | bool FirmwareBlobHandler::expire(uint16_t session) |
| 81 | { |
| 82 | return false; |
| 83 | } |
| 84 | } // namespace blobs |