11 #if FW_ENABLE_TEXT_LOGGING
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_pingIn_InputPort[port].
init();
128 this->m_pingIn_InputPort[port].
setPortNum(port);
130 #if FW_OBJECT_NAMES == 1
145 this->m_pingIn_InputPort[port].setObjName(portName);
149 #if FW_ENABLE_TEXT_LOGGING == 1
153 port < static_cast<PlatformIntType>(this->getNum_LogText_OutputPorts());
156 this->m_LogText_OutputPort[port].
init();
158 #if FW_OBJECT_NAMES == 1
173 this->m_LogText_OutputPort[port].setObjName(portName);
184 this->m_cmdRegOut_OutputPort[port].
init();
186 #if FW_OBJECT_NAMES == 1
201 this->m_cmdRegOut_OutputPort[port].setObjName(portName);
211 this->m_cmdResponseOut_OutputPort[port].
init();
213 #if FW_OBJECT_NAMES == 1
228 this->m_cmdResponseOut_OutputPort[port].setObjName(portName);
238 this->m_eventOut_OutputPort[port].
init();
240 #if FW_OBJECT_NAMES == 1
255 this->m_eventOut_OutputPort[port].setObjName(portName);
265 this->m_timeCaller_OutputPort[port].
init();
267 #if FW_OBJECT_NAMES == 1
282 this->m_timeCaller_OutputPort[port].setObjName(portName);
292 this->m_tlmOut_OutputPort[port].
init();
294 #if FW_OBJECT_NAMES == 1
309 this->m_tlmOut_OutputPort[port].setObjName(portName);
319 this->m_pingOut_OutputPort[port].
init();
321 #if FW_OBJECT_NAMES == 1
336 this->m_pingOut_OutputPort[port].setObjName(portName);
342 ComponentIpcSerializableBuffer::SERIALIZATION_SIZE
362 return &this->m_cmdIn_InputPort[portNum];
377 return &this->m_pingIn_InputPort[portNum];
384 #if FW_ENABLE_TEXT_LOGGING == 1
386 void FileManagerComponentBase ::
387 set_LogText_OutputPort(
393 portNum < this->getNum_LogText_OutputPorts(),
397 this->m_LogText_OutputPort[portNum].addCallPort(port);
413 this->m_cmdRegOut_OutputPort[portNum].
addCallPort(port);
427 this->m_cmdResponseOut_OutputPort[portNum].
addCallPort(port);
441 this->m_eventOut_OutputPort[portNum].
addCallPort(port);
455 this->m_timeCaller_OutputPort[portNum].
addCallPort(port);
469 this->m_tlmOut_OutputPort[portNum].
addCallPort(port);
487 this->m_pingOut_OutputPort[portNum].
addCallPort(port);
490 #if FW_PORT_SERIALIZATION
496 #if FW_ENABLE_TEXT_LOGGING == 1
498 void FileManagerComponentBase ::
499 set_LogText_OutputPort(
501 Fw::InputSerializePort* port
505 portNum < this->getNum_LogText_OutputPorts(),
509 this->m_LogText_OutputPort[portNum].registerSerialPort(port);
517 Fw::InputSerializePort* port
525 this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
531 Fw::InputSerializePort* port
539 this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
545 Fw::InputSerializePort* port
553 this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
559 Fw::InputSerializePort* port
567 this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
573 Fw::InputSerializePort* port
581 this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
586 #if FW_PORT_SERIALIZATION
595 Fw::InputSerializePort* port
603 this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
615 FW_ASSERT(this->m_cmdRegOut_OutputPort[0].isConnected());
617 this->m_cmdRegOut_OutputPort[0].
invoke(
621 this->m_cmdRegOut_OutputPort[0].
invoke(
625 this->m_cmdRegOut_OutputPort[0].
invoke(
629 this->m_cmdRegOut_OutputPort[0].
invoke(
633 this->m_cmdRegOut_OutputPort[0].
invoke(
637 this->m_cmdRegOut_OutputPort[0].
invoke(
641 this->m_cmdRegOut_OutputPort[0].
invoke(
652 Fw::ActiveComponentBase(compName)
687 #if FW_ENABLE_TEXT_LOGGING == 1
690 getNum_LogText_OutputPorts()
const
741 #if FW_ENABLE_TEXT_LOGGING == 1
743 bool FileManagerComponentBase ::
747 portNum < this->getNum_LogText_OutputPorts(),
751 return this->m_LogText_OutputPort[portNum].isConnected();
764 return this->m_cmdRegOut_OutputPort[portNum].
isConnected();
775 return this->m_cmdResponseOut_OutputPort[portNum].
isConnected();
786 return this->m_eventOut_OutputPort[portNum].
isConnected();
797 return this->m_timeCaller_OutputPort[portNum].
isConnected();
808 return this->m_tlmOut_OutputPort[portNum].
isConnected();
823 return this->m_pingOut_OutputPort[portNum].
isConnected();
849 ComponentIpcSerializableBuffer msg;
853 _status = msg.serialize(
862 _status = msg.serialize(portNum);
869 _status = msg.serialize(key);
916 this->m_pingOut_OutputPort[portNum].
invoke(
932 FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
933 this->m_cmdResponseOut_OutputPort[0].
invoke(opCode, cmdSeq, response);
954 ComponentIpcSerializableBuffer msg;
958 _status = msg.serialize(
static_cast<NATIVE_INT_TYPE>(CMD_CREATEDIRECTORY));
967 _status = msg.serialize(port);
973 _status = msg.serialize(opCode);
979 _status = msg.serialize(cmdSeq);
985 _status = msg.serialize(args);
1013 ComponentIpcSerializableBuffer msg;
1026 _status = msg.serialize(port);
1032 _status = msg.serialize(opCode);
1038 _status = msg.serialize(cmdSeq);
1044 _status = msg.serialize(args);
1072 ComponentIpcSerializableBuffer msg;
1076 _status = msg.serialize(
static_cast<NATIVE_INT_TYPE>(CMD_REMOVEDIRECTORY));
1085 _status = msg.serialize(port);
1091 _status = msg.serialize(opCode);
1097 _status = msg.serialize(cmdSeq);
1103 _status = msg.serialize(args);
1131 ComponentIpcSerializableBuffer msg;
1135 _status = msg.serialize(
static_cast<NATIVE_INT_TYPE>(CMD_REMOVEFILE));
1144 _status = msg.serialize(port);
1150 _status = msg.serialize(opCode);
1156 _status = msg.serialize(cmdSeq);
1162 _status = msg.serialize(args);
1190 ComponentIpcSerializableBuffer msg;
1194 _status = msg.serialize(
static_cast<NATIVE_INT_TYPE>(CMD_SHELLCOMMAND));
1203 _status = msg.serialize(port);
1209 _status = msg.serialize(opCode);
1215 _status = msg.serialize(cmdSeq);
1221 _status = msg.serialize(args);
1249 ComponentIpcSerializableBuffer msg;
1253 _status = msg.serialize(
static_cast<NATIVE_INT_TYPE>(CMD_APPENDFILE));
1262 _status = msg.serialize(port);
1268 _status = msg.serialize(opCode);
1274 _status = msg.serialize(cmdSeq);
1280 _status = msg.serialize(args);
1308 ComponentIpcSerializableBuffer msg;
1321 _status = msg.serialize(port);
1327 _status = msg.serialize(opCode);
1333 _status = msg.serialize(cmdSeq);
1339 _status = msg.serialize(args);
1452 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1453 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
1461 if (this->m_eventOut_OutputPort[0].isConnected()) {
1465 #if FW_AMPCS_COMPATIBLE
1474 _status = dirName.
serialize(_logBuff, 256);
1480 #if FW_AMPCS_COMPATIBLE
1483 static_cast<U8>(
sizeof(U32))
1496 this->m_eventOut_OutputPort[0].
invoke(
1505 #if FW_ENABLE_TEXT_LOGGING
1506 if (this->m_LogText_OutputPort[0].isConnected()) {
1507 #if FW_OBJECT_NAMES == 1
1508 const char* _formatString =
1509 "(%s) %s: Could not create directory %s, returned status %" PRIu32
"";
1511 const char* _formatString =
1512 "%s: Could not create directory %s, returned status %" PRIu32
"";
1524 "DirectoryCreateError ",
1532 this->m_LogText_OutputPort[0].invoke(
1550 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1551 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
1559 if (this->m_eventOut_OutputPort[0].isConnected()) {
1563 #if FW_AMPCS_COMPATIBLE
1572 _status = dirName.
serialize(_logBuff, 256);
1578 #if FW_AMPCS_COMPATIBLE
1581 static_cast<U8>(
sizeof(U32))
1594 this->m_eventOut_OutputPort[0].
invoke(
1603 #if FW_ENABLE_TEXT_LOGGING
1604 if (this->m_LogText_OutputPort[0].isConnected()) {
1605 #if FW_OBJECT_NAMES == 1
1606 const char* _formatString =
1607 "(%s) %s: Could not remove directory %s, returned status %" PRIu32
"";
1609 const char* _formatString =
1610 "%s: Could not remove directory %s, returned status %" PRIu32
"";
1622 "DirectoryRemoveError ",
1630 this->m_LogText_OutputPort[0].invoke(
1649 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1650 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
1658 if (this->m_eventOut_OutputPort[0].isConnected()) {
1662 #if FW_AMPCS_COMPATIBLE
1671 _status = sourceFileName.
serialize(_logBuff, 256);
1677 _status = destFileName.
serialize(_logBuff, 256);
1683 #if FW_AMPCS_COMPATIBLE
1686 static_cast<U8>(
sizeof(U32))
1699 this->m_eventOut_OutputPort[0].
invoke(
1708 #if FW_ENABLE_TEXT_LOGGING
1709 if (this->m_LogText_OutputPort[0].isConnected()) {
1710 #if FW_OBJECT_NAMES == 1
1711 const char* _formatString =
1712 "(%s) %s: Could not move file %s to file %s, returned status %" PRIu32
"";
1714 const char* _formatString =
1715 "%s: Could not move file %s to file %s, returned status %" PRIu32
"";
1736 this->m_LogText_OutputPort[0].invoke(
1754 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1755 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
1763 if (this->m_eventOut_OutputPort[0].isConnected()) {
1767 #if FW_AMPCS_COMPATIBLE
1776 _status = fileName.
serialize(_logBuff, 256);
1782 #if FW_AMPCS_COMPATIBLE
1785 static_cast<U8>(
sizeof(U32))
1798 this->m_eventOut_OutputPort[0].
invoke(
1807 #if FW_ENABLE_TEXT_LOGGING
1808 if (this->m_LogText_OutputPort[0].isConnected()) {
1809 #if FW_OBJECT_NAMES == 1
1810 const char* _formatString =
1811 "(%s) %s: Could not remove file %s, returned status %" PRIu32
"";
1813 const char* _formatString =
1814 "%s: Could not remove file %s, returned status %" PRIu32
"";
1834 this->m_LogText_OutputPort[0].invoke(
1852 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1853 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
1861 if (this->m_eventOut_OutputPort[0].isConnected()) {
1865 #if FW_AMPCS_COMPATIBLE
1874 _status = command.
serialize(_logBuff, 256);
1880 #if FW_AMPCS_COMPATIBLE
1883 static_cast<U8>(
sizeof(U32))
1896 this->m_eventOut_OutputPort[0].
invoke(
1905 #if FW_ENABLE_TEXT_LOGGING
1906 if (this->m_LogText_OutputPort[0].isConnected()) {
1907 #if FW_OBJECT_NAMES == 1
1908 const char* _formatString =
1909 "(%s) %s: Shell command %s failed with status %" PRIu32
"";
1911 const char* _formatString =
1912 "%s: Shell command %s failed with status %" PRIu32
"";
1924 "ShellCommandFailed ",
1932 this->m_LogText_OutputPort[0].invoke(
1951 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1952 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
1960 if (this->m_eventOut_OutputPort[0].isConnected()) {
1964 #if FW_AMPCS_COMPATIBLE
1973 _status = source.
serialize(_logBuff, 256);
1979 _status = target.
serialize(_logBuff, 256);
1985 #if FW_AMPCS_COMPATIBLE
1988 static_cast<U8>(
sizeof(U32))
2001 this->m_eventOut_OutputPort[0].
invoke(
2010 #if FW_ENABLE_TEXT_LOGGING
2011 if (this->m_LogText_OutputPort[0].isConnected()) {
2012 #if FW_OBJECT_NAMES == 1
2013 const char* _formatString =
2014 "(%s) %s: Appending %s onto %s failed with status %" PRIu32
"";
2016 const char* _formatString =
2017 "%s: Appending %s onto %s failed with status %" PRIu32
"";
2029 "AppendFileFailed ",
2038 this->m_LogText_OutputPort[0].invoke(
2056 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2057 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
2065 if (this->m_eventOut_OutputPort[0].isConnected()) {
2069 #if FW_AMPCS_COMPATIBLE
2078 _status = source.
serialize(_logBuff, 256);
2084 _status = target.
serialize(_logBuff, 256);
2090 this->m_eventOut_OutputPort[0].
invoke(
2099 #if FW_ENABLE_TEXT_LOGGING
2100 if (this->m_LogText_OutputPort[0].isConnected()) {
2101 #if FW_OBJECT_NAMES == 1
2102 const char* _formatString =
2103 "(%s) %s: Appended %s to the end of %s";
2105 const char* _formatString =
2106 "%s: Appended %s to the end of %s";
2118 "AppendFileSucceeded ",
2126 this->m_LogText_OutputPort[0].invoke(
2141 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2142 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
2150 if (this->m_eventOut_OutputPort[0].isConnected()) {
2154 #if FW_AMPCS_COMPATIBLE
2163 _status = command.
serialize(_logBuff, 256);
2169 this->m_eventOut_OutputPort[0].
invoke(
2178 #if FW_ENABLE_TEXT_LOGGING
2179 if (this->m_LogText_OutputPort[0].isConnected()) {
2180 #if FW_OBJECT_NAMES == 1
2181 const char* _formatString =
2182 "(%s) %s: Shell command %s succeeded";
2184 const char* _formatString =
2185 "%s: Shell command %s succeeded";
2197 "ShellCommandSucceeded ",
2204 this->m_LogText_OutputPort[0].invoke(
2219 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2220 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
2228 if (this->m_eventOut_OutputPort[0].isConnected()) {
2232 #if FW_AMPCS_COMPATIBLE
2241 _status = dirName.
serialize(_logBuff, 256);
2247 this->m_eventOut_OutputPort[0].
invoke(
2256 #if FW_ENABLE_TEXT_LOGGING
2257 if (this->m_LogText_OutputPort[0].isConnected()) {
2258 #if FW_OBJECT_NAMES == 1
2259 const char* _formatString =
2260 "(%s) %s: Created directory %s successfully";
2262 const char* _formatString =
2263 "%s: Created directory %s successfully";
2275 "CreateDirectorySucceeded ",
2282 this->m_LogText_OutputPort[0].invoke(
2297 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2298 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
2306 if (this->m_eventOut_OutputPort[0].isConnected()) {
2310 #if FW_AMPCS_COMPATIBLE
2319 _status = dirName.
serialize(_logBuff, 256);
2325 this->m_eventOut_OutputPort[0].
invoke(
2334 #if FW_ENABLE_TEXT_LOGGING
2335 if (this->m_LogText_OutputPort[0].isConnected()) {
2336 #if FW_OBJECT_NAMES == 1
2337 const char* _formatString =
2338 "(%s) %s: Removed directory %s successfully";
2340 const char* _formatString =
2341 "%s: Removed directory %s successfully";
2353 "RemoveDirectorySucceeded ",
2360 this->m_LogText_OutputPort[0].invoke(
2378 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2379 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
2387 if (this->m_eventOut_OutputPort[0].isConnected()) {
2391 #if FW_AMPCS_COMPATIBLE
2400 _status = sourceFileName.
serialize(_logBuff, 256);
2406 _status = destFileName.
serialize(_logBuff, 256);
2412 this->m_eventOut_OutputPort[0].
invoke(
2421 #if FW_ENABLE_TEXT_LOGGING
2422 if (this->m_LogText_OutputPort[0].isConnected()) {
2423 #if FW_OBJECT_NAMES == 1
2424 const char* _formatString =
2425 "(%s) %s: Moved file %s to file %s successfully";
2427 const char* _formatString =
2428 "%s: Moved file %s to file %s successfully";
2440 "MoveFileSucceeded ",
2448 this->m_LogText_OutputPort[0].invoke(
2463 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2464 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
2472 if (this->m_eventOut_OutputPort[0].isConnected()) {
2476 #if FW_AMPCS_COMPATIBLE
2485 _status = fileName.
serialize(_logBuff, 256);
2491 this->m_eventOut_OutputPort[0].
invoke(
2500 #if FW_ENABLE_TEXT_LOGGING
2501 if (this->m_LogText_OutputPort[0].isConnected()) {
2502 #if FW_OBJECT_NAMES == 1
2503 const char* _formatString =
2504 "(%s) %s: Removed file %s successfully";
2506 const char* _formatString =
2507 "%s: Removed file %s successfully";
2519 "RemoveFileSucceeded ",
2526 this->m_LogText_OutputPort[0].invoke(
2544 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2545 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
2553 if (this->m_eventOut_OutputPort[0].isConnected()) {
2557 #if FW_AMPCS_COMPATIBLE
2566 _status = source.
serialize(_logBuff, 256);
2572 _status = target.
serialize(_logBuff, 256);
2578 this->m_eventOut_OutputPort[0].
invoke(
2587 #if FW_ENABLE_TEXT_LOGGING
2588 if (this->m_LogText_OutputPort[0].isConnected()) {
2589 #if FW_OBJECT_NAMES == 1
2590 const char* _formatString =
2591 "(%s) %s: Appending file %s to the end of %s...";
2593 const char* _formatString =
2594 "%s: Appending file %s to the end of %s...";
2606 "AppendFileStarted ",
2614 this->m_LogText_OutputPort[0].invoke(
2629 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2630 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
2638 if (this->m_eventOut_OutputPort[0].isConnected()) {
2642 #if FW_AMPCS_COMPATIBLE
2651 _status = command.
serialize(_logBuff, 256);
2657 this->m_eventOut_OutputPort[0].
invoke(
2666 #if FW_ENABLE_TEXT_LOGGING
2667 if (this->m_LogText_OutputPort[0].isConnected()) {
2668 #if FW_OBJECT_NAMES == 1
2669 const char* _formatString =
2670 "(%s) %s: Running shell command %s...";
2672 const char* _formatString =
2673 "%s: Running shell command %s...";
2685 "ShellCommandStarted ",
2692 this->m_LogText_OutputPort[0].invoke(
2707 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2708 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
2716 if (this->m_eventOut_OutputPort[0].isConnected()) {
2720 #if FW_AMPCS_COMPATIBLE
2729 _status = dirName.
serialize(_logBuff, 256);
2735 this->m_eventOut_OutputPort[0].
invoke(
2744 #if FW_ENABLE_TEXT_LOGGING
2745 if (this->m_LogText_OutputPort[0].isConnected()) {
2746 #if FW_OBJECT_NAMES == 1
2747 const char* _formatString =
2748 "(%s) %s: Creating directory %s...";
2750 const char* _formatString =
2751 "%s: Creating directory %s...";
2763 "CreateDirectoryStarted ",
2770 this->m_LogText_OutputPort[0].invoke(
2785 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2786 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
2794 if (this->m_eventOut_OutputPort[0].isConnected()) {
2798 #if FW_AMPCS_COMPATIBLE
2807 _status = dirName.
serialize(_logBuff, 256);
2813 this->m_eventOut_OutputPort[0].
invoke(
2822 #if FW_ENABLE_TEXT_LOGGING
2823 if (this->m_LogText_OutputPort[0].isConnected()) {
2824 #if FW_OBJECT_NAMES == 1
2825 const char* _formatString =
2826 "(%s) %s: Removing directory %s...";
2828 const char* _formatString =
2829 "%s: Removing directory %s...";
2841 "RemoveDirectoryStarted ",
2848 this->m_LogText_OutputPort[0].invoke(
2866 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2867 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
2875 if (this->m_eventOut_OutputPort[0].isConnected()) {
2879 #if FW_AMPCS_COMPATIBLE
2888 _status = sourceFileName.
serialize(_logBuff, 256);
2894 _status = destFileName.
serialize(_logBuff, 256);
2900 this->m_eventOut_OutputPort[0].
invoke(
2909 #if FW_ENABLE_TEXT_LOGGING
2910 if (this->m_LogText_OutputPort[0].isConnected()) {
2911 #if FW_OBJECT_NAMES == 1
2912 const char* _formatString =
2913 "(%s) %s: Moving file %s to file %s...";
2915 const char* _formatString =
2916 "%s: Moving file %s to file %s...";
2936 this->m_LogText_OutputPort[0].invoke(
2951 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2952 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
2960 if (this->m_eventOut_OutputPort[0].isConnected()) {
2964 #if FW_AMPCS_COMPATIBLE
2973 _status = fileName.
serialize(_logBuff, 256);
2979 this->m_eventOut_OutputPort[0].
invoke(
2988 #if FW_ENABLE_TEXT_LOGGING
2989 if (this->m_LogText_OutputPort[0].isConnected()) {
2990 #if FW_OBJECT_NAMES == 1
2991 const char* _formatString =
2992 "(%s) %s: Removing file %s...";
2994 const char* _formatString =
2995 "%s: Removing file %s...";
3007 "RemoveFileStarted ",
3014 this->m_LogText_OutputPort[0].invoke(
3032 if (this->m_timeCaller_OutputPort[0].isConnected()) {
3033 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
3041 if (this->m_eventOut_OutputPort[0].isConnected()) {
3045 #if FW_AMPCS_COMPATIBLE
3054 _status = fileName.
serialize(_logBuff, 256);
3060 #if FW_AMPCS_COMPATIBLE
3063 static_cast<U8>(
sizeof(
U64))
3076 this->m_eventOut_OutputPort[0].
invoke(
3085 #if FW_ENABLE_TEXT_LOGGING
3086 if (this->m_LogText_OutputPort[0].isConnected()) {
3087 #if FW_OBJECT_NAMES == 1
3088 const char* _formatString =
3089 "(%s) %s: The size of file %s is %" PRIu64
" B";
3091 const char* _formatString =
3092 "%s: The size of file %s is %" PRIu64
" B";
3104 "FileSizeSucceeded ",
3112 this->m_LogText_OutputPort[0].invoke(
3130 if (this->m_timeCaller_OutputPort[0].isConnected()) {
3131 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
3139 if (this->m_eventOut_OutputPort[0].isConnected()) {
3143 #if FW_AMPCS_COMPATIBLE
3152 _status = fileName.
serialize(_logBuff, 256);
3158 #if FW_AMPCS_COMPATIBLE
3161 static_cast<U8>(
sizeof(U32))
3174 this->m_eventOut_OutputPort[0].
invoke(
3183 #if FW_ENABLE_TEXT_LOGGING
3184 if (this->m_LogText_OutputPort[0].isConnected()) {
3185 #if FW_OBJECT_NAMES == 1
3186 const char* _formatString =
3187 "(%s) %s: Failed to get the size of file %s, returned status %" PRIu32
"";
3189 const char* _formatString =
3190 "%s: Failed to get the size of file %s, returned status %" PRIu32
"";
3210 this->m_LogText_OutputPort[0].invoke(
3225 if (this->m_timeCaller_OutputPort[0].isConnected()) {
3226 this->m_timeCaller_OutputPort[0].
invoke(_logTime);
3234 if (this->m_eventOut_OutputPort[0].isConnected()) {
3238 #if FW_AMPCS_COMPATIBLE
3247 _status = fileName.
serialize(_logBuff, 256);
3253 this->m_eventOut_OutputPort[0].
invoke(
3262 #if FW_ENABLE_TEXT_LOGGING
3263 if (this->m_LogText_OutputPort[0].isConnected()) {
3264 #if FW_OBJECT_NAMES == 1
3265 const char* _formatString =
3266 "(%s) %s: Checking size of file %s...";
3268 const char* _formatString =
3269 "%s: Checking size of file %s...";
3288 this->m_LogText_OutputPort[0].invoke(
3308 if (this->m_tlmOut_OutputPort[0].isConnected()) {
3310 this->m_timeCaller_OutputPort[0].isConnected() &&
3313 this->m_timeCaller_OutputPort[0].
invoke(_tlmTime);
3327 this->m_tlmOut_OutputPort[0].
invoke(
3341 if (this->m_tlmOut_OutputPort[0].isConnected()) {
3343 this->m_timeCaller_OutputPort[0].isConnected() &&
3346 this->m_timeCaller_OutputPort[0].
invoke(_tlmTime);
3360 this->m_tlmOut_OutputPort[0].
invoke(
3375 if (this->m_timeCaller_OutputPort[0].isConnected()) {
3377 this->m_timeCaller_OutputPort[0].
invoke(_time);
3392 ComponentIpcSerializableBuffer msg;
3415 MsgTypeEnum msgType =
static_cast<MsgTypeEnum
>(desMsg);
3417 if (msgType == FILEMANAGER_COMPONENT_EXIT) {
3422 deserStatus = msg.deserialize(portNum);
3433 deserStatus = msg.deserialize(key);
3448 case CMD_CREATEDIRECTORY: {
3451 deserStatus = msg.deserialize(opCode);
3459 deserStatus = msg.deserialize(cmdSeq);
3480 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3493 #if FW_CMD_CHECK_RESIDUAL
3495 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3513 case CMD_MOVEFILE: {
3516 deserStatus = msg.deserialize(opCode);
3524 deserStatus = msg.deserialize(cmdSeq);
3545 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3560 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3573 #if FW_CMD_CHECK_RESIDUAL
3575 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3594 case CMD_REMOVEDIRECTORY: {
3597 deserStatus = msg.deserialize(opCode);
3605 deserStatus = msg.deserialize(cmdSeq);
3626 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3639 #if FW_CMD_CHECK_RESIDUAL
3641 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3659 case CMD_REMOVEFILE: {
3662 deserStatus = msg.deserialize(opCode);
3670 deserStatus = msg.deserialize(cmdSeq);
3691 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3706 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3719 #if FW_CMD_CHECK_RESIDUAL
3721 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3740 case CMD_SHELLCOMMAND: {
3743 deserStatus = msg.deserialize(opCode);
3751 deserStatus = msg.deserialize(cmdSeq);
3772 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3787 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3800 #if FW_CMD_CHECK_RESIDUAL
3802 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3821 case CMD_APPENDFILE: {
3824 deserStatus = msg.deserialize(opCode);
3832 deserStatus = msg.deserialize(cmdSeq);
3853 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3868 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3881 #if FW_CMD_CHECK_RESIDUAL
3883 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3902 case CMD_FILESIZE: {
3905 deserStatus = msg.deserialize(opCode);
3913 deserStatus = msg.deserialize(cmdSeq);
3934 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3947 #if FW_CMD_CHECK_RESIDUAL
3949 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3977 void FileManagerComponentBase ::
3989 const U32 idBase = callComp->
getIdBase();
3990 FW_ASSERT(opCode >= idBase, opCode, idBase);
3993 switch (opCode - idBase) {
3995 compPtr->CreateDirectory_cmdHandlerBase(
4004 compPtr->MoveFile_cmdHandlerBase(
4013 compPtr->RemoveDirectory_cmdHandlerBase(
4022 compPtr->RemoveFile_cmdHandlerBase(
4031 compPtr->ShellCommand_cmdHandlerBase(
4040 compPtr->AppendFile_cmdHandlerBase(
4049 compPtr->FileSize_cmdHandlerBase(
4063 void FileManagerComponentBase ::
4072 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
Enum representing a command response.
@ FORMAT_ERROR
Command failed to deserialize.
@ WARNING_HI
A serious but recoverable event.
@ ACTIVITY_HI
Important informational events.
const char * toChar() const override
SerializeStatus serialize(SerializeBufferBase &buffer) const override
serialization function
void init()
Object initializer.
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
@ 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.
void set_timeCaller_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
NATIVE_INT_TYPE getNum_pingIn_InputPorts() const
void pingOut_out(NATIVE_INT_TYPE portNum, U32 key)
Invoke output port pingOut.
void log_ACTIVITY_HI_AppendFileSucceeded(const Fw::LogStringArg &source, const Fw::LogStringArg &target)
NATIVE_INT_TYPE getNum_tlmOut_OutputPorts() const
bool isConnected_eventOut_OutputPort(NATIVE_INT_TYPE portNum)
void log_WARNING_HI_DirectoryRemoveError(const Fw::LogStringArg &dirName, U32 status)
void log_WARNING_HI_DirectoryCreateError(const Fw::LogStringArg &dirName, U32 status)
NATIVE_INT_TYPE getNum_pingOut_OutputPorts() const
NATIVE_INT_TYPE getNum_cmdIn_InputPorts() const
virtual void FileSize_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command FileSize.
virtual void FileSize_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &fileName)=0
Handler for command FileSize.
void ShellCommand_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void log_ACTIVITY_HI_ShellCommandSucceeded(const Fw::LogStringArg &command)
void log_WARNING_HI_FileSizeError(const Fw::LogStringArg &fileName, U32 status)
void set_cmdResponseOut_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
void log_ACTIVITY_HI_ShellCommandStarted(const Fw::LogStringArg &command)
virtual void RemoveDirectory_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &dirName)=0
@ OPCODE_CREATEDIRECTORY
Create a directory.
@ OPCODE_REMOVEDIRECTORY
Remove a directory, which must be empty.
@ OPCODE_SHELLCOMMAND
Perform a Linux shell command and write the output to a log file.
@ OPCODE_MOVEFILE
Move a file.
@ OPCODE_REMOVEFILE
Remove a file.
@ OPCODE_APPENDFILE
Append 1 file's contents to the end of another.
bool isConnected_timeCaller_OutputPort(NATIVE_INT_TYPE portNum)
virtual void MoveFile_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &sourceFileName, const Fw::CmdStringArg &destFileName)=0
virtual void AppendFile_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command AppendFile.
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
void tlmWrite_CommandsExecuted(U32 arg, Fw::Time _tlmTime=Fw::Time())
void set_tlmOut_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
Fw::InputCmdPort * get_cmdIn_InputPort(NATIVE_INT_TYPE portNum)
void tlmWrite_Errors(U32 arg, Fw::Time _tlmTime=Fw::Time())
void log_ACTIVITY_HI_RemoveFileStarted(const Fw::LogStringArg &fileName)
virtual void ShellCommand_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &command, const Fw::CmdStringArg &logFileName)=0
void regCommands()
Register commands with the Command Dispatcher.
void AppendFile_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void FileSize_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Base-class handler function for command FileSize.
virtual void pingIn_handler(NATIVE_INT_TYPE portNum, U32 key)=0
Handler for input port pingIn.
Svc::InputPingPort * get_pingIn_InputPort(NATIVE_INT_TYPE portNum)
void log_ACTIVITY_HI_FileSizeSucceeded(const Fw::LogStringArg &fileName, U64 size)
virtual ~FileManagerComponentBase()
Destroy FileManagerComponentBase object.
virtual void CreateDirectory_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CreateDirectory.
bool isConnected_tlmOut_OutputPort(NATIVE_INT_TYPE portNum)
void pingIn_handlerBase(NATIVE_INT_TYPE portNum, U32 key)
Handler base-class function for input port pingIn.
void RemoveDirectory_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
virtual void AppendFile_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &source, const Fw::CmdStringArg &target)=0
virtual void RemoveFile_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command RemoveFile.
void set_pingOut_OutputPort(NATIVE_INT_TYPE portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
void log_ACTIVITY_HI_FileSizeStarted(const Fw::LogStringArg &fileName)
void MoveFile_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void log_ACTIVITY_HI_RemoveFileSucceeded(const Fw::LogStringArg &fileName)
NATIVE_INT_TYPE getNum_timeCaller_OutputPorts() const
void CreateDirectory_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
NATIVE_INT_TYPE getNum_cmdResponseOut_OutputPorts() const
void log_ACTIVITY_HI_AppendFileStarted(const Fw::LogStringArg &source, const Fw::LogStringArg &target)
void set_cmdRegOut_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputCmdRegPort *port)
Connect port to cmdRegOut[portNum].
void log_WARNING_HI_FileMoveError(const Fw::LogStringArg &sourceFileName, const Fw::LogStringArg &destFileName, U32 status)
bool isConnected_pingOut_OutputPort(NATIVE_INT_TYPE portNum)
@ CHANNELID_ERRORS
Channel ID for Errors.
@ CHANNELID_COMMANDSEXECUTED
Channel ID for CommandsExecuted.
virtual void RemoveDirectory_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command RemoveDirectory.
void log_ACTIVITY_HI_RemoveDirectoryStarted(const Fw::LogStringArg &dirName)
bool isConnected_cmdResponseOut_OutputPort(NATIVE_INT_TYPE portNum)
void log_WARNING_HI_AppendFileFailed(const Fw::LogStringArg &source, const Fw::LogStringArg &target, U32 status)
NATIVE_INT_TYPE getNum_eventOut_OutputPorts() const
void log_ACTIVITY_HI_CreateDirectorySucceeded(const Fw::LogStringArg &dirName)
FileManagerComponentBase(const char *compName="")
Construct FileManagerComponentBase object.
void RemoveFile_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
bool isConnected_cmdRegOut_OutputPort(NATIVE_INT_TYPE portNum)
@ EVENTID_APPENDFILESUCCEEDED
The File System component appended 2 files without error.
@ EVENTID_REMOVEFILESTARTED
The File System component began deleting an existing file.
@ EVENTID_FILESIZEERROR
Failed to get file size.
@ EVENTID_DIRECTORYREMOVEERROR
An error occurred while attempting to remove a directory.
@ EVENTID_FILESIZESTARTED
Checking file size.
@ EVENTID_APPENDFILESTARTED
The File System component appended 2 files without error.
@ EVENTID_SHELLCOMMANDSTARTED
The File System component began executing a shell command.
@ EVENTID_APPENDFILEFAILED
The File System component returned status non-zero when trying to append 2 files together.
@ EVENTID_FILESIZESUCCEEDED
File size response.
@ EVENTID_MOVEFILESTARTED
The File System component began moving a file to a new location.
@ EVENTID_FILEREMOVEERROR
An error occurred while attempting to remove a file.
@ EVENTID_REMOVEDIRECTORYSTARTED
The File System component began deleting a directory.
@ EVENTID_SHELLCOMMANDFAILED
The File System component executed a shell command that returned status non-zero.
@ EVENTID_CREATEDIRECTORYSUCCEEDED
The File System component created a new directory without error.
@ EVENTID_MOVEFILESUCCEEDED
The File System component moved a file to a new location without error.
@ EVENTID_REMOVEDIRECTORYSUCCEEDED
The File System component deleted and existing directory without error.
@ EVENTID_DIRECTORYCREATEERROR
An error occurred while attempting to create a directory.
@ EVENTID_CREATEDIRECTORYSTARTED
The File System component began creating a new directory.
@ EVENTID_SHELLCOMMANDSUCCEEDED
The File System component executed a shell command that returned status zero.
@ EVENTID_FILEMOVEERROR
An error occurred while attempting to move a file.
@ EVENTID_REMOVEFILESUCCEEDED
The File System component deleted an existing file without error.
void log_ACTIVITY_HI_CreateDirectoryStarted(const Fw::LogStringArg &dirName)
virtual void RemoveFile_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &fileName, bool ignoreErrors)=0
virtual void CreateDirectory_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &dirName)=0
void log_ACTIVITY_HI_RemoveDirectorySucceeded(const Fw::LogStringArg &dirName)
void set_eventOut_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputLogPort *port)
Connect port to eventOut[portNum].
void log_ACTIVITY_HI_MoveFileSucceeded(const Fw::LogStringArg &sourceFileName, const Fw::LogStringArg &destFileName)
virtual void MoveFile_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command MoveFile.
virtual void ShellCommand_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command ShellCommand.
void log_WARNING_HI_ShellCommandFailed(const Fw::LogStringArg &command, U32 status)
void log_ACTIVITY_HI_MoveFileStarted(const Fw::LogStringArg &sourceFileName, const Fw::LogStringArg &destFileName)
void log_WARNING_HI_FileRemoveError(const Fw::LogStringArg &fileName, U32 status)
virtual void pingIn_preMsgHook(NATIVE_INT_TYPE portNum, U32 key)
Pre-message hook for async input port pingIn.
NATIVE_INT_TYPE getNum_cmdRegOut_OutputPorts() const
void invoke(U32 key)
Invoke a port interface.
void init()
Initialization function.
void addCallPort(InputPingPort *callPort)
Register an input port.
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.