F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Svc::FileWorker Class Reference

#include <Svc/FileWorker/FileWorker.hpp>

Inheritance diagram for Svc::FileWorker:
Svc::FileWorkerComponentBase Fw::ActiveComponentBase Fw::QueuedComponentBase Fw::PassiveComponentBase Fw::ObjBase

Public Member Functions

 FileWorker (const char *const compName)
 Construct FileWorker object. More...
 
 ~FileWorker ()
 Destroy FileWorker object. More...
 
void configure (U64 chunkSize)
 
- Public Member Functions inherited from Svc::FileWorkerComponentBase
void init (FwSizeType queueDepth, FwEnumStoreType instance=0)
 Initialize FileWorkerComponentBase object. More...
 
Fw::InputCmdPortget_cmdIn_InputPort (FwIndexType portNum)
 
Svc::InputCancelStatusPortget_cancelIn_InputPort (FwIndexType portNum)
 
Svc::InputFileReadPortget_readIn_InputPort (FwIndexType portNum)
 
Svc::InputVerifyStatusPortget_verifyIn_InputPort (FwIndexType portNum)
 
Svc::InputFileWritePortget_writeIn_InputPort (FwIndexType portNum)
 
void set_cmdRegOut_OutputPort (FwIndexType portNum, Fw::InputCmdRegPort *port)
 Connect port to cmdRegOut[portNum]. More...
 
void set_cmdResponseOut_OutputPort (FwIndexType portNum, Fw::InputCmdResponsePort *port)
 Connect port to cmdResponseOut[portNum]. More...
 
void set_logOut_OutputPort (FwIndexType portNum, Fw::InputLogPort *port)
 Connect port to logOut[portNum]. More...
 
void set_prmGetOut_OutputPort (FwIndexType portNum, Fw::InputPrmGetPort *port)
 Connect port to prmGetOut[portNum]. More...
 
void set_prmSetOut_OutputPort (FwIndexType portNum, Fw::InputPrmSetPort *port)
 Connect port to prmSetOut[portNum]. More...
 
void set_timeCaller_OutputPort (FwIndexType portNum, Fw::InputTimePort *port)
 Connect port to timeCaller[portNum]. More...
 
void set_tlmOut_OutputPort (FwIndexType portNum, Fw::InputTlmPort *port)
 Connect port to tlmOut[portNum]. More...
 
void set_readDoneOut_OutputPort (FwIndexType portNum, Svc::InputSignalDonePort *port)
 Connect port to readDoneOut[portNum]. More...
 
void set_verifyDoneOut_OutputPort (FwIndexType portNum, Svc::InputSignalDonePort *port)
 Connect port to verifyDoneOut[portNum]. More...
 
void set_writeDoneOut_OutputPort (FwIndexType portNum, Svc::InputSignalDonePort *port)
 Connect port to writeDoneOut[portNum]. More...
 
- Public Member Functions inherited from Fw::ActiveComponentBase
void start (FwTaskPriorityType priority=Os::Task::TASK_PRIORITY_DEFAULT, FwSizeType stackSize=Os::Task::TASK_DEFAULT, FwSizeType cpuAffinity=Os::Task::TASK_DEFAULT, FwTaskIdType identifier=static_cast< FwTaskIdType >(Os::Task::TASK_DEFAULT))
 called by instantiator when task is to be started More...
 
void exit ()
 exit task in active component More...
 
Os::Task::Status join ()
 Join the thread. More...
 
 DEPRECATED (Os::Task::Status join(void **value_ptr), "Switch to .join()")
 Join to thread with discarded value_ptr. More...
 
- Public Member Functions inherited from Fw::QueuedComponentBase
void deinit () override
 Allows de-initialization on teardown. More...
 
- Public Member Functions inherited from Fw::PassiveComponentBase
void setIdBase (const FwIdType)
 Set the ID base. More...
 
FwIdType getIdBase () const
 

Friends

class FileWorkerTester
 

Additional Inherited Members

- Public Types inherited from Fw::ActiveComponentBase
enum  { ACTIVE_COMPONENT_EXIT }
 
- Public Types inherited from Fw::QueuedComponentBase
enum  MsgDispatchStatus { MSG_DISPATCH_OK, MSG_DISPATCH_EMPTY, MSG_DISPATCH_ERROR, MSG_DISPATCH_EXIT }
 
- Protected Types inherited from Svc::FileWorkerComponentBase
enum  { NUM_CMDIN_INPUT_PORTS = 1 }
 Enumerations for numbers of special input ports. More...
 
