19 const U32 CHUNK_SIZE = 4096;
20 const U32 INITIAL_SEED = 0xFFFFFFFF;
21 const U32 MAX_IT = 0xFFFFFFFF;
24 U32 seed = INITIAL_SEED;
27 U8 file_buffer[CHUNK_SIZE];
30 for (U32 i = 0; !eof && i < MAX_IT; i++) {
33 if (status !=
OP_OK) {
38 status = file.
seek(offset,
true);
39 if (status !=
OP_OK) {
45 status = file.
read(file_buffer, chunk,
false);
49 if (chunk != 0 && status ==
OP_OK) {
53 }
else if (chunk == 0 && status ==
OP_OK) {
PlatformIntType NATIVE_INT_TYPE
uint8_t U8
8-bit unsigned integer
C++-compatible configuration header for fprime configuration.
static Status niceCRC32(U32 &crc, const char *fileName)
Calculates CRC32 of file, not burdening FS.
@ OTHER_ERROR
A catch-all for other errors. Have to look in implementation-specific code.
@ OP_OK
Operation was successful.
Status seek(NATIVE_INT_TYPE offset, bool absolute=true)
seek to location. If absolute = true, absolute from beginning of file
@ OPEN_READ
Open file for reading.
Status open(const char *fileName, Mode mode)
open file. Writing creates file if it doesn't exist
Status read(void *buffer, NATIVE_INT_TYPE &size, bool waitForFull=true)
waitForFull = true to wait for all bytes to be read
unsigned long update_crc_32(unsigned long crc, char c)