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];
76 void FileManagerComponentBase ::
88 port < static_cast<PlatformIntType>(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
107 this->m_cmdIn_InputPort[port].setObjName(portName);
114 port < static_cast<PlatformIntType>(this->getNum_pingIn_InputPorts());
117 this->m_pingIn_InputPort[port].init();
118 this->m_pingIn_InputPort[port].addCallComp(
122 this->m_pingIn_InputPort[port].setPortNum(port);
124#if FW_OBJECT_NAMES == 1
133 this->m_pingIn_InputPort[port].setObjName(portName);
137#if FW_ENABLE_TEXT_LOGGING == 1
141 port < static_cast<PlatformIntType>(this->getNum_LogText_OutputPorts());
144 this->m_LogText_OutputPort[port].init();
146#if FW_OBJECT_NAMES == 1
155 this->m_LogText_OutputPort[port].setObjName(portName);
163 port < static_cast<PlatformIntType>(this->getNum_cmdRegOut_OutputPorts());
166 this->m_cmdRegOut_OutputPort[port].init();
168#if FW_OBJECT_NAMES == 1
177 this->m_cmdRegOut_OutputPort[port].setObjName(portName);
184 port < static_cast<PlatformIntType>(this->getNum_cmdResponseOut_OutputPorts());
187 this->m_cmdResponseOut_OutputPort[port].init();
189#if FW_OBJECT_NAMES == 1
198 this->m_cmdResponseOut_OutputPort[port].setObjName(portName);
205 port < static_cast<PlatformIntType>(this->getNum_eventOut_OutputPorts());
208 this->m_eventOut_OutputPort[port].init();
210#if FW_OBJECT_NAMES == 1
219 this->m_eventOut_OutputPort[port].setObjName(portName);
226 port < static_cast<PlatformIntType>(this->getNum_timeCaller_OutputPorts());
229 this->m_timeCaller_OutputPort[port].init();
231#if FW_OBJECT_NAMES == 1
240 this->m_timeCaller_OutputPort[port].setObjName(portName);
247 port < static_cast<PlatformIntType>(this->getNum_tlmOut_OutputPorts());
250 this->m_tlmOut_OutputPort[port].init();
252#if FW_OBJECT_NAMES == 1
261 this->m_tlmOut_OutputPort[port].setObjName(portName);
268 port < static_cast<PlatformIntType>(this->getNum_pingOut_OutputPorts());
271 this->m_pingOut_OutputPort[port].init();
273#if FW_OBJECT_NAMES == 1
282 this->m_pingOut_OutputPort[port].setObjName(portName);
288 ComponentIpcSerializableBuffer::SERIALIZATION_SIZE
76 void FileManagerComponentBase :: {
…}
304 portNum < this->getNum_cmdIn_InputPorts(),
308 return &this->m_cmdIn_InputPort[portNum];
319 portNum < this->getNum_pingIn_InputPorts(),
323 return &this->m_pingIn_InputPort[portNum];
330#if FW_ENABLE_TEXT_LOGGING == 1
332 void FileManagerComponentBase ::
333 set_LogText_OutputPort(
339 portNum < this->getNum_LogText_OutputPorts(),
343 this->m_LogText_OutputPort[portNum].addCallPort(port);
348 void FileManagerComponentBase ::
349 set_cmdRegOut_OutputPort(
355 portNum < this->getNum_cmdRegOut_OutputPorts(),
359 this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
348 void FileManagerComponentBase :: {
…}
362 void FileManagerComponentBase ::
363 set_cmdResponseOut_OutputPort(
369 portNum < this->getNum_cmdResponseOut_OutputPorts(),
373 this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
362 void FileManagerComponentBase :: {
…}
376 void FileManagerComponentBase ::
377 set_eventOut_OutputPort(
383 portNum < this->getNum_eventOut_OutputPorts(),
387 this->m_eventOut_OutputPort[portNum].addCallPort(port);
376 void FileManagerComponentBase :: {
…}
390 void FileManagerComponentBase ::
391 set_timeCaller_OutputPort(
397 portNum < this->getNum_timeCaller_OutputPorts(),
401 this->m_timeCaller_OutputPort[portNum].addCallPort(port);
390 void FileManagerComponentBase :: {
…}
404 void FileManagerComponentBase ::
405 set_tlmOut_OutputPort(
411 portNum < this->getNum_tlmOut_OutputPorts(),
415 this->m_tlmOut_OutputPort[portNum].addCallPort(port);
404 void FileManagerComponentBase :: {
…}
422 void FileManagerComponentBase ::
423 set_pingOut_OutputPort(
429 portNum < this->getNum_pingOut_OutputPorts(),
433 this->m_pingOut_OutputPort[portNum].addCallPort(port);
422 void FileManagerComponentBase :: {
…}
436#if FW_PORT_SERIALIZATION
442#if FW_ENABLE_TEXT_LOGGING == 1
444 void FileManagerComponentBase ::
445 set_LogText_OutputPort(
447 Fw::InputSerializePort* port
451 portNum < this->getNum_LogText_OutputPorts(),
455 this->m_LogText_OutputPort[portNum].registerSerialPort(port);
460 void FileManagerComponentBase ::
461 set_cmdRegOut_OutputPort(
463 Fw::InputSerializePort* port
467 portNum < this->getNum_cmdRegOut_OutputPorts(),
471 this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
474 void FileManagerComponentBase ::
475 set_cmdResponseOut_OutputPort(
477 Fw::InputSerializePort* port
481 portNum < this->getNum_cmdResponseOut_OutputPorts(),
485 this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
488 void FileManagerComponentBase ::
489 set_eventOut_OutputPort(
491 Fw::InputSerializePort* port
495 portNum < this->getNum_eventOut_OutputPorts(),
499 this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
502 void FileManagerComponentBase ::
503 set_timeCaller_OutputPort(
505 Fw::InputSerializePort* port
509 portNum < this->getNum_timeCaller_OutputPorts(),
513 this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
516 void FileManagerComponentBase ::
517 set_tlmOut_OutputPort(
519 Fw::InputSerializePort* port
523 portNum < this->getNum_tlmOut_OutputPorts(),
527 this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
532#if FW_PORT_SERIALIZATION
538 void FileManagerComponentBase ::
539 set_pingOut_OutputPort(
541 Fw::InputSerializePort* port
545 portNum < this->getNum_pingOut_OutputPorts(),
549 this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
558 void FileManagerComponentBase ::
561 FW_ASSERT(this->m_cmdRegOut_OutputPort[0].isConnected());
563 this->m_cmdRegOut_OutputPort[0].invoke(
564 this->getIdBase() + OPCODE_CREATEDIRECTORY
567 this->m_cmdRegOut_OutputPort[0].invoke(
568 this->getIdBase() + OPCODE_MOVEFILE
571 this->m_cmdRegOut_OutputPort[0].invoke(
572 this->getIdBase() + OPCODE_REMOVEDIRECTORY
575 this->m_cmdRegOut_OutputPort[0].invoke(
576 this->getIdBase() + OPCODE_REMOVEFILE
579 this->m_cmdRegOut_OutputPort[0].invoke(
580 this->getIdBase() + OPCODE_SHELLCOMMAND
583 this->m_cmdRegOut_OutputPort[0].invoke(
584 this->getIdBase() + OPCODE_APPENDFILE
587 this->m_cmdRegOut_OutputPort[0].invoke(
588 this->getIdBase() + OPCODE_FILESIZE
558 void FileManagerComponentBase :: {
…}
596 FileManagerComponentBase ::
597 FileManagerComponentBase(
const char* compName) :
598 Fw::ActiveComponentBase(compName)
596 FileManagerComponentBase :: {
…}
603 FileManagerComponentBase ::
604 ~FileManagerComponentBase()
603 FileManagerComponentBase :: {
…}
614 getNum_cmdIn_InputPorts()
const
624 getNum_pingIn_InputPorts()
const
633#if FW_ENABLE_TEXT_LOGGING == 1
636 getNum_LogText_OutputPorts()
const
644 getNum_cmdRegOut_OutputPorts()
const
650 getNum_cmdResponseOut_OutputPorts()
const
656 getNum_eventOut_OutputPorts()
const
662 getNum_timeCaller_OutputPorts()
const
668 getNum_tlmOut_OutputPorts()
const
678 getNum_pingOut_OutputPorts()
const
687#if FW_ENABLE_TEXT_LOGGING == 1
689 bool FileManagerComponentBase ::
693 portNum < this->getNum_LogText_OutputPorts(),
697 return this->m_LogText_OutputPort[portNum].isConnected();
702 bool FileManagerComponentBase ::
706 portNum < this->getNum_cmdRegOut_OutputPorts(),
710 return this->m_cmdRegOut_OutputPort[portNum].isConnected();
702 bool FileManagerComponentBase :: {
…}
713 bool FileManagerComponentBase ::
717 portNum < this->getNum_cmdResponseOut_OutputPorts(),
721 return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
713 bool FileManagerComponentBase :: {
…}
724 bool FileManagerComponentBase ::
728 portNum < this->getNum_eventOut_OutputPorts(),
732 return this->m_eventOut_OutputPort[portNum].isConnected();
724 bool FileManagerComponentBase :: {
…}
735 bool FileManagerComponentBase ::
739 portNum < this->getNum_timeCaller_OutputPorts(),
743 return this->m_timeCaller_OutputPort[portNum].isConnected();
735 bool FileManagerComponentBase :: {
…}
746 bool FileManagerComponentBase ::
750 portNum < this->getNum_tlmOut_OutputPorts(),
754 return this->m_tlmOut_OutputPort[portNum].isConnected();
746 bool FileManagerComponentBase :: {
…}
761 bool FileManagerComponentBase ::
765 portNum < this->getNum_pingOut_OutputPorts(),
769 return this->m_pingOut_OutputPort[portNum].isConnected();
761 bool FileManagerComponentBase :: {
…}
778 void FileManagerComponentBase ::
786 portNum < this->getNum_pingIn_InputPorts(),
795 ComponentIpcSerializableBuffer msg;
799 _status = msg.serialize(
808 _status = msg.serialize(portNum);
815 _status = msg.serialize(key);
778 void FileManagerComponentBase :: {
…}
839 void FileManagerComponentBase ::
839 void FileManagerComponentBase :: {
…}
852 void FileManagerComponentBase ::
859 portNum < this->getNum_pingOut_OutputPorts(),
862 this->m_pingOut_OutputPort[portNum].invoke(
852 void FileManagerComponentBase :: {
…}
871 void FileManagerComponentBase ::
878 FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
879 this->m_cmdResponseOut_OutputPort[0].invoke(opCode, cmdSeq, response);
871 void FileManagerComponentBase :: {
…}
888 void FileManagerComponentBase ::
889 CreateDirectory_cmdHandlerBase(
896 this->CreateDirectory_preMsgHook(opCode,cmdSeq);
900 ComponentIpcSerializableBuffer msg;
904 _status = msg.serialize(
static_cast<NATIVE_INT_TYPE>(CMD_CREATEDIRECTORY));
913 _status = msg.serialize(port);
919 _status = msg.serialize(opCode);
925 _status = msg.serialize(cmdSeq);
931 _status = msg.serialize(args);
888 void FileManagerComponentBase :: {
…}
947 void FileManagerComponentBase ::
948 MoveFile_cmdHandlerBase(
955 this->MoveFile_preMsgHook(opCode,cmdSeq);
959 ComponentIpcSerializableBuffer msg;
972 _status = msg.serialize(port);
978 _status = msg.serialize(opCode);
984 _status = msg.serialize(cmdSeq);
990 _status = msg.serialize(args);
947 void FileManagerComponentBase :: {
…}
1006 void FileManagerComponentBase ::
1007 RemoveDirectory_cmdHandlerBase(
1014 this->RemoveDirectory_preMsgHook(opCode,cmdSeq);
1018 ComponentIpcSerializableBuffer msg;
1022 _status = msg.serialize(
static_cast<NATIVE_INT_TYPE>(CMD_REMOVEDIRECTORY));
1031 _status = msg.serialize(port);
1037 _status = msg.serialize(opCode);
1043 _status = msg.serialize(cmdSeq);
1049 _status = msg.serialize(args);
1006 void FileManagerComponentBase :: {
…}
1065 void FileManagerComponentBase ::
1066 RemoveFile_cmdHandlerBase(
1073 this->RemoveFile_preMsgHook(opCode,cmdSeq);
1077 ComponentIpcSerializableBuffer msg;
1081 _status = msg.serialize(
static_cast<NATIVE_INT_TYPE>(CMD_REMOVEFILE));
1090 _status = msg.serialize(port);
1096 _status = msg.serialize(opCode);
1102 _status = msg.serialize(cmdSeq);
1108 _status = msg.serialize(args);
1065 void FileManagerComponentBase :: {
…}
1124 void FileManagerComponentBase ::
1125 ShellCommand_cmdHandlerBase(
1132 this->ShellCommand_preMsgHook(opCode,cmdSeq);
1136 ComponentIpcSerializableBuffer msg;
1140 _status = msg.serialize(
static_cast<NATIVE_INT_TYPE>(CMD_SHELLCOMMAND));
1149 _status = msg.serialize(port);
1155 _status = msg.serialize(opCode);
1161 _status = msg.serialize(cmdSeq);
1167 _status = msg.serialize(args);
1124 void FileManagerComponentBase :: {
…}
1183 void FileManagerComponentBase ::
1184 AppendFile_cmdHandlerBase(
1191 this->AppendFile_preMsgHook(opCode,cmdSeq);
1195 ComponentIpcSerializableBuffer msg;
1199 _status = msg.serialize(
static_cast<NATIVE_INT_TYPE>(CMD_APPENDFILE));
1208 _status = msg.serialize(port);
1214 _status = msg.serialize(opCode);
1220 _status = msg.serialize(cmdSeq);
1226 _status = msg.serialize(args);
1183 void FileManagerComponentBase :: {
…}
1242 void FileManagerComponentBase ::
1243 FileSize_cmdHandlerBase(
1250 this->FileSize_preMsgHook(opCode,cmdSeq);
1254 ComponentIpcSerializableBuffer msg;
1267 _status = msg.serialize(port);
1273 _status = msg.serialize(opCode);
1279 _status = msg.serialize(cmdSeq);
1285 _status = msg.serialize(args);
1242 void FileManagerComponentBase :: {
…}
1309 void FileManagerComponentBase ::
1310 CreateDirectory_preMsgHook(
1309 void FileManagerComponentBase :: {
…}
1318 void FileManagerComponentBase ::
1319 MoveFile_preMsgHook(
1318 void FileManagerComponentBase :: {
…}
1327 void FileManagerComponentBase ::
1328 RemoveDirectory_preMsgHook(
1327 void FileManagerComponentBase :: {
…}
1336 void FileManagerComponentBase ::
1337 RemoveFile_preMsgHook(
1336 void FileManagerComponentBase :: {
…}
1345 void FileManagerComponentBase ::
1346 ShellCommand_preMsgHook(
1345 void FileManagerComponentBase :: {
…}
1354 void FileManagerComponentBase ::
1355 AppendFile_preMsgHook(
1354 void FileManagerComponentBase :: {
…}
1363 void FileManagerComponentBase ::
1364 FileSize_preMsgHook(
1363 void FileManagerComponentBase :: {
…}
1376 void FileManagerComponentBase ::
1377 log_WARNING_HI_DirectoryCreateError(
1384 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1385 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1390 _id = this->getIdBase() + EVENTID_DIRECTORYCREATEERROR;
1393 if (this->m_eventOut_OutputPort[0].isConnected()) {
1397#if FW_AMPCS_COMPATIBLE
1406 _status = dirName.
serialize(_logBuff, 256);
1412#if FW_AMPCS_COMPATIBLE
1415 static_cast<U8>(
sizeof(U32))
1428 this->m_eventOut_OutputPort[0].invoke(
1437#if FW_ENABLE_TEXT_LOGGING
1438 if (this->m_LogText_OutputPort[0].isConnected()) {
1439#if FW_OBJECT_NAMES == 1
1440 const char* _formatString =
1441 "(%s) %s: Could not create directory %s, returned status %" PRIu32
"";
1443 const char* _formatString =
1444 "%s: Could not create directory %s, returned status %" PRIu32
"";
1456 "DirectoryCreateError ",
1464 this->m_LogText_OutputPort[0].invoke(
1376 void FileManagerComponentBase :: {
…}
1474 void FileManagerComponentBase ::
1475 log_WARNING_HI_DirectoryRemoveError(
1482 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1483 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1488 _id = this->getIdBase() + EVENTID_DIRECTORYREMOVEERROR;
1491 if (this->m_eventOut_OutputPort[0].isConnected()) {
1495#if FW_AMPCS_COMPATIBLE
1504 _status = dirName.
serialize(_logBuff, 256);
1510#if FW_AMPCS_COMPATIBLE
1513 static_cast<U8>(
sizeof(U32))
1526 this->m_eventOut_OutputPort[0].invoke(
1535#if FW_ENABLE_TEXT_LOGGING
1536 if (this->m_LogText_OutputPort[0].isConnected()) {
1537#if FW_OBJECT_NAMES == 1
1538 const char* _formatString =
1539 "(%s) %s: Could not remove directory %s, returned status %" PRIu32
"";
1541 const char* _formatString =
1542 "%s: Could not remove directory %s, returned status %" PRIu32
"";
1554 "DirectoryRemoveError ",
1562 this->m_LogText_OutputPort[0].invoke(
1474 void FileManagerComponentBase :: {
…}
1572 void FileManagerComponentBase ::
1573 log_WARNING_HI_FileMoveError(
1581 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1582 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1587 _id = this->getIdBase() + EVENTID_FILEMOVEERROR;
1590 if (this->m_eventOut_OutputPort[0].isConnected()) {
1594#if FW_AMPCS_COMPATIBLE
1603 _status = sourceFileName.
serialize(_logBuff, 256);
1609 _status = destFileName.
serialize(_logBuff, 256);
1615#if FW_AMPCS_COMPATIBLE
1618 static_cast<U8>(
sizeof(U32))
1631 this->m_eventOut_OutputPort[0].invoke(
1640#if FW_ENABLE_TEXT_LOGGING
1641 if (this->m_LogText_OutputPort[0].isConnected()) {
1642#if FW_OBJECT_NAMES == 1
1643 const char* _formatString =
1644 "(%s) %s: Could not move file %s to file %s, returned status %" PRIu32
"";
1646 const char* _formatString =
1647 "%s: Could not move file %s to file %s, returned status %" PRIu32
"";
1668 this->m_LogText_OutputPort[0].invoke(
1572 void FileManagerComponentBase :: {
…}
1678 void FileManagerComponentBase ::
1679 log_WARNING_HI_FileRemoveError(
1686 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1687 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1692 _id = this->getIdBase() + EVENTID_FILEREMOVEERROR;
1695 if (this->m_eventOut_OutputPort[0].isConnected()) {
1699#if FW_AMPCS_COMPATIBLE
1708 _status = fileName.
serialize(_logBuff, 256);
1714#if FW_AMPCS_COMPATIBLE
1717 static_cast<U8>(
sizeof(U32))
1730 this->m_eventOut_OutputPort[0].invoke(
1739#if FW_ENABLE_TEXT_LOGGING
1740 if (this->m_LogText_OutputPort[0].isConnected()) {
1741#if FW_OBJECT_NAMES == 1
1742 const char* _formatString =
1743 "(%s) %s: Could not remove file %s, returned status %" PRIu32
"";
1745 const char* _formatString =
1746 "%s: Could not remove file %s, returned status %" PRIu32
"";
1766 this->m_LogText_OutputPort[0].invoke(
1678 void FileManagerComponentBase :: {
…}
1776 void FileManagerComponentBase ::
1777 log_WARNING_HI_ShellCommandFailed(
1784 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1785 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1790 _id = this->getIdBase() + EVENTID_SHELLCOMMANDFAILED;
1793 if (this->m_eventOut_OutputPort[0].isConnected()) {
1797#if FW_AMPCS_COMPATIBLE
1806 _status = command.
serialize(_logBuff, 256);
1812#if FW_AMPCS_COMPATIBLE
1815 static_cast<U8>(
sizeof(U32))
1828 this->m_eventOut_OutputPort[0].invoke(
1837#if FW_ENABLE_TEXT_LOGGING
1838 if (this->m_LogText_OutputPort[0].isConnected()) {
1839#if FW_OBJECT_NAMES == 1
1840 const char* _formatString =
1841 "(%s) %s: Shell command %s failed with status %" PRIu32
"";
1843 const char* _formatString =
1844 "%s: Shell command %s failed with status %" PRIu32
"";
1856 "ShellCommandFailed ",
1864 this->m_LogText_OutputPort[0].invoke(
1776 void FileManagerComponentBase :: {
…}
1874 void FileManagerComponentBase ::
1875 log_WARNING_HI_AppendFileFailed(
1883 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1884 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1889 _id = this->getIdBase() + EVENTID_APPENDFILEFAILED;
1892 if (this->m_eventOut_OutputPort[0].isConnected()) {
1896#if FW_AMPCS_COMPATIBLE
1905 _status = source.
serialize(_logBuff, 256);
1911 _status = target.
serialize(_logBuff, 256);
1917#if FW_AMPCS_COMPATIBLE
1920 static_cast<U8>(
sizeof(U32))
1933 this->m_eventOut_OutputPort[0].invoke(
1942#if FW_ENABLE_TEXT_LOGGING
1943 if (this->m_LogText_OutputPort[0].isConnected()) {
1944#if FW_OBJECT_NAMES == 1
1945 const char* _formatString =
1946 "(%s) %s: Appending %s onto %s failed with status %" PRIu32
"";
1948 const char* _formatString =
1949 "%s: Appending %s onto %s failed with status %" PRIu32
"";
1961 "AppendFileFailed ",
1970 this->m_LogText_OutputPort[0].invoke(
1874 void FileManagerComponentBase :: {
…}
1980 void FileManagerComponentBase ::
1981 log_ACTIVITY_HI_AppendFileSucceeded(
1988 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1989 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1994 _id = this->getIdBase() + EVENTID_APPENDFILESUCCEEDED;
1997 if (this->m_eventOut_OutputPort[0].isConnected()) {
2001#if FW_AMPCS_COMPATIBLE
2010 _status = source.
serialize(_logBuff, 256);
2016 _status = target.
serialize(_logBuff, 256);
2022 this->m_eventOut_OutputPort[0].invoke(
2031#if FW_ENABLE_TEXT_LOGGING
2032 if (this->m_LogText_OutputPort[0].isConnected()) {
2033#if FW_OBJECT_NAMES == 1
2034 const char* _formatString =
2035 "(%s) %s: Appended %s to the end of %s";
2037 const char* _formatString =
2038 "%s: Appended %s to the end of %s";
2050 "AppendFileSucceeded ",
2058 this->m_LogText_OutputPort[0].invoke(
1980 void FileManagerComponentBase :: {
…}
2068 void FileManagerComponentBase ::
2073 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2074 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2079 _id = this->getIdBase() + EVENTID_SHELLCOMMANDSUCCEEDED;
2082 if (this->m_eventOut_OutputPort[0].isConnected()) {
2086#if FW_AMPCS_COMPATIBLE
2095 _status = command.
serialize(_logBuff, 256);
2101 this->m_eventOut_OutputPort[0].invoke(
2110#if FW_ENABLE_TEXT_LOGGING
2111 if (this->m_LogText_OutputPort[0].isConnected()) {
2112#if FW_OBJECT_NAMES == 1
2113 const char* _formatString =
2114 "(%s) %s: Shell command %s succeeded";
2116 const char* _formatString =
2117 "%s: Shell command %s succeeded";
2129 "ShellCommandSucceeded ",
2136 this->m_LogText_OutputPort[0].invoke(
2068 void FileManagerComponentBase :: {
…}
2146 void FileManagerComponentBase ::
2151 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2152 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2157 _id = this->getIdBase() + EVENTID_CREATEDIRECTORYSUCCEEDED;
2160 if (this->m_eventOut_OutputPort[0].isConnected()) {
2164#if FW_AMPCS_COMPATIBLE
2173 _status = dirName.
serialize(_logBuff, 256);
2179 this->m_eventOut_OutputPort[0].invoke(
2188#if FW_ENABLE_TEXT_LOGGING
2189 if (this->m_LogText_OutputPort[0].isConnected()) {
2190#if FW_OBJECT_NAMES == 1
2191 const char* _formatString =
2192 "(%s) %s: Created directory %s successfully";
2194 const char* _formatString =
2195 "%s: Created directory %s successfully";
2207 "CreateDirectorySucceeded ",
2214 this->m_LogText_OutputPort[0].invoke(
2146 void FileManagerComponentBase :: {
…}
2224 void FileManagerComponentBase ::
2229 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2230 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2235 _id = this->getIdBase() + EVENTID_REMOVEDIRECTORYSUCCEEDED;
2238 if (this->m_eventOut_OutputPort[0].isConnected()) {
2242#if FW_AMPCS_COMPATIBLE
2251 _status = dirName.
serialize(_logBuff, 256);
2257 this->m_eventOut_OutputPort[0].invoke(
2266#if FW_ENABLE_TEXT_LOGGING
2267 if (this->m_LogText_OutputPort[0].isConnected()) {
2268#if FW_OBJECT_NAMES == 1
2269 const char* _formatString =
2270 "(%s) %s: Removed directory %s successfully";
2272 const char* _formatString =
2273 "%s: Removed directory %s successfully";
2285 "RemoveDirectorySucceeded ",
2292 this->m_LogText_OutputPort[0].invoke(
2224 void FileManagerComponentBase :: {
…}
2302 void FileManagerComponentBase ::
2303 log_ACTIVITY_HI_MoveFileSucceeded(
2310 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2311 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2316 _id = this->getIdBase() + EVENTID_MOVEFILESUCCEEDED;
2319 if (this->m_eventOut_OutputPort[0].isConnected()) {
2323#if FW_AMPCS_COMPATIBLE
2332 _status = sourceFileName.
serialize(_logBuff, 256);
2338 _status = destFileName.
serialize(_logBuff, 256);
2344 this->m_eventOut_OutputPort[0].invoke(
2353#if FW_ENABLE_TEXT_LOGGING
2354 if (this->m_LogText_OutputPort[0].isConnected()) {
2355#if FW_OBJECT_NAMES == 1
2356 const char* _formatString =
2357 "(%s) %s: Moved file %s to file %s successfully";
2359 const char* _formatString =
2360 "%s: Moved file %s to file %s successfully";
2372 "MoveFileSucceeded ",
2380 this->m_LogText_OutputPort[0].invoke(
2302 void FileManagerComponentBase :: {
…}
2390 void FileManagerComponentBase ::
2395 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2396 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2401 _id = this->getIdBase() + EVENTID_REMOVEFILESUCCEEDED;
2404 if (this->m_eventOut_OutputPort[0].isConnected()) {
2408#if FW_AMPCS_COMPATIBLE
2417 _status = fileName.
serialize(_logBuff, 256);
2423 this->m_eventOut_OutputPort[0].invoke(
2432#if FW_ENABLE_TEXT_LOGGING
2433 if (this->m_LogText_OutputPort[0].isConnected()) {
2434#if FW_OBJECT_NAMES == 1
2435 const char* _formatString =
2436 "(%s) %s: Removed file %s successfully";
2438 const char* _formatString =
2439 "%s: Removed file %s successfully";
2451 "RemoveFileSucceeded ",
2458 this->m_LogText_OutputPort[0].invoke(
2390 void FileManagerComponentBase :: {
…}
2468 void FileManagerComponentBase ::
2469 log_ACTIVITY_HI_AppendFileStarted(
2476 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2477 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2482 _id = this->getIdBase() + EVENTID_APPENDFILESTARTED;
2485 if (this->m_eventOut_OutputPort[0].isConnected()) {
2489#if FW_AMPCS_COMPATIBLE
2498 _status = source.
serialize(_logBuff, 256);
2504 _status = target.
serialize(_logBuff, 256);
2510 this->m_eventOut_OutputPort[0].invoke(
2519#if FW_ENABLE_TEXT_LOGGING
2520 if (this->m_LogText_OutputPort[0].isConnected()) {
2521#if FW_OBJECT_NAMES == 1
2522 const char* _formatString =
2523 "(%s) %s: Appending file %s to the end of %s...";
2525 const char* _formatString =
2526 "%s: Appending file %s to the end of %s...";
2538 "AppendFileStarted ",
2546 this->m_LogText_OutputPort[0].invoke(
2468 void FileManagerComponentBase :: {
…}
2556 void FileManagerComponentBase ::
2561 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2562 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2567 _id = this->getIdBase() + EVENTID_SHELLCOMMANDSTARTED;
2570 if (this->m_eventOut_OutputPort[0].isConnected()) {
2574#if FW_AMPCS_COMPATIBLE
2583 _status = command.
serialize(_logBuff, 256);
2589 this->m_eventOut_OutputPort[0].invoke(
2598#if FW_ENABLE_TEXT_LOGGING
2599 if (this->m_LogText_OutputPort[0].isConnected()) {
2600#if FW_OBJECT_NAMES == 1
2601 const char* _formatString =
2602 "(%s) %s: Running shell command %s...";
2604 const char* _formatString =
2605 "%s: Running shell command %s...";
2617 "ShellCommandStarted ",
2624 this->m_LogText_OutputPort[0].invoke(
2556 void FileManagerComponentBase :: {
…}
2634 void FileManagerComponentBase ::
2639 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2640 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2645 _id = this->getIdBase() + EVENTID_CREATEDIRECTORYSTARTED;
2648 if (this->m_eventOut_OutputPort[0].isConnected()) {
2652#if FW_AMPCS_COMPATIBLE
2661 _status = dirName.
serialize(_logBuff, 256);
2667 this->m_eventOut_OutputPort[0].invoke(
2676#if FW_ENABLE_TEXT_LOGGING
2677 if (this->m_LogText_OutputPort[0].isConnected()) {
2678#if FW_OBJECT_NAMES == 1
2679 const char* _formatString =
2680 "(%s) %s: Creating directory %s...";
2682 const char* _formatString =
2683 "%s: Creating directory %s...";
2695 "CreateDirectoryStarted ",
2702 this->m_LogText_OutputPort[0].invoke(
2634 void FileManagerComponentBase :: {
…}
2712 void FileManagerComponentBase ::
2717 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2718 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2723 _id = this->getIdBase() + EVENTID_REMOVEDIRECTORYSTARTED;
2726 if (this->m_eventOut_OutputPort[0].isConnected()) {
2730#if FW_AMPCS_COMPATIBLE
2739 _status = dirName.
serialize(_logBuff, 256);
2745 this->m_eventOut_OutputPort[0].invoke(
2754#if FW_ENABLE_TEXT_LOGGING
2755 if (this->m_LogText_OutputPort[0].isConnected()) {
2756#if FW_OBJECT_NAMES == 1
2757 const char* _formatString =
2758 "(%s) %s: Removing directory %s...";
2760 const char* _formatString =
2761 "%s: Removing directory %s...";
2773 "RemoveDirectoryStarted ",
2780 this->m_LogText_OutputPort[0].invoke(
2712 void FileManagerComponentBase :: {
…}
2790 void FileManagerComponentBase ::
2791 log_ACTIVITY_HI_MoveFileStarted(
2798 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2799 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2804 _id = this->getIdBase() + EVENTID_MOVEFILESTARTED;
2807 if (this->m_eventOut_OutputPort[0].isConnected()) {
2811#if FW_AMPCS_COMPATIBLE
2820 _status = sourceFileName.
serialize(_logBuff, 256);
2826 _status = destFileName.
serialize(_logBuff, 256);
2832 this->m_eventOut_OutputPort[0].invoke(
2841#if FW_ENABLE_TEXT_LOGGING
2842 if (this->m_LogText_OutputPort[0].isConnected()) {
2843#if FW_OBJECT_NAMES == 1
2844 const char* _formatString =
2845 "(%s) %s: Moving file %s to file %s...";
2847 const char* _formatString =
2848 "%s: Moving file %s to file %s...";
2868 this->m_LogText_OutputPort[0].invoke(
2790 void FileManagerComponentBase :: {
…}
2878 void FileManagerComponentBase ::
2883 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2884 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2889 _id = this->getIdBase() + EVENTID_REMOVEFILESTARTED;
2892 if (this->m_eventOut_OutputPort[0].isConnected()) {
2896#if FW_AMPCS_COMPATIBLE
2905 _status = fileName.
serialize(_logBuff, 256);
2911 this->m_eventOut_OutputPort[0].invoke(
2920#if FW_ENABLE_TEXT_LOGGING
2921 if (this->m_LogText_OutputPort[0].isConnected()) {
2922#if FW_OBJECT_NAMES == 1
2923 const char* _formatString =
2924 "(%s) %s: Removing file %s...";
2926 const char* _formatString =
2927 "%s: Removing file %s...";
2939 "RemoveFileStarted ",
2946 this->m_LogText_OutputPort[0].invoke(
2878 void FileManagerComponentBase :: {
…}
2956 void FileManagerComponentBase ::
2957 log_ACTIVITY_HI_FileSizeSucceeded(
2964 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2965 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2970 _id = this->getIdBase() + EVENTID_FILESIZESUCCEEDED;
2973 if (this->m_eventOut_OutputPort[0].isConnected()) {
2977#if FW_AMPCS_COMPATIBLE
2986 _status = fileName.
serialize(_logBuff, 256);
2992#if FW_AMPCS_COMPATIBLE
2995 static_cast<U8>(
sizeof(
U64))
3008 this->m_eventOut_OutputPort[0].invoke(
3017#if FW_ENABLE_TEXT_LOGGING
3018 if (this->m_LogText_OutputPort[0].isConnected()) {
3019#if FW_OBJECT_NAMES == 1
3020 const char* _formatString =
3021 "(%s) %s: The size of file %s is %" PRIu64
" B";
3023 const char* _formatString =
3024 "%s: The size of file %s is %" PRIu64
" B";
3036 "FileSizeSucceeded ",
3044 this->m_LogText_OutputPort[0].invoke(
2956 void FileManagerComponentBase :: {
…}
3054 void FileManagerComponentBase ::
3055 log_WARNING_HI_FileSizeError(
3062 if (this->m_timeCaller_OutputPort[0].isConnected()) {
3063 this->m_timeCaller_OutputPort[0].invoke(_logTime);
3068 _id = this->getIdBase() + EVENTID_FILESIZEERROR;
3071 if (this->m_eventOut_OutputPort[0].isConnected()) {
3075#if FW_AMPCS_COMPATIBLE
3084 _status = fileName.
serialize(_logBuff, 256);
3090#if FW_AMPCS_COMPATIBLE
3093 static_cast<U8>(
sizeof(U32))
3106 this->m_eventOut_OutputPort[0].invoke(
3115#if FW_ENABLE_TEXT_LOGGING
3116 if (this->m_LogText_OutputPort[0].isConnected()) {
3117#if FW_OBJECT_NAMES == 1
3118 const char* _formatString =
3119 "(%s) %s: Failed to get the size of file %s, returned status %" PRIu32
"";
3121 const char* _formatString =
3122 "%s: Failed to get the size of file %s, returned status %" PRIu32
"";
3142 this->m_LogText_OutputPort[0].invoke(
3054 void FileManagerComponentBase :: {
…}
3152 void FileManagerComponentBase ::
3157 if (this->m_timeCaller_OutputPort[0].isConnected()) {
3158 this->m_timeCaller_OutputPort[0].invoke(_logTime);
3163 _id = this->getIdBase() + EVENTID_FILESIZESTARTED;
3166 if (this->m_eventOut_OutputPort[0].isConnected()) {
3170#if FW_AMPCS_COMPATIBLE
3179 _status = fileName.
serialize(_logBuff, 256);
3185 this->m_eventOut_OutputPort[0].invoke(
3194#if FW_ENABLE_TEXT_LOGGING
3195 if (this->m_LogText_OutputPort[0].isConnected()) {
3196#if FW_OBJECT_NAMES == 1
3197 const char* _formatString =
3198 "(%s) %s: Checking size of file %s...";
3200 const char* _formatString =
3201 "%s: Checking size of file %s...";
3220 this->m_LogText_OutputPort[0].invoke(
3152 void FileManagerComponentBase :: {
…}
3234 void FileManagerComponentBase ::
3235 tlmWrite_CommandsExecuted(
3240 if (this->m_tlmOut_OutputPort[0].isConnected()) {
3242 this->m_timeCaller_OutputPort[0].isConnected() &&
3245 this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
3257 _id = this->getIdBase() + CHANNELID_COMMANDSEXECUTED;
3259 this->m_tlmOut_OutputPort[0].invoke(
3234 void FileManagerComponentBase :: {
…}
3267 void FileManagerComponentBase ::
3273 if (this->m_tlmOut_OutputPort[0].isConnected()) {
3275 this->m_timeCaller_OutputPort[0].isConnected() &&
3278 this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
3290 _id = this->getIdBase() + CHANNELID_ERRORS;
3292 this->m_tlmOut_OutputPort[0].invoke(
3267 void FileManagerComponentBase :: {
…}
3307 if (this->m_timeCaller_OutputPort[0].isConnected()) {
3309 this->m_timeCaller_OutputPort[0].invoke(_time);
3324 ComponentIpcSerializableBuffer msg;
3347 MsgTypeEnum msgType =
static_cast<MsgTypeEnum
>(desMsg);
3349 if (msgType == FILEMANAGER_COMPONENT_EXIT) {
3350 return MSG_DISPATCH_EXIT;
3354 deserStatus = msg.deserialize(portNum);
3365 deserStatus = msg.deserialize(key);
3371 this->pingIn_handler(
3380 case CMD_CREATEDIRECTORY: {
3383 deserStatus = msg.deserialize(opCode);
3391 deserStatus = msg.deserialize(cmdSeq);
3399 deserStatus = msg.deserialize(args);
3412 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3413 this->cmdResponse_out(
3425#if FW_CMD_CHECK_RESIDUAL
3427 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3436 this->CreateDirectory_cmdHandler(
3445 case CMD_MOVEFILE: {
3448 deserStatus = msg.deserialize(opCode);
3456 deserStatus = msg.deserialize(cmdSeq);
3464 deserStatus = msg.deserialize(args);
3477 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3478 this->cmdResponse_out(
3492 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3493 this->cmdResponse_out(
3505#if FW_CMD_CHECK_RESIDUAL
3507 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3516 this->MoveFile_cmdHandler(
3526 case CMD_REMOVEDIRECTORY: {
3529 deserStatus = msg.deserialize(opCode);
3537 deserStatus = msg.deserialize(cmdSeq);
3545 deserStatus = msg.deserialize(args);
3558 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3559 this->cmdResponse_out(
3571#if FW_CMD_CHECK_RESIDUAL
3573 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3582 this->RemoveDirectory_cmdHandler(
3591 case CMD_REMOVEFILE: {
3594 deserStatus = msg.deserialize(opCode);
3602 deserStatus = msg.deserialize(cmdSeq);
3610 deserStatus = msg.deserialize(args);
3623 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3624 this->cmdResponse_out(
3638 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3639 this->cmdResponse_out(
3651#if FW_CMD_CHECK_RESIDUAL
3653 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3662 this->RemoveFile_cmdHandler(
3672 case CMD_SHELLCOMMAND: {
3675 deserStatus = msg.deserialize(opCode);
3683 deserStatus = msg.deserialize(cmdSeq);
3691 deserStatus = msg.deserialize(args);
3704 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3705 this->cmdResponse_out(
3719 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3720 this->cmdResponse_out(
3732#if FW_CMD_CHECK_RESIDUAL
3734 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3743 this->ShellCommand_cmdHandler(
3753 case CMD_APPENDFILE: {
3756 deserStatus = msg.deserialize(opCode);
3764 deserStatus = msg.deserialize(cmdSeq);
3772 deserStatus = msg.deserialize(args);
3785 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3786 this->cmdResponse_out(
3800 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3801 this->cmdResponse_out(
3813#if FW_CMD_CHECK_RESIDUAL
3815 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3824 this->AppendFile_cmdHandler(
3834 case CMD_FILESIZE: {
3837 deserStatus = msg.deserialize(opCode);
3845 deserStatus = msg.deserialize(cmdSeq);
3853 deserStatus = msg.deserialize(args);
3866 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3867 this->cmdResponse_out(
3879#if FW_CMD_CHECK_RESIDUAL
3881 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3890 this->FileSize_cmdHandler(
3899 return MSG_DISPATCH_ERROR;
3902 return MSG_DISPATCH_OK;
3909 void FileManagerComponentBase ::
3919 FileManagerComponentBase* compPtr =
static_cast<FileManagerComponentBase*
>(callComp);
3921 const U32 idBase = callComp->
getIdBase();
3922 FW_ASSERT(opCode >= idBase, opCode, idBase);
3925 switch (opCode - idBase) {
3926 case OPCODE_CREATEDIRECTORY: {
3927 compPtr->CreateDirectory_cmdHandlerBase(
3935 case OPCODE_MOVEFILE: {
3936 compPtr->MoveFile_cmdHandlerBase(
3944 case OPCODE_REMOVEDIRECTORY: {
3945 compPtr->RemoveDirectory_cmdHandlerBase(
3953 case OPCODE_REMOVEFILE: {
3954 compPtr->RemoveFile_cmdHandlerBase(
3962 case OPCODE_SHELLCOMMAND: {
3963 compPtr->ShellCommand_cmdHandlerBase(
3971 case OPCODE_APPENDFILE: {
3972 compPtr->AppendFile_cmdHandlerBase(
3980 case OPCODE_FILESIZE: {
3981 compPtr->FileSize_cmdHandlerBase(
3995 void FileManagerComponentBase ::
4003 FileManagerComponentBase* compPtr =
static_cast<FileManagerComponentBase*
>(callComp);
4004 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.