enum  { NUM_CANCELIN_INPUT_PORTS = 1, NUM_READIN_INPUT_PORTS = 1, NUM_VERIFYIN_INPUT_PORTS = 1, NUM_WRITEIN_INPUT_PORTS = 1 }
 Enumerations for numbers of typed input ports. More...
 
enum  {
  NUM_CMDREGOUT_OUTPUT_PORTS = 1, NUM_CMDRESPONSEOUT_OUTPUT_PORTS = 1, NUM_LOGOUT_OUTPUT_PORTS = 1, NUM_LOGTEXTOUT_OUTPUT_PORTS = 1,
  NUM_PRMGETOUT_OUTPUT_PORTS = 1, NUM_PRMSETOUT_OUTPUT_PORTS = 1, NUM_TIMECALLER_OUTPUT_PORTS = 1, NUM_TLMOUT_OUTPUT_PORTS = 1
}
 Enumerations for numbers of special output ports. More...
 
enum  { NUM_READDONEOUT_OUTPUT_PORTS = 1, NUM_VERIFYDONEOUT_OUTPUT_PORTS = 1, NUM_WRITEDONEOUT_OUTPUT_PORTS = 1 }
 Enumerations for numbers of typed output ports. More...
 
enum  {
  EVENTID_NOTINIDLE = 0x0, EVENTID_CRCFAILED = 0x1, EVENTID_CRCVERIFICATIONERROR = 0x2, EVENTID_READFAILEDFILESIZE = 0x3,
  EVENTID_OPENFILEERROR = 0x4, EVENTID_READBEGIN = 0x5, EVENTID_READCOMPLETED = 0x6, EVENTID_READERROR = 0x7,
  EVENTID_READABORTED = 0x8, EVENTID_READTIMEOUT = 0x9, EVENTID_WRITEBEGIN = 0xa, EVENTID_WRITECOMPLETED = 0xb,
  EVENTID_WRITEFILEERROR = 0xc, EVENTID_WRITEVALIDATIONOPENERROR = 0xd, EVENTID_WRITEVALIDATIONREADERROR = 0xe, EVENTID_WRITEVALIDATIONERROR = 0xf,
  EVENTID_WRITETIMEOUT = 0x10, EVENTID_WRITEABORTED = 0x11
}
 Event IDs. More...
 
enum  {
  EVENTID_NOTINIDLE_THROTTLE = 2, EVENTID_CRCFAILED_THROTTLE = 2, EVENTID_READFAILEDFILESIZE_THROTTLE = 2, EVENTID_OPENFILEERROR_THROTTLE = 2,
  EVENTID_WRITEFILEERROR_THROTTLE = 2, EVENTID_WRITEVALIDATIONOPENERROR_THROTTLE = 2, EVENTID_WRITEVALIDATIONREADERROR_THROTTLE = 2
}
 Event throttle values: sets initial value of countdown variables. More...
 
- Protected Types inherited from Fw::ActiveComponentBase
enum  Lifecycle { CREATED, DISPATCHING, FINALIZING, DONE }
 Tracks the lifecycle of the component. More...
 
- Protected Member Functions inherited from Svc::FileWorkerComponentBase
 FileWorkerComponentBase (const char *compName="")
 Construct FileWorkerComponentBase object. More...
 
virtual ~FileWorkerComponentBase ()
 Destroy FileWorkerComponentBase object. More...
 
bool isConnected_cmdRegOut_OutputPort (FwIndexType portNum)
 
bool isConnected_cmdResponseOut_OutputPort (FwIndexType portNum)
 
bool isConnected_logOut_OutputPort (FwIndexType portNum)
 
bool isConnected_prmGetOut_OutputPort (FwIndexType portNum)
 
bool isConnected_prmSetOut_OutputPort (FwIndexType portNum)
 
bool isConnected_timeCaller_OutputPort (FwIndexType portNum)
 
bool isConnected_tlmOut_OutputPort (FwIndexType portNum)
 
bool isConnected_readDoneOut_OutputPort (FwIndexType portNum)
 
bool isConnected_verifyDoneOut_OutputPort (FwIndexType portNum)
 
bool isConnected_writeDoneOut_OutputPort (FwIndexType portNum)
 
virtual void writeIn_handler (FwIndexType portNum, const Fw::StringBase &path, Fw::Buffer &buffer, FwSizeType offsetBytes, bool append)=0
 Handler for input port writeIn. More...
 
void cancelIn_handlerBase (FwIndexType portNum)
 Handler base-class function for input port cancelIn. More...
 
