11 #if FW_ENABLE_TEXT_LOGGING
21 BUFFERRETURN_BUFFERSEND,
39 class ComponentIpcSerializableBuffer :
54 return sizeof(m_buff);
61 const U8* getBuffAddr()
const {
67 U8 m_buff[SERIALIZATION_SIZE];
91 this->m_cmdIn_InputPort[port].
init();
96 this->m_cmdIn_InputPort[port].
setPortNum(port);
98 #if FW_OBJECT_NAMES == 1
113 this->m_cmdIn_InputPort[port].setObjName(portName);
123 this->m_Run_InputPort[port].
init();
130 #if FW_OBJECT_NAMES == 1
145 this->m_Run_InputPort[port].setObjName(portName);
155 this->m_SendFile_InputPort[port].
init();
160 this->m_SendFile_InputPort[port].
setPortNum(port);
162 #if FW_OBJECT_NAMES == 1
177 this->m_SendFile_InputPort[port].setObjName(portName);
187 this->m_bufferReturn_InputPort[port].
init();
192 this->m_bufferReturn_InputPort[port].
setPortNum(port);
194 #if FW_OBJECT_NAMES == 1
209 this->m_bufferReturn_InputPort[port].setObjName(portName);
219 this->m_pingIn_InputPort[port].
init();
224 this->m_pingIn_InputPort[port].
setPortNum(port);
226 #if FW_OBJECT_NAMES == 1
241 this->m_pingIn_InputPort[port].setObjName(portName);
251 this->m_cmdRegOut_OutputPort[port].
init();
253 #if FW_OBJECT_NAMES == 1
268 this->m_cmdRegOut_OutputPort[port].setObjName(portName);
278 this->m_cmdResponseOut_OutputPort[port].
init();
280 #if FW_OBJECT_NAMES == 1
295 this->m_cmdResponseOut_OutputPort[port].setObjName(portName);
305 this->m_eventOut_OutputPort[port].
init();
307 #if FW_OBJECT_NAMES == 1
322 this->m_eventOut_OutputPort[port].setObjName(portName);
326 #if FW_ENABLE_TEXT_LOGGING == 1
330 port < static_cast<PlatformIntType>(this->getNum_textEventOut_OutputPorts());
333 this->m_textEventOut_OutputPort[port].
init();
335 #if FW_OBJECT_NAMES == 1
350 this->m_textEventOut_OutputPort[port].setObjName(portName);
361 this->m_timeCaller_OutputPort[port].
init();
363 #if FW_OBJECT_NAMES == 1
378 this->m_timeCaller_OutputPort[port].setObjName(portName);
388 this->m_tlmOut_OutputPort[port].
init();
390 #if FW_OBJECT_NAMES == 1
405 this->m_tlmOut_OutputPort[port].setObjName(portName);
415 this->m_FileComplete_OutputPort[port].
init();
417 #if FW_OBJECT_NAMES == 1
432 this->m_FileComplete_OutputPort[port].setObjName(portName);
442 this->m_bufferSendOut_OutputPort[port].
init();
444 #if FW_OBJECT_NAMES == 1
459 this->m_bufferSendOut_OutputPort[port].setObjName(portName);
469 this->m_pingOut_OutputPort[port].
init();
471 #if FW_OBJECT_NAMES == 1
486 this->m_pingOut_OutputPort[port].setObjName(portName);
492 ComponentIpcSerializableBuffer::SERIALIZATION_SIZE
512 return &this->m_cmdIn_InputPort[portNum];
527 return &this->m_Run_InputPort[portNum];
538 return &this->m_SendFile_InputPort[portNum];
549 return &this->m_bufferReturn_InputPort[portNum];
560 return &this->m_pingIn_InputPort[portNum];
578 this->m_cmdRegOut_OutputPort[portNum].
addCallPort(port);
592 this->m_cmdResponseOut_OutputPort[portNum].
addCallPort(port);
606 this->m_eventOut_OutputPort[portNum].
addCallPort(port);
609 #if FW_ENABLE_TEXT_LOGGING == 1
611 void FileDownlinkComponentBase ::
612 set_textEventOut_OutputPort(
618 portNum < this->getNum_textEventOut_OutputPorts(),
622 this->m_textEventOut_OutputPort[portNum].addCallPort(port);
638 this->m_timeCaller_OutputPort[portNum].
addCallPort(port);
652 this->m_tlmOut_OutputPort[portNum].
addCallPort(port);
670 this->m_FileComplete_OutputPort[portNum].
addCallPort(port);
684 this->m_bufferSendOut_OutputPort[portNum].
addCallPort(port);
698 this->m_pingOut_OutputPort[portNum].
addCallPort(port);
701 #if FW_PORT_SERIALIZATION
710 Fw::InputSerializePort* port
718 this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
724 Fw::InputSerializePort* port
732 this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
738 Fw::InputSerializePort* port
746 this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
749 #if FW_ENABLE_TEXT_LOGGING == 1
751 void FileDownlinkComponentBase ::
752 set_textEventOut_OutputPort(
754 Fw::InputSerializePort* port
758 portNum < this->getNum_textEventOut_OutputPorts(),
762 this->m_textEventOut_OutputPort[portNum].registerSerialPort(port);
770 Fw::InputSerializePort* port
778 this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
784 Fw::InputSerializePort* port
792 this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
797 #if FW_PORT_SERIALIZATION
806 Fw::InputSerializePort* port
814 this->m_FileComplete_OutputPort[portNum].registerSerialPort(port);
820 Fw::InputSerializePort* port
828 this->m_bufferSendOut_OutputPort[portNum].registerSerialPort(port);
834 Fw::InputSerializePort* port
842 this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
854 FW_ASSERT(this->m_cmdRegOut_OutputPort[0].isConnected());
856 this->m_cmdRegOut_OutputPort[0].
invoke(
860 this->m_cmdRegOut_OutputPort[0].
invoke(
864 this->m_cmdRegOut_OutputPort[0].
invoke(
875 Fw::ActiveComponentBase(compName)
946 #if FW_ENABLE_TEXT_LOGGING == 1
949 getNum_textEventOut_OutputPorts()
const
1002 return this->m_cmdRegOut_OutputPort[portNum].
isConnected();
1013 return this->m_cmdResponseOut_OutputPort[portNum].
isConnected();
1024 return this->m_eventOut_OutputPort[portNum].
isConnected();
1027 #if FW_ENABLE_TEXT_LOGGING == 1
1029 bool FileDownlinkComponentBase ::
1033 portNum < this->getNum_textEventOut_OutputPorts(),
1037 return this->m_textEventOut_OutputPort[portNum].isConnected();
1050 return this->m_timeCaller_OutputPort[portNum].
isConnected();
1061 return this->m_tlmOut_OutputPort[portNum].
isConnected();
1076 return this->m_FileComplete_OutputPort[portNum].
isConnected();
1087 return this->m_bufferSendOut_OutputPort[portNum].
isConnected();
1098 return this->m_pingOut_OutputPort[portNum].
isConnected();
1124 ComponentIpcSerializableBuffer msg;
1128 _status = msg.serialize(
1137 _status = msg.serialize(portNum);
1144 _status = msg.serialize(context);
1212 ComponentIpcSerializableBuffer msg;
1216 _status = msg.serialize(
1225 _status = msg.serialize(portNum);
1232 _status = msg.serialize(fwBuffer);
1265 ComponentIpcSerializableBuffer msg;
1269 _status = msg.serialize(
1278 _status = msg.serialize(portNum);
1285 _status = msg.serialize(key);
1350 this->m_FileComplete_OutputPort[portNum].
invoke(
1365 this->m_bufferSendOut_OutputPort[portNum].
invoke(
1380 this->m_pingOut_OutputPort[portNum].
invoke(
1396 FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
1397 this->m_cmdResponseOut_OutputPort[0].
invoke(opCode, cmdSeq, response);
1418 ComponentIpcSerializableBuffer msg;
1431 _status = msg.serialize(port);
1437 _status = msg.serialize(opCode);
1443 _status = msg.serialize(cmdSeq);
1449 _status = msg.serialize(args);
1477 ComponentIpcSerializableBuffer msg;
1490 _status = msg.serialize(port);
1496 _status = msg.serialize(opCode);
1502 _status = msg.serialize(cmdSeq);
1508 _status = msg.serialize(args);
1536 ComponentIpcSerializableBuffer msg;
1540 _status = msg.serialize(
static_cast<NATIVE_INT_TYPE>(CMD_SENDPARTIAL));
1549 _status = msg.serialize(port);
1555 _status = msg.serialize(opCode);
1561 _status = msg.serialize(cmdSeq);
1567 _status = msg.serialize(args);
1633 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1634 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
1642 if (this->m_eventOut_OutputPort[0].isConnected()) {
1646 #if FW_AMPCS_COMPATIBLE
1655 _status = fileName.
serialize(_logBuff, 100);
1661 this->m_eventOut_OutputPort[0].
invoke(
1670 #if FW_ENABLE_TEXT_LOGGING
1671 if (this->m_textEventOut_OutputPort[0].isConnected()) {
1672 #if FW_OBJECT_NAMES == 1
1673 const char* _formatString =
1674 "(%s) %s: Could not open file %s";
1676 const char* _formatString =
1677 "%s: Could not open file %s";
1696 this->m_textEventOut_OutputPort[0].invoke(
1714 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1715 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
1723 if (this->m_eventOut_OutputPort[0].isConnected()) {
1727 #if FW_AMPCS_COMPATIBLE
1736 _status = fileName.
serialize(_logBuff, 100);
1742 #if FW_AMPCS_COMPATIBLE
1745 static_cast<U8>(
sizeof(I32))
1758 this->m_eventOut_OutputPort[0].
invoke(
1767 #if FW_ENABLE_TEXT_LOGGING
1768 if (this->m_textEventOut_OutputPort[0].isConnected()) {
1769 #if FW_OBJECT_NAMES == 1
1770 const char* _formatString =
1771 "(%s) %s: Could not read file %s with status %" PRIi32
"";
1773 const char* _formatString =
1774 "%s: Could not read file %s with status %" PRIi32
"";
1794 this->m_textEventOut_OutputPort[0].invoke(
1812 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1813 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
1821 if (this->m_eventOut_OutputPort[0].isConnected()) {
1825 #if FW_AMPCS_COMPATIBLE
1834 _status = sourceFileName.
serialize(_logBuff, 100);
1840 _status = destFileName.
serialize(_logBuff, 100);
1846 this->m_eventOut_OutputPort[0].
invoke(
1855 #if FW_ENABLE_TEXT_LOGGING
1856 if (this->m_textEventOut_OutputPort[0].isConnected()) {
1857 #if FW_OBJECT_NAMES == 1
1858 const char* _formatString =
1859 "(%s) %s: Sent file %s to file %s";
1861 const char* _formatString =
1862 "%s: Sent file %s to file %s";
1882 this->m_textEventOut_OutputPort[0].invoke(
1900 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1901 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
1909 if (this->m_eventOut_OutputPort[0].isConnected()) {
1913 #if FW_AMPCS_COMPATIBLE
1922 _status = sourceFileName.
serialize(_logBuff, 100);
1928 _status = destFileName.
serialize(_logBuff, 100);
1934 this->m_eventOut_OutputPort[0].
invoke(
1943 #if FW_ENABLE_TEXT_LOGGING
1944 if (this->m_textEventOut_OutputPort[0].isConnected()) {
1945 #if FW_OBJECT_NAMES == 1
1946 const char* _formatString =
1947 "(%s) %s: Canceled downlink of file %s to file %s";
1949 const char* _formatString =
1950 "%s: Canceled downlink of file %s to file %s";
1962 "DownlinkCanceled ",
1970 this->m_textEventOut_OutputPort[0].invoke(
1988 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1989 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
1997 if (this->m_eventOut_OutputPort[0].isConnected()) {
2001 #if FW_AMPCS_COMPATIBLE
2010 _status = sourceFileName.
serialize(_logBuff, 100);
2016 _status = destFileName.
serialize(_logBuff, 100);
2022 this->m_eventOut_OutputPort[0].
invoke(
2031 #if FW_ENABLE_TEXT_LOGGING
2032 if (this->m_textEventOut_OutputPort[0].isConnected()) {
2033 #if FW_OBJECT_NAMES == 1
2034 const char* _formatString =
2035 "(%s) %s: Timeout occurred during downlink of file %s to file %s. Downlink has been canceled.";
2037 const char* _formatString =
2038 "%s: Timeout occurred during downlink of file %s to file %s. Downlink has been canceled.";
2058 this->m_textEventOut_OutputPort[0].invoke(
2079 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2080 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
2088 if (this->m_eventOut_OutputPort[0].isConnected()) {
2092 #if FW_AMPCS_COMPATIBLE
2101 #if FW_AMPCS_COMPATIBLE
2104 static_cast<U8>(
sizeof(U32))
2111 _status = _logBuff.
serialize(startOffset);
2117 #if FW_AMPCS_COMPATIBLE
2120 static_cast<U8>(
sizeof(U32))
2133 #if FW_AMPCS_COMPATIBLE
2136 static_cast<U8>(
sizeof(U32))
2149 _status = sourceFileName.
serialize(_logBuff, 100);
2155 _status = destFileName.
serialize(_logBuff, 100);
2161 this->m_eventOut_OutputPort[0].
invoke(
2170 #if FW_ENABLE_TEXT_LOGGING
2171 if (this->m_textEventOut_OutputPort[0].isConnected()) {
2172 #if FW_OBJECT_NAMES == 1
2173 const char* _formatString =
2174 "(%s) %s: Offset %" PRIu32
" plus length %" PRIu32
" is greater than source size %" PRIu32
" for partial downlink of file %s to file %s. ";
2176 const char* _formatString =
2177 "%s: Offset %" PRIu32
" plus length %" PRIu32
" is greater than source size %" PRIu32
" for partial downlink of file %s to file %s. ";
2189 "DownlinkPartialWarning ",
2200 this->m_textEventOut_OutputPort[0].invoke(
2220 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2221 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
2229 if (this->m_eventOut_OutputPort[0].isConnected()) {
2233 #if FW_AMPCS_COMPATIBLE
2242 _status = sourceFileName.
serialize(_logBuff, 100);
2248 _status = destFileName.
serialize(_logBuff, 100);
2254 #if FW_AMPCS_COMPATIBLE
2257 static_cast<U8>(
sizeof(U32))
2264 _status = _logBuff.
serialize(startOffset);
2270 #if FW_AMPCS_COMPATIBLE
2273 static_cast<U8>(
sizeof(U32))
2286 this->m_eventOut_OutputPort[0].
invoke(
2295 #if FW_ENABLE_TEXT_LOGGING
2296 if (this->m_textEventOut_OutputPort[0].isConnected()) {
2297 #if FW_OBJECT_NAMES == 1
2298 const char* _formatString =
2299 "(%s) %s: Error occurred during partial downlink of file %s to file %s. Offset %" PRIu32
" greater than or equal to source filesize %" PRIu32
".";
2301 const char* _formatString =
2302 "%s: Error occurred during partial downlink of file %s to file %s. Offset %" PRIu32
" greater than or equal to source filesize %" PRIu32
".";
2314 "DownlinkPartialFail ",
2324 this->m_textEventOut_OutputPort[0].invoke(
2342 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2343 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
2351 if (this->m_eventOut_OutputPort[0].isConnected()) {
2355 #if FW_AMPCS_COMPATIBLE
2364 _status = sourceFileName.
serialize(_logBuff, 100);
2370 #if FW_AMPCS_COMPATIBLE
2373 static_cast<U8>(
sizeof(U32))
2380 _status = _logBuff.
serialize(byteOffset);
2386 this->m_eventOut_OutputPort[0].
invoke(
2395 #if FW_ENABLE_TEXT_LOGGING
2396 if (this->m_textEventOut_OutputPort[0].isConnected()) {
2397 #if FW_OBJECT_NAMES == 1
2398 const char* _formatString =
2399 "(%s) %s: Failed to send data packet from file %s at byte offset %" PRIu32
".";
2401 const char* _formatString =
2402 "%s: Failed to send data packet from file %s at byte offset %" PRIu32
".";
2422 this->m_textEventOut_OutputPort[0].invoke(
2441 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2442 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
2450 if (this->m_eventOut_OutputPort[0].isConnected()) {
2454 #if FW_AMPCS_COMPATIBLE
2463 #if FW_AMPCS_COMPATIBLE
2466 static_cast<U8>(
sizeof(U32))
2479 _status = sourceFileName.
serialize(_logBuff, 100);
2485 _status = destFileName.
serialize(_logBuff, 100);
2491 this->m_eventOut_OutputPort[0].
invoke(
2500 #if FW_ENABLE_TEXT_LOGGING
2501 if (this->m_textEventOut_OutputPort[0].isConnected()) {
2502 #if FW_OBJECT_NAMES == 1
2503 const char* _formatString =
2504 "(%s) %s: Downlink of %" PRIu32
" bytes started from %s to %s";
2506 const char* _formatString =
2507 "%s: Downlink of %" PRIu32
" bytes started from %s to %s";
2528 this->m_textEventOut_OutputPort[0].invoke(
2548 if (this->m_tlmOut_OutputPort[0].isConnected()) {
2550 this->m_timeCaller_OutputPort[0].isConnected() &&
2553 this->m_timeCaller_OutputPort[0].
invoke(_tlmTime);
2567 this->m_tlmOut_OutputPort[0].
invoke(
2581 if (this->m_tlmOut_OutputPort[0].isConnected()) {
2583 this->m_timeCaller_OutputPort[0].isConnected() &&
2586 this->m_timeCaller_OutputPort[0].
invoke(_tlmTime);
2600 this->m_tlmOut_OutputPort[0].
invoke(
2614 if (this->m_tlmOut_OutputPort[0].isConnected()) {
2616 this->m_timeCaller_OutputPort[0].isConnected() &&
2619 this->m_timeCaller_OutputPort[0].
invoke(_tlmTime);
2633 this->m_tlmOut_OutputPort[0].
invoke(
2648 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2650 this->m_timeCaller_OutputPort[0].
invoke(_time);
2668 this->m_guardedPortMutex.
lock();
2674 this->m_guardedPortMutex.
unLock();
2684 ComponentIpcSerializableBuffer msg;
2707 MsgTypeEnum msgType =
static_cast<MsgTypeEnum
>(desMsg);
2709 if (msgType == FILEDOWNLINK_COMPONENT_EXIT) {
2714 deserStatus = msg.deserialize(portNum);
2725 deserStatus = msg.deserialize(context);
2740 case BUFFERRETURN_BUFFERSEND: {
2761 deserStatus = msg.deserialize(key);
2776 case CMD_SENDFILE: {
2779 deserStatus = msg.deserialize(opCode);
2787 deserStatus = msg.deserialize(cmdSeq);
2808 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2823 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2836 #if FW_CMD_CHECK_RESIDUAL
2838 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2860 deserStatus = msg.deserialize(opCode);
2868 deserStatus = msg.deserialize(cmdSeq);
2887 #if FW_CMD_CHECK_RESIDUAL
2889 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2904 case CMD_SENDPARTIAL: {
2907 deserStatus = msg.deserialize(opCode);
2915 deserStatus = msg.deserialize(cmdSeq);
2936 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2951 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2966 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2981 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2994 #if FW_CMD_CHECK_RESIDUAL
2996 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3027 void FileDownlinkComponentBase ::
3039 const U32 idBase = callComp->
getIdBase();
3040 FW_ASSERT(opCode >= idBase, opCode, idBase);
3043 switch (opCode - idBase) {
3045 compPtr->SendFile_cmdHandlerBase(
3054 compPtr->Cancel_cmdHandlerBase(
3063 compPtr->SendPartial_cmdHandlerBase(
3077 void FileDownlinkComponentBase ::
3086 compPtr->Run_handlerBase(
3104 return compPtr->SendFile_handlerBase(
3113 void FileDownlinkComponentBase ::
3114 m_p_bufferReturn_in(
3122 compPtr->bufferReturn_handlerBase(
3128 void FileDownlinkComponentBase ::
3137 compPtr->pingIn_handlerBase(
PlatformIntType NATIVE_INT_TYPE
uint8_t U8
8-bit unsigned integer
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
PlatformUIntType NATIVE_UINT_TYPE
int PlatformIntType
DefaultTypes.hpp provides fallback defaults for the platform types.
#define PRI_PlatformIntType
@ TB_NONE
No time base has been established.
PlatformAssertArgType FwAssertArgType
#define FW_LOG_TEXT_BUFFER_SIZE
Max size of string for text log message.
#define FW_OBJ_NAME_MAX_SIZE
Size of object name (if object names enabled). AC Limits to 80, truncation occurs above 80.
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects)
@ ACTIVE_COMPONENT_EXIT
message to exit active component task
Fw::SerializeStatus deserialize(Fw::SerializeBufferBase &buffer)
Enum representing a command response.
@ FORMAT_ERROR
Command failed to deserialize.
@ WARNING_HI
A serious but recoverable event.
@ ACTIVITY_HI
Important informational events.
@ WARNING_LO
A less serious but recoverable event.
const char * toChar() const override
SerializeStatus serialize(SerializeBufferBase &buffer) const override
serialization function
void init()
Object initializer.
void addCallPort(InputBufferSendPort *callPort)
Register an input port.
void invoke(Fw::Buffer &fwBuffer)
Invoke a port interface.
void init()
Initialization function.
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
void invoke(FwOpcodeType opCode)
Invoke a port interface.
void init()
Initialization function.
void init()
Initialization function.
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Invoke a port interface.
void init()
Initialization function.
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Invoke a port interface.
void addCallPort(InputLogPort *callPort)
Register an input port.
void addCallPort(InputTimePort *callPort)
Register an input port.
void invoke(Fw::Time &time)
Invoke a port interface.
void init()
Initialization function.
void addCallPort(InputTlmPort *callPort)
Register an input port.
void init()
Initialization function.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Invoke a port interface.
Os::Queue::QueueStatus createQueue(NATIVE_INT_TYPE depth, NATIVE_INT_TYPE msgSize)
Os::Queue m_queue
queue object for active component
@ MSG_DISPATCH_OK
Dispatch was normal.
@ MSG_DISPATCH_EXIT
A message was sent requesting an exit of the loop.
@ MSG_DISPATCH_ERROR
Errors dispatching messages.
NATIVE_UINT_TYPE getBuffLeft() const
returns how much deserialization buffer is left
void resetDeser()
reset deserialization to beginning
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
void unLock()
unlock the mutex
void lock()
lock the mutex
@ QUEUE_OK
message sent/received okay
QueueStatus send(const Fw::SerializeBufferBase &buffer, NATIVE_INT_TYPE priority, QueueBlocking block)
send a message
QueueStatus receive(Fw::SerializeBufferBase &buffer, NATIVE_INT_TYPE &priority, QueueBlocking block)
receive a message
@ QUEUE_BLOCKING
Queue receive blocks until a message arrives.
@ QUEUE_NONBLOCKING
Queue receive always returns even if there is no message.
@ EVENTID_DOWNLINKTIMEOUT
The File Downlink component has detected a timeout. Downlink has been canceled.
@ EVENTID_SENDSTARTED
The File Downlink component started a file download.
@ EVENTID_DOWNLINKPARTIALFAIL
The File Downlink component has detected a timeout. Downlink has been canceled.
@ EVENTID_FILEREADERROR
An error occurred reading a file.
@ EVENTID_SENDDATAFAIL
The File Downlink component generated an error when trying to send a data packet.
@ EVENTID_DOWNLINKCANCELED
The File Downlink component canceled downlink of a file.
@ EVENTID_FILEOPENERROR
An error occurred opening a file.
@ EVENTID_FILESENT
The File Downlink component successfully sent a file.
@ EVENTID_DOWNLINKPARTIALWARNING
The File Downlink component has detected a timeout. Downlink has been canceled.
void log_WARNING_HI_FileReadError(const Fw::LogStringArg &fileName, I32 status)
void log_WARNING_HI_DownlinkPartialFail(const Fw::LogStringArg &sourceFileName, const Fw::LogStringArg &destFileName, U32 startOffset, U32 filesize)
void set_timeCaller_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
virtual void Cancel_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
void regCommands()
Register commands with the Command Dispatcher.
bool isConnected_bufferSendOut_OutputPort(NATIVE_INT_TYPE portNum)
NATIVE_INT_TYPE getNum_eventOut_OutputPorts() const
void set_FileComplete_OutputPort(NATIVE_INT_TYPE portNum, Svc::InputSendFileCompletePort *port)
Connect port to FileComplete[portNum].
Fw::InputBufferSendPort * get_bufferReturn_InputPort(NATIVE_INT_TYPE portNum)
Svc::InputSendFileRequestPort * get_SendFile_InputPort(NATIVE_INT_TYPE portNum)
@ CHANNELID_FILESSENT
Channel ID for FilesSent.
@ CHANNELID_PACKETSSENT
Channel ID for PacketsSent.
@ CHANNELID_WARNINGS
Channel ID for Warnings.
virtual void SendFile_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &sourceFileName, const Fw::CmdStringArg &destFileName)=0
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
Svc::InputSchedPort * get_Run_InputPort(NATIVE_INT_TYPE portNum)
virtual void SendPartial_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &sourceFileName, const Fw::CmdStringArg &destFileName, U32 startOffset, U32 length)=0
void log_WARNING_LO_DownlinkPartialWarning(U32 startOffset, U32 length, U32 filesize, const Fw::LogStringArg &sourceFileName, const Fw::LogStringArg &destFileName)
NATIVE_INT_TYPE getNum_cmdRegOut_OutputPorts() const
virtual void Run_preMsgHook(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context)
Pre-message hook for async input port Run.
void Cancel_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
bool isConnected_tlmOut_OutputPort(NATIVE_INT_TYPE portNum)
bool isConnected_timeCaller_OutputPort(NATIVE_INT_TYPE portNum)
Svc::SendFileResponse SendFile_handlerBase(NATIVE_INT_TYPE portNum, const Svc::SendFileRequestPortStrings::StringSize100 &sourceFileName, const Svc::SendFileRequestPortStrings::StringSize100 &destFileName, U32 offset, U32 length)
Handler base-class function for input port SendFile.
void tlmWrite_Warnings(U32 arg, Fw::Time _tlmTime=Fw::Time())
virtual void unLock()
Unlock the guarded mutex.
virtual void lock()
Lock the guarded mutex.
void set_cmdRegOut_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputCmdRegPort *port)
Connect port to cmdRegOut[portNum].
void SendFile_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void set_tlmOut_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
FileDownlinkComponentBase(const char *compName="")
Construct FileDownlinkComponentBase object.
void bufferReturn_handlerBase(NATIVE_INT_TYPE portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port bufferReturn.
void set_pingOut_OutputPort(NATIVE_INT_TYPE portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
bool isConnected_eventOut_OutputPort(NATIVE_INT_TYPE portNum)
bool isConnected_cmdRegOut_OutputPort(NATIVE_INT_TYPE portNum)
void set_cmdResponseOut_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
NATIVE_INT_TYPE getNum_bufferReturn_InputPorts() const
NATIVE_INT_TYPE getNum_timeCaller_OutputPorts() const
@ OPCODE_CANCEL
Cancel the downlink in progress, if any.
@ OPCODE_SENDPARTIAL
Read a named file off the disk from a starting position. Divide it into packets and send the packets ...
@ OPCODE_SENDFILE
Read a named file off the disk. Divide it into packets and send the packets for transmission to the g...
virtual void bufferReturn_preMsgHook(NATIVE_INT_TYPE portNum, Fw::Buffer &fwBuffer)
Pre-message hook for async input port bufferReturn.
void log_WARNING_HI_SendDataFail(const Fw::LogStringArg &sourceFileName, U32 byteOffset)
virtual Svc::SendFileResponse SendFile_handler(NATIVE_INT_TYPE portNum, const Svc::SendFileRequestPortStrings::StringSize100 &sourceFileName, const Svc::SendFileRequestPortStrings::StringSize100 &destFileName, U32 offset, U32 length)=0
Handler for input port SendFile.
NATIVE_INT_TYPE getNum_SendFile_InputPorts() const
bool isConnected_cmdResponseOut_OutputPort(NATIVE_INT_TYPE portNum)
void pingIn_handlerBase(NATIVE_INT_TYPE portNum, U32 key)
Handler base-class function for input port pingIn.
virtual void Cancel_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command Cancel.
void set_eventOut_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputLogPort *port)
Connect port to eventOut[portNum].
bool isConnected_FileComplete_OutputPort(NATIVE_INT_TYPE portNum)
NATIVE_INT_TYPE getNum_FileComplete_OutputPorts() const
void log_ACTIVITY_HI_SendStarted(U32 fileSize, const Fw::LogStringArg &sourceFileName, const Fw::LogStringArg &destFileName)
void pingOut_out(NATIVE_INT_TYPE portNum, U32 key)
Invoke output port pingOut.
Fw::InputCmdPort * get_cmdIn_InputPort(NATIVE_INT_TYPE portNum)
NATIVE_INT_TYPE getNum_pingIn_InputPorts() const
NATIVE_INT_TYPE getNum_bufferSendOut_OutputPorts() const
virtual void pingIn_preMsgHook(NATIVE_INT_TYPE portNum, U32 key)
Pre-message hook for async input port pingIn.
virtual void Run_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context)=0
Handler for input port Run.
virtual void SendPartial_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command SendPartial.
void log_WARNING_HI_FileOpenError(const Fw::LogStringArg &fileName)
NATIVE_INT_TYPE getNum_tlmOut_OutputPorts() const
NATIVE_INT_TYPE getNum_cmdIn_InputPorts() const
Svc::InputPingPort * get_pingIn_InputPort(NATIVE_INT_TYPE portNum)
NATIVE_INT_TYPE getNum_pingOut_OutputPorts() const
void bufferSendOut_out(NATIVE_INT_TYPE portNum, Fw::Buffer &fwBuffer)
Invoke output port bufferSendOut.
virtual void bufferReturn_handler(NATIVE_INT_TYPE portNum, Fw::Buffer &fwBuffer)=0
Handler for input port bufferReturn.
virtual ~FileDownlinkComponentBase()
Destroy FileDownlinkComponentBase object.
void FileComplete_out(NATIVE_INT_TYPE portNum, const Svc::SendFileResponse &resp)
Invoke output port FileComplete.
void log_ACTIVITY_HI_FileSent(const Fw::LogStringArg &sourceFileName, const Fw::LogStringArg &destFileName)
void tlmWrite_FilesSent(U32 arg, Fw::Time _tlmTime=Fw::Time())
void Run_handlerBase(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context)
Handler base-class function for input port Run.
void log_WARNING_HI_DownlinkTimeout(const Fw::LogStringArg &sourceFileName, const Fw::LogStringArg &destFileName)
void SendPartial_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
virtual void SendFile_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command SendFile.
void set_bufferSendOut_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputBufferSendPort *port)
Connect port to bufferSendOut[portNum].
NATIVE_INT_TYPE getNum_cmdResponseOut_OutputPorts() const
bool isConnected_pingOut_OutputPort(NATIVE_INT_TYPE portNum)
void log_ACTIVITY_HI_DownlinkCanceled(const Fw::LogStringArg &sourceFileName, const Fw::LogStringArg &destFileName)
NATIVE_INT_TYPE getNum_Run_InputPorts() const
void tlmWrite_PacketsSent(U32 arg, Fw::Time _tlmTime=Fw::Time())
virtual void pingIn_handler(NATIVE_INT_TYPE portNum, U32 key)=0
Handler for input port pingIn.
void invoke(U32 key)
Invoke a port interface.
void init()
Initialization function.
void addCallPort(InputPingPort *callPort)
Register an input port.
void addCallPort(InputSendFileCompletePort *callPort)
Register an input port.
void init()
Initialization function.
void invoke(const Svc::SendFileResponse &resp)
Invoke a port interface.
Send file response struct.
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.