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

#include <Svc/ComLoggerDp/ComLoggerDp.hpp>

Inheritance diagram for Svc::ComLoggerDp:
Svc::ComLoggerDpComponentBase Fw::ActiveComponentBase Fw::QueuedComponentBase Fw::PassiveComponentBase Fw::ObjBase

Public Member Functions

 ComLoggerDp (const char *const compName)
 Construct ComLoggerDp object. More...
 
 ~ComLoggerDp ()
 Destroy ComLoggerDp object. More...
 
 ComLoggerDp (const ComLoggerDp &)=delete
 Copy constructor (deleted) More...
 
ComLoggerDp & operator= (const ComLoggerDp &)=delete
 Copy assignment operator (deleted) More...
 
 ComLoggerDp (ComLoggerDp &&)=delete
 Move constructor (deleted) More...
 
ComLoggerDp & operator= (ComLoggerDp &&)=delete
 Move assignment operator (deleted) More...
 
void configure (bool enabled, FwSizeType packetsPerContainer, FwDpPriorityType priority, U32 flushTimeout)
 
- Public Member Functions inherited from Svc::ComLoggerDpComponentBase
void init (FwSizeType queueDepth, FwEnumStoreType instance=0)
 Initialize ComLoggerDpComponentBase object. More...
 
Fw::InputCmdPort * get_cmdIn_InputPort (FwIndexType portNum)
 
Fw::InputComPort * get_comIn_InputPort (FwIndexType portNum)
 
Svc::InputPingPort * get_pingIn_InputPort (FwIndexType portNum)
 
Svc::InputSchedPort * get_schedIn_InputPort (FwIndexType portNum)
 
Svc::InputComLoggerStartPort * get_startRecordingIn_InputPort (FwIndexType portNum)
 
Svc::InputComLoggerStopPort * get_stopRecordingIn_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_productGetOut_OutputPort (FwIndexType portNum, Fw::InputDpGetPort *port)
 Connect port to productGetOut[portNum]. More...
 