void readIn_handlerBase (FwIndexType portNum, const Fw::StringBase &path, Fw::Buffer &buffer)
 Handler base-class function for input port readIn. More...
 
void verifyIn_handlerBase (FwIndexType portNum, const Fw::StringBase &path, U32 crc)
 Handler base-class function for input port verifyIn. More...
 
void writeIn_handlerBase (FwIndexType portNum, const Fw::StringBase &path, Fw::Buffer &buffer, FwSizeType offsetBytes, bool append)
 Handler base-class function for input port writeIn. More...
 
virtual void readIn_preMsgHook (FwIndexType portNum, const Fw::StringBase &path, Fw::Buffer &buffer)
 Pre-message hook for async input port readIn. More...
 
virtual void verifyIn_preMsgHook (FwIndexType portNum, const Fw::StringBase &path, U32 crc)
 Pre-message hook for async input port verifyIn. More...
 
virtual void writeIn_preMsgHook (FwIndexType portNum, const Fw::StringBase &path, Fw::Buffer &buffer, FwSizeType offsetBytes, bool append)
 Pre-message hook for async input port writeIn. More...
 
void readDoneOut_out (FwIndexType portNum, U32 status, FwSizeType sizeBytes)
 Invoke output port readDoneOut. More...
 
void verifyDoneOut_out (FwIndexType portNum, U32 status, FwSizeType sizeBytes)
 Invoke output port verifyDoneOut. More...
 
void writeDoneOut_out (FwIndexType portNum, U32 status, FwSizeType sizeBytes)
 Invoke output port writeDoneOut. More...
 
void log_WARNING_HI_NotInIdle (U32 currState)
 
void log_WARNING_HI_CrcFailed (U32 crcStat)
 
void log_WARNING_LO_CrcVerificationError (U32 crcExp, U32 crcCalculated) const
 
void log_WARNING_HI_ReadFailedFileSize (U32 fsStat)
 
void log_WARNING_HI_OpenFileError (const Fw::StringBase &fileName, U32 fsStat)
 
void log_ACTIVITY_LO_ReadBegin (FwSizeType fileSize, const Fw::StringBase &fileName) const
 
void log_ACTIVITY_LO_ReadCompleted (FwSizeType fileSize, const Fw::StringBase &fileName) const
 
void log_WARNING_HI_ReadError (FwSizeType bytesRead, FwSizeType readSize, const Fw::StringBase &fileName) const
 
void log_WARNING_LO_ReadAborted (FwSizeType bytesRead, FwSizeType readSize, const Fw::StringBase &fileName) const
 
void log_WARNING_HI_ReadTimeout (FwSizeType bytesRead, FwSizeType readSize, const Fw::StringBase &fileName, U64 timeout) const
 
void log_ACTIVITY_LO_WriteBegin (FwSizeType writeSize, const Fw::StringBase &fileName) const
 
void log_ACTIVITY_LO_WriteCompleted (FwSizeType writeSize, const Fw::StringBase &fileName) const
 
void log_WARNING_HI_WriteFileError (FwSizeType bytesWritten, FwSizeType writeSize, const Fw::StringBase &fileName, I32 status)
 
void log_WARNING_HI_WriteValidationOpenError (const Fw::StringBase &hashFileName, I32 status)
 
void log_WARNING_HI_WriteValidationReadError (const Fw::StringBase &hashFileName, I32 status)
 
void log_WARNING_LO_WriteValidationError (const Fw::StringBase &hashFileName, FwSizeType bytesWritten, FwSizeType hashSize) const
 
void log_WARNING_HI_WriteTimeout (FwSizeType bytesWritten, FwSizeType writeSize, const Fw::StringBase &fileName, U64 timeout) const
 
void log_WARNING_LO_WriteAborted (FwSizeType bytesWritten, FwSizeType writeSize, const Fw::StringBase &fileName) const
 
void log_WARNING_HI_NotInIdle_ThrottleClear ()
 Reset throttle value for NotInIdle. More...
 
void log_WARNING_HI_CrcFailed_ThrottleClear ()
 Reset throttle value for CrcFailed. More...
 
void log_WARNING_HI_ReadFailedFileSize_ThrottleClear ()
 Reset throttle value for ReadFailedFileSize. More...
 
void log_WARNING_HI_OpenFileError_ThrottleClear ()
 Reset throttle value for OpenFileError. More...
 
void log_WARNING_HI_WriteFileError_ThrottleClear ()
 Reset throttle value for WriteFileError. More...
 
