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);
205 static_cast<U32
>(writeSize),
210 static_cast<U32
>(fileSize), fileName);
216 this->m_numSuccessfulWrites++;
218 this->m_numFailedWrites++;
PlatformIntType NATIVE_INT_TYPE
constexpr const char * DP_FILENAME_FORMAT
PlatformSignedSizeType FwSignedSizeType
PlatformSizeType FwSizeType
PlatformIndexType FwIndexType
C++-compatible configuration header for fprime configuration.
@ OK
Command successfully executed.
U8 SerialType
The serial representation type.
A data product Container.
Fw::Time getTimeTag() const
DpCfg::ProcType::SerialType getProcTypes() const
static constexpr FwSizeType MIN_PACKET_SIZE
FwDpPriorityType getPriority() const
Fw::Buffer getBuffer() const
Fw::SerializeStatus deserializeHeader()
Success::T checkHeaderHash(Utils::HashBuffer &storedHash, Utils::HashBuffer &computedHash) const
Check the header hash.
FwSizeType getPacketSize() const
Get the packet size corresponding to the data size.
void setBuffer(const Buffer &buffer)
Set the packet buffer.
const char * toChar() const
void format(const CHAR *formatString,...)
write formatted string to buffer
@ FAILURE
Representing failure.
@ SUCCESS
Representing success.
Os::FileInterface::Status open(const char *path, Mode mode)
open file with supplied path and mode
Status write(const U8 *buffer, FwSignedSizeType &size)
write data to this file from the supplied buffer bounded by size
@ OP_OK
Operation was successful.
@ OPEN_CREATE
Open file for writing and truncates file if it exists, ie same flags as creat()
Auto-generated base for DpWriter component.
void deallocBufferSendOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port deallocBufferSendOut.
void log_WARNING_HI_BufferTooSmallForData(U32 bufferSize, U32 minSize)
void dpWrittenOut_out(FwIndexType portNum, const Fw::StringBase &fileName, FwDpPriorityType priority, FwSizeType size)
Invoke output port dpWrittenOut.
void log_WARNING_HI_InvalidHeader_ThrottleClear()
Reset throttle value for InvalidHeader.
void log_WARNING_HI_FileOpenError(U32 status, const Fw::StringBase &file)
void log_WARNING_HI_FileWriteError(U32 status, U32 bytesWritten, U32 bytesToWrite, const Fw::StringBase &file)
void log_WARNING_HI_InvalidBuffer_ThrottleClear()
Reset throttle value for InvalidBuffer.
void tlmWrite_NumSuccessfulWrites(U32 arg, Fw::Time _tlmTime=Fw::Time())
void log_WARNING_HI_BufferTooSmallForPacket_ThrottleClear()
Reset throttle value for BufferTooSmallForPacket.
void log_WARNING_HI_InvalidBuffer()
void log_WARNING_HI_InvalidHeaderHash_ThrottleClear()
Reset throttle value for InvalidHeaderHash.
void log_WARNING_HI_FileWriteError_ThrottleClear()
Reset throttle value for FileWriteError.
void tlmWrite_NumBuffersReceived(U32 arg, Fw::Time _tlmTime=Fw::Time())
void log_ACTIVITY_LO_FileWritten(U32 bytes, const Fw::StringBase &file)
void procBufferSendOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port procBufferSendOut.
void tlmWrite_NumBytesWritten(U64 arg, Fw::Time _tlmTime=Fw::Time())
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
void log_WARNING_HI_BufferTooSmallForPacket(U32 bufferSize, U32 minSize)
void log_WARNING_HI_InvalidHeader(U32 bufferSize, U32 errorCode)
@ NUM_PROCBUFFERSENDOUT_OUTPUT_PORTS
bool isConnected_dpWrittenOut_OutputPort(FwIndexType portNum)
void log_WARNING_HI_FileOpenError_ThrottleClear()
Reset throttle value for FileOpenError.
void tlmWrite_NumErrors(U32 arg, Fw::Time _tlmTime=Fw::Time())
void tlmWrite_NumFailedWrites(U32 arg, Fw::Time _tlmTime=Fw::Time())
void log_WARNING_HI_BufferTooSmallForData_ThrottleClear()
Reset throttle value for BufferTooSmallForData.
void log_WARNING_HI_InvalidHeaderHash(U32 bufferSize, U32 storedHash, U32 computedHash)
void configure(const Fw::StringBase &dpFileNamePrefix)
Configure writer.
DpWriter(const char *const compName)
A container class for holding a hash buffer.
U32 asBigEndianU32() const
Convert bytes 0 through 3 of the hash data to a big-Endian U32 value.
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.