mirror of
https://github.com/nasa/fprime.git
synced 2025-12-11 13:04:17 -06:00
* lestarch: adding logical types implementation into Linux/StandardTypes.hpp * lestarch: removing VxWorks StandardTypes from repository * updated fprime types for correct compilation with vxworks and baremetal * lestarch: refactoring types and configuration header w.r.t type design * lestarch: replacing usages of AssertArg with FwAssertArgType * lestarch: missspelled configuration * lestarch: minor compilation fixes * lestarch: renaming StandardTypes.hpp -> PlatformTypes.hpp * lestarch: updating PRI tokens * lestarch: replacing BasicTypes.hpp includes with FpConfig.hpp * lestarch: UT and compilation fixes for types refactor * lestarch: sp * lestarch: fixing RPI issues in PassiveConsoleTextLogger * lestarch: converting RPI build to debug * lestarch: removing duplicate config imports * lestarch: fixing documentation * lestarch: fixing up multiple definitions and RPI compilation problems * lestarch: reverting debug build * lestarch: reverting platform types to class-based constants * lestarch: reworking basic types * lestarch: configured types refactor into classes * lestarch: fixing bugs with static constants in classes * lestarch: fixing platform types spelling and documentation * lestarch: adding include guards to types headers Co-authored-by: Kevin F Ortega <kevin.f.ortega@jpl.nasa.gov>
43 lines
1.1 KiB
C++
43 lines
1.1 KiB
C++
// ======================================================================
|
|
// \title CRCChecker.hpp
|
|
// \author ortega
|
|
// \brief hpp file for a crc32 checker
|
|
//
|
|
// \copyright
|
|
// Copyright 2009-2020, by the California Institute of Technology.
|
|
// ALL RIGHTS RESERVED. United States Government Sponsorship
|
|
// acknowledged.
|
|
// ======================================================================
|
|
|
|
#ifndef CRC_CHECKER_HPP
|
|
#define CRC_CHECKER_HPP
|
|
|
|
#include <FpConfig.hpp>
|
|
|
|
namespace Utils {
|
|
|
|
static const NATIVE_INT_TYPE CRC_FILE_READ_BLOCK = 2048;
|
|
static const U32 CRC_MAX_FILENAME_SIZE = 128; // TODO use a config variable
|
|
|
|
typedef enum
|
|
{
|
|
PASSED_FILE_CRC_CHECK = 0,
|
|
PASSED_FILE_CRC_WRITE,
|
|
FAILED_FILE_SIZE,
|
|
FAILED_FILE_SIZE_CAST,
|
|
FAILED_FILE_OPEN,
|
|
FAILED_FILE_READ,
|
|
FAILED_FILE_CRC_OPEN,
|
|
FAILED_FILE_CRC_READ,
|
|
FAILED_FILE_CRC_WRITE,
|
|
FAILED_FILE_CRC_CHECK
|
|
} crc_stat_t;
|
|
|
|
crc_stat_t create_checksum_file(const char* const filename);
|
|
crc_stat_t read_crc32_from_file(const char* const fname, U32 &checksum_from_file);
|
|
crc_stat_t verify_checksum(const char* const filename, U32 &expected, U32 &actual);
|
|
|
|
}
|
|
|
|
#endif
|