fprime/Utils/CRCChecker.hpp
M Starch ec08d43dd3
Removes NATIVE_INT_TYPE, NATIVE_UINT_TYPE, and POINTER_CAST from Fw (#3286)
* NATIVE_INT_TYPE use in toString

* NATIVE_INT_TYPE use in SimpleObjRegistry

* NATIVE_INT_TYPE use in Asserts

* NATIVE_INT_TYPE use in Fw/Comp

* NATIVE_INT_TYPE use in getCapacity

* NATIVE_INT_TYPE use in getEntries

* NATIVE_INT_TYPE use in size/length

* NATIVE_INT_TYPE use in FILE_NAME_ARG

* NATIVE_INT_TYPE use in Fw (misc)

* NATIVE_INT_TYPE use in identifier

* NATIVE_INT_TYPE use in Fw (misc II)

* POINTER_CAST in Buffer

* POINTER_CAST in Serializable

* sp

* Removing no longer used DefaultTypes.hpp

* Fixes to accomidate Fw refactor

* Unit-test and CI fixes

* Fixing review comments - pt 1
2025-03-04 14:42:48 -08:00

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 FwSignedSizeType 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