eive-obsw/mission/tmtc/DirectTmSinkIF.h
Robin Mueller 8dbc5cad48
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
EIVE/eive-obsw/pipeline/head This commit looks good
more bugfixes
2023-10-13 09:39:50 +02:00

36 lines
1.2 KiB
C++

#ifndef MISSION_TMTC_DIRECTTMSINKIF_H_
#define MISSION_TMTC_DIRECTTMSINKIF_H_
#include <cstddef>
#include "eive/resultClassIds.h"
#include "fsfw/retval.h"
class DirectTmSinkIF {
public:
virtual ~DirectTmSinkIF() = default;
static constexpr uint8_t CLASS_ID = CLASS_ID::TM_SINK;
static constexpr ReturnValue_t IS_BUSY = returnvalue::makeCode(CLASS_ID, 0);
static constexpr ReturnValue_t PARTIALLY_WRITTEN = returnvalue::makeCode(CLASS_ID, 1);
static constexpr ReturnValue_t INCOMPLETE_PARTIAL_WRITE = returnvalue::makeCode(CLASS_ID, 2);
/**
* @brief Implements the functionality to write to a TM sink directly
*
* @param data Pointer to buffer holding the data to write
* @param size Number of bytes to write
* @return returnvalue::OK on success, returnvalue::FAILED on failure, IS_BUSY
* if the TM sink is busy, PARTIALLY_WRITTEN if only a portion of the bytes could be
* written.
*/
virtual ReturnValue_t write(const uint8_t* data, size_t size, size_t& writtenSize) = 0;
virtual ReturnValue_t finishWrite(const uint8_t* data, size_t start, size_t remainingSize) = 0;
virtual bool isBusy() const = 0;
};
#endif /* MISSION_TMTC_DIRECTTMSINKIF_H_ */