diff options
author | Patrick Venture <venture@google.com> | 2019-03-07 12:48:32 -0800 |
---|---|---|
committer | Patrick Venture <venture@google.com> | 2019-03-08 13:10:01 -0800 |
commit | de8a16e2e85f49e142461b7e6fe901d3f8740fdf (patch) | |
tree | 065055f299e232874190c8e921d7960b9f434cd4 /crc.hpp | |
parent | b15d654ed1f6804fb2e82a5cfe97eaf35b83529e (diff) | |
download | phosphor-ipmi-blobs-de8a16e2e85f49e142461b7e6fe901d3f8740fdf.tar.gz phosphor-ipmi-blobs-de8a16e2e85f49e142461b7e6fe901d3f8740fdf.zip |
use ipmiblob library from ipmi-blob-tool
Drop all code that is now handled by the ipmiblob library provided by
the new ipmi-blob-tool. This is a library that can be included on the
BMC if necessary, but relies on nothing that is strictly meant for the
BMC.
Change-Id: I2b02ae0d432e84c08e598d27eef85b57c06a70fc
Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'crc.hpp')
-rw-r--r-- | crc.hpp | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/crc.hpp b/crc.hpp deleted file mode 100644 index 3793d9a..0000000 --- a/crc.hpp +++ /dev/null @@ -1,60 +0,0 @@ -#pragma once - -#include <cstdint> - -namespace blobs -{ - -using std::size_t; -using std::uint16_t; -using std::uint32_t; -using std::uint8_t; - -constexpr uint16_t crc16Ccitt = 0x1021; -/* Value from: http://srecord.sourceforge.net/crc16-ccitt.html for - * implementation without explicit bit adding. - */ -constexpr uint16_t crc16Initial = 0xFFFF; - -class CrcInterface -{ - public: - virtual ~CrcInterface() = default; - - /** - * Reset the crc. - */ - virtual void clear() = 0; - - /** - * Provide bytes against which to compute the crc. This method is - * meant to be only called once between clear() and get(). - * - * @param[in] bytes - the data against which to compute. - * @param[in] length - the number of bytes. - */ - virtual void compute(const uint8_t* bytes, uint32_t length) = 0; - - /** - * Read back the current crc value. - * - * @return the crc16 value. - */ - virtual uint16_t get() const = 0; -}; - -class Crc16 : public CrcInterface -{ - public: - Crc16() : poly(crc16Ccitt), value(crc16Initial){}; - ~Crc16() = default; - - void clear() override; - void compute(const uint8_t* bytes, uint32_t length) override; - uint16_t get() const override; - - private: - uint16_t poly; - uint16_t value; -}; -} // namespace blobs |