Partition.h
Go to the documentation of this file.
134 uint32_t offset{0};
144 Info(const String& name, Type type, uint8_t subtype, uint32_t offset, uint32_t size, Flags flags)
208 template <typename T> typename std::enable_if<std::is_pod<T>::value, bool>::type read(size_t offset, T& value)
381 template <typename E> typename std::enable_if<bool(E::partitionType), String>::type toString(E subType)
386 template <typename E> typename std::enable_if<bool(E::partitionType), String>::type toLongString(E subType)
uint32_t lastAddress() const
Obtain address of last byte in this this partition.
Definition: Partition.h:261
bool contains(uint32_t addr) const
Determine if given address contained within this partition.
Definition: Partition.h:342
std::enable_if< std::is_pod< T >::value, bool >::type read(size_t offset, T &value)
Definition: Partition.h:208
Info(const String &name, Type type, uint8_t subtype, uint32_t offset, uint32_t size, Flags flags)
Definition: Partition.h:144
bool isEncrypted() const
Check state of partition encrypted flag.
Definition: Partition.h:294
bool isReadOnly() const
Check state of partition readOnly flag.
Definition: Partition.h:302
uint32_t address() const
Obtain partition starting address.
Definition: Partition.h:252
bool getDeviceAddress(uint32_t &address, size_t size) const
Get corresponding storage device address for a given partition offset.
uint8_t subType() const
Obtain partition sub-type.
Definition: Partition.h:243
bool verify(Type type, uint8_t subtype) const
Write/erase prohibited.
String getDeviceName() const
Get name of storage device for this partition.
bool write(size_t offset, const void *src, size_t size)
Write data to the partition.
size_t getBlockSize() const
Obtain smallest allocation unit for erase operations.
bool operator==(const Partition &other) const
Definition: Partition.h:347
Partition::Type type() const
Obtain partition type.
Definition: Partition.h:235
Class to manage a NUL-terminated C-style string When storing persistent strings in RAM the regular St...
Definition: CString.h:26
String toString(Storage::Partition::Type type, uint8_t subType)
Device * getDevice() const
Get storage device containing this partition.
Definition: Partition.h:334
Represents a storage device (e.g. flash memory)
Definition: Components/Storage/src/include/Storage/Device.h:32
String toLongString(Storage::Partition::Type type, uint8_t subType)
String typeString() const
bool verify(uint8_t type, uint8_t subtype) const
Definition: Partition.h:172
Internal structure describing the binary layout of a partition table entry.
Definition: partition.h:16
String longTypeString() const
static SubType::App apptypeOta(uint8_t i)
Convenience function to get SubType value for the i-th OTA partition.
Definition: Partition.h:187
bool read(size_t offset, void *dst, size_t size)
Read data from the partition.
Definition: FileDevice.h:23
bool erase_range(size_t offset, size_t size)
Erase part of the partition.
Definition: Partition.h:91