void log_WARNING_HI_WriteValidationOpenError_ThrottleClear ()
 Reset throttle value for WriteValidationOpenError. More...
 
void log_WARNING_HI_WriteValidationReadError_ThrottleClear ()
 Reset throttle value for WriteValidationReadError. More...
 
Fw::Time getTime () const
 
virtual void lock ()
 Lock the guarded mutex. More...
 
virtual void unLock ()
 Unlock the guarded mutex. More...
 
- Protected Member Functions inherited from Fw::ActiveComponentBase
 ActiveComponentBase (const char *name)
 Constructor. More...
 
virtual ~ActiveComponentBase ()
 Destructor. More...
 
void init (FwEnumStoreType instance)
 initialization code More...
 
virtual void preamble ()
 A function that will be called before the event loop is entered. More...
 
MsgDispatchStatus dispatch ()
 The function that will dispatching messages. More...
 
virtual void finalizer ()
 A function that will be called after exiting the loop. More...
 
- Protected Member Functions inherited from Fw::QueuedComponentBase
 QueuedComponentBase (const char *name)
 Constructor. More...
 
virtual ~QueuedComponentBase ()
 Destructor. More...
 
void init (FwEnumStoreType instance)
 initialization function More...
 
Os::Queue::Status createQueue (FwSizeType depth, FwSizeType msgSize)
 
MsgDispatchStatus dispatchAvailableMessages ()
 dispatches all messages currently in the queue, returning status of the dispatch More...
 
FwSizeType getNumMsgsDropped ()
 return number of messages dropped More...
 
void incNumMsgDropped ()
 increment the number of messages dropped More...
 
- Protected Member Functions inherited from Fw::PassiveComponentBase
 PassiveComponentBase (const char *name)
 Named constructor. More...
 
virtual ~PassiveComponentBase ()
 Destructor. More...
 
void init (FwEnumStoreType instance)
 Initialization function. More...
 
FwEnumStoreType getInstance () const
 
- Protected Member Functions inherited from Fw::ObjBase
 ObjBase (const char *name)
 ObjBase constructor. More...
 
virtual ~ObjBase ()
 Destructor. More...
 
void init ()
 Object initializer. More...
 
- Static Protected Member Functions inherited from Svc::FileWorkerComponentBase
static constexpr FwIndexType getNum_cmdIn_InputPorts ()
 
static constexpr FwIndexType getNum_cancelIn_InputPorts ()
 
static constexpr FwIndexType getNum_readIn_InputPorts ()
 
static constexpr FwIndexType getNum_verifyIn_InputPorts ()
 
static constexpr FwIndexType getNum_writeIn_InputPorts ()
 
static constexpr FwIndexType getNum_cmdRegOut_OutputPorts ()
 
static constexpr FwIndexType getNum_cmdResponseOut_OutputPorts ()
 
static constexpr FwIndexType getNum_logOut_OutputPorts ()
 
static constexpr FwIndexType getNum_prmGetOut_OutputPorts ()
 
static constexpr FwIndexType getNum_prmSetOut_OutputPorts ()
 
static constexpr FwIndexType getNum_timeCaller_OutputPorts ()
 
static constexpr FwIndexType getNum_tlmOut_OutputPorts ()
 
static constexpr FwIndexType getNum_readDoneOut_OutputPorts ()
 
static constexpr FwIndexType getNum_verifyDoneOut_OutputPorts ()
 
static constexpr FwIndexType getNum_writeDoneOut_OutputPorts ()
 
- Protected Attributes inherited from Fw::ActiveComponentBase
Os::Task m_task
 task object for active component More...
 
- Protected Attributes inherited from Fw::QueuedComponentBase
Os::Queue m_queue
 queue object for active component More...
 

Detailed Description

Definition at line 23 of file FileWorker.hpp.

Constructor & Destructor Documentation

◆ FileWorker()

Svc::FileWorker::FileWorker ( const char *const  compName)

Construct FileWorker object.

Parameters
compNameThe component name

Definition at line 15 of file FileWorker.cpp.

◆ ~FileWorker()

Svc::FileWorker::~FileWorker ( )

Destroy FileWorker object.

Definition at line 23 of file FileWorker.cpp.

Member Function Documentation

◆ configure()

void Svc::FileWorker::configure ( U64  chunkSize)

Definition at line 18 of file FileWorker.cpp.

Friends And Related Function Documentation

◆ FileWorkerTester

friend class FileWorkerTester
friend

Definition at line 24 of file FileWorker.hpp.


The documentation for this class was generated from the following files: