blob: b7c0c60d9b63011c5cde2cf4236a9e8efc37d248 [file] [log] [blame]
Patrick Venturefa6c4d92018-11-02 18:34:53 -07001#include "config.h"
2
Patrick Venturec7ca2912018-11-02 11:38:33 -07003#include "firmware_handler.hpp"
4
Patrick Venturefa6c4d92018-11-02 18:34:53 -07005#include <string>
6#include <vector>
7
Patrick Venturec7ca2912018-11-02 11:38:33 -07008namespace blobs
9{
10
Patrick Venturefa6c4d92018-11-02 18:34:53 -070011std::vector<std::string> supportedFirmware = {
12 "/flash/hash",
13#ifdef ENABLE_STATIC_LAYOUT
14 "/flash/image",
15#endif
16};
17
Patrick Venturec7ca2912018-11-02 11:38:33 -070018bool FirmwareBlobHandler::canHandleBlob(const std::string& path)
19{
20 return false;
21}
22std::vector<std::string> FirmwareBlobHandler::getBlobIds()
23{
Patrick Venturefa6c4d92018-11-02 18:34:53 -070024 /*
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 Venturec7ca2912018-11-02 11:38:33 -070037}
38bool FirmwareBlobHandler::deleteBlob(const std::string& path)
39{
40 return false;
41}
42bool FirmwareBlobHandler::stat(const std::string& path, struct BlobMeta* meta)
43{
44 return false;
45}
46bool FirmwareBlobHandler::open(uint16_t session, uint16_t flags,
47 const std::string& path)
48{
49 return false;
50}
51std::vector<uint8_t> FirmwareBlobHandler::read(uint16_t session,
52 uint32_t offset,
53 uint32_t requestedSize)
54{
55 return {};
56}
57bool FirmwareBlobHandler::write(uint16_t session, uint32_t offset,
58 const std::vector<uint8_t>& data)
59{
60 return false;
61}
62bool FirmwareBlobHandler::writeMeta(uint16_t session, uint32_t offset,
63 const std::vector<uint8_t>& data)
64{
65 return false;
66}
67bool FirmwareBlobHandler::commit(uint16_t session,
68 const std::vector<uint8_t>& data)
69{
70 return false;
71}
72bool FirmwareBlobHandler::close(uint16_t session)
73{
74 return false;
75}
76bool FirmwareBlobHandler::stat(uint16_t session, struct BlobMeta* meta)
77{
78 return false;
79}
80bool FirmwareBlobHandler::expire(uint16_t session)
81{
82 return false;
83}
84} // namespace blobs