SUIT storage backend driver struct. More...
#include <storage.h>
Data Fields | |
| int(* | init )(suit_storage_t *storage) |
| One-time initialization function. More... | |
| int(* | start )(suit_storage_t *storage, const suit_manifest_t *manifest, size_t len) |
| Start a new payload write sequence. More... | |
| int(* | write )(suit_storage_t *storage, const suit_manifest_t *manifest, const uint8_t *buf, size_t offset, size_t len) |
| Write a new chunk of the payload to the storage backend. More... | |
| int(* | finish )(suit_storage_t *storage, const suit_manifest_t *manifest) |
| Signal that the payload write stage done to the storage backend. More... | |
| int(* | read )(suit_storage_t *storage, uint8_t *buf, size_t offset, size_t len) |
| Read a chunk of previously written data back. More... | |
| int(* | read_ptr )(suit_storage_t *storage, const uint8_t **buf, size_t *len) |
| retrieve a direct read pointer for this storage backend More... | |
| int(* | install )(suit_storage_t *storage, const suit_manifest_t *manifest) |
| Install the payload or mark the payload as valid. More... | |
| int(* | erase )(suit_storage_t *storage) |
| Erase the previously loaded payload. More... | |
| bool(* | has_location )(const suit_storage_t *storage, const char *location) |
| Check if this storage backend services a location. More... | |
| bool(* | match_offset )(const suit_storage_t *storage, size_t offset) |
| Checks if the supplied offset is true or false for the current location. More... | |
| int(* | set_active_location )(suit_storage_t *storage, const char *location) |
| Set the active location of the storage handler. More... | |
| int(* | get_seq_no )(const suit_storage_t *storage, uint32_t *seq_no) |
| Retrieve the sequence number from the storage backend. More... | |
| int(* | set_seq_no )(suit_storage_t *storage, uint32_t seq_no) |
| Set a new sequence number in the storage backend. More... | |
| char | separator |
| Component ID separator used by this storage driver. | |
| int(* suit_storage_driver::erase) (suit_storage_t *storage) |
Erase the previously loaded payload.
| [in] | storage | Storage context |
| int(* suit_storage_driver::finish) (suit_storage_t *storage, const suit_manifest_t *manifest) |
Signal that the payload write stage done to the storage backend.
| [in] | storage | Storage context |
| [in] | manifest | The suit manifest context |
| int(* suit_storage_driver::get_seq_no) (const suit_storage_t *storage, uint32_t *seq_no) |
Retrieve the sequence number from the storage backend.
| [in] | storage | Storage context |
| [out] | seq_no | Retrieved sequence number |
| bool(* suit_storage_driver::has_location) (const suit_storage_t *storage, const char *location) |
| int(* suit_storage_driver::init) (suit_storage_t *storage) |
| int(* suit_storage_driver::install) (suit_storage_t *storage, const suit_manifest_t *manifest) |
Install the payload or mark the payload as valid.
| [in] | storage | Storage context |
| [in] | manifest | The suit manifest context |
| bool(* suit_storage_driver::match_offset) (const suit_storage_t *storage, size_t offset) |
Checks if the supplied offset is true or false for the current location.
| [in] | storage | Storage context |
| [in] | offset | Offset to check |
| int(* suit_storage_driver::read) (suit_storage_t *storage, uint8_t *buf, size_t offset, size_t len) |
Read a chunk of previously written data back.
| [in] | storage | Storage context |
| [out] | buf | Buffer to write the read data in |
| [in] | offset | Offset to read from |
| [in] | len | Number of bytes to read |
| int(* suit_storage_driver::read_ptr) (suit_storage_t *storage, const uint8_t **buf, size_t *len) |
retrieve a direct read pointer for this storage backend
| [in] | storage | Storage context |
| [out] | buf | Pointer to the location data |
| [out] | len | Full length of the location data |
| int(* suit_storage_driver::set_active_location) (suit_storage_t *storage, const char *location) |
Set the active location of the storage handler.
A storage backend can handle multiple locations, e.g. a VFS backend targeting multiple files on a filesystem, setting the location selects the target location for writes or reads.
| [in] | storage | Storage backend context |
| [in] | location | The location supplied as string with components separated by the suit_storage_driver_t::separator |
| int(* suit_storage_driver::set_seq_no) (suit_storage_t *storage, uint32_t seq_no) |
Set a new sequence number in the storage backend.
| [in] | storage | Storage context |
| [in] | seq_no | Sequence number to store |
| int(* suit_storage_driver::start) (suit_storage_t *storage, const suit_manifest_t *manifest, size_t len) |
Start a new payload write sequence.
| [in] | storage | Storage context |
| [in] | manifest | The suit manifest context |
| [in] | len | Total size of the payload in bytes |
| int(* suit_storage_driver::write) (suit_storage_t *storage, const suit_manifest_t *manifest, const uint8_t *buf, size_t offset, size_t len) |
Write a new chunk of the payload to the storage backend.
| [in] | storage | Storage context |
| [in] | manifest | The suit manifest context |
| [in] | buf | Buffer to read the payload chunk from |
| [in] | offset | Offset to write at |
| [in] | len | Length of the payload chunk |