void set_productSendOut_OutputPort (FwIndexType portNum, Fw::InputDpSendPort *port)
 Connect port to productSendOut[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_pingOut_OutputPort (FwIndexType portNum, Svc::InputPingPort *port)
 Connect port to pingOut[portNum]. More...
 
void regCommands ()
 Register commands with the Command Dispatcher. 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
 

Static Public Member Functions

static constexpr FwSizeType ComLoggerDpBuffSize (FwSizeType packetsPerContainer)
 

Static Public Attributes

static constexpr FwSizeType MAX_RECORD_DATA_SIZE = FW_COM_BUFFER_MAX_SIZE + sizeof(ComLoggerDpSentry)
 Maximum data size of one record: a sentry followed by a maximum-size ComBuffer. More...
 
static constexpr FwSizeType RECORD_SIZE = SIZE_OF_ComBufferRecord_RECORD(MAX_RECORD_DATA_SIZE)
 Serialized size of one ComBufferRecord holding MAX_RECORD_DATA_SIZE bytes. More...
 

Friends

class ComLoggerDpTester
 

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::ComLoggerDpComponentBase
enum  { NUM_CMDIN_INPUT_PORTS = 1 }
 Enumerations for numbers of special input ports. More...
 
enum  {
  NUM_COMIN_INPUT_PORTS = 1, NUM_PINGIN_INPUT_PORTS = 1, NUM_SCHEDIN_INPUT_PORTS = 1, NUM_STARTRECORDINGIN_INPUT_PORTS = 1,
  NUM_STOPRECORDINGIN_INPUT_PORTS = 1
}
 Enumerations for numbers of typed input ports. More...
 
enum  {
  NUM_LOGTEXT_OUTPUT_PORTS = 1, NUM_CMDREGOUT_OUTPUT_PORTS = 1, NUM_CMDRESPONSEOUT_OUTPUT_PORTS = 1, NUM_LOGOUT_OUTPUT_PORTS = 1,
  NUM_PRODUCTGETOUT_OUTPUT_PORTS = 1, NUM_PRODUCTSENDOUT_OUTPUT_PORTS = 1, NUM_TIMECALLER_OUTPUT_PORTS = 1, NUM_TLMOUT_OUTPUT_PORTS = 1
}
 Enumerations for numbers of special output ports. More...
 
enum  { NUM_PINGOUT_OUTPUT_PORTS = 1 }
 Enumerations for numbers of typed output ports. More...
 
enum  { OPCODE_STARTCOMDP = 0x0, OPCODE_UPDATEPRIORITY = 0x1, OPCODE_STOPCOMDP = 0x2, OPCODE_CLEAR_COUNTERS = 0x3 }
 Command opcodes. More...
 
enum  {
  EVENTID_DPBUFFERERROR = 0x0, EVENTID_COMDPSTARTED = 0x1, EVENTID_COMDPSTOPPED = 0x2, EVENTID_PRIORITYUPDATED = 0x3,
  EVENTID_COUNTERSCLEARED = 0x4, EVENTID_STARTRECORDINGFAILED = 0x5
}
 Event IDs. More...
 
enum  { EVENTID_DPBUFFERERROR_THROTTLE = 1 }
 Event throttle values: sets initial value of countdown variables. More...
 
enum  { CHANNELID_LOGGINGENABLED = 0x0, CHANNELID_NUMBUFFERSLOGGED = 0x1, CHANNELID_NUMBUFFERSDROPPED = 0x2, CHANNELID_NUMQUEUEDROPS = 0x4 }
 Channel IDs. 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::ComLoggerDpComponentBase
 ComLoggerDpComponentBase (const char *compName="")
 Construct ComLoggerDpComponentBase object. More...
 
virtual ~ComLoggerDpComponentBase ()
 Destroy ComLoggerDpComponentBase object. More...
 
bool isConnected_cmdRegOut_OutputPort (FwIndexType portNum) const
 
bool isConnected_cmdResponseOut_OutputPort (FwIndexType portNum) const
 
bool isConnected_logOut_OutputPort (FwIndexType portNum) const
 
bool isConnected_productGetOut_OutputPort (FwIndexType portNum) const
 
bool isConnected_productSendOut_OutputPort (FwIndexType portNum) const
 
bool isConnected_timeCaller_OutputPort (FwIndexType portNum) const
 
bool isConnected_tlmOut_OutputPort (FwIndexType portNum) const
 
bool isConnected_pingOut_OutputPort (FwIndexType portNum) const
 
void cmdIn_handlerBase (FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
 Handler base-class function for input port cmdIn. More...
 
void comIn_handlerBase (FwIndexType portNum, Fw::ComBuffer &data, U32 context)
 Handler base-class function for input port comIn. More...
 
void pingIn_handlerBase (FwIndexType portNum, U32 key)
 Handler base-class function for input port pingIn. More...
 
void schedIn_handlerBase (FwIndexType portNum, U32 context)
 Handler base-class function for input port schedIn. More...
 
void startRecordingIn_handlerBase (FwIndexType portNum, FwSizeType packetsPerContainer, FwDpPriorityType priority)
 Handler base-class function for input port startRecordingIn. More...
 
void stopRecordingIn_handlerBase (FwIndexType portNum)
 Handler base-class function for input port stopRecordingIn. More...
 
virtual void comIn_preMsgHook (FwIndexType portNum, Fw::ComBuffer &data, U32 context)
 Pre-message hook for async input port comIn. More...
 
virtual void pingIn_preMsgHook (FwIndexType portNum, U32 key)
 Pre-message hook for async input port pingIn. More...
 
virtual void schedIn_preMsgHook (FwIndexType portNum, U32 context)
 Pre-message hook for async input port schedIn. More...
 
virtual void startRecordingIn_preMsgHook (FwIndexType portNum, FwSizeType packetsPerContainer, FwDpPriorityType priority)
 Pre-message hook for async input port startRecordingIn. More...
 
virtual void stopRecordingIn_preMsgHook (FwIndexType portNum)
 Pre-message hook for async input port stopRecordingIn. More...
 
void pingOut_out (FwIndexType portNum, U32 key) const
 Invoke output port pingOut. More...
 
void cmdResponse_out (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
 Emit command response. More...
 
void StartComDp_cmdHandlerBase (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
 
void UpdatePriority_cmdHandlerBase (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
 
void StopComDp_cmdHandlerBase (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
 
void CLEAR_COUNTERS_cmdHandlerBase (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
 
virtual void StartComDp_preMsgHook (FwOpcodeType opCode, U32 cmdSeq)
 Pre-message hook for command StartComDp. More...
 
virtual void UpdatePriority_preMsgHook (FwOpcodeType opCode, U32 cmdSeq)
 Pre-message hook for command UpdatePriority. More...
 
virtual void StopComDp_preMsgHook (FwOpcodeType opCode, U32 cmdSeq)
 Pre-message hook for command StopComDp. More...
 
virtual void CLEAR_COUNTERS_preMsgHook (FwOpcodeType opCode, U32 cmdSeq)
 Pre-message hook for command CLEAR_COUNTERS. More...
 
void log_WARNING_HI_DpBufferError (U32 size)
 Log event DpBufferError. More...
 
void log_ACTIVITY_HI_ComDpStarted (FwSizeType packetsPerContainer) const
 
void log_ACTIVITY_HI_ComDpStopped (const Svc::ComLoggerDp_PartialContainerStatus &partialContainer) const
 
void log_ACTIVITY_LO_PriorityUpdated (FwDpPriorityType priority) const
 
void log_ACTIVITY_LO_CountersCleared () const
 
void log_WARNING_LO_StartRecordingFailed (FwSizeType packetsPerContainer) const
 
void log_WARNING_HI_DpBufferError_ThrottleClear ()
 Reset throttle value for DpBufferError. More...
 
void tlmWrite (FwChanIdType id, Fw::TlmBuffer &_tlmBuff, Fw::Time _tlmTime=Fw::Time()) const
 
void tlmWrite_LoggingEnabled (bool arg, Fw::Time _tlmTime=Fw::Time()) const
 
void tlmWrite_NumBuffersLogged (U32 arg, Fw::Time _tlmTime=Fw::Time()) const
 
void tlmWrite_NumBuffersDropped (U32 arg, Fw::Time _tlmTime=Fw::Time()) const
 
void tlmWrite_NumQueueDrops (U32 arg, Fw::Time _tlmTime=Fw::Time()) const
 
Fw::Success::T dpGet_ComBuffContainer (FwSizeType dataSize, DpContainer &container)
 
void dpSend (DpContainer &container, Fw::Time timeTag=Fw::ZERO_TIME)
 Send a data product. More...
 
Fw::Time getTime () const
 
- 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::ComLoggerDpComponentBase
static constexpr FwSizeType SIZE_OF_ComBufferRecord_RECORD (FwSizeType arraySize)
 Record sizes. More...
 
static constexpr FwIndexType getNum_cmdIn_InputPorts ()
 
static constexpr FwIndexType getNum_comIn_InputPorts ()
 
static constexpr FwIndexType getNum_pingIn_InputPorts ()
 
static constexpr FwIndexType getNum_schedIn_InputPorts ()
 
static constexpr FwIndexType getNum_startRecordingIn_InputPorts ()
 
static constexpr FwIndexType getNum_stopRecordingIn_InputPorts ()
 
static constexpr FwIndexType getNum_cmdRegOut_OutputPorts ()
 
static constexpr FwIndexType getNum_cmdResponseOut_OutputPorts ()
 
static constexpr FwIndexType getNum_logOut_OutputPorts ()
 
static constexpr FwIndexType getNum_productGetOut_OutputPorts ()
 
static constexpr FwIndexType getNum_productSendOut_OutputPorts ()
 
static constexpr FwIndexType getNum_timeCaller_OutputPorts ()
 
static constexpr FwIndexType getNum_tlmOut_OutputPorts ()
 
static constexpr FwIndexType getNum_pingOut_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 19 of file ComLoggerDp.hpp.

Constructor & Destructor Documentation

◆ ComLoggerDp() [1/3]

Svc::ComLoggerDp::ComLoggerDp ( const char *const  compName)
explicit

Construct ComLoggerDp object.

Parameters
compNameThe component name

Definition at line 16 of file ComLoggerDp.cpp.

◆ ~ComLoggerDp()

Svc::ComLoggerDp::~ComLoggerDp ( )

Destroy ComLoggerDp object.

Definition at line 18 of file ComLoggerDp.cpp.

◆ ComLoggerDp() [2/3]

Svc::ComLoggerDp::ComLoggerDp ( const ComLoggerDp &  )
delete

Copy constructor (deleted)

◆ ComLoggerDp() [3/3]

Svc::ComLoggerDp::ComLoggerDp ( ComLoggerDp &&  )
delete

Move constructor (deleted)

Member Function Documentation

◆ ComLoggerDpBuffSize()

static constexpr FwSizeType Svc::ComLoggerDp::ComLoggerDpBuffSize ( FwSizeType  packetsPerContainer)
inlinestatic

Calculate total buffer size needed for a data product container This is the TOTAL size including:

  • DpContainer header (packet descriptor, ID, priority, time tag, etc.)
  • Header hash
  • Record data (N packets × (sentry + ComBuffer data))
  • Data hash

Use this function to compute the size of buffers to allocate from Svc::BufferManager or equivalent for holding complete data product containers.

NOTE: This is NOT the size to pass to dpGet() - DpManager adds the header overhead internally. This is for external buffer allocation only.

Parameters
packetsPerContainerNumber of packets that will fit in the container
Returns
Total buffer size in bytes needed for the complete container

Definition at line 49 of file ComLoggerDp.hpp.

◆ configure()

void Svc::ComLoggerDp::configure ( bool  enabled,
FwSizeType  packetsPerContainer,
FwDpPriorityType  priority,
U32  flushTimeout 
)

Configure initial logging state; must be called once after init() If enabled is true, an invalid packetsPerContainer (0 or above the container-size limit) triggers FW_ASSERT

Parameters
enabledwhether data product logging is initially enabled
packetsPerContainernumber of packets per container (must be > 0 if enabled is true, ignored otherwise)
prioritydata product priority (ignored if enabled is false)
flushTimeoutnumber of schedIn calls without packets before auto-flush (0 = disable auto-flush)

Definition at line 24 of file ComLoggerDp.cpp.

◆ operator=() [1/2]

ComLoggerDp& Svc::ComLoggerDp::operator= ( const ComLoggerDp &  )
delete

Copy assignment operator (deleted)

◆ operator=() [2/2]

ComLoggerDp& Svc::ComLoggerDp::operator= ( ComLoggerDp &&  )
delete

Move assignment operator (deleted)

Friends And Related Function Documentation

◆ ComLoggerDpTester

friend class ComLoggerDpTester
friend

Definition at line 21 of file ComLoggerDp.hpp.

Member Data Documentation

◆ MAX_RECORD_DATA_SIZE

constexpr FwSizeType Svc::ComLoggerDp::MAX_RECORD_DATA_SIZE = FW_COM_BUFFER_MAX_SIZE + sizeof(ComLoggerDpSentry)
static

Maximum data size of one record: a sentry followed by a maximum-size ComBuffer.

Definition at line 29 of file ComLoggerDp.hpp.

◆ RECORD_SIZE

constexpr FwSizeType Svc::ComLoggerDp::RECORD_SIZE = SIZE_OF_ComBufferRecord_RECORD(MAX_RECORD_DATA_SIZE)
static

Serialized size of one ComBufferRecord holding MAX_RECORD_DATA_SIZE bytes.

Definition at line 32 of file ComLoggerDp.hpp.


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