14 #include "config/DpCfg.hpp" 27 this->m_dpFileNamePrefix = dpFileNamePrefix;
39 ++this->m_numBuffersReceived;
69 status = this->deserializePacketHeader(buffer, container);
74 if (bufferSize < packetSize) {
81 this->performProcessing(container);
102 status = this->writeFile(container, fileName, fileSize);
106 this->sendNotification(container, fileName, fileSize);
118 void DpWriter::schedIn_handler(
const FwIndexType portNum, U32 context) {
134 void DpWriter::CLEAR_EVENT_THROTTLE_cmdHandler(
FwOpcodeType opCode, U32 cmdSeq) {
171 bool did_process =
false;
173 if ((procTypes & (1 << portNum)) != 0) {
189 static_cast<FwAssertArgType>(buffer.
getSize()));
224 this->m_numBytesWritten +=
static_cast<U64
>(writeSize);
226 if ((fileStatus ==
Os::File::OP_OK) and (writeSize == static_cast<FwSizeType>(fileSize))) {
233 static_cast<U32>(fileSize), fileName);
239 this->m_numSuccessfulWrites++;
241 this->m_numFailedWrites++;
Serialization/Deserialization operation was successful.
A data product Container.
FwDpPriorityType getPriority() const
FwIdType FwOpcodeType
The type of a command opcode.
void log_WARNING_HI_BufferTooSmallForData(FwSizeType bufferSize, U32 minSize)
PlatformSizeType FwSizeType
U32 FwDpPriorityType
The type of a data product priority.
static constexpr FwSizeType MIN_PACKET_SIZE
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
void setBuffer(const Buffer &buffer)
Set the packet buffer.
void tlmWrite_NumErrors(U32 arg, Fw::Time _tlmTime=Fw::Time())
bool isConnected_dpWrittenOut_OutputPort(FwIndexType portNum) const
SerializeStatus
forward declaration for string
void deallocBufferSendOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer) const
Invoke output port deallocBufferSendOut.
void log_WARNING_HI_InvalidBuffer_ThrottleClear()
Reset throttle value for InvalidBuffer.
Os::FileInterface::Status open(const char *path, Mode mode)
open file with supplied path and mode
void tlmWrite_NumFailedWrites(U32 arg, Fw::Time _tlmTime=Fw::Time())
void log_WARNING_HI_FileWriteError_ThrottleClear()
Reset throttle value for FileWriteError.
void updateHeaderHash()
Compute and set the header hash.
void dpWrittenOut_out(FwIndexType portNum, const Fw::StringBase &fileName, FwDpPriorityType priority, FwSizeType size) const
Invoke output port dpWrittenOut.
void log_WARNING_HI_InvalidHeaderHash(FwSizeType bufferSize, U32 storedHash, U32 computedHash)
constexpr const char * DP_FILENAME_FORMAT
void tlmWrite_NumBuffersReceived(U32 arg, Fw::Time _tlmTime=Fw::Time())
Fw::Time getTimeTag() const
void procBufferSendOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer) const
Invoke output port procBufferSendOut.
void log_WARNING_HI_BufferTooSmallForData_ThrottleClear()
Reset throttle value for BufferTooSmallForData.
void log_WARNING_HI_FileOpenError_ThrottleClear()
Reset throttle value for FileOpenError.
Status write(const U8 *buffer, FwSizeType &size)
write data to this file from the supplied buffer bounded by size
const char * toChar() const
Convert to a C-style char*.
void log_WARNING_HI_FileOpenError(U32 status, const Fw::StringBase &file)
void log_WARNING_HI_InvalidHeader_ThrottleClear()
Reset throttle value for InvalidHeader.
void log_WARNING_HI_FileNameFormatError(const Fw::StringFormatStatus &status)
FwSizeType getPacketSize() const
Get the packet size corresponding to the data size.
Fw::Buffer getBuffer() const
void log_WARNING_HI_InvalidHeaderHash_ThrottleClear()
Reset throttle value for InvalidHeaderHash.
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Command successfully executed.
void log_WARNING_HI_BufferTooSmallForPacket(FwSizeType bufferSize, U32 minSize)
U8 SerialType
The serial representation type.
FwSizeType getSize() const
DpCfg::ProcType::SerialType getProcTypes() const
FwIdType FwDpIdType
The type of a data product identifier.
void updateDataHash()
Update the data hash.
void log_ACTIVITY_LO_FileWritten(U32 bytes, const Fw::StringBase &file) const
Operation was successful.
A read-only abstract superclass for StringBase.
PlatformIndexType FwIndexType
void configure(const Fw::ConstStringBase &dpFileNamePrefix)
Configure writer.
U32 asBigEndianU32() const
Convert bytes 0 through 3 of the hash data to a big-Endian U32 value.
void log_WARNING_HI_FileWriteError(U32 status, U32 bytesWritten, U32 bytesToWrite, const Fw::StringBase &file)
A container class for holding a hash buffer.
Success::T checkHeaderHash(Utils::HashBuffer &storedHash, Utils::HashBuffer &computedHash) const
Check the header hash.
RateGroupDivider component implementation.
Fw::SerializeStatus deserializeHeader()
void tlmWrite_NumBytesWritten(U64 arg, Fw::Time _tlmTime=Fw::Time())
void log_WARNING_HI_InvalidHeader(FwSizeType bufferSize, U32 errorCode)
void tlmWrite_NumSuccessfulWrites(U32 arg, Fw::Time _tlmTime=Fw::Time())
void log_WARNING_HI_BufferTooSmallForPacket_ThrottleClear()
Reset throttle value for BufferTooSmallForPacket.
DpWriter(const char *const compName)
void log_WARNING_HI_InvalidBuffer()
Auto-generated base for DpWriter component.
PlatformAssertArgType FwAssertArgType
The type of arguments to assert functions.
FormatStatus
status of string format calls
Open file for writing and truncates file if it exists, ie same flags as creat()