11#if FW_ENABLE_TEXT_LOGGING
38 class ComponentIpcSerializableBuffer :
53 return sizeof(m_buff);
60 const U8* getBuffAddr()
const {
66 U8 m_buff[SERIALIZATION_SIZE];
75 void FileManagerComponentBase ::
87 port < static_cast<PlatformIntType>(this->getNum_cmdIn_InputPorts());
90 this->m_cmdIn_InputPort[port].init();
91 this->m_cmdIn_InputPort[port].addCallComp(
95 this->m_cmdIn_InputPort[port].setPortNum(port);
97#if FW_OBJECT_NAMES == 1
106 this->m_cmdIn_InputPort[port].setObjName(portName);
113 port < static_cast<PlatformIntType>(this->getNum_pingIn_InputPorts());
116 this->m_pingIn_InputPort[port].init();
117 this->m_pingIn_InputPort[port].addCallComp(
121 this->m_pingIn_InputPort[port].setPortNum(port);
123#if FW_OBJECT_NAMES == 1
132 this->m_pingIn_InputPort[port].setObjName(portName);
136#if FW_ENABLE_TEXT_LOGGING == 1
140 port < static_cast<PlatformIntType>(this->getNum_LogText_OutputPorts());
143 this->m_LogText_OutputPort[port].init();
145#if FW_OBJECT_NAMES == 1
154 this->m_LogText_OutputPort[port].setObjName(portName);
162 port < static_cast<PlatformIntType>(this->getNum_cmdRegOut_OutputPorts());
165 this->m_cmdRegOut_OutputPort[port].init();
167#if FW_OBJECT_NAMES == 1
176 this->m_cmdRegOut_OutputPort[port].setObjName(portName);
183 port < static_cast<PlatformIntType>(this->getNum_cmdResponseOut_OutputPorts());
186 this->m_cmdResponseOut_OutputPort[port].init();
188#if FW_OBJECT_NAMES == 1
197 this->m_cmdResponseOut_OutputPort[port].setObjName(portName);
204 port < static_cast<PlatformIntType>(this->getNum_eventOut_OutputPorts());
207 this->m_eventOut_OutputPort[port].init();
209#if FW_OBJECT_NAMES == 1
218 this->m_eventOut_OutputPort[port].setObjName(portName);
225 port < static_cast<PlatformIntType>(this->getNum_timeCaller_OutputPorts());
228 this->m_timeCaller_OutputPort[port].init();
230#if FW_OBJECT_NAMES == 1
239 this->m_timeCaller_OutputPort[port].setObjName(portName);
246 port < static_cast<PlatformIntType>(this->getNum_tlmOut_OutputPorts());
249 this->m_tlmOut_OutputPort[port].init();
251#if FW_OBJECT_NAMES == 1
260 this->m_tlmOut_OutputPort[port].setObjName(portName);
267 port < static_cast<PlatformIntType>(this->getNum_pingOut_OutputPorts());
270 this->m_pingOut_OutputPort[port].init();
272#if FW_OBJECT_NAMES == 1
281 this->m_pingOut_OutputPort[port].setObjName(portName);
287 ComponentIpcSerializableBuffer::SERIALIZATION_SIZE
75 void FileManagerComponentBase :: {
…}
303 portNum < this->getNum_cmdIn_InputPorts(),
307 return &this->m_cmdIn_InputPort[portNum];
318 portNum < this->getNum_pingIn_InputPorts(),
322 return &this->m_pingIn_InputPort[portNum];
329#if FW_ENABLE_TEXT_LOGGING == 1
331 void FileManagerComponentBase ::
332 set_LogText_OutputPort(
338 portNum < this->getNum_LogText_OutputPorts(),
342 this->m_LogText_OutputPort[portNum].addCallPort(port);
347 void FileManagerComponentBase ::
348 set_cmdRegOut_OutputPort(
354 portNum < this->getNum_cmdRegOut_OutputPorts(),
358 this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
347 void FileManagerComponentBase :: {
…}
361 void FileManagerComponentBase ::
362 set_cmdResponseOut_OutputPort(
368 portNum < this->getNum_cmdResponseOut_OutputPorts(),
372 this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
361 void FileManagerComponentBase :: {
…}
375 void FileManagerComponentBase ::
376 set_eventOut_OutputPort(
382 portNum < this->getNum_eventOut_OutputPorts(),
386 this->m_eventOut_OutputPort[portNum].addCallPort(port);
375 void FileManagerComponentBase :: {
…}
389 void FileManagerComponentBase ::
390 set_timeCaller_OutputPort(
396 portNum < this->getNum_timeCaller_OutputPorts(),
400 this->m_timeCaller_OutputPort[portNum].addCallPort(port);
389 void FileManagerComponentBase :: {
…}
403 void FileManagerComponentBase ::
404 set_tlmOut_OutputPort(
410 portNum < this->getNum_tlmOut_OutputPorts(),
414 this->m_tlmOut_OutputPort[portNum].addCallPort(port);
403 void FileManagerComponentBase :: {
…}
421 void FileManagerComponentBase ::
422 set_pingOut_OutputPort(
428 portNum < this->getNum_pingOut_OutputPorts(),
432 this->m_pingOut_OutputPort[portNum].addCallPort(port);
421 void FileManagerComponentBase :: {
…}
435#if FW_PORT_SERIALIZATION
441#if FW_ENABLE_TEXT_LOGGING == 1
443 void FileManagerComponentBase ::
444 set_LogText_OutputPort(
446 Fw::InputSerializePort* port
450 portNum < this->getNum_LogText_OutputPorts(),
454 this->m_LogText_OutputPort[portNum].registerSerialPort(port);
459 void FileManagerComponentBase ::
460 set_cmdRegOut_OutputPort(
462 Fw::InputSerializePort* port
466 portNum < this->getNum_cmdRegOut_OutputPorts(),
470 this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
473 void FileManagerComponentBase ::
474 set_cmdResponseOut_OutputPort(
476 Fw::InputSerializePort* port
480 portNum < this->getNum_cmdResponseOut_OutputPorts(),
484 this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
487 void FileManagerComponentBase ::
488 set_eventOut_OutputPort(
490 Fw::InputSerializePort* port
494 portNum < this->getNum_eventOut_OutputPorts(),
498 this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
501 void FileManagerComponentBase ::
502 set_timeCaller_OutputPort(
504 Fw::InputSerializePort* port
508 portNum < this->getNum_timeCaller_OutputPorts(),
512 this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
515 void FileManagerComponentBase ::
516 set_tlmOut_OutputPort(
518 Fw::InputSerializePort* port
522 portNum < this->getNum_tlmOut_OutputPorts(),
526 this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
531#if FW_PORT_SERIALIZATION
537 void FileManagerComponentBase ::
538 set_pingOut_OutputPort(
540 Fw::InputSerializePort* port
544 portNum < this->getNum_pingOut_OutputPorts(),
548 this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
557 void FileManagerComponentBase ::
560 FW_ASSERT(this->m_cmdRegOut_OutputPort[0].isConnected());
562 this->m_cmdRegOut_OutputPort[0].invoke(
563 this->getIdBase() + OPCODE_CREATEDIRECTORY
566 this->m_cmdRegOut_OutputPort[0].invoke(
567 this->getIdBase() + OPCODE_MOVEFILE
570 this->m_cmdRegOut_OutputPort[0].invoke(
571 this->getIdBase() + OPCODE_REMOVEDIRECTORY
574 this->m_cmdRegOut_OutputPort[0].invoke(
575 this->getIdBase() + OPCODE_REMOVEFILE
578 this->m_cmdRegOut_OutputPort[0].invoke(
579 this->getIdBase() + OPCODE_SHELLCOMMAND
582 this->m_cmdRegOut_OutputPort[0].invoke(
583 this->getIdBase() + OPCODE_APPENDFILE
586 this->m_cmdRegOut_OutputPort[0].invoke(
587 this->getIdBase() + OPCODE_FILESIZE
557 void FileManagerComponentBase :: {
…}
595 FileManagerComponentBase ::
596 FileManagerComponentBase(
const char* compName) :
597 Fw::ActiveComponentBase(compName)
595 FileManagerComponentBase :: {
…}
602 FileManagerComponentBase ::
603 ~FileManagerComponentBase()
602 FileManagerComponentBase :: {
…}
613 getNum_cmdIn_InputPorts()
623 getNum_pingIn_InputPorts()
632#if FW_ENABLE_TEXT_LOGGING == 1
635 getNum_LogText_OutputPorts()
643 getNum_cmdRegOut_OutputPorts()
649 getNum_cmdResponseOut_OutputPorts()
655 getNum_eventOut_OutputPorts()
661 getNum_timeCaller_OutputPorts()
667 getNum_tlmOut_OutputPorts()
677 getNum_pingOut_OutputPorts()
686#if FW_ENABLE_TEXT_LOGGING == 1
688 bool FileManagerComponentBase ::
692 portNum < this->getNum_LogText_OutputPorts(),
696 return this->m_LogText_OutputPort[portNum].isConnected();
701 bool FileManagerComponentBase ::
705 portNum < this->getNum_cmdRegOut_OutputPorts(),
709 return this->m_cmdRegOut_OutputPort[portNum].isConnected();
701 bool FileManagerComponentBase :: {
…}
712 bool FileManagerComponentBase ::
716 portNum < this->getNum_cmdResponseOut_OutputPorts(),
720 return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
712 bool FileManagerComponentBase :: {
…}
723 bool FileManagerComponentBase ::
727 portNum < this->getNum_eventOut_OutputPorts(),
731 return this->m_eventOut_OutputPort[portNum].isConnected();
723 bool FileManagerComponentBase :: {
…}
734 bool FileManagerComponentBase ::
738 portNum < this->getNum_timeCaller_OutputPorts(),
742 return this->m_timeCaller_OutputPort[portNum].isConnected();
734 bool FileManagerComponentBase :: {
…}
745 bool FileManagerComponentBase ::
749 portNum < this->getNum_tlmOut_OutputPorts(),
753 return this->m_tlmOut_OutputPort[portNum].isConnected();
745 bool FileManagerComponentBase :: {
…}
760 bool FileManagerComponentBase ::
764 portNum < this->getNum_pingOut_OutputPorts(),
768 return this->m_pingOut_OutputPort[portNum].isConnected();
760 bool FileManagerComponentBase :: {
…}
777 void FileManagerComponentBase ::
785 portNum < this->getNum_pingIn_InputPorts(),
794 ComponentIpcSerializableBuffer msg;
798 _status = msg.serialize(
807 _status = msg.serialize(portNum);
814 _status = msg.serialize(key);
777 void FileManagerComponentBase :: {
…}
838 void FileManagerComponentBase ::
838 void FileManagerComponentBase :: {
…}
851 void FileManagerComponentBase ::
858 portNum < this->getNum_pingOut_OutputPorts(),
861 this->m_pingOut_OutputPort[portNum].invoke(
851 void FileManagerComponentBase :: {
…}
870 void FileManagerComponentBase ::
877 FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
878 this->m_cmdResponseOut_OutputPort[0].invoke(opCode, cmdSeq, response);
870 void FileManagerComponentBase :: {
…}
887 void FileManagerComponentBase ::
888 CreateDirectory_cmdHandlerBase(
895 this->CreateDirectory_preMsgHook(opCode,cmdSeq);
899 ComponentIpcSerializableBuffer msg;
903 _status = msg.serialize(
static_cast<NATIVE_INT_TYPE>(CMD_CREATEDIRECTORY));
912 _status = msg.serialize(port);
918 _status = msg.serialize(opCode);
924 _status = msg.serialize(cmdSeq);
930 _status = msg.serialize(args);
887 void FileManagerComponentBase :: {
…}
946 void FileManagerComponentBase ::
947 MoveFile_cmdHandlerBase(
954 this->MoveFile_preMsgHook(opCode,cmdSeq);
958 ComponentIpcSerializableBuffer msg;
971 _status = msg.serialize(port);
977 _status = msg.serialize(opCode);
983 _status = msg.serialize(cmdSeq);
989 _status = msg.serialize(args);
946 void FileManagerComponentBase :: {
…}
1005 void FileManagerComponentBase ::
1006 RemoveDirectory_cmdHandlerBase(
1013 this->RemoveDirectory_preMsgHook(opCode,cmdSeq);
1017 ComponentIpcSerializableBuffer msg;
1021 _status = msg.serialize(
static_cast<NATIVE_INT_TYPE>(CMD_REMOVEDIRECTORY));
1030 _status = msg.serialize(port);
1036 _status = msg.serialize(opCode);
1042 _status = msg.serialize(cmdSeq);
1048 _status = msg.serialize(args);
1005 void FileManagerComponentBase :: {
…}
1064 void FileManagerComponentBase ::
1065 RemoveFile_cmdHandlerBase(
1072 this->RemoveFile_preMsgHook(opCode,cmdSeq);
1076 ComponentIpcSerializableBuffer msg;
1080 _status = msg.serialize(
static_cast<NATIVE_INT_TYPE>(CMD_REMOVEFILE));
1089 _status = msg.serialize(port);
1095 _status = msg.serialize(opCode);
1101 _status = msg.serialize(cmdSeq);
1107 _status = msg.serialize(args);
1064 void FileManagerComponentBase :: {
…}
1123 void FileManagerComponentBase ::
1124 ShellCommand_cmdHandlerBase(
1131 this->ShellCommand_preMsgHook(opCode,cmdSeq);
1135 ComponentIpcSerializableBuffer msg;
1139 _status = msg.serialize(
static_cast<NATIVE_INT_TYPE>(CMD_SHELLCOMMAND));
1148 _status = msg.serialize(port);
1154 _status = msg.serialize(opCode);
1160 _status = msg.serialize(cmdSeq);
1166 _status = msg.serialize(args);
1123 void FileManagerComponentBase :: {
…}
1182 void FileManagerComponentBase ::
1183 AppendFile_cmdHandlerBase(
1190 this->AppendFile_preMsgHook(opCode,cmdSeq);
1194 ComponentIpcSerializableBuffer msg;
1198 _status = msg.serialize(
static_cast<NATIVE_INT_TYPE>(CMD_APPENDFILE));
1207 _status = msg.serialize(port);
1213 _status = msg.serialize(opCode);
1219 _status = msg.serialize(cmdSeq);
1225 _status = msg.serialize(args);
1182 void FileManagerComponentBase :: {
…}
1241 void FileManagerComponentBase ::
1242 FileSize_cmdHandlerBase(
1249 this->FileSize_preMsgHook(opCode,cmdSeq);
1253 ComponentIpcSerializableBuffer msg;
1266 _status = msg.serialize(port);
1272 _status = msg.serialize(opCode);
1278 _status = msg.serialize(cmdSeq);
1284 _status = msg.serialize(args);
1241 void FileManagerComponentBase :: {
…}
1308 void FileManagerComponentBase ::
1309 CreateDirectory_preMsgHook(
1308 void FileManagerComponentBase :: {
…}
1317 void FileManagerComponentBase ::
1318 MoveFile_preMsgHook(
1317 void FileManagerComponentBase :: {
…}
1326 void FileManagerComponentBase ::
1327 RemoveDirectory_preMsgHook(
1326 void FileManagerComponentBase :: {
…}
1335 void FileManagerComponentBase ::
1336 RemoveFile_preMsgHook(
1335 void FileManagerComponentBase :: {
…}
1344 void FileManagerComponentBase ::
1345 ShellCommand_preMsgHook(
1344 void FileManagerComponentBase :: {
…}
1353 void FileManagerComponentBase ::
1354 AppendFile_preMsgHook(
1353 void FileManagerComponentBase :: {
…}
1362 void FileManagerComponentBase ::
1363 FileSize_preMsgHook(
1362 void FileManagerComponentBase :: {
…}
1375 void FileManagerComponentBase ::
1376 log_WARNING_HI_DirectoryCreateError(
1383 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1384 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1389 _id = this->getIdBase() + EVENTID_DIRECTORYCREATEERROR;
1392 if (this->m_eventOut_OutputPort[0].isConnected()) {
1396#if FW_AMPCS_COMPATIBLE
1405 _status = dirName.
serialize(_logBuff, 256);
1411#if FW_AMPCS_COMPATIBLE
1414 static_cast<U8>(
sizeof(U32))
1427 this->m_eventOut_OutputPort[0].invoke(
1436#if FW_ENABLE_TEXT_LOGGING
1437 if (this->m_LogText_OutputPort[0].isConnected()) {
1438#if FW_OBJECT_NAMES == 1
1439 const char* _formatString =
1440 "(%s) %s: Could not create directory %s, returned status %" PRIu32
"";
1442 const char* _formatString =
1443 "%s: Could not create directory %s, returned status %" PRIu32
"";
1455 "DirectoryCreateError ",
1463 this->m_LogText_OutputPort[0].invoke(
1375 void FileManagerComponentBase :: {
…}
1473 void FileManagerComponentBase ::
1474 log_WARNING_HI_DirectoryRemoveError(
1481 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1482 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1487 _id = this->getIdBase() + EVENTID_DIRECTORYREMOVEERROR;
1490 if (this->m_eventOut_OutputPort[0].isConnected()) {
1494#if FW_AMPCS_COMPATIBLE
1503 _status = dirName.
serialize(_logBuff, 256);
1509#if FW_AMPCS_COMPATIBLE
1512 static_cast<U8>(
sizeof(U32))
1525 this->m_eventOut_OutputPort[0].invoke(
1534#if FW_ENABLE_TEXT_LOGGING
1535 if (this->m_LogText_OutputPort[0].isConnected()) {
1536#if FW_OBJECT_NAMES == 1
1537 const char* _formatString =
1538 "(%s) %s: Could not remove directory %s, returned status %" PRIu32
"";
1540 const char* _formatString =
1541 "%s: Could not remove directory %s, returned status %" PRIu32
"";
1553 "DirectoryRemoveError ",
1561 this->m_LogText_OutputPort[0].invoke(
1473 void FileManagerComponentBase :: {
…}
1571 void FileManagerComponentBase ::
1572 log_WARNING_HI_FileMoveError(
1580 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1581 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1586 _id = this->getIdBase() + EVENTID_FILEMOVEERROR;
1589 if (this->m_eventOut_OutputPort[0].isConnected()) {
1593#if FW_AMPCS_COMPATIBLE
1602 _status = sourceFileName.
serialize(_logBuff, 256);
1608 _status = destFileName.
serialize(_logBuff, 256);
1614#if FW_AMPCS_COMPATIBLE
1617 static_cast<U8>(
sizeof(U32))
1630 this->m_eventOut_OutputPort[0].invoke(
1639#if FW_ENABLE_TEXT_LOGGING
1640 if (this->m_LogText_OutputPort[0].isConnected()) {
1641#if FW_OBJECT_NAMES == 1
1642 const char* _formatString =
1643 "(%s) %s: Could not move file %s to file %s, returned status %" PRIu32
"";
1645 const char* _formatString =
1646 "%s: Could not move file %s to file %s, returned status %" PRIu32
"";
1667 this->m_LogText_OutputPort[0].invoke(
1571 void FileManagerComponentBase :: {
…}
1677 void FileManagerComponentBase ::
1678 log_WARNING_HI_FileRemoveError(
1685 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1686 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1691 _id = this->getIdBase() + EVENTID_FILEREMOVEERROR;
1694 if (this->m_eventOut_OutputPort[0].isConnected()) {
1698#if FW_AMPCS_COMPATIBLE
1707 _status = fileName.
serialize(_logBuff, 256);
1713#if FW_AMPCS_COMPATIBLE
1716 static_cast<U8>(
sizeof(U32))
1729 this->m_eventOut_OutputPort[0].invoke(
1738#if FW_ENABLE_TEXT_LOGGING
1739 if (this->m_LogText_OutputPort[0].isConnected()) {
1740#if FW_OBJECT_NAMES == 1
1741 const char* _formatString =
1742 "(%s) %s: Could not remove file %s, returned status %" PRIu32
"";
1744 const char* _formatString =
1745 "%s: Could not remove file %s, returned status %" PRIu32
"";
1765 this->m_LogText_OutputPort[0].invoke(
1677 void FileManagerComponentBase :: {
…}
1775 void FileManagerComponentBase ::
1776 log_WARNING_HI_ShellCommandFailed(
1783 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1784 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1789 _id = this->getIdBase() + EVENTID_SHELLCOMMANDFAILED;
1792 if (this->m_eventOut_OutputPort[0].isConnected()) {
1796#if FW_AMPCS_COMPATIBLE
1805 _status = command.
serialize(_logBuff, 256);
1811#if FW_AMPCS_COMPATIBLE
1814 static_cast<U8>(
sizeof(U32))
1827 this->m_eventOut_OutputPort[0].invoke(
1836#if FW_ENABLE_TEXT_LOGGING
1837 if (this->m_LogText_OutputPort[0].isConnected()) {
1838#if FW_OBJECT_NAMES == 1
1839 const char* _formatString =
1840 "(%s) %s: Shell command %s failed with status %" PRIu32
"";
1842 const char* _formatString =
1843 "%s: Shell command %s failed with status %" PRIu32
"";
1855 "ShellCommandFailed ",
1863 this->m_LogText_OutputPort[0].invoke(
1775 void FileManagerComponentBase :: {
…}
1873 void FileManagerComponentBase ::
1874 log_WARNING_HI_AppendFileFailed(
1882 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1883 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1888 _id = this->getIdBase() + EVENTID_APPENDFILEFAILED;
1891 if (this->m_eventOut_OutputPort[0].isConnected()) {
1895#if FW_AMPCS_COMPATIBLE
1904 _status = source.
serialize(_logBuff, 256);
1910 _status = target.
serialize(_logBuff, 256);
1916#if FW_AMPCS_COMPATIBLE
1919 static_cast<U8>(
sizeof(U32))
1932 this->m_eventOut_OutputPort[0].invoke(
1941#if FW_ENABLE_TEXT_LOGGING
1942 if (this->m_LogText_OutputPort[0].isConnected()) {
1943#if FW_OBJECT_NAMES == 1
1944 const char* _formatString =
1945 "(%s) %s: Appending %s onto %s failed with status %" PRIu32
"";
1947 const char* _formatString =
1948 "%s: Appending %s onto %s failed with status %" PRIu32
"";
1960 "AppendFileFailed ",
1969 this->m_LogText_OutputPort[0].invoke(
1873 void FileManagerComponentBase :: {
…}
1979 void FileManagerComponentBase ::
1980 log_ACTIVITY_HI_AppendFileSucceeded(
1987 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1988 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1993 _id = this->getIdBase() + EVENTID_APPENDFILESUCCEEDED;
1996 if (this->m_eventOut_OutputPort[0].isConnected()) {
2000#if FW_AMPCS_COMPATIBLE
2009 _status = source.
serialize(_logBuff, 256);
2015 _status = target.
serialize(_logBuff, 256);
2021 this->m_eventOut_OutputPort[0].invoke(
2030#if FW_ENABLE_TEXT_LOGGING
2031 if (this->m_LogText_OutputPort[0].isConnected()) {
2032#if FW_OBJECT_NAMES == 1
2033 const char* _formatString =
2034 "(%s) %s: Appended %s to the end of %s";
2036 const char* _formatString =
2037 "%s: Appended %s to the end of %s";
2049 "AppendFileSucceeded ",
2057 this->m_LogText_OutputPort[0].invoke(
1979 void FileManagerComponentBase :: {
…}
2067 void FileManagerComponentBase ::
2072 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2073 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2078 _id = this->getIdBase() + EVENTID_SHELLCOMMANDSUCCEEDED;
2081 if (this->m_eventOut_OutputPort[0].isConnected()) {
2085#if FW_AMPCS_COMPATIBLE
2094 _status = command.
serialize(_logBuff, 256);
2100 this->m_eventOut_OutputPort[0].invoke(
2109#if FW_ENABLE_TEXT_LOGGING
2110 if (this->m_LogText_OutputPort[0].isConnected()) {
2111#if FW_OBJECT_NAMES == 1
2112 const char* _formatString =
2113 "(%s) %s: Shell command %s succeeded";
2115 const char* _formatString =
2116 "%s: Shell command %s succeeded";
2128 "ShellCommandSucceeded ",
2135 this->m_LogText_OutputPort[0].invoke(
2067 void FileManagerComponentBase :: {
…}
2145 void FileManagerComponentBase ::
2150 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2151 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2156 _id = this->getIdBase() + EVENTID_CREATEDIRECTORYSUCCEEDED;
2159 if (this->m_eventOut_OutputPort[0].isConnected()) {
2163#if FW_AMPCS_COMPATIBLE
2172 _status = dirName.
serialize(_logBuff, 256);
2178 this->m_eventOut_OutputPort[0].invoke(
2187#if FW_ENABLE_TEXT_LOGGING
2188 if (this->m_LogText_OutputPort[0].isConnected()) {
2189#if FW_OBJECT_NAMES == 1
2190 const char* _formatString =
2191 "(%s) %s: Created directory %s successfully";
2193 const char* _formatString =
2194 "%s: Created directory %s successfully";
2206 "CreateDirectorySucceeded ",
2213 this->m_LogText_OutputPort[0].invoke(
2145 void FileManagerComponentBase :: {
…}
2223 void FileManagerComponentBase ::
2228 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2229 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2234 _id = this->getIdBase() + EVENTID_REMOVEDIRECTORYSUCCEEDED;
2237 if (this->m_eventOut_OutputPort[0].isConnected()) {
2241#if FW_AMPCS_COMPATIBLE
2250 _status = dirName.
serialize(_logBuff, 256);
2256 this->m_eventOut_OutputPort[0].invoke(
2265#if FW_ENABLE_TEXT_LOGGING
2266 if (this->m_LogText_OutputPort[0].isConnected()) {
2267#if FW_OBJECT_NAMES == 1
2268 const char* _formatString =
2269 "(%s) %s: Removed directory %s successfully";
2271 const char* _formatString =
2272 "%s: Removed directory %s successfully";
2284 "RemoveDirectorySucceeded ",
2291 this->m_LogText_OutputPort[0].invoke(
2223 void FileManagerComponentBase :: {
…}
2301 void FileManagerComponentBase ::
2302 log_ACTIVITY_HI_MoveFileSucceeded(
2309 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2310 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2315 _id = this->getIdBase() + EVENTID_MOVEFILESUCCEEDED;
2318 if (this->m_eventOut_OutputPort[0].isConnected()) {
2322#if FW_AMPCS_COMPATIBLE
2331 _status = sourceFileName.
serialize(_logBuff, 256);
2337 _status = destFileName.
serialize(_logBuff, 256);
2343 this->m_eventOut_OutputPort[0].invoke(
2352#if FW_ENABLE_TEXT_LOGGING
2353 if (this->m_LogText_OutputPort[0].isConnected()) {
2354#if FW_OBJECT_NAMES == 1
2355 const char* _formatString =
2356 "(%s) %s: Moved file %s to file %s successfully";
2358 const char* _formatString =
2359 "%s: Moved file %s to file %s successfully";
2371 "MoveFileSucceeded ",
2379 this->m_LogText_OutputPort[0].invoke(
2301 void FileManagerComponentBase :: {
…}
2389 void FileManagerComponentBase ::
2394 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2395 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2400 _id = this->getIdBase() + EVENTID_REMOVEFILESUCCEEDED;
2403 if (this->m_eventOut_OutputPort[0].isConnected()) {
2407#if FW_AMPCS_COMPATIBLE
2416 _status = fileName.
serialize(_logBuff, 256);
2422 this->m_eventOut_OutputPort[0].invoke(
2431#if FW_ENABLE_TEXT_LOGGING
2432 if (this->m_LogText_OutputPort[0].isConnected()) {
2433#if FW_OBJECT_NAMES == 1
2434 const char* _formatString =
2435 "(%s) %s: Removed file %s successfully";
2437 const char* _formatString =
2438 "%s: Removed file %s successfully";
2450 "RemoveFileSucceeded ",
2457 this->m_LogText_OutputPort[0].invoke(
2389 void FileManagerComponentBase :: {
…}
2467 void FileManagerComponentBase ::
2468 log_ACTIVITY_HI_AppendFileStarted(
2475 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2476 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2481 _id = this->getIdBase() + EVENTID_APPENDFILESTARTED;
2484 if (this->m_eventOut_OutputPort[0].isConnected()) {
2488#if FW_AMPCS_COMPATIBLE
2497 _status = source.
serialize(_logBuff, 256);
2503 _status = target.
serialize(_logBuff, 256);
2509 this->m_eventOut_OutputPort[0].invoke(
2518#if FW_ENABLE_TEXT_LOGGING
2519 if (this->m_LogText_OutputPort[0].isConnected()) {
2520#if FW_OBJECT_NAMES == 1
2521 const char* _formatString =
2522 "(%s) %s: Appending file %s to the end of %s...";
2524 const char* _formatString =
2525 "%s: Appending file %s to the end of %s...";
2537 "AppendFileStarted ",
2545 this->m_LogText_OutputPort[0].invoke(
2467 void FileManagerComponentBase :: {
…}
2555 void FileManagerComponentBase ::
2560 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2561 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2566 _id = this->getIdBase() + EVENTID_SHELLCOMMANDSTARTED;
2569 if (this->m_eventOut_OutputPort[0].isConnected()) {
2573#if FW_AMPCS_COMPATIBLE
2582 _status = command.
serialize(_logBuff, 256);
2588 this->m_eventOut_OutputPort[0].invoke(
2597#if FW_ENABLE_TEXT_LOGGING
2598 if (this->m_LogText_OutputPort[0].isConnected()) {
2599#if FW_OBJECT_NAMES == 1
2600 const char* _formatString =
2601 "(%s) %s: Running shell command %s...";
2603 const char* _formatString =
2604 "%s: Running shell command %s...";
2616 "ShellCommandStarted ",
2623 this->m_LogText_OutputPort[0].invoke(
2555 void FileManagerComponentBase :: {
…}
2633 void FileManagerComponentBase ::
2638 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2639 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2644 _id = this->getIdBase() + EVENTID_CREATEDIRECTORYSTARTED;
2647 if (this->m_eventOut_OutputPort[0].isConnected()) {
2651#if FW_AMPCS_COMPATIBLE
2660 _status = dirName.
serialize(_logBuff, 256);
2666 this->m_eventOut_OutputPort[0].invoke(
2675#if FW_ENABLE_TEXT_LOGGING
2676 if (this->m_LogText_OutputPort[0].isConnected()) {
2677#if FW_OBJECT_NAMES == 1
2678 const char* _formatString =
2679 "(%s) %s: Creating directory %s...";
2681 const char* _formatString =
2682 "%s: Creating directory %s...";
2694 "CreateDirectoryStarted ",
2701 this->m_LogText_OutputPort[0].invoke(
2633 void FileManagerComponentBase :: {
…}
2711 void FileManagerComponentBase ::
2716 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2717 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2722 _id = this->getIdBase() + EVENTID_REMOVEDIRECTORYSTARTED;
2725 if (this->m_eventOut_OutputPort[0].isConnected()) {
2729#if FW_AMPCS_COMPATIBLE
2738 _status = dirName.
serialize(_logBuff, 256);
2744 this->m_eventOut_OutputPort[0].invoke(
2753#if FW_ENABLE_TEXT_LOGGING
2754 if (this->m_LogText_OutputPort[0].isConnected()) {
2755#if FW_OBJECT_NAMES == 1
2756 const char* _formatString =
2757 "(%s) %s: Removing directory %s...";
2759 const char* _formatString =
2760 "%s: Removing directory %s...";
2772 "RemoveDirectoryStarted ",
2779 this->m_LogText_OutputPort[0].invoke(
2711 void FileManagerComponentBase :: {
…}
2789 void FileManagerComponentBase ::
2790 log_ACTIVITY_HI_MoveFileStarted(
2797 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2798 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2803 _id = this->getIdBase() + EVENTID_MOVEFILESTARTED;
2806 if (this->m_eventOut_OutputPort[0].isConnected()) {
2810#if FW_AMPCS_COMPATIBLE
2819 _status = sourceFileName.
serialize(_logBuff, 256);
2825 _status = destFileName.
serialize(_logBuff, 256);
2831 this->m_eventOut_OutputPort[0].invoke(
2840#if FW_ENABLE_TEXT_LOGGING
2841 if (this->m_LogText_OutputPort[0].isConnected()) {
2842#if FW_OBJECT_NAMES == 1
2843 const char* _formatString =
2844 "(%s) %s: Moving file %s to file %s...";
2846 const char* _formatString =
2847 "%s: Moving file %s to file %s...";
2867 this->m_LogText_OutputPort[0].invoke(
2789 void FileManagerComponentBase :: {
…}
2877 void FileManagerComponentBase ::
2882 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2883 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2888 _id = this->getIdBase() + EVENTID_REMOVEFILESTARTED;
2891 if (this->m_eventOut_OutputPort[0].isConnected()) {
2895#if FW_AMPCS_COMPATIBLE
2904 _status = fileName.
serialize(_logBuff, 256);
2910 this->m_eventOut_OutputPort[0].invoke(
2919#if FW_ENABLE_TEXT_LOGGING
2920 if (this->m_LogText_OutputPort[0].isConnected()) {
2921#if FW_OBJECT_NAMES == 1
2922 const char* _formatString =
2923 "(%s) %s: Removing file %s...";
2925 const char* _formatString =
2926 "%s: Removing file %s...";
2938 "RemoveFileStarted ",
2945 this->m_LogText_OutputPort[0].invoke(
2877 void FileManagerComponentBase :: {
…}
2955 void FileManagerComponentBase ::
2956 log_ACTIVITY_HI_FileSizeSucceeded(
2963 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2964 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2969 _id = this->getIdBase() + EVENTID_FILESIZESUCCEEDED;
2972 if (this->m_eventOut_OutputPort[0].isConnected()) {
2976#if FW_AMPCS_COMPATIBLE
2985 _status = fileName.
serialize(_logBuff, 256);
2991#if FW_AMPCS_COMPATIBLE
2994 static_cast<U8>(
sizeof(
U64))
3007 this->m_eventOut_OutputPort[0].invoke(
3016#if FW_ENABLE_TEXT_LOGGING
3017 if (this->m_LogText_OutputPort[0].isConnected()) {
3018#if FW_OBJECT_NAMES == 1
3019 const char* _formatString =
3020 "(%s) %s: The size of file %s is %" PRIu64
" B";
3022 const char* _formatString =
3023 "%s: The size of file %s is %" PRIu64
" B";
3035 "FileSizeSucceeded ",
3043 this->m_LogText_OutputPort[0].invoke(
2955 void FileManagerComponentBase :: {
…}
3053 void FileManagerComponentBase ::
3054 log_WARNING_HI_FileSizeError(
3061 if (this->m_timeCaller_OutputPort[0].isConnected()) {
3062 this->m_timeCaller_OutputPort[0].invoke(_logTime);
3067 _id = this->getIdBase() + EVENTID_FILESIZEERROR;
3070 if (this->m_eventOut_OutputPort[0].isConnected()) {
3074#if FW_AMPCS_COMPATIBLE
3083 _status = fileName.
serialize(_logBuff, 256);
3089#if FW_AMPCS_COMPATIBLE
3092 static_cast<U8>(
sizeof(U32))
3105 this->m_eventOut_OutputPort[0].invoke(
3114#if FW_ENABLE_TEXT_LOGGING
3115 if (this->m_LogText_OutputPort[0].isConnected()) {
3116#if FW_OBJECT_NAMES == 1
3117 const char* _formatString =
3118 "(%s) %s: Failed to get the size of file %s, returned status %" PRIu32
"";
3120 const char* _formatString =
3121 "%s: Failed to get the size of file %s, returned status %" PRIu32
"";
3141 this->m_LogText_OutputPort[0].invoke(
3053 void FileManagerComponentBase :: {
…}
3151 void FileManagerComponentBase ::
3156 if (this->m_timeCaller_OutputPort[0].isConnected()) {
3157 this->m_timeCaller_OutputPort[0].invoke(_logTime);
3162 _id = this->getIdBase() + EVENTID_FILESIZESTARTED;
3165 if (this->m_eventOut_OutputPort[0].isConnected()) {
3169#if FW_AMPCS_COMPATIBLE
3178 _status = fileName.
serialize(_logBuff, 256);
3184 this->m_eventOut_OutputPort[0].invoke(
3193#if FW_ENABLE_TEXT_LOGGING
3194 if (this->m_LogText_OutputPort[0].isConnected()) {
3195#if FW_OBJECT_NAMES == 1
3196 const char* _formatString =
3197 "(%s) %s: Checking size of file %s...";
3199 const char* _formatString =
3200 "%s: Checking size of file %s...";
3219 this->m_LogText_OutputPort[0].invoke(
3151 void FileManagerComponentBase :: {
…}
3233 void FileManagerComponentBase ::
3234 tlmWrite_CommandsExecuted(
3239 if (this->m_tlmOut_OutputPort[0].isConnected()) {
3241 this->m_timeCaller_OutputPort[0].isConnected() &&
3244 this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
3256 _id = this->getIdBase() + CHANNELID_COMMANDSEXECUTED;
3258 this->m_tlmOut_OutputPort[0].invoke(
3233 void FileManagerComponentBase :: {
…}
3266 void FileManagerComponentBase ::
3272 if (this->m_tlmOut_OutputPort[0].isConnected()) {
3274 this->m_timeCaller_OutputPort[0].isConnected() &&
3277 this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
3289 _id = this->getIdBase() + CHANNELID_ERRORS;
3291 this->m_tlmOut_OutputPort[0].invoke(
3266 void FileManagerComponentBase :: {
…}
3306 if (this->m_timeCaller_OutputPort[0].isConnected()) {
3308 this->m_timeCaller_OutputPort[0].invoke(_time);
3323 ComponentIpcSerializableBuffer msg;
3346 MsgTypeEnum msgType =
static_cast<MsgTypeEnum
>(desMsg);
3348 if (msgType == FILEMANAGER_COMPONENT_EXIT) {
3349 return MSG_DISPATCH_EXIT;
3353 deserStatus = msg.deserialize(portNum);
3364 deserStatus = msg.deserialize(key);
3370 this->pingIn_handler(
3379 case CMD_CREATEDIRECTORY: {
3382 deserStatus = msg.deserialize(opCode);
3390 deserStatus = msg.deserialize(cmdSeq);
3398 deserStatus = msg.deserialize(args);
3411 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3412 this->cmdResponse_out(
3424#if FW_CMD_CHECK_RESIDUAL
3426 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3435 this->CreateDirectory_cmdHandler(
3444 case CMD_MOVEFILE: {
3447 deserStatus = msg.deserialize(opCode);
3455 deserStatus = msg.deserialize(cmdSeq);
3463 deserStatus = msg.deserialize(args);
3476 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3477 this->cmdResponse_out(
3491 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3492 this->cmdResponse_out(
3504#if FW_CMD_CHECK_RESIDUAL
3506 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3515 this->MoveFile_cmdHandler(
3525 case CMD_REMOVEDIRECTORY: {
3528 deserStatus = msg.deserialize(opCode);
3536 deserStatus = msg.deserialize(cmdSeq);
3544 deserStatus = msg.deserialize(args);
3557 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3558 this->cmdResponse_out(
3570#if FW_CMD_CHECK_RESIDUAL
3572 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3581 this->RemoveDirectory_cmdHandler(
3590 case CMD_REMOVEFILE: {
3593 deserStatus = msg.deserialize(opCode);
3601 deserStatus = msg.deserialize(cmdSeq);
3609 deserStatus = msg.deserialize(args);
3622 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3623 this->cmdResponse_out(
3637 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3638 this->cmdResponse_out(
3650#if FW_CMD_CHECK_RESIDUAL
3652 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3661 this->RemoveFile_cmdHandler(
3671 case CMD_SHELLCOMMAND: {
3674 deserStatus = msg.deserialize(opCode);
3682 deserStatus = msg.deserialize(cmdSeq);
3690 deserStatus = msg.deserialize(args);
3703 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3704 this->cmdResponse_out(
3718 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3719 this->cmdResponse_out(
3731#if FW_CMD_CHECK_RESIDUAL
3733 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3742 this->ShellCommand_cmdHandler(
3752 case CMD_APPENDFILE: {
3755 deserStatus = msg.deserialize(opCode);
3763 deserStatus = msg.deserialize(cmdSeq);
3771 deserStatus = msg.deserialize(args);
3784 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3785 this->cmdResponse_out(
3799 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3800 this->cmdResponse_out(
3812#if FW_CMD_CHECK_RESIDUAL
3814 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3823 this->AppendFile_cmdHandler(
3833 case CMD_FILESIZE: {
3836 deserStatus = msg.deserialize(opCode);
3844 deserStatus = msg.deserialize(cmdSeq);
3852 deserStatus = msg.deserialize(args);
3865 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3866 this->cmdResponse_out(
3878#if FW_CMD_CHECK_RESIDUAL
3880 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3889 this->FileSize_cmdHandler(
3898 return MSG_DISPATCH_ERROR;
3901 return MSG_DISPATCH_OK;
3908 void FileManagerComponentBase ::
3918 FileManagerComponentBase* compPtr =
static_cast<FileManagerComponentBase*
>(callComp);
3920 const U32 idBase = callComp->
getIdBase();
3921 FW_ASSERT(opCode >= idBase, opCode, idBase);
3924 switch (opCode - idBase) {
3925 case OPCODE_CREATEDIRECTORY: {
3926 compPtr->CreateDirectory_cmdHandlerBase(
3934 case OPCODE_MOVEFILE: {
3935 compPtr->MoveFile_cmdHandlerBase(
3943 case OPCODE_REMOVEDIRECTORY: {
3944 compPtr->RemoveDirectory_cmdHandlerBase(
3952 case OPCODE_REMOVEFILE: {
3953 compPtr->RemoveFile_cmdHandlerBase(
3961 case OPCODE_SHELLCOMMAND: {
3962 compPtr->ShellCommand_cmdHandlerBase(
3970 case OPCODE_APPENDFILE: {
3971 compPtr->AppendFile_cmdHandlerBase(
3979 case OPCODE_FILESIZE: {
3980 compPtr->FileSize_cmdHandlerBase(
3994 void FileManagerComponentBase ::
4002 FileManagerComponentBase* compPtr =
static_cast<FileManagerComponentBase*
>(callComp);
4003 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_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.
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
@ QUEUE_BLOCKING
Queue receive blocks until a message arrives.
@ QUEUE_NONBLOCKING
Queue receive always returns even if there is no message.
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.