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
105 char portName[2*FW_OBJ_NAME_MAX_SIZE];
113 this->m_cmdIn_InputPort[port].setObjName(portName);
120 port < static_cast<PlatformIntType>(this->getNum_pingIn_InputPorts());
123 this->m_pingIn_InputPort[port].init();
124 this->m_pingIn_InputPort[port].addCallComp(
128 this->m_pingIn_InputPort[port].setPortNum(port);
130#if FW_OBJECT_NAMES == 1
137 char portName[2*FW_OBJ_NAME_MAX_SIZE];
145 this->m_pingIn_InputPort[port].setObjName(portName);
149#if FW_ENABLE_TEXT_LOGGING == 1
153 port < static_cast<PlatformIntType>(this->getNum_LogText_OutputPorts());
156 this->m_LogText_OutputPort[port].init();
158#if FW_OBJECT_NAMES == 1
165 char portName[2*FW_OBJ_NAME_MAX_SIZE];
173 this->m_LogText_OutputPort[port].setObjName(portName);
181 port < static_cast<PlatformIntType>(this->getNum_cmdRegOut_OutputPorts());
184 this->m_cmdRegOut_OutputPort[port].init();
186#if FW_OBJECT_NAMES == 1
193 char portName[2*FW_OBJ_NAME_MAX_SIZE];
201 this->m_cmdRegOut_OutputPort[port].setObjName(portName);
208 port < static_cast<PlatformIntType>(this->getNum_cmdResponseOut_OutputPorts());
211 this->m_cmdResponseOut_OutputPort[port].init();
213#if FW_OBJECT_NAMES == 1
220 char portName[2*FW_OBJ_NAME_MAX_SIZE];
228 this->m_cmdResponseOut_OutputPort[port].setObjName(portName);
235 port < static_cast<PlatformIntType>(this->getNum_eventOut_OutputPorts());
238 this->m_eventOut_OutputPort[port].init();
240#if FW_OBJECT_NAMES == 1
247 char portName[2*FW_OBJ_NAME_MAX_SIZE];
255 this->m_eventOut_OutputPort[port].setObjName(portName);
262 port < static_cast<PlatformIntType>(this->getNum_timeCaller_OutputPorts());
265 this->m_timeCaller_OutputPort[port].init();
267#if FW_OBJECT_NAMES == 1
274 char portName[2*FW_OBJ_NAME_MAX_SIZE];
282 this->m_timeCaller_OutputPort[port].setObjName(portName);
289 port < static_cast<PlatformIntType>(this->getNum_tlmOut_OutputPorts());
292 this->m_tlmOut_OutputPort[port].init();
294#if FW_OBJECT_NAMES == 1
301 char portName[2*FW_OBJ_NAME_MAX_SIZE];
309 this->m_tlmOut_OutputPort[port].setObjName(portName);
316 port < static_cast<PlatformIntType>(this->getNum_pingOut_OutputPorts());
319 this->m_pingOut_OutputPort[port].init();
321#if FW_OBJECT_NAMES == 1
328 char portName[2*FW_OBJ_NAME_MAX_SIZE];
336 this->m_pingOut_OutputPort[port].setObjName(portName);
342 ComponentIpcSerializableBuffer::SERIALIZATION_SIZE
76 void FileManagerComponentBase :: {
…}
358 portNum < this->getNum_cmdIn_InputPorts(),
362 return &this->m_cmdIn_InputPort[portNum];
373 portNum < this->getNum_pingIn_InputPorts(),
377 return &this->m_pingIn_InputPort[portNum];
384#if FW_ENABLE_TEXT_LOGGING == 1
386 void FileManagerComponentBase ::
387 set_LogText_OutputPort(
393 portNum < this->getNum_LogText_OutputPorts(),
397 this->m_LogText_OutputPort[portNum].addCallPort(port);
402 void FileManagerComponentBase ::
403 set_cmdRegOut_OutputPort(
409 portNum < this->getNum_cmdRegOut_OutputPorts(),
413 this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
402 void FileManagerComponentBase :: {
…}
416 void FileManagerComponentBase ::
417 set_cmdResponseOut_OutputPort(
423 portNum < this->getNum_cmdResponseOut_OutputPorts(),
427 this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
416 void FileManagerComponentBase :: {
…}
430 void FileManagerComponentBase ::
431 set_eventOut_OutputPort(
437 portNum < this->getNum_eventOut_OutputPorts(),
441 this->m_eventOut_OutputPort[portNum].addCallPort(port);
430 void FileManagerComponentBase :: {
…}
444 void FileManagerComponentBase ::
445 set_timeCaller_OutputPort(
451 portNum < this->getNum_timeCaller_OutputPorts(),
455 this->m_timeCaller_OutputPort[portNum].addCallPort(port);
444 void FileManagerComponentBase :: {
…}
458 void FileManagerComponentBase ::
459 set_tlmOut_OutputPort(
465 portNum < this->getNum_tlmOut_OutputPorts(),
469 this->m_tlmOut_OutputPort[portNum].addCallPort(port);
458 void FileManagerComponentBase :: {
…}
476 void FileManagerComponentBase ::
477 set_pingOut_OutputPort(
483 portNum < this->getNum_pingOut_OutputPorts(),
487 this->m_pingOut_OutputPort[portNum].addCallPort(port);
476 void FileManagerComponentBase :: {
…}
490#if FW_PORT_SERIALIZATION
496#if FW_ENABLE_TEXT_LOGGING == 1
498 void FileManagerComponentBase ::
499 set_LogText_OutputPort(
501 Fw::InputSerializePort* port
505 portNum < this->getNum_LogText_OutputPorts(),
509 this->m_LogText_OutputPort[portNum].registerSerialPort(port);
514 void FileManagerComponentBase ::
515 set_cmdRegOut_OutputPort(
517 Fw::InputSerializePort* port
521 portNum < this->getNum_cmdRegOut_OutputPorts(),
525 this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
528 void FileManagerComponentBase ::
529 set_cmdResponseOut_OutputPort(
531 Fw::InputSerializePort* port
535 portNum < this->getNum_cmdResponseOut_OutputPorts(),
539 this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
542 void FileManagerComponentBase ::
543 set_eventOut_OutputPort(
545 Fw::InputSerializePort* port
549 portNum < this->getNum_eventOut_OutputPorts(),
553 this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
556 void FileManagerComponentBase ::
557 set_timeCaller_OutputPort(
559 Fw::InputSerializePort* port
563 portNum < this->getNum_timeCaller_OutputPorts(),
567 this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
570 void FileManagerComponentBase ::
571 set_tlmOut_OutputPort(
573 Fw::InputSerializePort* port
577 portNum < this->getNum_tlmOut_OutputPorts(),
581 this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
586#if FW_PORT_SERIALIZATION
592 void FileManagerComponentBase ::
593 set_pingOut_OutputPort(
595 Fw::InputSerializePort* port
599 portNum < this->getNum_pingOut_OutputPorts(),
603 this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
612 void FileManagerComponentBase ::
615 FW_ASSERT(this->m_cmdRegOut_OutputPort[0].isConnected());
617 this->m_cmdRegOut_OutputPort[0].invoke(
618 this->getIdBase() + OPCODE_CREATEDIRECTORY
621 this->m_cmdRegOut_OutputPort[0].invoke(
622 this->getIdBase() + OPCODE_MOVEFILE
625 this->m_cmdRegOut_OutputPort[0].invoke(
626 this->getIdBase() + OPCODE_REMOVEDIRECTORY
629 this->m_cmdRegOut_OutputPort[0].invoke(
630 this->getIdBase() + OPCODE_REMOVEFILE
633 this->m_cmdRegOut_OutputPort[0].invoke(
634 this->getIdBase() + OPCODE_SHELLCOMMAND
637 this->m_cmdRegOut_OutputPort[0].invoke(
638 this->getIdBase() + OPCODE_APPENDFILE
641 this->m_cmdRegOut_OutputPort[0].invoke(
642 this->getIdBase() + OPCODE_FILESIZE
612 void FileManagerComponentBase :: {
…}
650 FileManagerComponentBase ::
651 FileManagerComponentBase(
const char* compName) :
652 Fw::ActiveComponentBase(compName)
650 FileManagerComponentBase :: {
…}
657 FileManagerComponentBase ::
658 ~FileManagerComponentBase()
657 FileManagerComponentBase :: {
…}
668 getNum_cmdIn_InputPorts()
const
678 getNum_pingIn_InputPorts()
const
687#if FW_ENABLE_TEXT_LOGGING == 1
690 getNum_LogText_OutputPorts()
const
698 getNum_cmdRegOut_OutputPorts()
const
704 getNum_cmdResponseOut_OutputPorts()
const
710 getNum_eventOut_OutputPorts()
const
716 getNum_timeCaller_OutputPorts()
const
722 getNum_tlmOut_OutputPorts()
const
732 getNum_pingOut_OutputPorts()
const
741#if FW_ENABLE_TEXT_LOGGING == 1
743 bool FileManagerComponentBase ::
747 portNum < this->getNum_LogText_OutputPorts(),
751 return this->m_LogText_OutputPort[portNum].isConnected();
756 bool FileManagerComponentBase ::
760 portNum < this->getNum_cmdRegOut_OutputPorts(),
764 return this->m_cmdRegOut_OutputPort[portNum].isConnected();
756 bool FileManagerComponentBase :: {
…}
767 bool FileManagerComponentBase ::
771 portNum < this->getNum_cmdResponseOut_OutputPorts(),
775 return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
767 bool FileManagerComponentBase :: {
…}
778 bool FileManagerComponentBase ::
782 portNum < this->getNum_eventOut_OutputPorts(),
786 return this->m_eventOut_OutputPort[portNum].isConnected();
778 bool FileManagerComponentBase :: {
…}
789 bool FileManagerComponentBase ::
793 portNum < this->getNum_timeCaller_OutputPorts(),
797 return this->m_timeCaller_OutputPort[portNum].isConnected();
789 bool FileManagerComponentBase :: {
…}
800 bool FileManagerComponentBase ::
804 portNum < this->getNum_tlmOut_OutputPorts(),
808 return this->m_tlmOut_OutputPort[portNum].isConnected();
800 bool FileManagerComponentBase :: {
…}
815 bool FileManagerComponentBase ::
819 portNum < this->getNum_pingOut_OutputPorts(),
823 return this->m_pingOut_OutputPort[portNum].isConnected();
815 bool FileManagerComponentBase :: {
…}
832 void FileManagerComponentBase ::
840 portNum < this->getNum_pingIn_InputPorts(),
849 ComponentIpcSerializableBuffer msg;
853 _status = msg.serialize(
862 _status = msg.serialize(portNum);
869 _status = msg.serialize(key);
832 void FileManagerComponentBase :: {
…}
893 void FileManagerComponentBase ::
893 void FileManagerComponentBase :: {
…}
906 void FileManagerComponentBase ::
913 portNum < this->getNum_pingOut_OutputPorts(),
916 this->m_pingOut_OutputPort[portNum].invoke(
906 void FileManagerComponentBase :: {
…}
925 void FileManagerComponentBase ::
932 FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
933 this->m_cmdResponseOut_OutputPort[0].invoke(opCode, cmdSeq, response);
925 void FileManagerComponentBase :: {
…}
942 void FileManagerComponentBase ::
943 CreateDirectory_cmdHandlerBase(
950 this->CreateDirectory_preMsgHook(opCode,cmdSeq);
954 ComponentIpcSerializableBuffer msg;
958 _status = msg.serialize(
static_cast<NATIVE_INT_TYPE>(CMD_CREATEDIRECTORY));
967 _status = msg.serialize(port);
973 _status = msg.serialize(opCode);
979 _status = msg.serialize(cmdSeq);
985 _status = msg.serialize(args);
942 void FileManagerComponentBase :: {
…}
1001 void FileManagerComponentBase ::
1002 MoveFile_cmdHandlerBase(
1009 this->MoveFile_preMsgHook(opCode,cmdSeq);
1013 ComponentIpcSerializableBuffer msg;
1026 _status = msg.serialize(port);
1032 _status = msg.serialize(opCode);
1038 _status = msg.serialize(cmdSeq);
1044 _status = msg.serialize(args);
1001 void FileManagerComponentBase :: {
…}
1060 void FileManagerComponentBase ::
1061 RemoveDirectory_cmdHandlerBase(
1068 this->RemoveDirectory_preMsgHook(opCode,cmdSeq);
1072 ComponentIpcSerializableBuffer msg;
1076 _status = msg.serialize(
static_cast<NATIVE_INT_TYPE>(CMD_REMOVEDIRECTORY));
1085 _status = msg.serialize(port);
1091 _status = msg.serialize(opCode);
1097 _status = msg.serialize(cmdSeq);
1103 _status = msg.serialize(args);
1060 void FileManagerComponentBase :: {
…}
1119 void FileManagerComponentBase ::
1120 RemoveFile_cmdHandlerBase(
1127 this->RemoveFile_preMsgHook(opCode,cmdSeq);
1131 ComponentIpcSerializableBuffer msg;
1135 _status = msg.serialize(
static_cast<NATIVE_INT_TYPE>(CMD_REMOVEFILE));
1144 _status = msg.serialize(port);
1150 _status = msg.serialize(opCode);
1156 _status = msg.serialize(cmdSeq);
1162 _status = msg.serialize(args);
1119 void FileManagerComponentBase :: {
…}
1178 void FileManagerComponentBase ::
1179 ShellCommand_cmdHandlerBase(
1186 this->ShellCommand_preMsgHook(opCode,cmdSeq);
1190 ComponentIpcSerializableBuffer msg;
1194 _status = msg.serialize(
static_cast<NATIVE_INT_TYPE>(CMD_SHELLCOMMAND));
1203 _status = msg.serialize(port);
1209 _status = msg.serialize(opCode);
1215 _status = msg.serialize(cmdSeq);
1221 _status = msg.serialize(args);
1178 void FileManagerComponentBase :: {
…}
1237 void FileManagerComponentBase ::
1238 AppendFile_cmdHandlerBase(
1245 this->AppendFile_preMsgHook(opCode,cmdSeq);
1249 ComponentIpcSerializableBuffer msg;
1253 _status = msg.serialize(
static_cast<NATIVE_INT_TYPE>(CMD_APPENDFILE));
1262 _status = msg.serialize(port);
1268 _status = msg.serialize(opCode);
1274 _status = msg.serialize(cmdSeq);
1280 _status = msg.serialize(args);
1237 void FileManagerComponentBase :: {
…}
1296 void FileManagerComponentBase ::
1297 FileSize_cmdHandlerBase(
1304 this->FileSize_preMsgHook(opCode,cmdSeq);
1308 ComponentIpcSerializableBuffer msg;
1321 _status = msg.serialize(port);
1327 _status = msg.serialize(opCode);
1333 _status = msg.serialize(cmdSeq);
1339 _status = msg.serialize(args);
1296 void FileManagerComponentBase :: {
…}
1363 void FileManagerComponentBase ::
1364 CreateDirectory_preMsgHook(
1363 void FileManagerComponentBase :: {
…}
1374 void FileManagerComponentBase ::
1375 MoveFile_preMsgHook(
1374 void FileManagerComponentBase :: {
…}
1385 void FileManagerComponentBase ::
1386 RemoveDirectory_preMsgHook(
1385 void FileManagerComponentBase :: {
…}
1396 void FileManagerComponentBase ::
1397 RemoveFile_preMsgHook(
1396 void FileManagerComponentBase :: {
…}
1407 void FileManagerComponentBase ::
1408 ShellCommand_preMsgHook(
1407 void FileManagerComponentBase :: {
…}
1418 void FileManagerComponentBase ::
1419 AppendFile_preMsgHook(
1418 void FileManagerComponentBase :: {
…}
1429 void FileManagerComponentBase ::
1430 FileSize_preMsgHook(
1429 void FileManagerComponentBase :: {
…}
1444 void FileManagerComponentBase ::
1445 log_WARNING_HI_DirectoryCreateError(
1452 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1453 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1458 _id = this->getIdBase() + EVENTID_DIRECTORYCREATEERROR;
1461 if (this->m_eventOut_OutputPort[0].isConnected()) {
1465#if FW_AMPCS_COMPATIBLE
1474 _status = dirName.
serialize(_logBuff, 256);
1480#if FW_AMPCS_COMPATIBLE
1483 static_cast<U8>(
sizeof(U32))
1496 this->m_eventOut_OutputPort[0].invoke(
1505#if FW_ENABLE_TEXT_LOGGING
1506 if (this->m_LogText_OutputPort[0].isConnected()) {
1507#if FW_OBJECT_NAMES == 1
1508 const char* _formatString =
1509 "(%s) %s: Could not create directory %s, returned status %" PRIu32
"";
1511 const char* _formatString =
1512 "%s: Could not create directory %s, returned status %" PRIu32
"";
1524 "DirectoryCreateError ",
1532 this->m_LogText_OutputPort[0].invoke(
1444 void FileManagerComponentBase :: {
…}
1542 void FileManagerComponentBase ::
1543 log_WARNING_HI_DirectoryRemoveError(
1550 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1551 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1556 _id = this->getIdBase() + EVENTID_DIRECTORYREMOVEERROR;
1559 if (this->m_eventOut_OutputPort[0].isConnected()) {
1563#if FW_AMPCS_COMPATIBLE
1572 _status = dirName.
serialize(_logBuff, 256);
1578#if FW_AMPCS_COMPATIBLE
1581 static_cast<U8>(
sizeof(U32))
1594 this->m_eventOut_OutputPort[0].invoke(
1603#if FW_ENABLE_TEXT_LOGGING
1604 if (this->m_LogText_OutputPort[0].isConnected()) {
1605#if FW_OBJECT_NAMES == 1
1606 const char* _formatString =
1607 "(%s) %s: Could not remove directory %s, returned status %" PRIu32
"";
1609 const char* _formatString =
1610 "%s: Could not remove directory %s, returned status %" PRIu32
"";
1622 "DirectoryRemoveError ",
1630 this->m_LogText_OutputPort[0].invoke(
1542 void FileManagerComponentBase :: {
…}
1640 void FileManagerComponentBase ::
1641 log_WARNING_HI_FileMoveError(
1649 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1650 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1655 _id = this->getIdBase() + EVENTID_FILEMOVEERROR;
1658 if (this->m_eventOut_OutputPort[0].isConnected()) {
1662#if FW_AMPCS_COMPATIBLE
1671 _status = sourceFileName.
serialize(_logBuff, 256);
1677 _status = destFileName.
serialize(_logBuff, 256);
1683#if FW_AMPCS_COMPATIBLE
1686 static_cast<U8>(
sizeof(U32))
1699 this->m_eventOut_OutputPort[0].invoke(
1708#if FW_ENABLE_TEXT_LOGGING
1709 if (this->m_LogText_OutputPort[0].isConnected()) {
1710#if FW_OBJECT_NAMES == 1
1711 const char* _formatString =
1712 "(%s) %s: Could not move file %s to file %s, returned status %" PRIu32
"";
1714 const char* _formatString =
1715 "%s: Could not move file %s to file %s, returned status %" PRIu32
"";
1736 this->m_LogText_OutputPort[0].invoke(
1640 void FileManagerComponentBase :: {
…}
1746 void FileManagerComponentBase ::
1747 log_WARNING_HI_FileRemoveError(
1754 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1755 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1760 _id = this->getIdBase() + EVENTID_FILEREMOVEERROR;
1763 if (this->m_eventOut_OutputPort[0].isConnected()) {
1767#if FW_AMPCS_COMPATIBLE
1776 _status = fileName.
serialize(_logBuff, 256);
1782#if FW_AMPCS_COMPATIBLE
1785 static_cast<U8>(
sizeof(U32))
1798 this->m_eventOut_OutputPort[0].invoke(
1807#if FW_ENABLE_TEXT_LOGGING
1808 if (this->m_LogText_OutputPort[0].isConnected()) {
1809#if FW_OBJECT_NAMES == 1
1810 const char* _formatString =
1811 "(%s) %s: Could not remove file %s, returned status %" PRIu32
"";
1813 const char* _formatString =
1814 "%s: Could not remove file %s, returned status %" PRIu32
"";
1834 this->m_LogText_OutputPort[0].invoke(
1746 void FileManagerComponentBase :: {
…}
1844 void FileManagerComponentBase ::
1845 log_WARNING_HI_ShellCommandFailed(
1852 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1853 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1858 _id = this->getIdBase() + EVENTID_SHELLCOMMANDFAILED;
1861 if (this->m_eventOut_OutputPort[0].isConnected()) {
1865#if FW_AMPCS_COMPATIBLE
1874 _status = command.
serialize(_logBuff, 256);
1880#if FW_AMPCS_COMPATIBLE
1883 static_cast<U8>(
sizeof(U32))
1896 this->m_eventOut_OutputPort[0].invoke(
1905#if FW_ENABLE_TEXT_LOGGING
1906 if (this->m_LogText_OutputPort[0].isConnected()) {
1907#if FW_OBJECT_NAMES == 1
1908 const char* _formatString =
1909 "(%s) %s: Shell command %s failed with status %" PRIu32
"";
1911 const char* _formatString =
1912 "%s: Shell command %s failed with status %" PRIu32
"";
1924 "ShellCommandFailed ",
1932 this->m_LogText_OutputPort[0].invoke(
1844 void FileManagerComponentBase :: {
…}
1942 void FileManagerComponentBase ::
1943 log_WARNING_HI_AppendFileFailed(
1951 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1952 this->m_timeCaller_OutputPort[0].invoke(_logTime);
1957 _id = this->getIdBase() + EVENTID_APPENDFILEFAILED;
1960 if (this->m_eventOut_OutputPort[0].isConnected()) {
1964#if FW_AMPCS_COMPATIBLE
1973 _status = source.
serialize(_logBuff, 256);
1979 _status = target.
serialize(_logBuff, 256);
1985#if FW_AMPCS_COMPATIBLE
1988 static_cast<U8>(
sizeof(U32))
2001 this->m_eventOut_OutputPort[0].invoke(
2010#if FW_ENABLE_TEXT_LOGGING
2011 if (this->m_LogText_OutputPort[0].isConnected()) {
2012#if FW_OBJECT_NAMES == 1
2013 const char* _formatString =
2014 "(%s) %s: Appending %s onto %s failed with status %" PRIu32
"";
2016 const char* _formatString =
2017 "%s: Appending %s onto %s failed with status %" PRIu32
"";
2029 "AppendFileFailed ",
2038 this->m_LogText_OutputPort[0].invoke(
1942 void FileManagerComponentBase :: {
…}
2048 void FileManagerComponentBase ::
2049 log_ACTIVITY_HI_AppendFileSucceeded(
2056 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2057 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2062 _id = this->getIdBase() + EVENTID_APPENDFILESUCCEEDED;
2065 if (this->m_eventOut_OutputPort[0].isConnected()) {
2069#if FW_AMPCS_COMPATIBLE
2078 _status = source.
serialize(_logBuff, 256);
2084 _status = target.
serialize(_logBuff, 256);
2090 this->m_eventOut_OutputPort[0].invoke(
2099#if FW_ENABLE_TEXT_LOGGING
2100 if (this->m_LogText_OutputPort[0].isConnected()) {
2101#if FW_OBJECT_NAMES == 1
2102 const char* _formatString =
2103 "(%s) %s: Appended %s to the end of %s";
2105 const char* _formatString =
2106 "%s: Appended %s to the end of %s";
2118 "AppendFileSucceeded ",
2126 this->m_LogText_OutputPort[0].invoke(
2048 void FileManagerComponentBase :: {
…}
2136 void FileManagerComponentBase ::
2141 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2142 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2147 _id = this->getIdBase() + EVENTID_SHELLCOMMANDSUCCEEDED;
2150 if (this->m_eventOut_OutputPort[0].isConnected()) {
2154#if FW_AMPCS_COMPATIBLE
2163 _status = command.
serialize(_logBuff, 256);
2169 this->m_eventOut_OutputPort[0].invoke(
2178#if FW_ENABLE_TEXT_LOGGING
2179 if (this->m_LogText_OutputPort[0].isConnected()) {
2180#if FW_OBJECT_NAMES == 1
2181 const char* _formatString =
2182 "(%s) %s: Shell command %s succeeded";
2184 const char* _formatString =
2185 "%s: Shell command %s succeeded";
2197 "ShellCommandSucceeded ",
2204 this->m_LogText_OutputPort[0].invoke(
2136 void FileManagerComponentBase :: {
…}
2214 void FileManagerComponentBase ::
2219 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2220 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2225 _id = this->getIdBase() + EVENTID_CREATEDIRECTORYSUCCEEDED;
2228 if (this->m_eventOut_OutputPort[0].isConnected()) {
2232#if FW_AMPCS_COMPATIBLE
2241 _status = dirName.
serialize(_logBuff, 256);
2247 this->m_eventOut_OutputPort[0].invoke(
2256#if FW_ENABLE_TEXT_LOGGING
2257 if (this->m_LogText_OutputPort[0].isConnected()) {
2258#if FW_OBJECT_NAMES == 1
2259 const char* _formatString =
2260 "(%s) %s: Created directory %s successfully";
2262 const char* _formatString =
2263 "%s: Created directory %s successfully";
2275 "CreateDirectorySucceeded ",
2282 this->m_LogText_OutputPort[0].invoke(
2214 void FileManagerComponentBase :: {
…}
2292 void FileManagerComponentBase ::
2297 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2298 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2303 _id = this->getIdBase() + EVENTID_REMOVEDIRECTORYSUCCEEDED;
2306 if (this->m_eventOut_OutputPort[0].isConnected()) {
2310#if FW_AMPCS_COMPATIBLE
2319 _status = dirName.
serialize(_logBuff, 256);
2325 this->m_eventOut_OutputPort[0].invoke(
2334#if FW_ENABLE_TEXT_LOGGING
2335 if (this->m_LogText_OutputPort[0].isConnected()) {
2336#if FW_OBJECT_NAMES == 1
2337 const char* _formatString =
2338 "(%s) %s: Removed directory %s successfully";
2340 const char* _formatString =
2341 "%s: Removed directory %s successfully";
2353 "RemoveDirectorySucceeded ",
2360 this->m_LogText_OutputPort[0].invoke(
2292 void FileManagerComponentBase :: {
…}
2370 void FileManagerComponentBase ::
2371 log_ACTIVITY_HI_MoveFileSucceeded(
2378 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2379 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2384 _id = this->getIdBase() + EVENTID_MOVEFILESUCCEEDED;
2387 if (this->m_eventOut_OutputPort[0].isConnected()) {
2391#if FW_AMPCS_COMPATIBLE
2400 _status = sourceFileName.
serialize(_logBuff, 256);
2406 _status = destFileName.
serialize(_logBuff, 256);
2412 this->m_eventOut_OutputPort[0].invoke(
2421#if FW_ENABLE_TEXT_LOGGING
2422 if (this->m_LogText_OutputPort[0].isConnected()) {
2423#if FW_OBJECT_NAMES == 1
2424 const char* _formatString =
2425 "(%s) %s: Moved file %s to file %s successfully";
2427 const char* _formatString =
2428 "%s: Moved file %s to file %s successfully";
2440 "MoveFileSucceeded ",
2448 this->m_LogText_OutputPort[0].invoke(
2370 void FileManagerComponentBase :: {
…}
2458 void FileManagerComponentBase ::
2463 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2464 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2469 _id = this->getIdBase() + EVENTID_REMOVEFILESUCCEEDED;
2472 if (this->m_eventOut_OutputPort[0].isConnected()) {
2476#if FW_AMPCS_COMPATIBLE
2485 _status = fileName.
serialize(_logBuff, 256);
2491 this->m_eventOut_OutputPort[0].invoke(
2500#if FW_ENABLE_TEXT_LOGGING
2501 if (this->m_LogText_OutputPort[0].isConnected()) {
2502#if FW_OBJECT_NAMES == 1
2503 const char* _formatString =
2504 "(%s) %s: Removed file %s successfully";
2506 const char* _formatString =
2507 "%s: Removed file %s successfully";
2519 "RemoveFileSucceeded ",
2526 this->m_LogText_OutputPort[0].invoke(
2458 void FileManagerComponentBase :: {
…}
2536 void FileManagerComponentBase ::
2537 log_ACTIVITY_HI_AppendFileStarted(
2544 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2545 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2550 _id = this->getIdBase() + EVENTID_APPENDFILESTARTED;
2553 if (this->m_eventOut_OutputPort[0].isConnected()) {
2557#if FW_AMPCS_COMPATIBLE
2566 _status = source.
serialize(_logBuff, 256);
2572 _status = target.
serialize(_logBuff, 256);
2578 this->m_eventOut_OutputPort[0].invoke(
2587#if FW_ENABLE_TEXT_LOGGING
2588 if (this->m_LogText_OutputPort[0].isConnected()) {
2589#if FW_OBJECT_NAMES == 1
2590 const char* _formatString =
2591 "(%s) %s: Appending file %s to the end of %s...";
2593 const char* _formatString =
2594 "%s: Appending file %s to the end of %s...";
2606 "AppendFileStarted ",
2614 this->m_LogText_OutputPort[0].invoke(
2536 void FileManagerComponentBase :: {
…}
2624 void FileManagerComponentBase ::
2629 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2630 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2635 _id = this->getIdBase() + EVENTID_SHELLCOMMANDSTARTED;
2638 if (this->m_eventOut_OutputPort[0].isConnected()) {
2642#if FW_AMPCS_COMPATIBLE
2651 _status = command.
serialize(_logBuff, 256);
2657 this->m_eventOut_OutputPort[0].invoke(
2666#if FW_ENABLE_TEXT_LOGGING
2667 if (this->m_LogText_OutputPort[0].isConnected()) {
2668#if FW_OBJECT_NAMES == 1
2669 const char* _formatString =
2670 "(%s) %s: Running shell command %s...";
2672 const char* _formatString =
2673 "%s: Running shell command %s...";
2685 "ShellCommandStarted ",
2692 this->m_LogText_OutputPort[0].invoke(
2624 void FileManagerComponentBase :: {
…}
2702 void FileManagerComponentBase ::
2707 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2708 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2713 _id = this->getIdBase() + EVENTID_CREATEDIRECTORYSTARTED;
2716 if (this->m_eventOut_OutputPort[0].isConnected()) {
2720#if FW_AMPCS_COMPATIBLE
2729 _status = dirName.
serialize(_logBuff, 256);
2735 this->m_eventOut_OutputPort[0].invoke(
2744#if FW_ENABLE_TEXT_LOGGING
2745 if (this->m_LogText_OutputPort[0].isConnected()) {
2746#if FW_OBJECT_NAMES == 1
2747 const char* _formatString =
2748 "(%s) %s: Creating directory %s...";
2750 const char* _formatString =
2751 "%s: Creating directory %s...";
2763 "CreateDirectoryStarted ",
2770 this->m_LogText_OutputPort[0].invoke(
2702 void FileManagerComponentBase :: {
…}
2780 void FileManagerComponentBase ::
2785 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2786 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2791 _id = this->getIdBase() + EVENTID_REMOVEDIRECTORYSTARTED;
2794 if (this->m_eventOut_OutputPort[0].isConnected()) {
2798#if FW_AMPCS_COMPATIBLE
2807 _status = dirName.
serialize(_logBuff, 256);
2813 this->m_eventOut_OutputPort[0].invoke(
2822#if FW_ENABLE_TEXT_LOGGING
2823 if (this->m_LogText_OutputPort[0].isConnected()) {
2824#if FW_OBJECT_NAMES == 1
2825 const char* _formatString =
2826 "(%s) %s: Removing directory %s...";
2828 const char* _formatString =
2829 "%s: Removing directory %s...";
2841 "RemoveDirectoryStarted ",
2848 this->m_LogText_OutputPort[0].invoke(
2780 void FileManagerComponentBase :: {
…}
2858 void FileManagerComponentBase ::
2859 log_ACTIVITY_HI_MoveFileStarted(
2866 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2867 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2872 _id = this->getIdBase() + EVENTID_MOVEFILESTARTED;
2875 if (this->m_eventOut_OutputPort[0].isConnected()) {
2879#if FW_AMPCS_COMPATIBLE
2888 _status = sourceFileName.
serialize(_logBuff, 256);
2894 _status = destFileName.
serialize(_logBuff, 256);
2900 this->m_eventOut_OutputPort[0].invoke(
2909#if FW_ENABLE_TEXT_LOGGING
2910 if (this->m_LogText_OutputPort[0].isConnected()) {
2911#if FW_OBJECT_NAMES == 1
2912 const char* _formatString =
2913 "(%s) %s: Moving file %s to file %s...";
2915 const char* _formatString =
2916 "%s: Moving file %s to file %s...";
2936 this->m_LogText_OutputPort[0].invoke(
2858 void FileManagerComponentBase :: {
…}
2946 void FileManagerComponentBase ::
2951 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2952 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2957 _id = this->getIdBase() + EVENTID_REMOVEFILESTARTED;
2960 if (this->m_eventOut_OutputPort[0].isConnected()) {
2964#if FW_AMPCS_COMPATIBLE
2973 _status = fileName.
serialize(_logBuff, 256);
2979 this->m_eventOut_OutputPort[0].invoke(
2988#if FW_ENABLE_TEXT_LOGGING
2989 if (this->m_LogText_OutputPort[0].isConnected()) {
2990#if FW_OBJECT_NAMES == 1
2991 const char* _formatString =
2992 "(%s) %s: Removing file %s...";
2994 const char* _formatString =
2995 "%s: Removing file %s...";
3007 "RemoveFileStarted ",
3014 this->m_LogText_OutputPort[0].invoke(
2946 void FileManagerComponentBase :: {
…}
3024 void FileManagerComponentBase ::
3025 log_ACTIVITY_HI_FileSizeSucceeded(
3032 if (this->m_timeCaller_OutputPort[0].isConnected()) {
3033 this->m_timeCaller_OutputPort[0].invoke(_logTime);
3038 _id = this->getIdBase() + EVENTID_FILESIZESUCCEEDED;
3041 if (this->m_eventOut_OutputPort[0].isConnected()) {
3045#if FW_AMPCS_COMPATIBLE
3054 _status = fileName.
serialize(_logBuff, 256);
3060#if FW_AMPCS_COMPATIBLE
3063 static_cast<U8>(
sizeof(
U64))
3076 this->m_eventOut_OutputPort[0].invoke(
3085#if FW_ENABLE_TEXT_LOGGING
3086 if (this->m_LogText_OutputPort[0].isConnected()) {
3087#if FW_OBJECT_NAMES == 1
3088 const char* _formatString =
3089 "(%s) %s: The size of file %s is %" PRIu64
" B";
3091 const char* _formatString =
3092 "%s: The size of file %s is %" PRIu64
" B";
3104 "FileSizeSucceeded ",
3112 this->m_LogText_OutputPort[0].invoke(
3024 void FileManagerComponentBase :: {
…}
3122 void FileManagerComponentBase ::
3123 log_WARNING_HI_FileSizeError(
3130 if (this->m_timeCaller_OutputPort[0].isConnected()) {
3131 this->m_timeCaller_OutputPort[0].invoke(_logTime);
3136 _id = this->getIdBase() + EVENTID_FILESIZEERROR;
3139 if (this->m_eventOut_OutputPort[0].isConnected()) {
3143#if FW_AMPCS_COMPATIBLE
3152 _status = fileName.
serialize(_logBuff, 256);
3158#if FW_AMPCS_COMPATIBLE
3161 static_cast<U8>(
sizeof(U32))
3174 this->m_eventOut_OutputPort[0].invoke(
3183#if FW_ENABLE_TEXT_LOGGING
3184 if (this->m_LogText_OutputPort[0].isConnected()) {
3185#if FW_OBJECT_NAMES == 1
3186 const char* _formatString =
3187 "(%s) %s: Failed to get the size of file %s, returned status %" PRIu32
"";
3189 const char* _formatString =
3190 "%s: Failed to get the size of file %s, returned status %" PRIu32
"";
3210 this->m_LogText_OutputPort[0].invoke(
3122 void FileManagerComponentBase :: {
…}
3220 void FileManagerComponentBase ::
3225 if (this->m_timeCaller_OutputPort[0].isConnected()) {
3226 this->m_timeCaller_OutputPort[0].invoke(_logTime);
3231 _id = this->getIdBase() + EVENTID_FILESIZESTARTED;
3234 if (this->m_eventOut_OutputPort[0].isConnected()) {
3238#if FW_AMPCS_COMPATIBLE
3247 _status = fileName.
serialize(_logBuff, 256);
3253 this->m_eventOut_OutputPort[0].invoke(
3262#if FW_ENABLE_TEXT_LOGGING
3263 if (this->m_LogText_OutputPort[0].isConnected()) {
3264#if FW_OBJECT_NAMES == 1
3265 const char* _formatString =
3266 "(%s) %s: Checking size of file %s...";
3268 const char* _formatString =
3269 "%s: Checking size of file %s...";
3288 this->m_LogText_OutputPort[0].invoke(
3220 void FileManagerComponentBase :: {
…}
3302 void FileManagerComponentBase ::
3303 tlmWrite_CommandsExecuted(
3308 if (this->m_tlmOut_OutputPort[0].isConnected()) {
3310 this->m_timeCaller_OutputPort[0].isConnected() &&
3313 this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
3325 _id = this->getIdBase() + CHANNELID_COMMANDSEXECUTED;
3327 this->m_tlmOut_OutputPort[0].invoke(
3302 void FileManagerComponentBase :: {
…}
3335 void FileManagerComponentBase ::
3341 if (this->m_tlmOut_OutputPort[0].isConnected()) {
3343 this->m_timeCaller_OutputPort[0].isConnected() &&
3346 this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
3358 _id = this->getIdBase() + CHANNELID_ERRORS;
3360 this->m_tlmOut_OutputPort[0].invoke(
3335 void FileManagerComponentBase :: {
…}
3375 if (this->m_timeCaller_OutputPort[0].isConnected()) {
3377 this->m_timeCaller_OutputPort[0].invoke(_time);
3392 ComponentIpcSerializableBuffer msg;
3415 MsgTypeEnum msgType =
static_cast<MsgTypeEnum
>(desMsg);
3417 if (msgType == FILEMANAGER_COMPONENT_EXIT) {
3418 return MSG_DISPATCH_EXIT;
3422 deserStatus = msg.deserialize(portNum);
3433 deserStatus = msg.deserialize(key);
3439 this->pingIn_handler(
3448 case CMD_CREATEDIRECTORY: {
3451 deserStatus = msg.deserialize(opCode);
3459 deserStatus = msg.deserialize(cmdSeq);
3467 deserStatus = msg.deserialize(args);
3480 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3481 this->cmdResponse_out(
3493#if FW_CMD_CHECK_RESIDUAL
3495 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3504 this->CreateDirectory_cmdHandler(
3513 case CMD_MOVEFILE: {
3516 deserStatus = msg.deserialize(opCode);
3524 deserStatus = msg.deserialize(cmdSeq);
3532 deserStatus = msg.deserialize(args);
3545 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3546 this->cmdResponse_out(
3560 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3561 this->cmdResponse_out(
3573#if FW_CMD_CHECK_RESIDUAL
3575 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3584 this->MoveFile_cmdHandler(
3594 case CMD_REMOVEDIRECTORY: {
3597 deserStatus = msg.deserialize(opCode);
3605 deserStatus = msg.deserialize(cmdSeq);
3613 deserStatus = msg.deserialize(args);
3626 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3627 this->cmdResponse_out(
3639#if FW_CMD_CHECK_RESIDUAL
3641 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3650 this->RemoveDirectory_cmdHandler(
3659 case CMD_REMOVEFILE: {
3662 deserStatus = msg.deserialize(opCode);
3670 deserStatus = msg.deserialize(cmdSeq);
3678 deserStatus = msg.deserialize(args);
3691 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3692 this->cmdResponse_out(
3706 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3707 this->cmdResponse_out(
3719#if FW_CMD_CHECK_RESIDUAL
3721 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3730 this->RemoveFile_cmdHandler(
3740 case CMD_SHELLCOMMAND: {
3743 deserStatus = msg.deserialize(opCode);
3751 deserStatus = msg.deserialize(cmdSeq);
3759 deserStatus = msg.deserialize(args);
3772 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3773 this->cmdResponse_out(
3787 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3788 this->cmdResponse_out(
3800#if FW_CMD_CHECK_RESIDUAL
3802 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3811 this->ShellCommand_cmdHandler(
3821 case CMD_APPENDFILE: {
3824 deserStatus = msg.deserialize(opCode);
3832 deserStatus = msg.deserialize(cmdSeq);
3840 deserStatus = msg.deserialize(args);
3853 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3854 this->cmdResponse_out(
3868 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3869 this->cmdResponse_out(
3881#if FW_CMD_CHECK_RESIDUAL
3883 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3892 this->AppendFile_cmdHandler(
3902 case CMD_FILESIZE: {
3905 deserStatus = msg.deserialize(opCode);
3913 deserStatus = msg.deserialize(cmdSeq);
3921 deserStatus = msg.deserialize(args);
3934 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3935 this->cmdResponse_out(
3947#if FW_CMD_CHECK_RESIDUAL
3949 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3958 this->FileSize_cmdHandler(
3967 return MSG_DISPATCH_ERROR;
3970 return MSG_DISPATCH_OK;
3977 void FileManagerComponentBase ::
3987 FileManagerComponentBase* compPtr =
static_cast<FileManagerComponentBase*
>(callComp);
3989 const U32 idBase = callComp->
getIdBase();
3990 FW_ASSERT(opCode >= idBase, opCode, idBase);
3993 switch (opCode - idBase) {
3994 case OPCODE_CREATEDIRECTORY: {
3995 compPtr->CreateDirectory_cmdHandlerBase(
4003 case OPCODE_MOVEFILE: {
4004 compPtr->MoveFile_cmdHandlerBase(
4012 case OPCODE_REMOVEDIRECTORY: {
4013 compPtr->RemoveDirectory_cmdHandlerBase(
4021 case OPCODE_REMOVEFILE: {
4022 compPtr->RemoveFile_cmdHandlerBase(
4030 case OPCODE_SHELLCOMMAND: {
4031 compPtr->ShellCommand_cmdHandlerBase(
4039 case OPCODE_APPENDFILE: {
4040 compPtr->AppendFile_cmdHandlerBase(
4048 case OPCODE_FILESIZE: {
4049 compPtr->FileSize_cmdHandlerBase(
4063 void FileManagerComponentBase ::
4071 FileManagerComponentBase* compPtr =
static_cast<FileManagerComponentBase*
>(callComp);
4072 compPtr->pingIn_handlerBase(
PlatformIntType NATIVE_INT_TYPE
uint8_t U8
8-bit unsigned integer
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
PlatformUIntType NATIVE_UINT_TYPE
int PlatformIntType
DefaultTypes.hpp provides fallback defaults for the platform types.
#define PRI_PlatformIntType
@ TB_NONE
No time base has been established.
PlatformAssertArgType FwAssertArgType
#define FW_LOG_TEXT_BUFFER_SIZE
Max size of string for text log message.
#define FW_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.