11#ifndef Svc_CmdSequencerImpl_HPP
12#define Svc_CmdSequencerImpl_HPP
18#include "Svc/CmdSequencer/CmdSequencerComponentAc.hpp"
23 public CmdSequencerComponentBase
75 const CmdSequencer_FileReadStage::t stage,
92 const U32 recordNumber,
300 INITIAL_COMPUTED_VALUE = 0xFFFFFFFFU
383 bool deserializeHeader();
387 bool readRecordsAndCRC();
406 Record::Descriptor& descriptor
430 bool validateRecords();
473 this->expirationTime = time;
478 this->m_state = CLEAR;
486 if (this->m_state == CLEAR) {
569 void cmdResponseIn_handler(
573 const Fw::CmdResponse& response
577 void schedIn_handler(
583 void seqRunIn_handler(
596 void seqCancelIn_handler(
608 void CS_AUTO_cmdHandler(
615 void CS_CANCEL_cmdHandler(
622 void CS_MANUAL_cmdHandler(
628 void CS_RUN_cmdHandler(
632 Svc::CmdSequencer_BlockState block
637 void CS_START_cmdHandler(
645 void CS_STEP_cmdHandler(
652 void CS_VALIDATE_cmdHandler(
662 void CS_JOIN_WAIT_cmdHandler(
680 void performCmd_Cancel();
683 void performCmd_Step();
686 void performCmd_Step_RELATIVE(
691 void performCmd_Step_ABSOLUTE(
696 void commandComplete(
701 void sequenceComplete();
731 FPrimeSequence m_FPrimeSequence;
734 Sequence *m_sequence;
740 U32 m_cancelCmdCount;
752 Sequence::Record m_record;
761 U32 m_totalExecutedCount;
764 U32 m_sequencesCompletedCount;
770 Timer m_cmdTimeoutTimer;
773 Svc::CmdSequencer_BlockState::t m_blockState;
PlatformIntType NATIVE_INT_TYPE
PlatformUIntType NATIVE_UINT_TYPE
U8 FwTimeContextStoreType
Defines a base class for a memory allocator for classes.
Defines a file class to validate files or generate a file validator file.
static Comparison compare(const Time &time1, const Time &time2)
A sequence that uses the F Prime binary format.
bool loadFile(const Fw::CmdStringArg &fileName)
void nextRecord(Record &record)
bool hasMoreRecords() const
Sequence event reporting.
void recordMismatch(const U32 numRecords, const U32 extraBytes)
Record mismatch.
void fileNotFound()
File not found.
void timeBaseMismatch(const TimeBase currTimeBase, const TimeBase seqTimeBase)
Time base mismatch.
void fileSizeError(const U32 size)
File size error.
void fileReadError()
File read error.
void fileCRCFailure(const U32 storedCRC, const U32 computedCRC)
File CRC failure.
void timeContextMismatch(const FwTimeContextStoreType currTimeContext, const FwTimeContextStoreType seqTimeContext)
Time context mismatch.
void recordInvalid(const U32 recordNumber, const I32 error)
Record invalid.
void fileInvalid(const CmdSequencer_FileReadStage::t stage, const I32 error)
File invalid.
@ END_OF_SEQUENCE
end of sequence
Fw::ComBuffer m_command
The command.
Descriptor m_descriptor
The descriptor.
Record()
Construct a Record object.
Fw::Time m_timeTag
The time tag. NOTE: timeBase and context not filled in.
A sequence with unspecified binary format.
Events m_events
Event reporting.
void allocateBuffer(NATIVE_INT_TYPE identifier, Fw::MemAllocator &allocator, NATIVE_UINT_TYPE bytes)
Give the sequence representation a memory buffer.
Header m_header
The sequence header.
Fw::CmdStringArg & getFileName()
Fw::LogStringArg m_logFileName
Copy of file name for events.
virtual void nextRecord(Record &record)=0
Fw::ExternalSerializeBuffer m_buffer
Serialize buffer to hold the binary sequence data.
void deallocateBuffer(Fw::MemAllocator &allocator)
Deallocate the buffer.
virtual bool hasMoreRecords() const =0
CmdSequencerComponentImpl & m_component
The enclosing component.
virtual bool loadFile(const Fw::CmdStringArg &fileName)=0
NATIVE_INT_TYPE m_allocatorId
The allocator ID.
const Header & getHeader() const
Get the sequence header.
Fw::LogStringArg & getLogFileName()
void setFileName(const Fw::CmdStringArg &fileName)
Set the file name. Also sets the log file name.
virtual ~Sequence()
Destroy a Sequence object.
Fw::CmdStringArg m_fileName
The sequence file name.
~CmdSequencerComponentImpl()
Destroy a CmdDispatcherComponentBase.
void deallocateBuffer(Fw::MemAllocator &allocator)
Return allocated buffer. Call during shutdown.
void init(const NATIVE_INT_TYPE queueDepth, const NATIVE_INT_TYPE instance)
Initialize a CmdSequencer.
CmdSequencerComponentImpl(const char *compName)
Construct a CmdSequencer.
void setTimeout(const NATIVE_UINT_TYPE seconds)
void setSequenceFormat(Sequence &sequence)
void loadSequence(const Fw::String &fileName)
void allocateBuffer(const NATIVE_INT_TYPE identifier, Fw::MemAllocator &allocator, const NATIVE_UINT_TYPE bytes)
SerializeStatus
forward declaration for string
Container for computed and stored CRC values.
void finalize()
Finalize computed CRC.
void init()
Initialize computed CRC.
U32 m_computed
Computed CRC.
void update(const BYTE *buffer, NATIVE_UINT_TYPE bufferSize)
Update computed CRC.