f3s_v2read()

int32_t f3s_v2read (f3s_dbase_t *dbase,
                    f3s_access_t *access,
                    uint32_t flags,
                    uint32_t text_offset,
                    int32_t buffer_size,
                    uint8_t *buffer);

This optional function is called to read buffer_size bytes from address text_offset into buffer. Normally the flash devices will be read directly via memcpy().

On success, it should return the number of bytes read. If an error occurs, it should return -1 with errno set to one of the following:

EIO
Recoverable I/O error (e.g. failed due to low power, but corruption is localized and block will be usable after erasing).
EFAULT
Unrecoverable I/O error (e.g. block no longer usable).
EINVAL
Invalid command error.
ERANGE
Flash memory access out of range (via service->page function).
ENODEV
Flash no longer accessible (e.g. flash removed).
ESHUTDOWN
Critical error; shut down the flash driver.