10#if FW_ENABLE_TEXT_LOGGING
38 class ComponentIpcSerializableBuffer :
48 MAX_DATA_SIZE =
sizeof(BuffUnion),
50 SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
54 return sizeof(m_buff);
61 const U8* getBuffAddr()
const {
67 U8 m_buff[SERIALIZATION_SIZE];
76 void FileManagerComponentBase ::
88 port < static_cast<FwIndexType>(this->getNum_cmdIn_InputPorts());
91 this->m_cmdIn_InputPort[port].init();
92 this->m_cmdIn_InputPort[port].addCallComp(
96 this->m_cmdIn_InputPort[port].setPortNum(port);
98#if FW_OBJECT_NAMES == 1
102 this->m_objName.toChar(),
105 this->m_cmdIn_InputPort[port].setObjName(portName.
toChar());
112 port < static_cast<FwIndexType>(this->getNum_pingIn_InputPorts());
115 this->m_pingIn_InputPort[port].init();
116 this->m_pingIn_InputPort[port].addCallComp(
120 this->m_pingIn_InputPort[port].setPortNum(port);
122#if FW_OBJECT_NAMES == 1
126 this->m_objName.toChar(),
129 this->m_pingIn_InputPort[port].setObjName(portName.
toChar());
133#if FW_ENABLE_TEXT_LOGGING == 1
137 port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
140 this->m_LogText_OutputPort[port].init();
142#if FW_OBJECT_NAMES == 1
146 this->m_objName.toChar(),
149 this->m_LogText_OutputPort[port].setObjName(portName.
toChar());
157 port < static_cast<FwIndexType>(this->getNum_cmdRegOut_OutputPorts());
160 this->m_cmdRegOut_OutputPort[port].init();
162#if FW_OBJECT_NAMES == 1
166 this->m_objName.toChar(),
169 this->m_cmdRegOut_OutputPort[port].setObjName(portName.
toChar());
176 port < static_cast<FwIndexType>(this->getNum_cmdResponseOut_OutputPorts());
179 this->m_cmdResponseOut_OutputPort[port].init();
181#if FW_OBJECT_NAMES == 1
185 this->m_objName.toChar(),
188 this->m_cmdResponseOut_OutputPort[port].setObjName(portName.
toChar());
195 port < static_cast<FwIndexType>(this->getNum_eventOut_OutputPorts());
198 this->m_eventOut_OutputPort[port].init();
200#if FW_OBJECT_NAMES == 1
204 this->m_objName.toChar(),
207 this->m_eventOut_OutputPort[port].setObjName(portName.
toChar());
214 port < static_cast<FwIndexType>(this->getNum_timeCaller_OutputPorts());
217 this->m_timeCaller_OutputPort[port].init();
219#if FW_OBJECT_NAMES == 1
223 this->m_objName.toChar(),
226 this->m_timeCaller_OutputPort[port].setObjName(portName.
toChar());
233 port < static_cast<FwIndexType>(this->getNum_tlmOut_OutputPorts());
236 this->m_tlmOut_OutputPort[port].init();
238#if FW_OBJECT_NAMES == 1
242 this->m_objName.toChar(),
245 this->m_tlmOut_OutputPort[port].setObjName(portName.
toChar());
252 port < static_cast<FwIndexType>(this->getNum_pingOut_OutputPorts());
255 this->m_pingOut_OutputPort[port].init();
257#if FW_OBJECT_NAMES == 1
261 this->m_objName.toChar(),
264 this->m_pingOut_OutputPort[port].setObjName(portName.
toChar());
271 static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
287 portNum < this->getNum_cmdIn_InputPorts(),
291 return &this->m_cmdIn_InputPort[portNum];
302 portNum < this->getNum_pingIn_InputPorts(),
306 return &this->m_pingIn_InputPort[portNum];
313#if FW_ENABLE_TEXT_LOGGING == 1
315 void FileManagerComponentBase ::
316 set_LogText_OutputPort(
322 portNum < this->getNum_LogText_OutputPorts(),
326 this->m_LogText_OutputPort[portNum].addCallPort(port);
331 void FileManagerComponentBase ::
332 set_cmdRegOut_OutputPort(
338 portNum < this->getNum_cmdRegOut_OutputPorts(),
342 this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
345 void FileManagerComponentBase ::
346 set_cmdResponseOut_OutputPort(
352 portNum < this->getNum_cmdResponseOut_OutputPorts(),
356 this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
359 void FileManagerComponentBase ::
360 set_eventOut_OutputPort(
366 portNum < this->getNum_eventOut_OutputPorts(),
370 this->m_eventOut_OutputPort[portNum].addCallPort(port);
373 void FileManagerComponentBase ::
374 set_timeCaller_OutputPort(
380 portNum < this->getNum_timeCaller_OutputPorts(),
384 this->m_timeCaller_OutputPort[portNum].addCallPort(port);
387 void FileManagerComponentBase ::
388 set_tlmOut_OutputPort(
394 portNum < this->getNum_tlmOut_OutputPorts(),
398 this->m_tlmOut_OutputPort[portNum].addCallPort(port);
405 void FileManagerComponentBase ::
406 set_pingOut_OutputPort(
412 portNum < this->getNum_pingOut_OutputPorts(),
416 this->m_pingOut_OutputPort[portNum].addCallPort(port);
419#if FW_PORT_SERIALIZATION
425#if FW_ENABLE_TEXT_LOGGING == 1
427 void FileManagerComponentBase ::
428 set_LogText_OutputPort(
430 Fw::InputSerializePort* port
434 portNum < this->getNum_LogText_OutputPorts(),
438 this->m_LogText_OutputPort[portNum].registerSerialPort(port);
443 void FileManagerComponentBase ::
444 set_cmdRegOut_OutputPort(
446 Fw::InputSerializePort* port
450 portNum < this->getNum_cmdRegOut_OutputPorts(),
454 this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
457 void FileManagerComponentBase ::
458 set_cmdResponseOut_OutputPort(
460 Fw::InputSerializePort* port
464 portNum < this->getNum_cmdResponseOut_OutputPorts(),
468 this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
471 void FileManagerComponentBase ::
472 set_eventOut_OutputPort(
474 Fw::InputSerializePort* port
478 portNum < this->getNum_eventOut_OutputPorts(),
482 this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
485 void FileManagerComponentBase ::
486 set_timeCaller_OutputPort(
488 Fw::InputSerializePort* port
492 portNum < this->getNum_timeCaller_OutputPorts(),
496 this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
499 void FileManagerComponentBase ::
500 set_tlmOut_OutputPort(
502 Fw::InputSerializePort* port
506 portNum < this->getNum_tlmOut_OutputPorts(),
510 this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
515#if FW_PORT_SERIALIZATION
521 void FileManagerComponentBase ::
522 set_pingOut_OutputPort(
524 Fw::InputSerializePort* port
528 portNum < this->getNum_pingOut_OutputPorts(),
532 this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
541 void FileManagerComponentBase ::
544 FW_ASSERT(this->m_cmdRegOut_OutputPort[0].isConnected());
546 this->m_cmdRegOut_OutputPort[0].invoke(
547 this->getIdBase() + OPCODE_CREATEDIRECTORY
550 this->m_cmdRegOut_OutputPort[0].invoke(
551 this->getIdBase() + OPCODE_MOVEFILE
554 this->m_cmdRegOut_OutputPort[0].invoke(
555 this->getIdBase() + OPCODE_REMOVEDIRECTORY
558 this->m_cmdRegOut_OutputPort[0].invoke(
559 this->getIdBase() + OPCODE_REMOVEFILE
562 this->m_cmdRegOut_OutputPort[0].invoke(
563 this->getIdBase() + OPCODE_SHELLCOMMAND
566 this->m_cmdRegOut_OutputPort[0].invoke(
567 this->getIdBase() + OPCODE_APPENDFILE
570 this->m_cmdRegOut_OutputPort[0].invoke(
571 this->getIdBase() + OPCODE_FILESIZE
579 FileManagerComponentBase ::
580 FileManagerComponentBase(
const char* compName) :
581 Fw::ActiveComponentBase(compName)
586 FileManagerComponentBase ::
587 ~FileManagerComponentBase()
597 getNum_cmdIn_InputPorts()
const
607 getNum_pingIn_InputPorts()
const
616#if FW_ENABLE_TEXT_LOGGING == 1
619 getNum_LogText_OutputPorts()
const
627 getNum_cmdRegOut_OutputPorts()
const
633 getNum_cmdResponseOut_OutputPorts()
const
639 getNum_eventOut_OutputPorts()
const
645 getNum_timeCaller_OutputPorts()
const
651 getNum_tlmOut_OutputPorts()
const
661 getNum_pingOut_OutputPorts()
const
670#if FW_ENABLE_TEXT_LOGGING == 1
672 bool FileManagerComponentBase ::
673 isConnected_LogText_OutputPort(
FwIndexType portNum)
676 portNum < this->getNum_LogText_OutputPorts(),
680 return this->m_LogText_OutputPort[portNum].isConnected();
685 bool FileManagerComponentBase ::
686 isConnected_cmdRegOut_OutputPort(
FwIndexType portNum)
689 portNum < this->getNum_cmdRegOut_OutputPorts(),
693 return this->m_cmdRegOut_OutputPort[portNum].isConnected();
696 bool FileManagerComponentBase ::
697 isConnected_cmdResponseOut_OutputPort(
FwIndexType portNum)
700 portNum < this->getNum_cmdResponseOut_OutputPorts(),
704 return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
707 bool FileManagerComponentBase ::
708 isConnected_eventOut_OutputPort(
FwIndexType portNum)
711 portNum < this->getNum_eventOut_OutputPorts(),
715 return this->m_eventOut_OutputPort[portNum].isConnected();
718 bool FileManagerComponentBase ::
719 isConnected_timeCaller_OutputPort(
FwIndexType portNum)
722 portNum < this->getNum_timeCaller_OutputPorts(),
726 return this->m_timeCaller_OutputPort[portNum].isConnected();
729 bool FileManagerComponentBase ::
733 portNum < this->getNum_tlmOut_OutputPorts(),
737 return this->m_tlmOut_OutputPort[portNum].isConnected();
744 bool FileManagerComponentBase ::
745 isConnected_pingOut_OutputPort(
FwIndexType portNum)
748 portNum < this->getNum_pingOut_OutputPorts(),
752 return this->m_pingOut_OutputPort[portNum].isConnected();
761 void FileManagerComponentBase ::
769 portNum < this->getNum_pingIn_InputPorts(),
778 ComponentIpcSerializableBuffer msg;
782 _status = msg.serialize(
791 _status = msg.serialize(portNum);
798 _status = msg.serialize(key);
822 void FileManagerComponentBase ::
835 void FileManagerComponentBase ::
842 portNum < this->getNum_pingOut_OutputPorts(),
845 this->m_pingOut_OutputPort[portNum].invoke(
854 void FileManagerComponentBase ::
861 FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
862 this->m_cmdResponseOut_OutputPort[0].invoke(opCode, cmdSeq, response);
871 void FileManagerComponentBase ::
872 CreateDirectory_cmdHandlerBase(
879 this->CreateDirectory_preMsgHook(opCode,cmdSeq);
883 ComponentIpcSerializableBuffer msg;
887 _status = msg.serialize(
static_cast<FwEnumStoreType>(CMD_CREATEDIRECTORY));
896 _status = msg.serialize(port);
902 _status = msg.serialize(opCode);
908 _status = msg.serialize(cmdSeq);
914 _status = msg.serialize(args);
930 void FileManagerComponentBase ::
931 MoveFile_cmdHandlerBase(
938 this->MoveFile_preMsgHook(opCode,cmdSeq);
942 ComponentIpcSerializableBuffer msg;
955 _status = msg.serialize(port);
961 _status = msg.serialize(opCode);
967 _status = msg.serialize(cmdSeq);
973 _status = msg.serialize(args);
989 void FileManagerComponentBase ::
990 RemoveDirectory_cmdHandlerBase(
997 this->RemoveDirectory_preMsgHook(opCode,cmdSeq);
1001 ComponentIpcSerializableBuffer msg;
1005 _status = msg.serialize(
static_cast<FwEnumStoreType>(CMD_REMOVEDIRECTORY));
1014 _status = msg.serialize(port);
1020 _status = msg.serialize(opCode);
1026 _status = msg.serialize(cmdSeq);
1032 _status = msg.serialize(args);
1048 void FileManagerComponentBase ::
1049 RemoveFile_cmdHandlerBase(
1056 this->RemoveFile_preMsgHook(opCode,cmdSeq);
1060 ComponentIpcSerializableBuffer msg;
1064 _status = msg.serialize(
static_cast<FwEnumStoreType>(CMD_REMOVEFILE));
1073 _status = msg.serialize(port);
1079 _status = msg.serialize(opCode);
1085 _status = msg.serialize(cmdSeq);
1091 _status = msg.serialize(args);
1107 void FileManagerComponentBase ::
1108 ShellCommand_cmdHandlerBase(
1115 this->ShellCommand_preMsgHook(opCode,cmdSeq);
1119 ComponentIpcSerializableBuffer msg;
1123 _status = msg.serialize(
static_cast<FwEnumStoreType>(CMD_SHELLCOMMAND));
1132 _status = msg.serialize(port);
1138 _status = msg.serialize(opCode);
1144 _status = msg.serialize(cmdSeq);
1150 _status = msg.serialize(args);
1166 void FileManagerComponentBase ::
1167 AppendFile_cmdHandlerBase(
1174 this->AppendFile_preMsgHook(opCode,cmdSeq);
1178 ComponentIpcSerializableBuffer msg;
1182 _status = msg.serialize(
static_cast<FwEnumStoreType>(CMD_APPENDFILE));
1191 _status = msg.serialize(port);
1197 _status = msg.serialize(opCode);
1203 _status = msg.serialize(cmdSeq);
1209 _status = msg.serialize(args);
1225 void FileManagerComponentBase ::
1226 FileSize_cmdHandlerBase(
1233 this->FileSize_preMsgHook(opCode,cmdSeq);
1237 ComponentIpcSerializableBuffer msg;
1250 _status = msg.serialize(port);
1256 _status = msg.serialize(opCode);
1262 _status = msg.serialize(cmdSeq);
1268 _status = msg.serialize(args);
1292 void FileManagerComponentBase ::
1293 CreateDirectory_preMsgHook(
1303 void FileManagerComponentBase ::
1304 MoveFile_preMsgHook(
1314 void FileManagerComponentBase ::
1315 RemoveDirectory_preMsgHook(
1325 void FileManagerComponentBase ::
1326 RemoveFile_preMsgHook(
1336 void FileManagerComponentBase ::
1337 ShellCommand_preMsgHook(
1347 void FileManagerComponentBase ::
1348 AppendFile_preMsgHook(
1358 void FileManagerComponentBase ::
1359 FileSize_preMsgHook(
1373 void FileManagerComponentBase ::
1374 log_WARNING_HI_DirectoryCreateError(
1381 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1382 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1387 _id = this->getIdBase() + EVENTID_DIRECTORYCREATEERROR;
1390 if (this->m_eventOut_OutputPort[0].isConnected()) {
1394#if FW_AMPCS_COMPATIBLE
1409#if FW_AMPCS_COMPATIBLE
1412 static_cast<U8>(
sizeof(U32))
1425 this->m_eventOut_OutputPort[0].invoke(
1434#if FW_ENABLE_TEXT_LOGGING
1435 if (this->m_LogText_OutputPort[0].isConnected()) {
1436#if FW_OBJECT_NAMES == 1
1437 const char* _formatString =
1438 "(%s) %s: Could not create directory %s, returned status %" PRIu32
"";
1440 const char* _formatString =
1441 "%s: Could not create directory %s, returned status %" PRIu32
"";
1448 this->m_objName.toChar(),
1450 "DirectoryCreateError ",
1455 this->m_LogText_OutputPort[0].invoke(
1465 void FileManagerComponentBase ::
1466 log_WARNING_HI_DirectoryRemoveError(
1473 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1474 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1479 _id = this->getIdBase() + EVENTID_DIRECTORYREMOVEERROR;
1482 if (this->m_eventOut_OutputPort[0].isConnected()) {
1486#if FW_AMPCS_COMPATIBLE
1501#if FW_AMPCS_COMPATIBLE
1504 static_cast<U8>(
sizeof(U32))
1517 this->m_eventOut_OutputPort[0].invoke(
1526#if FW_ENABLE_TEXT_LOGGING
1527 if (this->m_LogText_OutputPort[0].isConnected()) {
1528#if FW_OBJECT_NAMES == 1
1529 const char* _formatString =
1530 "(%s) %s: Could not remove directory %s, returned status %" PRIu32
"";
1532 const char* _formatString =
1533 "%s: Could not remove directory %s, returned status %" PRIu32
"";
1540 this->m_objName.toChar(),
1542 "DirectoryRemoveError ",
1547 this->m_LogText_OutputPort[0].invoke(
1557 void FileManagerComponentBase ::
1558 log_WARNING_HI_FileMoveError(
1566 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1567 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1572 _id = this->getIdBase() + EVENTID_FILEMOVEERROR;
1575 if (this->m_eventOut_OutputPort[0].isConnected()) {
1579#if FW_AMPCS_COMPATIBLE
1600#if FW_AMPCS_COMPATIBLE
1603 static_cast<U8>(
sizeof(U32))
1616 this->m_eventOut_OutputPort[0].invoke(
1625#if FW_ENABLE_TEXT_LOGGING
1626 if (this->m_LogText_OutputPort[0].isConnected()) {
1627#if FW_OBJECT_NAMES == 1
1628 const char* _formatString =
1629 "(%s) %s: Could not move file %s to file %s, returned status %" PRIu32
"";
1631 const char* _formatString =
1632 "%s: Could not move file %s to file %s, returned status %" PRIu32
"";
1639 this->m_objName.toChar(),
1647 this->m_LogText_OutputPort[0].invoke(
1657 void FileManagerComponentBase ::
1658 log_WARNING_HI_FileRemoveError(
1665 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1666 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1671 _id = this->getIdBase() + EVENTID_FILEREMOVEERROR;
1674 if (this->m_eventOut_OutputPort[0].isConnected()) {
1678#if FW_AMPCS_COMPATIBLE
1693#if FW_AMPCS_COMPATIBLE
1696 static_cast<U8>(
sizeof(U32))
1709 this->m_eventOut_OutputPort[0].invoke(
1718#if FW_ENABLE_TEXT_LOGGING
1719 if (this->m_LogText_OutputPort[0].isConnected()) {
1720#if FW_OBJECT_NAMES == 1
1721 const char* _formatString =
1722 "(%s) %s: Could not remove file %s, returned status %" PRIu32
"";
1724 const char* _formatString =
1725 "%s: Could not remove file %s, returned status %" PRIu32
"";
1732 this->m_objName.toChar(),
1739 this->m_LogText_OutputPort[0].invoke(
1749 void FileManagerComponentBase ::
1750 log_WARNING_HI_ShellCommandFailed(
1757 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1758 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1763 _id = this->getIdBase() + EVENTID_SHELLCOMMANDFAILED;
1766 if (this->m_eventOut_OutputPort[0].isConnected()) {
1770#if FW_AMPCS_COMPATIBLE
1785#if FW_AMPCS_COMPATIBLE
1788 static_cast<U8>(
sizeof(U32))
1801 this->m_eventOut_OutputPort[0].invoke(
1810#if FW_ENABLE_TEXT_LOGGING
1811 if (this->m_LogText_OutputPort[0].isConnected()) {
1812#if FW_OBJECT_NAMES == 1
1813 const char* _formatString =
1814 "(%s) %s: Shell command %s failed with status %" PRIu32
"";
1816 const char* _formatString =
1817 "%s: Shell command %s failed with status %" PRIu32
"";
1824 this->m_objName.toChar(),
1826 "ShellCommandFailed ",
1831 this->m_LogText_OutputPort[0].invoke(
1841 void FileManagerComponentBase ::
1842 log_WARNING_HI_AppendFileFailed(
1850 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1851 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1856 _id = this->getIdBase() + EVENTID_APPENDFILEFAILED;
1859 if (this->m_eventOut_OutputPort[0].isConnected()) {
1863#if FW_AMPCS_COMPATIBLE
1884#if FW_AMPCS_COMPATIBLE
1887 static_cast<U8>(
sizeof(U32))
1900 this->m_eventOut_OutputPort[0].invoke(
1909#if FW_ENABLE_TEXT_LOGGING
1910 if (this->m_LogText_OutputPort[0].isConnected()) {
1911#if FW_OBJECT_NAMES == 1
1912 const char* _formatString =
1913 "(%s) %s: Appending %s onto %s failed with status %" PRIu32
"";
1915 const char* _formatString =
1916 "%s: Appending %s onto %s failed with status %" PRIu32
"";
1923 this->m_objName.toChar(),
1925 "AppendFileFailed ",
1931 this->m_LogText_OutputPort[0].invoke(
1941 void FileManagerComponentBase ::
1942 log_ACTIVITY_HI_AppendFileSucceeded(
1949 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1950 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1955 _id = this->getIdBase() + EVENTID_APPENDFILESUCCEEDED;
1958 if (this->m_eventOut_OutputPort[0].isConnected()) {
1962#if FW_AMPCS_COMPATIBLE
1983 this->m_eventOut_OutputPort[0].invoke(
1992#if FW_ENABLE_TEXT_LOGGING
1993 if (this->m_LogText_OutputPort[0].isConnected()) {
1994#if FW_OBJECT_NAMES == 1
1995 const char* _formatString =
1996 "(%s) %s: Appended %s to the end of %s";
1998 const char* _formatString =
1999 "%s: Appended %s to the end of %s";
2006 this->m_objName.toChar(),
2008 "AppendFileSucceeded ",
2013 this->m_LogText_OutputPort[0].invoke(
2023 void FileManagerComponentBase ::
2024 log_ACTIVITY_HI_ShellCommandSucceeded(
const Fw::StringBase& command)
const
2028 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2029 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2034 _id = this->getIdBase() + EVENTID_SHELLCOMMANDSUCCEEDED;
2037 if (this->m_eventOut_OutputPort[0].isConnected()) {
2041#if FW_AMPCS_COMPATIBLE
2056 this->m_eventOut_OutputPort[0].invoke(
2065#if FW_ENABLE_TEXT_LOGGING
2066 if (this->m_LogText_OutputPort[0].isConnected()) {
2067#if FW_OBJECT_NAMES == 1
2068 const char* _formatString =
2069 "(%s) %s: Shell command %s succeeded";
2071 const char* _formatString =
2072 "%s: Shell command %s succeeded";
2079 this->m_objName.toChar(),
2081 "ShellCommandSucceeded ",
2085 this->m_LogText_OutputPort[0].invoke(
2095 void FileManagerComponentBase ::
2096 log_ACTIVITY_HI_CreateDirectorySucceeded(
const Fw::StringBase& dirName)
const
2100 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2101 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2106 _id = this->getIdBase() + EVENTID_CREATEDIRECTORYSUCCEEDED;
2109 if (this->m_eventOut_OutputPort[0].isConnected()) {
2113#if FW_AMPCS_COMPATIBLE
2128 this->m_eventOut_OutputPort[0].invoke(
2137#if FW_ENABLE_TEXT_LOGGING
2138 if (this->m_LogText_OutputPort[0].isConnected()) {
2139#if FW_OBJECT_NAMES == 1
2140 const char* _formatString =
2141 "(%s) %s: Created directory %s successfully";
2143 const char* _formatString =
2144 "%s: Created directory %s successfully";
2151 this->m_objName.toChar(),
2153 "CreateDirectorySucceeded ",
2157 this->m_LogText_OutputPort[0].invoke(
2167 void FileManagerComponentBase ::
2168 log_ACTIVITY_HI_RemoveDirectorySucceeded(
const Fw::StringBase& dirName)
const
2172 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2173 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2178 _id = this->getIdBase() + EVENTID_REMOVEDIRECTORYSUCCEEDED;
2181 if (this->m_eventOut_OutputPort[0].isConnected()) {
2185#if FW_AMPCS_COMPATIBLE
2200 this->m_eventOut_OutputPort[0].invoke(
2209#if FW_ENABLE_TEXT_LOGGING
2210 if (this->m_LogText_OutputPort[0].isConnected()) {
2211#if FW_OBJECT_NAMES == 1
2212 const char* _formatString =
2213 "(%s) %s: Removed directory %s successfully";
2215 const char* _formatString =
2216 "%s: Removed directory %s successfully";
2223 this->m_objName.toChar(),
2225 "RemoveDirectorySucceeded ",
2229 this->m_LogText_OutputPort[0].invoke(
2239 void FileManagerComponentBase ::
2240 log_ACTIVITY_HI_MoveFileSucceeded(
2247 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2248 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2253 _id = this->getIdBase() + EVENTID_MOVEFILESUCCEEDED;
2256 if (this->m_eventOut_OutputPort[0].isConnected()) {
2260#if FW_AMPCS_COMPATIBLE
2281 this->m_eventOut_OutputPort[0].invoke(
2290#if FW_ENABLE_TEXT_LOGGING
2291 if (this->m_LogText_OutputPort[0].isConnected()) {
2292#if FW_OBJECT_NAMES == 1
2293 const char* _formatString =
2294 "(%s) %s: Moved file %s to file %s successfully";
2296 const char* _formatString =
2297 "%s: Moved file %s to file %s successfully";
2304 this->m_objName.toChar(),
2306 "MoveFileSucceeded ",
2311 this->m_LogText_OutputPort[0].invoke(
2321 void FileManagerComponentBase ::
2322 log_ACTIVITY_HI_RemoveFileSucceeded(
const Fw::StringBase& fileName)
const
2326 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2327 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2332 _id = this->getIdBase() + EVENTID_REMOVEFILESUCCEEDED;
2335 if (this->m_eventOut_OutputPort[0].isConnected()) {
2339#if FW_AMPCS_COMPATIBLE
2354 this->m_eventOut_OutputPort[0].invoke(
2363#if FW_ENABLE_TEXT_LOGGING
2364 if (this->m_LogText_OutputPort[0].isConnected()) {
2365#if FW_OBJECT_NAMES == 1
2366 const char* _formatString =
2367 "(%s) %s: Removed file %s successfully";
2369 const char* _formatString =
2370 "%s: Removed file %s successfully";
2377 this->m_objName.toChar(),
2379 "RemoveFileSucceeded ",
2383 this->m_LogText_OutputPort[0].invoke(
2393 void FileManagerComponentBase ::
2394 log_ACTIVITY_HI_AppendFileStarted(
2401 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2402 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2407 _id = this->getIdBase() + EVENTID_APPENDFILESTARTED;
2410 if (this->m_eventOut_OutputPort[0].isConnected()) {
2414#if FW_AMPCS_COMPATIBLE
2435 this->m_eventOut_OutputPort[0].invoke(
2444#if FW_ENABLE_TEXT_LOGGING
2445 if (this->m_LogText_OutputPort[0].isConnected()) {
2446#if FW_OBJECT_NAMES == 1
2447 const char* _formatString =
2448 "(%s) %s: Appending file %s to the end of %s...";
2450 const char* _formatString =
2451 "%s: Appending file %s to the end of %s...";
2458 this->m_objName.toChar(),
2460 "AppendFileStarted ",
2465 this->m_LogText_OutputPort[0].invoke(
2475 void FileManagerComponentBase ::
2476 log_ACTIVITY_HI_ShellCommandStarted(
const Fw::StringBase& command)
const
2480 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2481 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2486 _id = this->getIdBase() + EVENTID_SHELLCOMMANDSTARTED;
2489 if (this->m_eventOut_OutputPort[0].isConnected()) {
2493#if FW_AMPCS_COMPATIBLE
2508 this->m_eventOut_OutputPort[0].invoke(
2517#if FW_ENABLE_TEXT_LOGGING
2518 if (this->m_LogText_OutputPort[0].isConnected()) {
2519#if FW_OBJECT_NAMES == 1
2520 const char* _formatString =
2521 "(%s) %s: Running shell command %s...";
2523 const char* _formatString =
2524 "%s: Running shell command %s...";
2531 this->m_objName.toChar(),
2533 "ShellCommandStarted ",
2537 this->m_LogText_OutputPort[0].invoke(
2547 void FileManagerComponentBase ::
2548 log_ACTIVITY_HI_CreateDirectoryStarted(
const Fw::StringBase& dirName)
const
2552 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2553 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2558 _id = this->getIdBase() + EVENTID_CREATEDIRECTORYSTARTED;
2561 if (this->m_eventOut_OutputPort[0].isConnected()) {
2565#if FW_AMPCS_COMPATIBLE
2580 this->m_eventOut_OutputPort[0].invoke(
2589#if FW_ENABLE_TEXT_LOGGING
2590 if (this->m_LogText_OutputPort[0].isConnected()) {
2591#if FW_OBJECT_NAMES == 1
2592 const char* _formatString =
2593 "(%s) %s: Creating directory %s...";
2595 const char* _formatString =
2596 "%s: Creating directory %s...";
2603 this->m_objName.toChar(),
2605 "CreateDirectoryStarted ",
2609 this->m_LogText_OutputPort[0].invoke(
2619 void FileManagerComponentBase ::
2620 log_ACTIVITY_HI_RemoveDirectoryStarted(
const Fw::StringBase& dirName)
const
2624 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2625 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2630 _id = this->getIdBase() + EVENTID_REMOVEDIRECTORYSTARTED;
2633 if (this->m_eventOut_OutputPort[0].isConnected()) {
2637#if FW_AMPCS_COMPATIBLE
2652 this->m_eventOut_OutputPort[0].invoke(
2661#if FW_ENABLE_TEXT_LOGGING
2662 if (this->m_LogText_OutputPort[0].isConnected()) {
2663#if FW_OBJECT_NAMES == 1
2664 const char* _formatString =
2665 "(%s) %s: Removing directory %s...";
2667 const char* _formatString =
2668 "%s: Removing directory %s...";
2675 this->m_objName.toChar(),
2677 "RemoveDirectoryStarted ",
2681 this->m_LogText_OutputPort[0].invoke(
2691 void FileManagerComponentBase ::
2692 log_ACTIVITY_HI_MoveFileStarted(
2699 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2700 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2705 _id = this->getIdBase() + EVENTID_MOVEFILESTARTED;
2708 if (this->m_eventOut_OutputPort[0].isConnected()) {
2712#if FW_AMPCS_COMPATIBLE
2733 this->m_eventOut_OutputPort[0].invoke(
2742#if FW_ENABLE_TEXT_LOGGING
2743 if (this->m_LogText_OutputPort[0].isConnected()) {
2744#if FW_OBJECT_NAMES == 1
2745 const char* _formatString =
2746 "(%s) %s: Moving file %s to file %s...";
2748 const char* _formatString =
2749 "%s: Moving file %s to file %s...";
2756 this->m_objName.toChar(),
2763 this->m_LogText_OutputPort[0].invoke(
2773 void FileManagerComponentBase ::
2774 log_ACTIVITY_HI_RemoveFileStarted(
const Fw::StringBase& fileName)
const
2778 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2779 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2784 _id = this->getIdBase() + EVENTID_REMOVEFILESTARTED;
2787 if (this->m_eventOut_OutputPort[0].isConnected()) {
2791#if FW_AMPCS_COMPATIBLE
2806 this->m_eventOut_OutputPort[0].invoke(
2815#if FW_ENABLE_TEXT_LOGGING
2816 if (this->m_LogText_OutputPort[0].isConnected()) {
2817#if FW_OBJECT_NAMES == 1
2818 const char* _formatString =
2819 "(%s) %s: Removing file %s...";
2821 const char* _formatString =
2822 "%s: Removing file %s...";
2829 this->m_objName.toChar(),
2831 "RemoveFileStarted ",
2835 this->m_LogText_OutputPort[0].invoke(
2845 void FileManagerComponentBase ::
2846 log_ACTIVITY_HI_FileSizeSucceeded(
2853 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2854 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2859 _id = this->getIdBase() + EVENTID_FILESIZESUCCEEDED;
2862 if (this->m_eventOut_OutputPort[0].isConnected()) {
2866#if FW_AMPCS_COMPATIBLE
2881#if FW_AMPCS_COMPATIBLE
2884 static_cast<U8>(
sizeof(
U64))
2897 this->m_eventOut_OutputPort[0].invoke(
2906#if FW_ENABLE_TEXT_LOGGING
2907 if (this->m_LogText_OutputPort[0].isConnected()) {
2908#if FW_OBJECT_NAMES == 1
2909 const char* _formatString =
2910 "(%s) %s: The size of file %s is %" PRIu64
" B";
2912 const char* _formatString =
2913 "%s: The size of file %s is %" PRIu64
" B";
2920 this->m_objName.toChar(),
2922 "FileSizeSucceeded ",
2927 this->m_LogText_OutputPort[0].invoke(
2937 void FileManagerComponentBase ::
2938 log_WARNING_HI_FileSizeError(
2945 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2946 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2951 _id = this->getIdBase() + EVENTID_FILESIZEERROR;
2954 if (this->m_eventOut_OutputPort[0].isConnected()) {
2958#if FW_AMPCS_COMPATIBLE
2973#if FW_AMPCS_COMPATIBLE
2976 static_cast<U8>(
sizeof(U32))
2989 this->m_eventOut_OutputPort[0].invoke(
2998#if FW_ENABLE_TEXT_LOGGING
2999 if (this->m_LogText_OutputPort[0].isConnected()) {
3000#if FW_OBJECT_NAMES == 1
3001 const char* _formatString =
3002 "(%s) %s: Failed to get the size of file %s, returned status %" PRIu32
"";
3004 const char* _formatString =
3005 "%s: Failed to get the size of file %s, returned status %" PRIu32
"";
3012 this->m_objName.toChar(),
3019 this->m_LogText_OutputPort[0].invoke(
3029 void FileManagerComponentBase ::
3030 log_ACTIVITY_HI_FileSizeStarted(
const Fw::StringBase& fileName)
const
3034 if (this->m_timeCaller_OutputPort[0].isConnected()) {
3035 this->m_timeCaller_OutputPort[0].invoke(_logTime);
3040 _id = this->getIdBase() + EVENTID_FILESIZESTARTED;
3043 if (this->m_eventOut_OutputPort[0].isConnected()) {
3047#if FW_AMPCS_COMPATIBLE
3062 this->m_eventOut_OutputPort[0].invoke(
3071#if FW_ENABLE_TEXT_LOGGING
3072 if (this->m_LogText_OutputPort[0].isConnected()) {
3073#if FW_OBJECT_NAMES == 1
3074 const char* _formatString =
3075 "(%s) %s: Checking size of file %s...";
3077 const char* _formatString =
3078 "%s: Checking size of file %s...";
3085 this->m_objName.toChar(),
3091 this->m_LogText_OutputPort[0].invoke(
3105 void FileManagerComponentBase ::
3106 tlmWrite_CommandsExecuted(
3111 if (this->m_tlmOut_OutputPort[0].isConnected()) {
3113 this->m_timeCaller_OutputPort[0].isConnected() &&
3116 this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
3128 _id = this->getIdBase() + CHANNELID_COMMANDSEXECUTED;
3130 this->m_tlmOut_OutputPort[0].invoke(
3138 void FileManagerComponentBase ::
3144 if (this->m_tlmOut_OutputPort[0].isConnected()) {
3146 this->m_timeCaller_OutputPort[0].isConnected() &&
3149 this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
3161 _id = this->getIdBase() + CHANNELID_ERRORS;
3163 this->m_tlmOut_OutputPort[0].invoke(
3178 if (this->m_timeCaller_OutputPort[0].isConnected()) {
3180 this->m_timeCaller_OutputPort[0].invoke(_time);
3195 ComponentIpcSerializableBuffer msg;
3218 MsgTypeEnum msgType =
static_cast<MsgTypeEnum
>(desMsg);
3220 if (msgType == FILEMANAGER_COMPONENT_EXIT) {
3221 return MSG_DISPATCH_EXIT;
3225 deserStatus = msg.deserialize(portNum);
3236 deserStatus = msg.deserialize(key);
3242 this->pingIn_handler(
3251 case CMD_CREATEDIRECTORY: {
3254 deserStatus = msg.deserialize(opCode);
3262 deserStatus = msg.deserialize(cmdSeq);
3270 deserStatus = msg.deserialize(args);
3283 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3284 this->cmdResponse_out(
3296#if FW_CMD_CHECK_RESIDUAL
3298 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3307 this->CreateDirectory_cmdHandler(
3316 case CMD_MOVEFILE: {
3319 deserStatus = msg.deserialize(opCode);
3327 deserStatus = msg.deserialize(cmdSeq);
3335 deserStatus = msg.deserialize(args);
3348 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3349 this->cmdResponse_out(
3363 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3364 this->cmdResponse_out(
3376#if FW_CMD_CHECK_RESIDUAL
3378 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3387 this->MoveFile_cmdHandler(
3397 case CMD_REMOVEDIRECTORY: {
3400 deserStatus = msg.deserialize(opCode);
3408 deserStatus = msg.deserialize(cmdSeq);
3416 deserStatus = msg.deserialize(args);
3429 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3430 this->cmdResponse_out(
3442#if FW_CMD_CHECK_RESIDUAL
3444 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3453 this->RemoveDirectory_cmdHandler(
3462 case CMD_REMOVEFILE: {
3465 deserStatus = msg.deserialize(opCode);
3473 deserStatus = msg.deserialize(cmdSeq);
3481 deserStatus = msg.deserialize(args);
3494 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3495 this->cmdResponse_out(
3509 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3510 this->cmdResponse_out(
3522#if FW_CMD_CHECK_RESIDUAL
3524 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3533 this->RemoveFile_cmdHandler(
3543 case CMD_SHELLCOMMAND: {
3546 deserStatus = msg.deserialize(opCode);
3554 deserStatus = msg.deserialize(cmdSeq);
3562 deserStatus = msg.deserialize(args);
3575 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3576 this->cmdResponse_out(
3590 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3591 this->cmdResponse_out(
3603#if FW_CMD_CHECK_RESIDUAL
3605 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3614 this->ShellCommand_cmdHandler(
3624 case CMD_APPENDFILE: {
3627 deserStatus = msg.deserialize(opCode);
3635 deserStatus = msg.deserialize(cmdSeq);
3643 deserStatus = msg.deserialize(args);
3656 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3657 this->cmdResponse_out(
3671 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3672 this->cmdResponse_out(
3684#if FW_CMD_CHECK_RESIDUAL
3686 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3695 this->AppendFile_cmdHandler(
3705 case CMD_FILESIZE: {
3708 deserStatus = msg.deserialize(opCode);
3716 deserStatus = msg.deserialize(cmdSeq);
3724 deserStatus = msg.deserialize(args);
3737 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3738 this->cmdResponse_out(
3750#if FW_CMD_CHECK_RESIDUAL
3752 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3761 this->FileSize_cmdHandler(
3770 return MSG_DISPATCH_ERROR;
3773 return MSG_DISPATCH_OK;
3780 void FileManagerComponentBase ::
3790 FileManagerComponentBase* compPtr =
static_cast<FileManagerComponentBase*
>(callComp);
3792 const U32 idBase = callComp->
getIdBase();
3796 switch (opCode - idBase) {
3797 case OPCODE_CREATEDIRECTORY: {
3798 compPtr->CreateDirectory_cmdHandlerBase(
3806 case OPCODE_MOVEFILE: {
3807 compPtr->MoveFile_cmdHandlerBase(
3815 case OPCODE_REMOVEDIRECTORY: {
3816 compPtr->RemoveDirectory_cmdHandlerBase(
3824 case OPCODE_REMOVEFILE: {
3825 compPtr->RemoveFile_cmdHandlerBase(
3833 case OPCODE_SHELLCOMMAND: {
3834 compPtr->ShellCommand_cmdHandlerBase(
3842 case OPCODE_APPENDFILE: {
3843 compPtr->AppendFile_cmdHandlerBase(
3851 case OPCODE_FILESIZE: {
3852 compPtr->FileSize_cmdHandlerBase(
3866 void FileManagerComponentBase ::
3874 FileManagerComponentBase* compPtr =
static_cast<FileManagerComponentBase*
>(callComp);
3875 compPtr->pingIn_handlerBase(
#define FW_MIN(a, b)
MIN macro.
uint8_t U8
8-bit unsigned integer
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
#define PRI_PlatformIntType
@ TB_NONE
No time base has been established.
PlatformAssertArgType FwAssertArgType
PlatformSizeType FwSizeType
#define FW_LOG_STRING_MAX_SIZE
Max size of log string parameter type.
PlatformQueuePriorityType FwQueuePriorityType
PlatformIndexType FwIndexType
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects)/*#en...
@ 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.
void init()
Object initializer.
const char * toChar() const
NATIVE_UINT_TYPE SizeType
void resetDeser()
reset deserialization to beginning
Serializable::SizeType getBuffLeft() const
returns how much deserialization buffer is left
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
void format(const CHAR *formatString,...)
write formatted string to buffer
virtual SerializeStatus serialize(SerializeBufferBase &buffer) const
serialization function
virtual const CHAR * toChar() const =0
@ BLOCKING
Message will block until space is available.
@ NONBLOCKING
Message will return with status when space is unavailable.
Status
status returned from the queue send function
@ OP_OK
message sent/received okay
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.