C_runtime/blob.hpp
author Edouard Tisserant <edouard@beremiz.fr>
Thu, 01 Aug 2024 12:11:11 +0200
changeset 4002 6c2b80b4515d
parent 3940 934bd46a7500
permissions -rw-r--r--
MQTT: WIP, re-organized disconnection handling, now keep track of connection status and reconnect accordingly.

This fixes bug with non-reconnecting to broker when having no published variables.
#ifndef BLOB_HPP
#define BLOB_HPP

#include <string>
#include <filesystem>

#include "md5.hpp"

class Blob
{
public:
    Blob(uint8_t *seedData, size_t seedLength);
    ~Blob();
    MD5::digest_t digest();
    uint32_t appendChunk(uint8_t *data, size_t length);
    uint32_t asFile(std::filesystem::path &filename);

private:
    MD5 md5;
    std::FILE * m_file;
    std::filesystem::path m_filename;
};

#endif // BLOB_HPP