27 this->m_dpFileNamePrefix = dpFileNamePrefix;
39 ++this->m_numBuffersReceived;
50 static_cast<U32>(bufferSize),
65 static_cast<U32>(bufferSize),
72 status = this->deserializePacketHeader(buffer, container);
77 if (bufferSize < packetSize) {
79 static_cast<U32>(bufferSize),
80 static_cast<U32>(packetSize));
86 this->performProcessing(container);
99 status = this->writeFile(container, fileName, fileSize);
103 this->sendNotification(container, fileName, fileSize);
115 void DpWriter::schedIn_handler(
const NATIVE_INT_TYPE portNum, U32 context) {
131 void DpWriter::CLEAR_EVENT_THROTTLE_cmdHandler(
FwOpcodeType opCode, U32 cmdSeq) {
169 if ((procTypes & (1 << portNum)) != 0) {
199 this->m_numBytesWritten +=
static_cast<U64>(writeSize);
201 if ((fileStatus ==
Os::File::OP_OK) and (writeSize == static_cast<FwSignedSizeType>(fileSize))) {
205 static_cast<U32>(writeSize),
210 static_cast<U32>(fileSize), fileName);
216 this->m_numSuccessfulWrites++;
218 this->m_numFailedWrites++;
Serialization/Deserialization operation was successful.
A data product Container.
void deallocBufferSendOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port deallocBufferSendOut.
FwDpPriorityType getPriority() const
U8 SerialType
The serial representation type.
static constexpr FwSizeType MIN_PACKET_SIZE
PlatformIntType NATIVE_INT_TYPE
void log_WARNING_HI_BufferTooSmallForPacket(U32 bufferSize, U32 minSize)
void log_WARNING_HI_BufferTooSmallForData(U32 bufferSize, U32 minSize)
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
PlatformSizeType FwSizeType
Os::FileInterface::Status open(const char *path, Mode mode)
open file with supplied path and mode
PlatformIndexType FwIndexType
void setBuffer(const Buffer &buffer)
Set the packet buffer.
void tlmWrite_NumErrors(U32 arg, Fw::Time _tlmTime=Fw::Time())
constexpr const char * DP_FILENAME_FORMAT
SerializeStatus
forward declaration for string
void log_WARNING_HI_InvalidBuffer_ThrottleClear()
Reset throttle value for InvalidBuffer.
void tlmWrite_NumFailedWrites(U32 arg, Fw::Time _tlmTime=Fw::Time())
void log_WARNING_HI_FileWriteError_ThrottleClear()
Reset throttle value for FileWriteError.
const char * toChar() const
bool isConnected_dpWrittenOut_OutputPort(FwIndexType portNum)
void procBufferSendOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port procBufferSendOut.
void dpWrittenOut_out(FwIndexType portNum, const Fw::StringBase &fileName, FwDpPriorityType priority, FwSizeType size)
Invoke output port dpWrittenOut.
void tlmWrite_NumBuffersReceived(U32 arg, Fw::Time _tlmTime=Fw::Time())
Fw::Time getTimeTag() const
void log_WARNING_HI_BufferTooSmallForData_ThrottleClear()
Reset throttle value for BufferTooSmallForData.
void log_WARNING_HI_FileOpenError_ThrottleClear()
Reset throttle value for FileOpenError.
void log_WARNING_HI_FileOpenError(U32 status, const Fw::StringBase &file)
void log_WARNING_HI_InvalidHeader_ThrottleClear()
Reset throttle value for InvalidHeader.
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.
C++-compatible configuration header for fprime configuration.
DpCfg::ProcType::SerialType getProcTypes() const
void configure(const Fw::StringBase &dpFileNamePrefix)
Configure writer.
void log_ACTIVITY_LO_FileWritten(U32 bytes, const Fw::StringBase &file) const
Operation was successful.
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.
PlatformSignedSizeType FwSignedSizeType
Fw::SerializeStatus deserializeHeader()
void tlmWrite_NumBytesWritten(U64 arg, Fw::Time _tlmTime=Fw::Time())
void log_WARNING_HI_InvalidHeaderHash(U32 bufferSize, U32 storedHash, U32 computedHash)
void log_WARNING_HI_InvalidHeader(U32 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()
Status write(const U8 *buffer, FwSignedSizeType &size)
write data to this file from the supplied buffer bounded by size
Auto-generated base for DpWriter component.
Open file for writing and truncates file if it exists, ie same flags as creat()