diff --git a/Svc/ActiveLogger/docs/sdd.md b/Svc/ActiveLogger/docs/sdd.md index 45e516b988..3924ac7c40 100644 --- a/Svc/ActiveLogger/docs/sdd.md +++ b/Svc/ActiveLogger/docs/sdd.md @@ -102,13 +102,7 @@ Unit Test Checklist | [Link](Checklist_Unit_test.xlsx) ## 6. Unit Testing -[Unit Test Output](../test/ut/output/test.txt) - -[Coverage Output - `ActiveLoggerImpl.cpp`](../test/ut/output/ActiveLoggerImpl.cpp.gcov) - -[Coverage Output - `ActiveLoggerComponentAc.cpp`](../test/ut/output/ActiveLoggerComponentAc.cpp.gcov) - -[Report](../test/ut/output/SvcActiveLogger_gcov.txt) +To see unit test coverage run fprime-util check --coverage ## 7. Change Log diff --git a/Svc/ActiveLogger/test/ut/output/ActiveLoggerComponentAc.cpp.gcov b/Svc/ActiveLogger/test/ut/output/ActiveLoggerComponentAc.cpp.gcov deleted file mode 100644 index 996491b1c6..0000000000 --- a/Svc/ActiveLogger/test/ut/output/ActiveLoggerComponentAc.cpp.gcov +++ /dev/null @@ -1,2249 +0,0 @@ - -: 0:Source:/home/tim/source/isf/Svc/ActiveLogger/ActiveLoggerComponentAc.cpp - -: 0:Programs:2 - -: 1:// ====================================================================== - -: 2:// \title ActiveLoggerComponentAc.hpp - -: 3:// \author Auto-generated - -: 4:// \brief cpp file for ActiveLogger component base class - -: 5:// - -: 6:// \copyright - -: 7:// Copyright 2009-2015, by the California Institute of Technology. - -: 8:// ALL RIGHTS RESERVED. United States Government Sponsorship - -: 9:// acknowledged. - -: 11:// - -: 18:// ====================================================================== - -: 19: - -: 20:#include - -: 21:#include - -: 22:#include - -: 23:#include - -: 24:#if FW_ENABLE_TEXT_LOGGING - -: 25:#include - -: 26:#endif - -: 27: - -: 28: - -: 29:namespace Svc { - -: 30: - -: 31: // ---------------------------------------------------------------------- - -: 32: // Anonymous namespace to prevent name collisions - -: 33: // ---------------------------------------------------------------------- - -: 34: - -: 35: namespace { - -: 36: - -: 37: typedef enum { - -: 38: ACTIVELOGGER_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT, - -: 39: CMD_ALOG_DUMP_EVENT_LOG, - -: 40: CMD_ALOG_SET_ID_FILTER, - -: 41: CMD_ALOG_DUMP_FILTER_STATE, - -: 42: INT_IF_LOQQUEUE - -: 43: } MsgTypeEnum; - -: 44: - -: 45: // Get the max size by doing a union of the input port serialization sizes. - -: 46: - -: 47: typedef union { - -: 48: BYTE cmdPort[Fw::InputCmdPort::SERIALIZED_SIZE]; - -: 49: // Size of loqQueue argument list - -: 50: BYTE loqQueueIntIfSize[ - -: 51: sizeof(FwEventIdType) + - -: 52: Fw::Time::SERIALIZED_SIZE + - -: 53: sizeof(FwEnumStoreType) + - -: 54: Fw::LogBuffer::SERIALIZED_SIZE + - -: 55: 0 - -: 56: ]; - -: 57: } BuffUnion; - -: 58: - -: 59: // Define a message buffer class large enough to handle all the - -: 60: // asynchronous inputs to the component - -: 61: - 1068: 62: class ComponentIpcSerializableBuffer : - -: 63: public Fw::SerializeBufferBase - -: 64: { - -: 65: - -: 66: public: - -: 67: - -: 68: enum { - -: 69: // Max. message size = size of data + message id + port - -: 70: SERIALIZATION_SIZE = - -: 71: sizeof(BuffUnion) + - -: 72: sizeof(NATIVE_INT_TYPE) + - -: 73: sizeof(NATIVE_INT_TYPE) - -: 74: }; - -: 75: - 2640: 76: NATIVE_UINT_TYPE getBuffCapacity(void) const { - 2640: 77: return sizeof(m_buff); - -: 78: } - -: 79: - 18657: 80: U8* getBuffAddr(void) { - 18657: 81: return m_buff; - -: 82: } - -: 83: - 267: 84: const U8* getBuffAddr(void) const { - 267: 85: return m_buff; - -: 86: } - -: 87: - -: 88: private: - -: 89: // Should be the max of all the input ports serialized sizes... - -: 90: U8 m_buff[SERIALIZATION_SIZE]; - -: 91: - -: 92: }; - -: 93: - -: 94: } - -: 95: - -: 96: // ---------------------------------------------------------------------- - -: 97: // Getters for numbers of input ports - -: 98: // ---------------------------------------------------------------------- - -: 99: - 8: 100: Fw::InputLogPort *ActiveLoggerComponentBase :: - -: 101: get_LogRecv_InputPort(NATIVE_INT_TYPE portNum) - -: 102: { - 8: 103: FW_ASSERT(portNum < this->getNum_LogRecv_InputPorts(),static_cast(portNum)); - 8: 104: return &this->m_LogRecv_InputPort[portNum]; - -: 105: } - -: 106: - 8: 107: Fw::InputCmdPort *ActiveLoggerComponentBase :: - -: 108: get_CmdDisp_InputPort(NATIVE_INT_TYPE portNum) - -: 109: { - 8: 110: FW_ASSERT(portNum < this->getNum_CmdDisp_InputPorts(),static_cast(portNum)); - 8: 111: return &this->m_CmdDisp_InputPort[portNum]; - -: 112: } - -: 113: - -: 114: // ---------------------------------------------------------------------- - -: 115: // Typed connectors for output ports - -: 116: // ---------------------------------------------------------------------- - -: 117: - 8: 118: void ActiveLoggerComponentBase :: - -: 119: set_PktSend_OutputPort( - -: 120: NATIVE_INT_TYPE portNum, - -: 121: Fw::InputComPort* port - -: 122: ) - -: 123: { - 8: 124: FW_ASSERT(portNum < this->getNum_PktSend_OutputPorts(),static_cast(portNum)); - 8: 125: this->m_PktSend_OutputPort[portNum].addCallPort(port); - 8: 126: } - -: 127: - 8: 128: void ActiveLoggerComponentBase :: - -: 129: set_FatalAnnounce_OutputPort( - -: 130: NATIVE_INT_TYPE portNum, - -: 131: Svc::InputFatalEventPort* port - -: 132: ) - -: 133: { - 8: 134: FW_ASSERT(portNum < this->getNum_FatalAnnounce_OutputPorts(),static_cast(portNum)); - 8: 135: this->m_FatalAnnounce_OutputPort[portNum].addCallPort(port); - 8: 136: } - -: 137: - 8: 138: void ActiveLoggerComponentBase :: - -: 139: set_CmdStatus_OutputPort( - -: 140: NATIVE_INT_TYPE portNum, - -: 141: Fw::InputCmdResponsePort* port - -: 142: ) - -: 143: { - 8: 144: FW_ASSERT(portNum < this->getNum_CmdStatus_OutputPorts(),static_cast(portNum)); - 8: 145: this->m_CmdStatus_OutputPort[portNum].addCallPort(port); - 8: 146: } - -: 147: - #####: 148: void ActiveLoggerComponentBase :: - -: 149: set_CmdReg_OutputPort( - -: 150: NATIVE_INT_TYPE portNum, - -: 151: Fw::InputCmdRegPort* port - -: 152: ) - -: 153: { - #####: 154: FW_ASSERT(portNum < this->getNum_CmdReg_OutputPorts(),static_cast(portNum)); - #####: 155: this->m_CmdReg_OutputPort[portNum].addCallPort(port); - #####: 156: } - -: 157: - #####: 158: void ActiveLoggerComponentBase :: - -: 159: set_Time_OutputPort( - -: 160: NATIVE_INT_TYPE portNum, - -: 161: Fw::InputTimePort* port - -: 162: ) - -: 163: { - #####: 164: FW_ASSERT(portNum < this->getNum_Time_OutputPorts(),static_cast(portNum)); - #####: 165: this->m_Time_OutputPort[portNum].addCallPort(port); - #####: 166: } - -: 167: - 8: 168: void ActiveLoggerComponentBase :: - -: 169: set_Log_OutputPort( - -: 170: NATIVE_INT_TYPE portNum, - -: 171: Fw::InputLogPort* port - -: 172: ) - -: 173: { - 8: 174: FW_ASSERT(portNum < this->getNum_Log_OutputPorts(),static_cast(portNum)); - 8: 175: this->m_Log_OutputPort[portNum].addCallPort(port); - 8: 176: } - -: 177: - -: 178:#if FW_ENABLE_TEXT_LOGGING == 1 - 8: 179: void ActiveLoggerComponentBase :: - -: 180: set_LogText_OutputPort( - -: 181: NATIVE_INT_TYPE portNum, - -: 182: Fw::InputLogTextPort* port - -: 183: ) - -: 184: { - 8: 185: FW_ASSERT(portNum < this->getNum_LogText_OutputPorts(),static_cast(portNum)); - 8: 186: this->m_LogText_OutputPort[portNum].addCallPort(port); - 8: 187: } - -: 188:#endif - -: 189: - -: 190: // ---------------------------------------------------------------------- - -: 191: // Serialization connectors for output ports - -: 192: // ---------------------------------------------------------------------- - -: 193: - -: 194:#if FW_PORT_SERIALIZATION - -: 195: - #####: 196: void ActiveLoggerComponentBase :: - -: 197: set_PktSend_OutputPort( - -: 198: NATIVE_INT_TYPE portNum, - -: 199: Fw::InputSerializePort *port - -: 200: ) - -: 201: { - #####: 202: FW_ASSERT(portNum < this->getNum_PktSend_OutputPorts(),static_cast(portNum)); - #####: 203: return this->m_PktSend_OutputPort[portNum].registerSerialPort(port); - -: 204: } - -: 205: - #####: 206: void ActiveLoggerComponentBase :: - -: 207: set_FatalAnnounce_OutputPort( - -: 208: NATIVE_INT_TYPE portNum, - -: 209: Fw::InputSerializePort *port - -: 210: ) - -: 211: { - #####: 212: FW_ASSERT(portNum < this->getNum_FatalAnnounce_OutputPorts(),static_cast(portNum)); - #####: 213: return this->m_FatalAnnounce_OutputPort[portNum].registerSerialPort(port); - -: 214: } - -: 215: - #####: 216: void ActiveLoggerComponentBase :: - -: 217: set_CmdStatus_OutputPort( - -: 218: NATIVE_INT_TYPE portNum, - -: 219: Fw::InputSerializePort *port - -: 220: ) - -: 221: { - #####: 222: FW_ASSERT(portNum < this->getNum_CmdStatus_OutputPorts(),static_cast(portNum)); - #####: 223: return this->m_CmdStatus_OutputPort[portNum].registerSerialPort(port); - -: 224: } - -: 225: - #####: 226: void ActiveLoggerComponentBase :: - -: 227: set_CmdReg_OutputPort( - -: 228: NATIVE_INT_TYPE portNum, - -: 229: Fw::InputSerializePort *port - -: 230: ) - -: 231: { - #####: 232: FW_ASSERT(portNum < this->getNum_CmdReg_OutputPorts(),static_cast(portNum)); - #####: 233: return this->m_CmdReg_OutputPort[portNum].registerSerialPort(port); - -: 234: } - -: 235: - #####: 236: void ActiveLoggerComponentBase :: - -: 237: set_Time_OutputPort( - -: 238: NATIVE_INT_TYPE portNum, - -: 239: Fw::InputSerializePort *port - -: 240: ) - -: 241: { - #####: 242: FW_ASSERT(portNum < this->getNum_Time_OutputPorts(),static_cast(portNum)); - #####: 243: return this->m_Time_OutputPort[portNum].registerSerialPort(port); - -: 244: } - -: 245: - #####: 246: void ActiveLoggerComponentBase :: - -: 247: set_Log_OutputPort( - -: 248: NATIVE_INT_TYPE portNum, - -: 249: Fw::InputSerializePort *port - -: 250: ) - -: 251: { - #####: 252: FW_ASSERT(portNum < this->getNum_Log_OutputPorts(),static_cast(portNum)); - #####: 253: return this->m_Log_OutputPort[portNum].registerSerialPort(port); - -: 254: } - -: 255: - -: 256:#if FW_ENABLE_TEXT_LOGGING == 1 - #####: 257: void ActiveLoggerComponentBase :: - -: 258: set_LogText_OutputPort( - -: 259: NATIVE_INT_TYPE portNum, - -: 260: Fw::InputSerializePort *port - -: 261: ) - -: 262: { - #####: 263: FW_ASSERT(portNum < this->getNum_LogText_OutputPorts(),static_cast(portNum)); - #####: 264: return this->m_LogText_OutputPort[portNum].registerSerialPort(port); - -: 265: } - -: 266:#endif - -: 267: - -: 268:#endif - -: 269: - -: 270: // ---------------------------------------------------------------------- - -: 271: // Command registration - -: 272: // ---------------------------------------------------------------------- - -: 273: - #####: 274: void ActiveLoggerComponentBase :: - -: 275: regCommands(void) - -: 276: { - #####: 277: FW_ASSERT(this->m_CmdReg_OutputPort[0].isConnected()); - #####: 278: this->m_CmdReg_OutputPort[0].invoke(OPCODE_ALOG_SET_EVENT_REPORT_FILTER); - #####: 279: this->m_CmdReg_OutputPort[0].invoke(OPCODE_ALOG_SET_EVENT_SEND_FILTER); - #####: 280: this->m_CmdReg_OutputPort[0].invoke(OPCODE_ALOG_DUMP_EVENT_LOG); - #####: 281: this->m_CmdReg_OutputPort[0].invoke(OPCODE_ALOG_SET_ID_FILTER); - #####: 282: this->m_CmdReg_OutputPort[0].invoke(OPCODE_ALOG_DUMP_FILTER_STATE); - #####: 283: } - -: 284: - -: 285: // ---------------------------------------------------------------------- - -: 286: // Component construction, initialization, and destruction - -: 287: // ---------------------------------------------------------------------- - -: 288: - 8: 289: ActiveLoggerComponentBase :: - -: 290:#if FW_OBJECT_NAMES == 1 - -: 291: ActiveLoggerComponentBase(const char* compName) : - 8: 292: Fw::ActiveComponentBase(compName) - -: 293:#else - -: 294: ActiveLoggerComponentBase() : - -: 295: Fw::ActiveComponentBase() - -: 296:#endif - -: 297: { - -: 298: - 8: 299: } - -: 300: - 8: 301: void ActiveLoggerComponentBase :: - -: 302: init( - -: 303: NATIVE_INT_TYPE queueDepth, - -: 304: NATIVE_INT_TYPE instance - -: 305: ) - -: 306: { - -: 307: - -: 308: // Initialize base class - 8: 309: Fw::ActiveComponentBase::init(instance); - -: 310: - -: 311: // Connect input port LogRecv - 32: 312: for ( - 8: 313: NATIVE_INT_TYPE port = 0; - 16: 314: port < this->getNum_LogRecv_InputPorts(); - -: 315: port++ - -: 316: ) { - -: 317: - 8: 318: this->m_LogRecv_InputPort[port].init(); - -: 319: this->m_LogRecv_InputPort[port].addCallComp( - -: 320: this, - -: 321: m_p_LogRecv_in - 8: 322: ); - 8: 323: this->m_LogRecv_InputPort[port].setPortNum(port); - -: 324: - -: 325:#if FW_OBJECT_NAMES == 1 - -: 326: char portName[80]; - -: 327: (void) snprintf( - -: 328: portName, - -: 329: sizeof(portName), - -: 330: "%s_LogRecv_InputPort[%d]", - -: 331: this->m_objName, - -: 332: port - 8: 333: ); - 8: 334: this->m_LogRecv_InputPort[port].setObjName(portName); - -: 335:#endif - -: 336: - -: 337: } - -: 338: - -: 339: // Connect input port CmdDisp - 32: 340: for ( - 8: 341: NATIVE_INT_TYPE port = 0; - 16: 342: port < this->getNum_CmdDisp_InputPorts(); - -: 343: port++ - -: 344: ) { - -: 345: - 8: 346: this->m_CmdDisp_InputPort[port].init(); - -: 347: this->m_CmdDisp_InputPort[port].addCallComp( - -: 348: this, - -: 349: m_p_CmdDisp_in - 8: 350: ); - 8: 351: this->m_CmdDisp_InputPort[port].setPortNum(port); - -: 352: - -: 353:#if FW_OBJECT_NAMES == 1 - -: 354: char portName[80]; - -: 355: (void) snprintf( - -: 356: portName, - -: 357: sizeof(portName), - -: 358: "%s_CmdDisp_InputPort[%d]", - -: 359: this->m_objName, - -: 360: port - 8: 361: ); - 8: 362: this->m_CmdDisp_InputPort[port].setObjName(portName); - -: 363:#endif - -: 364: - -: 365: } - -: 366: - -: 367: // Initialize output port PktSend - 32: 368: for ( - 8: 369: NATIVE_INT_TYPE port = 0; - 16: 370: port < this->getNum_PktSend_OutputPorts(); - -: 371: port++ - -: 372: ) { - 8: 373: this->m_PktSend_OutputPort[port].init(); - -: 374: - -: 375:#if FW_OBJECT_NAMES == 1 - -: 376: char portName[80]; - -: 377: (void) snprintf( - -: 378: portName, - -: 379: sizeof(portName), - -: 380: "%s_PktSend_OutputPort[%d]", - -: 381: this->m_objName, - -: 382: port - 8: 383: ); - 8: 384: this->m_PktSend_OutputPort[port].setObjName(portName); - -: 385:#endif - -: 386: - -: 387: } - -: 388: - -: 389: // Initialize output port FatalAnnounce - 32: 390: for ( - 8: 391: NATIVE_INT_TYPE port = 0; - 16: 392: port < this->getNum_FatalAnnounce_OutputPorts(); - -: 393: port++ - -: 394: ) { - 8: 395: this->m_FatalAnnounce_OutputPort[port].init(); - -: 396: - -: 397:#if FW_OBJECT_NAMES == 1 - -: 398: char portName[80]; - -: 399: (void) snprintf( - -: 400: portName, - -: 401: sizeof(portName), - -: 402: "%s_FatalAnnounce_OutputPort[%d]", - -: 403: this->m_objName, - -: 404: port - 8: 405: ); - 8: 406: this->m_FatalAnnounce_OutputPort[port].setObjName(portName); - -: 407:#endif - -: 408: - -: 409: } - -: 410: - -: 411: // Initialize output port CmdStatus - 32: 412: for ( - 8: 413: NATIVE_INT_TYPE port = 0; - 16: 414: port < this->getNum_CmdStatus_OutputPorts(); - -: 415: port++ - -: 416: ) { - 8: 417: this->m_CmdStatus_OutputPort[port].init(); - -: 418: - -: 419:#if FW_OBJECT_NAMES == 1 - -: 420: char portName[80]; - -: 421: (void) snprintf( - -: 422: portName, - -: 423: sizeof(portName), - -: 424: "%s_CmdStatus_OutputPort[%d]", - -: 425: this->m_objName, - -: 426: port - 8: 427: ); - 8: 428: this->m_CmdStatus_OutputPort[port].setObjName(portName); - -: 429:#endif - -: 430: - -: 431: } - -: 432: - -: 433: // Initialize output port CmdReg - 32: 434: for ( - 8: 435: NATIVE_INT_TYPE port = 0; - 16: 436: port < this->getNum_CmdReg_OutputPorts(); - -: 437: port++ - -: 438: ) { - 8: 439: this->m_CmdReg_OutputPort[port].init(); - -: 440: - -: 441:#if FW_OBJECT_NAMES == 1 - -: 442: char portName[80]; - -: 443: (void) snprintf( - -: 444: portName, - -: 445: sizeof(portName), - -: 446: "%s_CmdReg_OutputPort[%d]", - -: 447: this->m_objName, - -: 448: port - 8: 449: ); - 8: 450: this->m_CmdReg_OutputPort[port].setObjName(portName); - -: 451:#endif - -: 452: - -: 453: } - -: 454: - -: 455: // Initialize output port Time - 32: 456: for ( - 8: 457: NATIVE_INT_TYPE port = 0; - 16: 458: port < this->getNum_Time_OutputPorts(); - -: 459: port++ - -: 460: ) { - 8: 461: this->m_Time_OutputPort[port].init(); - -: 462: - -: 463:#if FW_OBJECT_NAMES == 1 - -: 464: char portName[80]; - -: 465: (void) snprintf( - -: 466: portName, - -: 467: sizeof(portName), - -: 468: "%s_Time_OutputPort[%d]", - -: 469: this->m_objName, - -: 470: port - 8: 471: ); - 8: 472: this->m_Time_OutputPort[port].setObjName(portName); - -: 473:#endif - -: 474: - -: 475: } - -: 476: - -: 477: // Initialize output port Log - 32: 478: for ( - 8: 479: NATIVE_INT_TYPE port = 0; - 16: 480: port < this->getNum_Log_OutputPorts(); - -: 481: port++ - -: 482: ) { - 8: 483: this->m_Log_OutputPort[port].init(); - -: 484: - -: 485:#if FW_OBJECT_NAMES == 1 - -: 486: char portName[80]; - -: 487: (void) snprintf( - -: 488: portName, - -: 489: sizeof(portName), - -: 490: "%s_Log_OutputPort[%d]", - -: 491: this->m_objName, - -: 492: port - 8: 493: ); - 8: 494: this->m_Log_OutputPort[port].setObjName(portName); - -: 495:#endif - -: 496: - -: 497: } - -: 498: - -: 499: // Initialize output port LogText - -: 500:#if FW_ENABLE_TEXT_LOGGING == 1 - 32: 501: for ( - 8: 502: NATIVE_INT_TYPE port = 0; - 16: 503: port < this->getNum_LogText_OutputPorts(); - -: 504: port++ - -: 505: ) { - 8: 506: this->m_LogText_OutputPort[port].init(); - -: 507: - -: 508:#if FW_OBJECT_NAMES == 1 - -: 509: char portName[80]; - -: 510: (void) snprintf( - -: 511: portName, - -: 512: sizeof(portName), - -: 513: "%s_LogText_OutputPort[%d]", - -: 514: this->m_objName, - -: 515: port - 8: 516: ); - 8: 517: this->m_LogText_OutputPort[port].setObjName(portName); - -: 518:#endif - -: 519: - -: 520: } - -: 521:#endif - -: 522: - -: 523: Os::Queue::QueueStatus qStat = - -: 524: this->createQueue( - -: 525: queueDepth, - -: 526: ComponentIpcSerializableBuffer::SERIALIZATION_SIZE - 8: 527: ); - -: 528: FW_ASSERT( - -: 529: Os::Queue::QUEUE_OK == qStat, - -: 530: static_cast(qStat) - 8: 531: ); - -: 532: - 8: 533: } - -: 534: - 8: 535: ActiveLoggerComponentBase:: - 8: 536: ~ActiveLoggerComponentBase() { - -: 537: - 8: 538: } - -: 539: - -: 540: // ---------------------------------------------------------------------- - -: 541: // Invocation functions for output ports - -: 542: // ---------------------------------------------------------------------- - -: 543: - 162: 544: void ActiveLoggerComponentBase :: - -: 545: PktSend_out( - -: 546: NATIVE_INT_TYPE portNum, - -: 547: Fw::ComBuffer &data, U32 context - -: 548: ) - -: 549: { - 162: 550: FW_ASSERT(portNum < this->getNum_PktSend_OutputPorts(),static_cast(portNum)); - 162: 551: m_PktSend_OutputPort[portNum].invoke(data, context); - 162: 552: } - -: 553: - 9: 554: void ActiveLoggerComponentBase :: - -: 555: FatalAnnounce_out( - -: 556: NATIVE_INT_TYPE portNum, - -: 557: FwEventIdType Id - -: 558: ) - -: 559: { - 9: 560: FW_ASSERT(portNum < this->getNum_FatalAnnounce_OutputPorts(),static_cast(portNum)); - 9: 561: m_FatalAnnounce_OutputPort[portNum].invoke(Id); - 9: 562: } - -: 563: - -: 564: // ---------------------------------------------------------------------- - -: 565: // Getters for numbers of ports - -: 566: // ---------------------------------------------------------------------- - -: 567: - 223: 568: NATIVE_INT_TYPE ActiveLoggerComponentBase :: - -: 569: getNum_LogRecv_InputPorts(void) - -: 570: { - 223: 571: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 572: this->m_LogRecv_InputPort - -: 573: ); - -: 574: } - -: 575: - 348: 576: NATIVE_INT_TYPE ActiveLoggerComponentBase :: - -: 577: getNum_PktSend_OutputPorts(void) - -: 578: { - 348: 579: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 580: this->m_PktSend_OutputPort - -: 581: ); - -: 582: } - -: 583: - 42: 584: NATIVE_INT_TYPE ActiveLoggerComponentBase :: - -: 585: getNum_FatalAnnounce_OutputPorts(void) - -: 586: { - 42: 587: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 588: this->m_FatalAnnounce_OutputPort - -: 589: ); - -: 590: } - -: 591: - 24: 592: NATIVE_INT_TYPE ActiveLoggerComponentBase :: - -: 593: getNum_CmdDisp_InputPorts(void) - -: 594: { - 24: 595: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 596: this->m_CmdDisp_InputPort - -: 597: ); - -: 598: } - -: 599: - 24: 600: NATIVE_INT_TYPE ActiveLoggerComponentBase :: - -: 601: getNum_CmdStatus_OutputPorts(void) - -: 602: { - 24: 603: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 604: this->m_CmdStatus_OutputPort - -: 605: ); - -: 606: } - -: 607: - 16: 608: NATIVE_INT_TYPE ActiveLoggerComponentBase :: - -: 609: getNum_CmdReg_OutputPorts(void) - -: 610: { - 16: 611: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 612: this->m_CmdReg_OutputPort - -: 613: ); - -: 614: } - -: 615: - 16: 616: NATIVE_INT_TYPE ActiveLoggerComponentBase :: - -: 617: getNum_Time_OutputPorts(void) - -: 618: { - 16: 619: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 620: this->m_Time_OutputPort - -: 621: ); - -: 622: } - -: 623: - 24: 624: NATIVE_INT_TYPE ActiveLoggerComponentBase :: - -: 625: getNum_Log_OutputPorts(void) - -: 626: { - 24: 627: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 628: this->m_Log_OutputPort - -: 629: ); - -: 630: } - -: 631: - -: 632:#if FW_ENABLE_TEXT_LOGGING == 1 - 24: 633: NATIVE_INT_TYPE ActiveLoggerComponentBase :: - -: 634: getNum_LogText_OutputPorts(void) - -: 635: { - 24: 636: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 637: this->m_LogText_OutputPort - -: 638: ); - -: 639: } - -: 640:#endif - -: 641: - -: 642: // ---------------------------------------------------------------------- - -: 643: // Port connection status queries - -: 644: // ---------------------------------------------------------------------- - -: 645: - 162: 646: bool ActiveLoggerComponentBase :: - -: 647: isConnected_PktSend_OutputPort(NATIVE_INT_TYPE portNum) - -: 648: { - 162: 649: FW_ASSERT( - -: 650: portNum < this->getNum_PktSend_OutputPorts(), - -: 651: static_cast(portNum) - 162: 652: ); - 162: 653: return this->m_PktSend_OutputPort[portNum].isConnected(); - -: 654: } - -: 655: - 9: 656: bool ActiveLoggerComponentBase :: - -: 657: isConnected_FatalAnnounce_OutputPort(NATIVE_INT_TYPE portNum) - -: 658: { - 9: 659: FW_ASSERT( - -: 660: portNum < this->getNum_FatalAnnounce_OutputPorts(), - -: 661: static_cast(portNum) - 9: 662: ); - 9: 663: return this->m_FatalAnnounce_OutputPort[portNum].isConnected(); - -: 664: } - -: 665: - #####: 666: bool ActiveLoggerComponentBase :: - -: 667: isConnected_CmdStatus_OutputPort(NATIVE_INT_TYPE portNum) - -: 668: { - #####: 669: FW_ASSERT( - -: 670: portNum < this->getNum_CmdStatus_OutputPorts(), - -: 671: static_cast(portNum) - #####: 672: ); - #####: 673: return this->m_CmdStatus_OutputPort[portNum].isConnected(); - -: 674: } - -: 675: - #####: 676: bool ActiveLoggerComponentBase :: - -: 677: isConnected_CmdReg_OutputPort(NATIVE_INT_TYPE portNum) - -: 678: { - #####: 679: FW_ASSERT( - -: 680: portNum < this->getNum_CmdReg_OutputPorts(), - -: 681: static_cast(portNum) - #####: 682: ); - #####: 683: return this->m_CmdReg_OutputPort[portNum].isConnected(); - -: 684: } - -: 685: - #####: 686: bool ActiveLoggerComponentBase :: - -: 687: isConnected_Time_OutputPort(NATIVE_INT_TYPE portNum) - -: 688: { - #####: 689: FW_ASSERT( - -: 690: portNum < this->getNum_Time_OutputPorts(), - -: 691: static_cast(portNum) - #####: 692: ); - #####: 693: return this->m_Time_OutputPort[portNum].isConnected(); - -: 694: } - -: 695: - #####: 696: bool ActiveLoggerComponentBase :: - -: 697: isConnected_Log_OutputPort(NATIVE_INT_TYPE portNum) - -: 698: { - #####: 699: FW_ASSERT( - -: 700: portNum < this->getNum_Log_OutputPorts(), - -: 701: static_cast(portNum) - #####: 702: ); - #####: 703: return this->m_Log_OutputPort[portNum].isConnected(); - -: 704: } - -: 705: - -: 706:#if FW_ENABLE_TEXT_LOGGING == 1 - #####: 707: bool ActiveLoggerComponentBase :: - -: 708: isConnected_LogText_OutputPort(NATIVE_INT_TYPE portNum) - -: 709: { - #####: 710: FW_ASSERT( - -: 711: portNum < this->getNum_LogText_OutputPorts(), - -: 712: static_cast(portNum) - #####: 713: ); - #####: 714: return this->m_LogText_OutputPort[portNum].isConnected(); - -: 715: } - -: 716:#endif - -: 717: - -: 718: // ---------------------------------------------------------------------- - -: 719: // Calls for messages received on typed input ports - -: 720: // ---------------------------------------------------------------------- - -: 721: - 203: 722: void ActiveLoggerComponentBase :: - -: 723: m_p_CmdDisp_in( - -: 724: Fw::PassiveComponentBase* callComp, - -: 725: NATIVE_INT_TYPE portNum, - -: 726: FwOpcodeType opCode, - -: 727: U32 cmdSeq, - -: 728: Fw::CmdArgBuffer &args - -: 729: ) - -: 730: { - -: 731: - -: 732: // Select base class function based on opcode - 203: 733: FW_ASSERT(callComp); - -: 734: ActiveLoggerComponentBase* compPtr = - 203: 735: (ActiveLoggerComponentBase*) callComp; - -: 736: - 203: 737: switch (opCode) { - -: 738: - -: 739: case OPCODE_ALOG_SET_EVENT_REPORT_FILTER: - -: 740: compPtr->ALOG_SET_EVENT_REPORT_FILTER_cmdHandlerBase( - -: 741: opCode, - -: 742: cmdSeq, - -: 743: args - 52: 744: ); - 52: 745: break; - -: 746: - -: 747: case OPCODE_ALOG_SET_EVENT_SEND_FILTER: - -: 748: compPtr->ALOG_SET_EVENT_SEND_FILTER_cmdHandlerBase( - -: 749: opCode, - -: 750: cmdSeq, - -: 751: args - 52: 752: ); - 52: 753: break; - -: 754: - -: 755: case OPCODE_ALOG_DUMP_EVENT_LOG: - -: 756: compPtr->ALOG_DUMP_EVENT_LOG_cmdHandlerBase( - -: 757: opCode, - -: 758: cmdSeq, - -: 759: args - 17: 760: ); - 17: 761: break; - -: 762: - -: 763: case OPCODE_ALOG_SET_ID_FILTER: - -: 764: compPtr->ALOG_SET_ID_FILTER_cmdHandlerBase( - -: 765: opCode, - -: 766: cmdSeq, - -: 767: args - 81: 768: ); - 81: 769: break; - -: 770: - -: 771: case OPCODE_ALOG_DUMP_FILTER_STATE: - -: 772: compPtr->ALOG_DUMP_FILTER_STATE_cmdHandlerBase( - -: 773: opCode, - -: 774: cmdSeq, - -: 775: args - 1: 776: ); - 1: 777: break; - -: 778: - -: 779: default: { - -: 780: compPtr->cmdResponse_out( - -: 781: opCode,cmdSeq, - -: 782: Fw::COMMAND_INVALID_OPCODE - #####: 783: ); - #####: 784: break; - -: 785: } - -: 786: - -: 787: } - -: 788: - 203: 789: } - -: 790: - 203: 791: void ActiveLoggerComponentBase :: - -: 792: cmdResponse_out( - -: 793: FwOpcodeType opCode, - -: 794: U32 cmdSeq, - -: 795: Fw::CommandResponse response - -: 796: ) - -: 797: { - 203: 798: FW_ASSERT(this->m_CmdStatus_OutputPort[0].isConnected()); - 203: 799: this->m_CmdStatus_OutputPort[0].invoke(opCode,cmdSeq,response); - 203: 800: } - -: 801: - -: 802: // ---------------------------------------------------------------------- - -: 803: // Base class command functions - -: 804: // ---------------------------------------------------------------------- - -: 805: - 52: 806: void ActiveLoggerComponentBase :: - -: 807: ALOG_SET_EVENT_REPORT_FILTER_cmdHandlerBase( - -: 808: FwOpcodeType opCode, - -: 809: U32 cmdSeq, - -: 810: Fw::CmdArgBuffer &args - -: 811: ) - -: 812: { - -: 813: - -: 814: // Deserialize the arguments - -: 815: Fw::SerializeStatus _status; - -: 816: - -: 817: // Reset the buffer - 52: 818: args.resetDeser(); - -: 819: - -: 820: InputFilterLevel FilterLevel; - -: 821: FwEnumStoreType FilterLevelInt; - 52: 822: _status = args.deserialize(FilterLevelInt); - 52: 823: FilterLevel = (InputFilterLevel)FilterLevelInt; - 52: 824: if (_status != Fw::FW_SERIALIZE_OK) { - #####: 825: if (this->m_CmdStatus_OutputPort[0].isConnected()) { - -: 826: this->m_CmdStatus_OutputPort[0].invoke( - -: 827: opCode, - -: 828: cmdSeq,Fw::COMMAND_FORMAT_ERROR - #####: 829: ); - -: 830: } - #####: 831: return; - -: 832: } - -: 833: - -: 834: InputFilterEnabled FilterEnable; - -: 835: FwEnumStoreType FilterEnableInt; - 52: 836: _status = args.deserialize(FilterEnableInt); - 52: 837: FilterEnable = (InputFilterEnabled)FilterEnableInt; - 52: 838: if (_status != Fw::FW_SERIALIZE_OK) { - #####: 839: if (this->m_CmdStatus_OutputPort[0].isConnected()) { - -: 840: this->m_CmdStatus_OutputPort[0].invoke( - -: 841: opCode, - -: 842: cmdSeq,Fw::COMMAND_FORMAT_ERROR - #####: 843: ); - -: 844: } - #####: 845: return; - -: 846: } - -: 847: - -: 848: // Make sure there was no data left over. - -: 849: // That means the argument buffer size was incorrect. - 52: 850: if (args.getBuffLeft() != 0) { - #####: 851: if (this->m_CmdStatus_OutputPort[0].isConnected()) { - -: 852: this->m_CmdStatus_OutputPort[0].invoke( - -: 853: opCode, - -: 854: cmdSeq,Fw::COMMAND_FORMAT_ERROR - #####: 855: ); - -: 856: } - #####: 857: return; - -: 858: } - -: 859: this->ALOG_SET_EVENT_REPORT_FILTER_cmdHandler( - -: 860: opCode, - -: 861: cmdSeq, - -: 862: FilterLevel, FilterEnable - 52: 863: ); - -: 864: - -: 865: } - -: 866: - 52: 867: void ActiveLoggerComponentBase :: - -: 868: ALOG_SET_EVENT_SEND_FILTER_cmdHandlerBase( - -: 869: FwOpcodeType opCode, - -: 870: U32 cmdSeq, - -: 871: Fw::CmdArgBuffer &args - -: 872: ) - -: 873: { - -: 874: - -: 875: // Deserialize the arguments - -: 876: Fw::SerializeStatus _status; - -: 877: - -: 878: // Reset the buffer - 52: 879: args.resetDeser(); - -: 880: - -: 881: SendFilterLevel FilterLevel; - -: 882: FwEnumStoreType FilterLevelInt; - 52: 883: _status = args.deserialize(FilterLevelInt); - 52: 884: FilterLevel = (SendFilterLevel)FilterLevelInt; - 52: 885: if (_status != Fw::FW_SERIALIZE_OK) { - #####: 886: if (this->m_CmdStatus_OutputPort[0].isConnected()) { - -: 887: this->m_CmdStatus_OutputPort[0].invoke( - -: 888: opCode, - -: 889: cmdSeq,Fw::COMMAND_FORMAT_ERROR - #####: 890: ); - -: 891: } - #####: 892: return; - -: 893: } - -: 894: - -: 895: SendFilterEnabled FilterEnable; - -: 896: FwEnumStoreType FilterEnableInt; - 52: 897: _status = args.deserialize(FilterEnableInt); - 52: 898: FilterEnable = (SendFilterEnabled)FilterEnableInt; - 52: 899: if (_status != Fw::FW_SERIALIZE_OK) { - #####: 900: if (this->m_CmdStatus_OutputPort[0].isConnected()) { - -: 901: this->m_CmdStatus_OutputPort[0].invoke( - -: 902: opCode, - -: 903: cmdSeq,Fw::COMMAND_FORMAT_ERROR - #####: 904: ); - -: 905: } - #####: 906: return; - -: 907: } - -: 908: - -: 909: // Make sure there was no data left over. - -: 910: // That means the argument buffer size was incorrect. - 52: 911: if (args.getBuffLeft() != 0) { - #####: 912: if (this->m_CmdStatus_OutputPort[0].isConnected()) { - -: 913: this->m_CmdStatus_OutputPort[0].invoke( - -: 914: opCode, - -: 915: cmdSeq,Fw::COMMAND_FORMAT_ERROR - #####: 916: ); - -: 917: } - #####: 918: return; - -: 919: } - -: 920: this->ALOG_SET_EVENT_SEND_FILTER_cmdHandler( - -: 921: opCode, - -: 922: cmdSeq, - -: 923: FilterLevel, FilterEnable - 52: 924: ); - -: 925: - -: 926: } - -: 927: - 17: 928: void ActiveLoggerComponentBase :: - -: 929: ALOG_DUMP_EVENT_LOG_cmdHandlerBase( - -: 930: FwOpcodeType opCode, - -: 931: U32 cmdSeq, - -: 932: Fw::CmdArgBuffer &args - -: 933: ) - -: 934: { - -: 935: - -: 936: // Call pre-message hook - 17: 937: this->ALOG_DUMP_EVENT_LOG_preMsgHook(opCode,cmdSeq); - -: 938: - -: 939: // Defer deserializing arguments to the message dispatcher - -: 940: // to avoid deserializing and reserializing just for IPC - 17: 941: ComponentIpcSerializableBuffer msg; - -: 942: Fw::SerializeStatus _status; - -: 943: - -: 944: // Serialize for IPC - 17: 945: _status = msg.serialize((NATIVE_INT_TYPE)CMD_ALOG_DUMP_EVENT_LOG); - -: 946: FW_ASSERT ( - -: 947: _status == Fw::FW_SERIALIZE_OK, - -: 948: static_cast(_status) - 17: 949: ); - -: 950: - -: 951: // Fake port number to make message dequeue work - 17: 952: NATIVE_INT_TYPE port = 0; - 17: 953: _status = msg.serialize(port); - -: 954: FW_ASSERT ( - -: 955: _status == Fw::FW_SERIALIZE_OK, - -: 956: static_cast(_status) - 17: 957: ); - -: 958: - 17: 959: _status = msg.serialize(opCode); - -: 960: FW_ASSERT ( - -: 961: _status == Fw::FW_SERIALIZE_OK, - -: 962: static_cast(_status) - 17: 963: ); - -: 964: - 17: 965: _status = msg.serialize(cmdSeq); - -: 966: FW_ASSERT ( - -: 967: _status == Fw::FW_SERIALIZE_OK, - -: 968: static_cast(_status) - 17: 969: ); - -: 970: - 17: 971: _status = msg.serialize(args); - -: 972: FW_ASSERT ( - -: 973: _status == Fw::FW_SERIALIZE_OK, - -: 974: static_cast(_status) - 17: 975: ); - -: 976: - 17: 977: Os::Queue::QueueStatus qStatus = this->m_queue.send(msg,0); - -: 978: - -: 979: FW_ASSERT( - -: 980: qStatus == Os::Queue::QUEUE_OK, - -: 981: static_cast(qStatus) - 17: 982: ); - -: 983: - 17: 984: } - -: 985: - 17: 986: void ActiveLoggerComponentBase:: - -: 987: ALOG_DUMP_EVENT_LOG_preMsgHook( - -: 988: FwOpcodeType opCode, - -: 989: U32 cmdSeq - -: 990: ) - -: 991: { - -: 992: // Defaults to no-op; can be overridden - 17: 993: } - -: 994: - 81: 995: void ActiveLoggerComponentBase :: - -: 996: ALOG_SET_ID_FILTER_cmdHandlerBase( - -: 997: FwOpcodeType opCode, - -: 998: U32 cmdSeq, - -: 999: Fw::CmdArgBuffer &args - -: 1000: ) - -: 1001: { - -: 1002: - -: 1003: // Call pre-message hook - 81: 1004: this->ALOG_SET_ID_FILTER_preMsgHook(opCode,cmdSeq); - -: 1005: - -: 1006: // Defer deserializing arguments to the message dispatcher - -: 1007: // to avoid deserializing and reserializing just for IPC - 81: 1008: ComponentIpcSerializableBuffer msg; - -: 1009: Fw::SerializeStatus _status; - -: 1010: - -: 1011: // Serialize for IPC - 81: 1012: _status = msg.serialize((NATIVE_INT_TYPE)CMD_ALOG_SET_ID_FILTER); - -: 1013: FW_ASSERT ( - -: 1014: _status == Fw::FW_SERIALIZE_OK, - -: 1015: static_cast(_status) - 81: 1016: ); - -: 1017: - -: 1018: // Fake port number to make message dequeue work - 81: 1019: NATIVE_INT_TYPE port = 0; - 81: 1020: _status = msg.serialize(port); - -: 1021: FW_ASSERT ( - -: 1022: _status == Fw::FW_SERIALIZE_OK, - -: 1023: static_cast(_status) - 81: 1024: ); - -: 1025: - 81: 1026: _status = msg.serialize(opCode); - -: 1027: FW_ASSERT ( - -: 1028: _status == Fw::FW_SERIALIZE_OK, - -: 1029: static_cast(_status) - 81: 1030: ); - -: 1031: - 81: 1032: _status = msg.serialize(cmdSeq); - -: 1033: FW_ASSERT ( - -: 1034: _status == Fw::FW_SERIALIZE_OK, - -: 1035: static_cast(_status) - 81: 1036: ); - -: 1037: - 81: 1038: _status = msg.serialize(args); - -: 1039: FW_ASSERT ( - -: 1040: _status == Fw::FW_SERIALIZE_OK, - -: 1041: static_cast(_status) - 81: 1042: ); - -: 1043: - 81: 1044: Os::Queue::QueueStatus qStatus = this->m_queue.send(msg,0); - -: 1045: - -: 1046: FW_ASSERT( - -: 1047: qStatus == Os::Queue::QUEUE_OK, - -: 1048: static_cast(qStatus) - 81: 1049: ); - -: 1050: - 81: 1051: } - -: 1052: - 81: 1053: void ActiveLoggerComponentBase:: - -: 1054: ALOG_SET_ID_FILTER_preMsgHook( - -: 1055: FwOpcodeType opCode, - -: 1056: U32 cmdSeq - -: 1057: ) - -: 1058: { - -: 1059: // Defaults to no-op; can be overridden - 81: 1060: } - -: 1061: - 1: 1062: void ActiveLoggerComponentBase :: - -: 1063: ALOG_DUMP_FILTER_STATE_cmdHandlerBase( - -: 1064: FwOpcodeType opCode, - -: 1065: U32 cmdSeq, - -: 1066: Fw::CmdArgBuffer &args - -: 1067: ) - -: 1068: { - -: 1069: - -: 1070: // Call pre-message hook - 1: 1071: this->ALOG_DUMP_FILTER_STATE_preMsgHook(opCode,cmdSeq); - -: 1072: - -: 1073: // Defer deserializing arguments to the message dispatcher - -: 1074: // to avoid deserializing and reserializing just for IPC - 1: 1075: ComponentIpcSerializableBuffer msg; - -: 1076: Fw::SerializeStatus _status; - -: 1077: - -: 1078: // Serialize for IPC - 1: 1079: _status = msg.serialize((NATIVE_INT_TYPE)CMD_ALOG_DUMP_FILTER_STATE); - -: 1080: FW_ASSERT ( - -: 1081: _status == Fw::FW_SERIALIZE_OK, - -: 1082: static_cast(_status) - 1: 1083: ); - -: 1084: - -: 1085: // Fake port number to make message dequeue work - 1: 1086: NATIVE_INT_TYPE port = 0; - 1: 1087: _status = msg.serialize(port); - -: 1088: FW_ASSERT ( - -: 1089: _status == Fw::FW_SERIALIZE_OK, - -: 1090: static_cast(_status) - 1: 1091: ); - -: 1092: - 1: 1093: _status = msg.serialize(opCode); - -: 1094: FW_ASSERT ( - -: 1095: _status == Fw::FW_SERIALIZE_OK, - -: 1096: static_cast(_status) - 1: 1097: ); - -: 1098: - 1: 1099: _status = msg.serialize(cmdSeq); - -: 1100: FW_ASSERT ( - -: 1101: _status == Fw::FW_SERIALIZE_OK, - -: 1102: static_cast(_status) - 1: 1103: ); - -: 1104: - 1: 1105: _status = msg.serialize(args); - -: 1106: FW_ASSERT ( - -: 1107: _status == Fw::FW_SERIALIZE_OK, - -: 1108: static_cast(_status) - 1: 1109: ); - -: 1110: - 1: 1111: Os::Queue::QueueStatus qStatus = this->m_queue.send(msg,0); - -: 1112: - -: 1113: FW_ASSERT( - -: 1114: qStatus == Os::Queue::QUEUE_OK, - -: 1115: static_cast(qStatus) - 1: 1116: ); - -: 1117: - 1: 1118: } - -: 1119: - 1: 1120: void ActiveLoggerComponentBase:: - -: 1121: ALOG_DUMP_FILTER_STATE_preMsgHook( - -: 1122: FwOpcodeType opCode, - -: 1123: U32 cmdSeq - -: 1124: ) - -: 1125: { - -: 1126: // Defaults to no-op; can be overridden - 1: 1127: } - -: 1128: - -: 1129: // ---------------------------------------------------------------------- - -: 1130: // Time - -: 1131: // ---------------------------------------------------------------------- - -: 1132: - #####: 1133: Fw::Time ActiveLoggerComponentBase :: - -: 1134: getTime(void) - -: 1135: { - #####: 1136: if (this->m_Time_OutputPort[0].isConnected()) { - #####: 1137: return this->m_Time_OutputPort[0].invoke(); - -: 1138: } else { - #####: 1139: return Fw::Time(TB_NONE,0,0); - -: 1140: } - -: 1141: } - -: 1142: - -: 1143: // ---------------------------------------------------------------------- - -: 1144: // Event handling functions - -: 1145: // ---------------------------------------------------------------------- - -: 1146: - 15: 1147: void ActiveLoggerComponentBase :: - -: 1148: log_WARNING_HI_ALOG_FILE_WRITE_ERR( - -: 1149: LogWriteError stage, I32 error - -: 1150: ) - -: 1151: { - -: 1152: - -: 1153: // Get the time - 15: 1154: Fw::Time _logTime; - 15: 1155: if (this->m_Time_OutputPort[0].isConnected()) { - #####: 1156: _logTime = this->m_Time_OutputPort[0].invoke(); - -: 1157: } - -: 1158: - 15: 1159: FwEventIdType _id = static_cast(0); - -: 1160: - 15: 1161: _id = EVENTID_ALOG_FILE_WRITE_ERR; - -: 1162: - -: 1163: // Emit the event on the log port - 15: 1164: if (this->m_Log_OutputPort[0].isConnected()) { - -: 1165: - 15: 1166: Fw::LogBuffer _logBuff; - -: 1167: Fw::SerializeStatus _status; - -: 1168: - -: 1169:#if FW_AMPCS_COMPATIBLE - -: 1170: // Serialize the number of arguments - -: 1171: _status = _logBuff.serialize(static_cast(2)); - -: 1172: FW_ASSERT( - -: 1173: _status == Fw::FW_SERIALIZE_OK, - -: 1174: static_cast(_status) - -: 1175: ); - -: 1176:#endif - -: 1177: - -: 1178:#if FW_AMPCS_COMPATIBLE - -: 1179: // Serialize the argument size - -: 1180: _status = _logBuff.serialize(static_cast(sizeof(FwEnumStoreType))); - -: 1181: FW_ASSERT( - -: 1182: _status == Fw::FW_SERIALIZE_OK, - -: 1183: static_cast(_status) - -: 1184: ); - -: 1185:#endif - -: 1186: - -: 1187: _status = _logBuff.serialize( - -: 1188: static_cast(stage) - 15: 1189: ); - -: 1190: FW_ASSERT( - -: 1191: _status == Fw::FW_SERIALIZE_OK, - -: 1192: static_cast(_status) - 15: 1193: ); - -: 1194: - -: 1195:#if FW_AMPCS_COMPATIBLE - -: 1196: // Serialize the argument size - -: 1197: _status = _logBuff.serialize( - -: 1198: static_cast(sizeof(error)) - -: 1199: ); - -: 1200: FW_ASSERT( - -: 1201: _status == Fw::FW_SERIALIZE_OK, - -: 1202: static_cast(_status) - -: 1203: ); - -: 1204:#endif - -: 1205: - 15: 1206: _status = _logBuff.serialize(error); - -: 1207: FW_ASSERT( - -: 1208: _status == Fw::FW_SERIALIZE_OK, - -: 1209: static_cast(_status) - 15: 1210: ); - -: 1211: - -: 1212: - -: 1213: this->m_Log_OutputPort[0].invoke( - -: 1214: _id, - -: 1215: _logTime,Fw::LOG_WARNING_HI, - -: 1216: _logBuff - 15: 1217: ); - -: 1218: - -: 1219: } - -: 1220: - -: 1221: // Emit the event on the text log port - -: 1222:#if FW_ENABLE_TEXT_LOGGING - 15: 1223: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 1224: - -: 1225:#if FW_OBJECT_NAMES == 1 - -: 1226: const char* _formatString = - 15: 1227: "(%s) %s: Event buffer write failed in stage %d with error %d"; - -: 1228:#else - -: 1229: const char* _formatString = - -: 1230: "%s: Event buffer write failed in stage %d with error %d"; - -: 1231:#endif - -: 1232: - -: 1233: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 1234: - -: 1235: (void) snprintf( - -: 1236: _textBuffer, - -: 1237: FW_LOG_TEXT_BUFFER_SIZE, - -: 1238: _formatString, - -: 1239:#if FW_OBJECT_NAMES == 1 - -: 1240: this->m_objName, - -: 1241:#endif - -: 1242: "ALOG_FILE_WRITE_ERR " - -: 1243: , stage - -: 1244: , error - 15: 1245: ); - -: 1246: - -: 1247: // Null terminate - 15: 1248: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 15: 1249: Fw::TextLogString _logString = _textBuffer; - -: 1250: this->m_LogText_OutputPort[0].invoke( - -: 1251: _id, - -: 1252: _logTime,Fw::TEXT_LOG_WARNING_HI, - -: 1253: _logString - 15: 1254: ); - -: 1255: - 15: 1256: } - -: 1257:#endif - -: 1258: - 15: 1259: } - -: 1260: - 2: 1261: void ActiveLoggerComponentBase :: - -: 1262: log_ACTIVITY_HI_ALOG_FILE_WRITE_COMPLETE( - -: 1263: U32 records - -: 1264: ) - -: 1265: { - -: 1266: - -: 1267: // Get the time - 2: 1268: Fw::Time _logTime; - 2: 1269: if (this->m_Time_OutputPort[0].isConnected()) { - #####: 1270: _logTime = this->m_Time_OutputPort[0].invoke(); - -: 1271: } - -: 1272: - 2: 1273: FwEventIdType _id = static_cast(0); - -: 1274: - 2: 1275: _id = EVENTID_ALOG_FILE_WRITE_COMPLETE; - -: 1276: - -: 1277: // Emit the event on the log port - 2: 1278: if (this->m_Log_OutputPort[0].isConnected()) { - -: 1279: - 2: 1280: Fw::LogBuffer _logBuff; - -: 1281: Fw::SerializeStatus _status; - -: 1282: - -: 1283:#if FW_AMPCS_COMPATIBLE - -: 1284: // Serialize the number of arguments - -: 1285: _status = _logBuff.serialize(static_cast(1)); - -: 1286: FW_ASSERT( - -: 1287: _status == Fw::FW_SERIALIZE_OK, - -: 1288: static_cast(_status) - -: 1289: ); - -: 1290:#endif - -: 1291: - -: 1292:#if FW_AMPCS_COMPATIBLE - -: 1293: // Serialize the argument size - -: 1294: _status = _logBuff.serialize( - -: 1295: static_cast(sizeof(records)) - -: 1296: ); - -: 1297: FW_ASSERT( - -: 1298: _status == Fw::FW_SERIALIZE_OK, - -: 1299: static_cast(_status) - -: 1300: ); - -: 1301:#endif - -: 1302: - 2: 1303: _status = _logBuff.serialize(records); - -: 1304: FW_ASSERT( - -: 1305: _status == Fw::FW_SERIALIZE_OK, - -: 1306: static_cast(_status) - 2: 1307: ); - -: 1308: - -: 1309: - -: 1310: this->m_Log_OutputPort[0].invoke( - -: 1311: _id, - -: 1312: _logTime,Fw::LOG_ACTIVITY_HI, - -: 1313: _logBuff - 2: 1314: ); - -: 1315: - -: 1316: } - -: 1317: - -: 1318: // Emit the event on the text log port - -: 1319:#if FW_ENABLE_TEXT_LOGGING - 2: 1320: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 1321: - -: 1322:#if FW_OBJECT_NAMES == 1 - -: 1323: const char* _formatString = - 2: 1324: "(%s) %s: Event buffer write complete. Wrote %d records."; - -: 1325:#else - -: 1326: const char* _formatString = - -: 1327: "%s: Event buffer write complete. Wrote %d records."; - -: 1328:#endif - -: 1329: - -: 1330: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 1331: - -: 1332: (void) snprintf( - -: 1333: _textBuffer, - -: 1334: FW_LOG_TEXT_BUFFER_SIZE, - -: 1335: _formatString, - -: 1336:#if FW_OBJECT_NAMES == 1 - -: 1337: this->m_objName, - -: 1338:#endif - -: 1339: "ALOG_FILE_WRITE_COMPLETE " - -: 1340: , records - 2: 1341: ); - -: 1342: - -: 1343: // Null terminate - 2: 1344: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 2: 1345: Fw::TextLogString _logString = _textBuffer; - -: 1346: this->m_LogText_OutputPort[0].invoke( - -: 1347: _id, - -: 1348: _logTime,Fw::TEXT_LOG_ACTIVITY_HI, - -: 1349: _logString - 2: 1350: ); - -: 1351: - 2: 1352: } - -: 1353:#endif - -: 1354: - 2: 1355: } - -: 1356: - 6: 1357: void ActiveLoggerComponentBase :: - -: 1358: log_ACTIVITY_LO_ALOG_SEVERITY_FILTER_STATE( - -: 1359: EventFilterState severity, bool recvEnabled, bool sendEnabled - -: 1360: ) - -: 1361: { - -: 1362: - -: 1363: // Get the time - 6: 1364: Fw::Time _logTime; - 6: 1365: if (this->m_Time_OutputPort[0].isConnected()) { - #####: 1366: _logTime = this->m_Time_OutputPort[0].invoke(); - -: 1367: } - -: 1368: - 6: 1369: FwEventIdType _id = static_cast(0); - -: 1370: - 6: 1371: _id = EVENTID_ALOG_SEVERITY_FILTER_STATE; - -: 1372: - -: 1373: // Emit the event on the log port - 6: 1374: if (this->m_Log_OutputPort[0].isConnected()) { - -: 1375: - 6: 1376: Fw::LogBuffer _logBuff; - -: 1377: Fw::SerializeStatus _status; - -: 1378: - -: 1379:#if FW_AMPCS_COMPATIBLE - -: 1380: // Serialize the number of arguments - -: 1381: _status = _logBuff.serialize(static_cast(3)); - -: 1382: FW_ASSERT( - -: 1383: _status == Fw::FW_SERIALIZE_OK, - -: 1384: static_cast(_status) - -: 1385: ); - -: 1386:#endif - -: 1387: - -: 1388:#if FW_AMPCS_COMPATIBLE - -: 1389: // Serialize the argument size - -: 1390: _status = _logBuff.serialize(static_cast(sizeof(FwEnumStoreType))); - -: 1391: FW_ASSERT( - -: 1392: _status == Fw::FW_SERIALIZE_OK, - -: 1393: static_cast(_status) - -: 1394: ); - -: 1395:#endif - -: 1396: - -: 1397: _status = _logBuff.serialize( - -: 1398: static_cast(severity) - 6: 1399: ); - -: 1400: FW_ASSERT( - -: 1401: _status == Fw::FW_SERIALIZE_OK, - -: 1402: static_cast(_status) - 6: 1403: ); - -: 1404: - -: 1405:#if FW_AMPCS_COMPATIBLE - -: 1406: // Serialize the argument size - -: 1407: _status = _logBuff.serialize( - -: 1408: static_cast(sizeof(recvEnabled)) - -: 1409: ); - -: 1410: FW_ASSERT( - -: 1411: _status == Fw::FW_SERIALIZE_OK, - -: 1412: static_cast(_status) - -: 1413: ); - -: 1414:#endif - -: 1415: - 6: 1416: _status = _logBuff.serialize(recvEnabled); - -: 1417: FW_ASSERT( - -: 1418: _status == Fw::FW_SERIALIZE_OK, - -: 1419: static_cast(_status) - 6: 1420: ); - -: 1421: - -: 1422:#if FW_AMPCS_COMPATIBLE - -: 1423: // Serialize the argument size - -: 1424: _status = _logBuff.serialize( - -: 1425: static_cast(sizeof(sendEnabled)) - -: 1426: ); - -: 1427: FW_ASSERT( - -: 1428: _status == Fw::FW_SERIALIZE_OK, - -: 1429: static_cast(_status) - -: 1430: ); - -: 1431:#endif - -: 1432: - 6: 1433: _status = _logBuff.serialize(sendEnabled); - -: 1434: FW_ASSERT( - -: 1435: _status == Fw::FW_SERIALIZE_OK, - -: 1436: static_cast(_status) - 6: 1437: ); - -: 1438: - -: 1439: - -: 1440: this->m_Log_OutputPort[0].invoke( - -: 1441: _id, - -: 1442: _logTime,Fw::LOG_ACTIVITY_LO, - -: 1443: _logBuff - 6: 1444: ); - -: 1445: - -: 1446: } - -: 1447: - -: 1448: // Emit the event on the text log port - -: 1449:#if FW_ENABLE_TEXT_LOGGING - 6: 1450: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 1451: - -: 1452:#if FW_OBJECT_NAMES == 1 - -: 1453: const char* _formatString = - 6: 1454: "(%s) %s: %d filter state. Recv: %d Send: %d"; - -: 1455:#else - -: 1456: const char* _formatString = - -: 1457: "%s: %d filter state. Recv: %d Send: %d"; - -: 1458:#endif - -: 1459: - -: 1460: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 1461: - -: 1462: (void) snprintf( - -: 1463: _textBuffer, - -: 1464: FW_LOG_TEXT_BUFFER_SIZE, - -: 1465: _formatString, - -: 1466:#if FW_OBJECT_NAMES == 1 - -: 1467: this->m_objName, - -: 1468:#endif - -: 1469: "ALOG_SEVERITY_FILTER_STATE " - -: 1470: , severity - -: 1471: , recvEnabled - -: 1472: , sendEnabled - 6: 1473: ); - -: 1474: - -: 1475: // Null terminate - 6: 1476: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 6: 1477: Fw::TextLogString _logString = _textBuffer; - -: 1478: this->m_LogText_OutputPort[0].invoke( - -: 1479: _id, - -: 1480: _logTime,Fw::TEXT_LOG_ACTIVITY_LO, - -: 1481: _logString - 6: 1482: ); - -: 1483: - 6: 1484: } - -: 1485:#endif - -: 1486: - 6: 1487: } - -: 1488: - 56: 1489: void ActiveLoggerComponentBase :: - -: 1490: log_ACTIVITY_HI_ALOG_ID_FILTER_ENABLED( - -: 1491: U32 ID - -: 1492: ) - -: 1493: { - -: 1494: - -: 1495: // Get the time - 56: 1496: Fw::Time _logTime; - 56: 1497: if (this->m_Time_OutputPort[0].isConnected()) { - #####: 1498: _logTime = this->m_Time_OutputPort[0].invoke(); - -: 1499: } - -: 1500: - 56: 1501: FwEventIdType _id = static_cast(0); - -: 1502: - 56: 1503: _id = EVENTID_ALOG_ID_FILTER_ENABLED; - -: 1504: - -: 1505: // Emit the event on the log port - 56: 1506: if (this->m_Log_OutputPort[0].isConnected()) { - -: 1507: - 56: 1508: Fw::LogBuffer _logBuff; - -: 1509: Fw::SerializeStatus _status; - -: 1510: - -: 1511:#if FW_AMPCS_COMPATIBLE - -: 1512: // Serialize the number of arguments - -: 1513: _status = _logBuff.serialize(static_cast(1)); - -: 1514: FW_ASSERT( - -: 1515: _status == Fw::FW_SERIALIZE_OK, - -: 1516: static_cast(_status) - -: 1517: ); - -: 1518:#endif - -: 1519: - -: 1520:#if FW_AMPCS_COMPATIBLE - -: 1521: // Serialize the argument size - -: 1522: _status = _logBuff.serialize( - -: 1523: static_cast(sizeof(ID)) - -: 1524: ); - -: 1525: FW_ASSERT( - -: 1526: _status == Fw::FW_SERIALIZE_OK, - -: 1527: static_cast(_status) - -: 1528: ); - -: 1529:#endif - -: 1530: - 56: 1531: _status = _logBuff.serialize(ID); - -: 1532: FW_ASSERT( - -: 1533: _status == Fw::FW_SERIALIZE_OK, - -: 1534: static_cast(_status) - 56: 1535: ); - -: 1536: - -: 1537: - -: 1538: this->m_Log_OutputPort[0].invoke( - -: 1539: _id, - -: 1540: _logTime,Fw::LOG_ACTIVITY_HI, - -: 1541: _logBuff - 56: 1542: ); - -: 1543: - -: 1544: } - -: 1545: - -: 1546: // Emit the event on the text log port - -: 1547:#if FW_ENABLE_TEXT_LOGGING - 56: 1548: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 1549: - -: 1550:#if FW_OBJECT_NAMES == 1 - -: 1551: const char* _formatString = - 56: 1552: "(%s) %s: ID %d is filtered."; - -: 1553:#else - -: 1554: const char* _formatString = - -: 1555: "%s: ID %d is filtered."; - -: 1556:#endif - -: 1557: - -: 1558: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 1559: - -: 1560: (void) snprintf( - -: 1561: _textBuffer, - -: 1562: FW_LOG_TEXT_BUFFER_SIZE, - -: 1563: _formatString, - -: 1564:#if FW_OBJECT_NAMES == 1 - -: 1565: this->m_objName, - -: 1566:#endif - -: 1567: "ALOG_ID_FILTER_ENABLED " - -: 1568: , ID - 56: 1569: ); - -: 1570: - -: 1571: // Null terminate - 56: 1572: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 56: 1573: Fw::TextLogString _logString = _textBuffer; - -: 1574: this->m_LogText_OutputPort[0].invoke( - -: 1575: _id, - -: 1576: _logTime,Fw::TEXT_LOG_ACTIVITY_HI, - -: 1577: _logString - 56: 1578: ); - -: 1579: - 56: 1580: } - -: 1581:#endif - -: 1582: - 56: 1583: } - -: 1584: - 1: 1585: void ActiveLoggerComponentBase :: - -: 1586: log_WARNING_LO_ALOG_ID_FILTER_LIST_FULL( - -: 1587: U32 ID - -: 1588: ) - -: 1589: { - -: 1590: - -: 1591: // Get the time - 1: 1592: Fw::Time _logTime; - 1: 1593: if (this->m_Time_OutputPort[0].isConnected()) { - #####: 1594: _logTime = this->m_Time_OutputPort[0].invoke(); - -: 1595: } - -: 1596: - 1: 1597: FwEventIdType _id = static_cast(0); - -: 1598: - 1: 1599: _id = EVENTID_ALOG_ID_FILTER_LIST_FULL; - -: 1600: - -: 1601: // Emit the event on the log port - 1: 1602: if (this->m_Log_OutputPort[0].isConnected()) { - -: 1603: - 1: 1604: Fw::LogBuffer _logBuff; - -: 1605: Fw::SerializeStatus _status; - -: 1606: - -: 1607:#if FW_AMPCS_COMPATIBLE - -: 1608: // Serialize the number of arguments - -: 1609: _status = _logBuff.serialize(static_cast(1)); - -: 1610: FW_ASSERT( - -: 1611: _status == Fw::FW_SERIALIZE_OK, - -: 1612: static_cast(_status) - -: 1613: ); - -: 1614:#endif - -: 1615: - -: 1616:#if FW_AMPCS_COMPATIBLE - -: 1617: // Serialize the argument size - -: 1618: _status = _logBuff.serialize( - -: 1619: static_cast(sizeof(ID)) - -: 1620: ); - -: 1621: FW_ASSERT( - -: 1622: _status == Fw::FW_SERIALIZE_OK, - -: 1623: static_cast(_status) - -: 1624: ); - -: 1625:#endif - -: 1626: - 1: 1627: _status = _logBuff.serialize(ID); - -: 1628: FW_ASSERT( - -: 1629: _status == Fw::FW_SERIALIZE_OK, - -: 1630: static_cast(_status) - 1: 1631: ); - -: 1632: - -: 1633: - -: 1634: this->m_Log_OutputPort[0].invoke( - -: 1635: _id, - -: 1636: _logTime,Fw::LOG_WARNING_LO, - -: 1637: _logBuff - 1: 1638: ); - -: 1639: - -: 1640: } - -: 1641: - -: 1642: // Emit the event on the text log port - -: 1643:#if FW_ENABLE_TEXT_LOGGING - 1: 1644: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 1645: - -: 1646:#if FW_OBJECT_NAMES == 1 - -: 1647: const char* _formatString = - 1: 1648: "(%s) %s: ID filter list is full. Cannot filter %d ."; - -: 1649:#else - -: 1650: const char* _formatString = - -: 1651: "%s: ID filter list is full. Cannot filter %d ."; - -: 1652:#endif - -: 1653: - -: 1654: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 1655: - -: 1656: (void) snprintf( - -: 1657: _textBuffer, - -: 1658: FW_LOG_TEXT_BUFFER_SIZE, - -: 1659: _formatString, - -: 1660:#if FW_OBJECT_NAMES == 1 - -: 1661: this->m_objName, - -: 1662:#endif - -: 1663: "ALOG_ID_FILTER_LIST_FULL " - -: 1664: , ID - 1: 1665: ); - -: 1666: - -: 1667: // Null terminate - 1: 1668: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 1: 1669: Fw::TextLogString _logString = _textBuffer; - -: 1670: this->m_LogText_OutputPort[0].invoke( - -: 1671: _id, - -: 1672: _logTime,Fw::TEXT_LOG_WARNING_LO, - -: 1673: _logString - 1: 1674: ); - -: 1675: - 1: 1676: } - -: 1677:#endif - -: 1678: - 1: 1679: } - -: 1680: - 25: 1681: void ActiveLoggerComponentBase :: - -: 1682: log_ACTIVITY_HI_ALOG_ID_FILTER_REMOVED( - -: 1683: U32 ID - -: 1684: ) - -: 1685: { - -: 1686: - -: 1687: // Get the time - 25: 1688: Fw::Time _logTime; - 25: 1689: if (this->m_Time_OutputPort[0].isConnected()) { - #####: 1690: _logTime = this->m_Time_OutputPort[0].invoke(); - -: 1691: } - -: 1692: - 25: 1693: FwEventIdType _id = static_cast(0); - -: 1694: - 25: 1695: _id = EVENTID_ALOG_ID_FILTER_REMOVED; - -: 1696: - -: 1697: // Emit the event on the log port - 25: 1698: if (this->m_Log_OutputPort[0].isConnected()) { - -: 1699: - 25: 1700: Fw::LogBuffer _logBuff; - -: 1701: Fw::SerializeStatus _status; - -: 1702: - -: 1703:#if FW_AMPCS_COMPATIBLE - -: 1704: // Serialize the number of arguments - -: 1705: _status = _logBuff.serialize(static_cast(1)); - -: 1706: FW_ASSERT( - -: 1707: _status == Fw::FW_SERIALIZE_OK, - -: 1708: static_cast(_status) - -: 1709: ); - -: 1710:#endif - -: 1711: - -: 1712:#if FW_AMPCS_COMPATIBLE - -: 1713: // Serialize the argument size - -: 1714: _status = _logBuff.serialize( - -: 1715: static_cast(sizeof(ID)) - -: 1716: ); - -: 1717: FW_ASSERT( - -: 1718: _status == Fw::FW_SERIALIZE_OK, - -: 1719: static_cast(_status) - -: 1720: ); - -: 1721:#endif - -: 1722: - 25: 1723: _status = _logBuff.serialize(ID); - -: 1724: FW_ASSERT( - -: 1725: _status == Fw::FW_SERIALIZE_OK, - -: 1726: static_cast(_status) - 25: 1727: ); - -: 1728: - -: 1729: - -: 1730: this->m_Log_OutputPort[0].invoke( - -: 1731: _id, - -: 1732: _logTime,Fw::LOG_ACTIVITY_HI, - -: 1733: _logBuff - 25: 1734: ); - -: 1735: - -: 1736: } - -: 1737: - -: 1738: // Emit the event on the text log port - -: 1739:#if FW_ENABLE_TEXT_LOGGING - 25: 1740: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 1741: - -: 1742:#if FW_OBJECT_NAMES == 1 - -: 1743: const char* _formatString = - 25: 1744: "(%s) %s: ID filter ID %d removed."; - -: 1745:#else - -: 1746: const char* _formatString = - -: 1747: "%s: ID filter ID %d removed."; - -: 1748:#endif - -: 1749: - -: 1750: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 1751: - -: 1752: (void) snprintf( - -: 1753: _textBuffer, - -: 1754: FW_LOG_TEXT_BUFFER_SIZE, - -: 1755: _formatString, - -: 1756:#if FW_OBJECT_NAMES == 1 - -: 1757: this->m_objName, - -: 1758:#endif - -: 1759: "ALOG_ID_FILTER_REMOVED " - -: 1760: , ID - 25: 1761: ); - -: 1762: - -: 1763: // Null terminate - 25: 1764: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 25: 1765: Fw::TextLogString _logString = _textBuffer; - -: 1766: this->m_LogText_OutputPort[0].invoke( - -: 1767: _id, - -: 1768: _logTime,Fw::TEXT_LOG_ACTIVITY_HI, - -: 1769: _logString - 25: 1770: ); - -: 1771: - 25: 1772: } - -: 1773:#endif - -: 1774: - 25: 1775: } - -: 1776: - 1: 1777: void ActiveLoggerComponentBase :: - -: 1778: log_WARNING_LO_ALOG_ID_FILTER_NOT_FOUND( - -: 1779: U32 ID - -: 1780: ) - -: 1781: { - -: 1782: - -: 1783: // Get the time - 1: 1784: Fw::Time _logTime; - 1: 1785: if (this->m_Time_OutputPort[0].isConnected()) { - #####: 1786: _logTime = this->m_Time_OutputPort[0].invoke(); - -: 1787: } - -: 1788: - 1: 1789: FwEventIdType _id = static_cast(0); - -: 1790: - 1: 1791: _id = EVENTID_ALOG_ID_FILTER_NOT_FOUND; - -: 1792: - -: 1793: // Emit the event on the log port - 1: 1794: if (this->m_Log_OutputPort[0].isConnected()) { - -: 1795: - 1: 1796: Fw::LogBuffer _logBuff; - -: 1797: Fw::SerializeStatus _status; - -: 1798: - -: 1799:#if FW_AMPCS_COMPATIBLE - -: 1800: // Serialize the number of arguments - -: 1801: _status = _logBuff.serialize(static_cast(1)); - -: 1802: FW_ASSERT( - -: 1803: _status == Fw::FW_SERIALIZE_OK, - -: 1804: static_cast(_status) - -: 1805: ); - -: 1806:#endif - -: 1807: - -: 1808:#if FW_AMPCS_COMPATIBLE - -: 1809: // Serialize the argument size - -: 1810: _status = _logBuff.serialize( - -: 1811: static_cast(sizeof(ID)) - -: 1812: ); - -: 1813: FW_ASSERT( - -: 1814: _status == Fw::FW_SERIALIZE_OK, - -: 1815: static_cast(_status) - -: 1816: ); - -: 1817:#endif - -: 1818: - 1: 1819: _status = _logBuff.serialize(ID); - -: 1820: FW_ASSERT( - -: 1821: _status == Fw::FW_SERIALIZE_OK, - -: 1822: static_cast(_status) - 1: 1823: ); - -: 1824: - -: 1825: - -: 1826: this->m_Log_OutputPort[0].invoke( - -: 1827: _id, - -: 1828: _logTime,Fw::LOG_WARNING_LO, - -: 1829: _logBuff - 1: 1830: ); - -: 1831: - -: 1832: } - -: 1833: - -: 1834: // Emit the event on the text log port - -: 1835:#if FW_ENABLE_TEXT_LOGGING - 1: 1836: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 1837: - -: 1838:#if FW_OBJECT_NAMES == 1 - -: 1839: const char* _formatString = - 1: 1840: "(%s) %s: ID filter ID %d not found."; - -: 1841:#else - -: 1842: const char* _formatString = - -: 1843: "%s: ID filter ID %d not found."; - -: 1844:#endif - -: 1845: - -: 1846: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 1847: - -: 1848: (void) snprintf( - -: 1849: _textBuffer, - -: 1850: FW_LOG_TEXT_BUFFER_SIZE, - -: 1851: _formatString, - -: 1852:#if FW_OBJECT_NAMES == 1 - -: 1853: this->m_objName, - -: 1854:#endif - -: 1855: "ALOG_ID_FILTER_NOT_FOUND " - -: 1856: , ID - 1: 1857: ); - -: 1858: - -: 1859: // Null terminate - 1: 1860: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 1: 1861: Fw::TextLogString _logString = _textBuffer; - -: 1862: this->m_LogText_OutputPort[0].invoke( - -: 1863: _id, - -: 1864: _logTime,Fw::TEXT_LOG_WARNING_LO, - -: 1865: _logString - 1: 1866: ); - -: 1867: - 1: 1868: } - -: 1869:#endif - -: 1870: - 1: 1871: } - -: 1872: - -: 1873: // ---------------------------------------------------------------------- - -: 1874: // Invocation functions for interfaces - -: 1875: // ---------------------------------------------------------------------- - -: 1876: - 168: 1877: void ActiveLoggerComponentBase:: - -: 1878: loqQueue_internalInterfaceInvoke( - -: 1879: FwEventIdType id, Fw::Time& timeTag, QueueLogSeverity severity, Fw::LogBuffer& args - -: 1880: ) - -: 1881: { - -: 1882: - 168: 1883: ComponentIpcSerializableBuffer msg; - -: 1884: Fw::SerializeStatus _status; - -: 1885: - -: 1886: // Serialize the message ID - 168: 1887: _status = msg.serialize(static_cast(INT_IF_LOQQUEUE)); - -: 1888: FW_ASSERT ( - -: 1889: _status == Fw::FW_SERIALIZE_OK, - -: 1890: static_cast(_status) - 168: 1891: ); - -: 1892: - -: 1893: // Fake port number to make message dequeue work - 168: 1894: _status = msg.serialize(static_cast(0)); - -: 1895: FW_ASSERT ( - -: 1896: _status == Fw::FW_SERIALIZE_OK, - -: 1897: static_cast(_status) - 168: 1898: ); - -: 1899: - 168: 1900: _status = msg.serialize(id); - 168: 1901: FW_ASSERT(_status == Fw::FW_SERIALIZE_OK, static_cast(_status)); - 168: 1902: _status = msg.serialize(timeTag); - 168: 1903: FW_ASSERT(_status == Fw::FW_SERIALIZE_OK, static_cast(_status)); - 168: 1904: _status = msg.serialize(static_cast(severity)); - 168: 1905: FW_ASSERT(_status == Fw::FW_SERIALIZE_OK, static_cast(_status)); - 168: 1906: _status = msg.serialize(args); - 168: 1907: FW_ASSERT(_status == Fw::FW_SERIALIZE_OK, static_cast(_status)); - -: 1908: - -: 1909: Os::Queue::QueueStatus qStatus = - 168: 1910: this->m_queue.send(msg, 1); - -: 1911: FW_ASSERT( - -: 1912: qStatus == Os::Queue::QUEUE_OK, - -: 1913: static_cast(qStatus) - 168: 1914: ); - -: 1915: - 168: 1916: } - -: 1917: - -: 1918: // ---------------------------------------------------------------------- - -: 1919: // Calls for messages received on typed input ports - -: 1920: // ---------------------------------------------------------------------- - -: 1921: - 199: 1922: void ActiveLoggerComponentBase :: - -: 1923: m_p_LogRecv_in( - -: 1924: Fw::PassiveComponentBase* callComp, - -: 1925: NATIVE_INT_TYPE portNum, - -: 1926: FwEventIdType id, Fw::Time &timeTag, Fw::LogSeverity severity, Fw::LogBuffer &args - -: 1927: ) - -: 1928: { - 199: 1929: FW_ASSERT(callComp); - -: 1930: ActiveLoggerComponentBase* compPtr = - 199: 1931: (ActiveLoggerComponentBase*) callComp; - 199: 1932: compPtr->LogRecv_handlerBase(portNum, id, timeTag, severity, args); - 199: 1933: } - -: 1934: - -: 1935: // ---------------------------------------------------------------------- - -: 1936: // Port handler base-class functions for typed input ports - -: 1937: // ---------------------------------------------------------------------- - -: 1938: - 199: 1939: void ActiveLoggerComponentBase :: - -: 1940: LogRecv_handlerBase( - -: 1941: NATIVE_INT_TYPE portNum, - -: 1942: FwEventIdType id, Fw::Time &timeTag, Fw::LogSeverity severity, Fw::LogBuffer &args - -: 1943: ) - -: 1944: { - -: 1945: - -: 1946: // Make sure port number is valid - 199: 1947: FW_ASSERT(portNum < this->getNum_LogRecv_InputPorts(),static_cast(portNum)); - -: 1948: - -: 1949: // Down call to pure virtual handler method implemented in Impl class - 199: 1950: this->LogRecv_handler(portNum, id, timeTag, severity, args); - -: 1951: - 199: 1952: } - -: 1953: - -: 1954: // ---------------------------------------------------------------------- - -: 1955: // Message dispatch method for active and queued components. Called - -: 1956: // by active component thread or implementation code for queued components - -: 1957: // ---------------------------------------------------------------------- - -: 1958: - 267: 1959: Fw::QueuedComponentBase::MsgDispatchStatus ActiveLoggerComponentBase :: - -: 1960: doDispatch(void) - -: 1961: { - -: 1962: - 267: 1963: ComponentIpcSerializableBuffer msg; - -: 1964: NATIVE_INT_TYPE priority; - -: 1965: - 267: 1966: Os::Queue::QueueStatus msgStatus = this->m_queue.receive(msg,priority); - -: 1967: FW_ASSERT( - -: 1968: msgStatus == Os::Queue::QUEUE_OK, - -: 1969: static_cast(msgStatus) - 267: 1970: ); - -: 1971: - -: 1972: // Reset to beginning of buffer - 267: 1973: msg.resetDeser(); - -: 1974: - -: 1975: NATIVE_INT_TYPE desMsg; - 267: 1976: Fw::SerializeStatus deserStatus = msg.deserialize(desMsg); - -: 1977: FW_ASSERT( - -: 1978: deserStatus == Fw::FW_SERIALIZE_OK, - -: 1979: static_cast(deserStatus) - 267: 1980: ); - -: 1981: - 267: 1982: MsgTypeEnum msgType = static_cast(desMsg); - -: 1983: - 267: 1984: if (msgType == ACTIVELOGGER_COMPONENT_EXIT) { - #####: 1985: return MSG_DISPATCH_EXIT; - -: 1986: } - -: 1987: - -: 1988: NATIVE_INT_TYPE portNum; - 267: 1989: deserStatus = msg.deserialize(portNum); - -: 1990: FW_ASSERT( - -: 1991: deserStatus == Fw::FW_SERIALIZE_OK, - -: 1992: static_cast(deserStatus) - 267: 1993: ); - -: 1994: - 267: 1995: switch (msgType) { - -: 1996: - -: 1997: // Handle command ALOG_DUMP_EVENT_LOG - -: 1998: case CMD_ALOG_DUMP_EVENT_LOG: { - -: 1999: // Deserialize opcode - -: 2000: FwOpcodeType opCode; - 17: 2001: deserStatus = msg.deserialize(opCode); - -: 2002: FW_ASSERT ( - -: 2003: deserStatus == Fw::FW_SERIALIZE_OK, - -: 2004: static_cast(deserStatus) - 17: 2005: ); - -: 2006: - -: 2007: // Deserialize command sequence - -: 2008: U32 cmdSeq; - 17: 2009: deserStatus = msg.deserialize(cmdSeq); - -: 2010: FW_ASSERT ( - -: 2011: deserStatus == Fw::FW_SERIALIZE_OK, - -: 2012: static_cast(deserStatus) - 17: 2013: ); - -: 2014: - -: 2015: // Deserialize command argument buffer - 17: 2016: Fw::CmdArgBuffer args; - 17: 2017: deserStatus = msg.deserialize(args); - -: 2018: FW_ASSERT ( - -: 2019: deserStatus == Fw::FW_SERIALIZE_OK, - -: 2020: static_cast(deserStatus) - 17: 2021: ); - -: 2022: - -: 2023: // Reset buffer - 17: 2024: args.resetDeser(); - -: 2025: - -: 2026: // Deserialize argument filename - 34: 2027: Fw::CmdStringArg filename; - 17: 2028: deserStatus = args.deserialize(filename); - 17: 2029: if (deserStatus != Fw::FW_SERIALIZE_OK) { - #####: 2030: if (this->m_CmdStatus_OutputPort[0].isConnected()) { - -: 2031: this->cmdResponse_out( - -: 2032: opCode, - -: 2033: cmdSeq, - -: 2034: Fw::COMMAND_FORMAT_ERROR - #####: 2035: ); - -: 2036: } - -: 2037: // Don't crash the task if bad arguments were passed from the ground - #####: 2038: break; - -: 2039: } - -: 2040: - -: 2041: // Make sure there was no data left over. - -: 2042: // That means the argument buffer size was incorrect. - 17: 2043: if (args.getBuffLeft() != 0) { - #####: 2044: if (this->m_CmdStatus_OutputPort[0].isConnected()) { - #####: 2045: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_FORMAT_ERROR); - -: 2046: } - -: 2047: // Don't crash the task if bad arguments were passed from the ground - #####: 2048: break; - -: 2049: } - -: 2050: - -: 2051: // Call handler function - -: 2052: this->ALOG_DUMP_EVENT_LOG_cmdHandler( - -: 2053: opCode, - -: 2054: cmdSeq, - -: 2055: filename - 17: 2056: ); - -: 2057: - 34: 2058: break; - -: 2059: - -: 2060: } - -: 2061: - -: 2062: // Handle command ALOG_SET_ID_FILTER - -: 2063: case CMD_ALOG_SET_ID_FILTER: { - -: 2064: // Deserialize opcode - -: 2065: FwOpcodeType opCode; - 81: 2066: deserStatus = msg.deserialize(opCode); - -: 2067: FW_ASSERT ( - -: 2068: deserStatus == Fw::FW_SERIALIZE_OK, - -: 2069: static_cast(deserStatus) - 81: 2070: ); - -: 2071: - -: 2072: // Deserialize command sequence - -: 2073: U32 cmdSeq; - 81: 2074: deserStatus = msg.deserialize(cmdSeq); - -: 2075: FW_ASSERT ( - -: 2076: deserStatus == Fw::FW_SERIALIZE_OK, - -: 2077: static_cast(deserStatus) - 81: 2078: ); - -: 2079: - -: 2080: // Deserialize command argument buffer - 81: 2081: Fw::CmdArgBuffer args; - 81: 2082: deserStatus = msg.deserialize(args); - -: 2083: FW_ASSERT ( - -: 2084: deserStatus == Fw::FW_SERIALIZE_OK, - -: 2085: static_cast(deserStatus) - 81: 2086: ); - -: 2087: - -: 2088: // Reset buffer - 81: 2089: args.resetDeser(); - -: 2090: - -: 2091: // Deserialize argument ID - -: 2092: U32 ID; - 81: 2093: deserStatus = args.deserialize(ID); - 81: 2094: if (deserStatus != Fw::FW_SERIALIZE_OK) { - #####: 2095: if (this->m_CmdStatus_OutputPort[0].isConnected()) { - -: 2096: this->cmdResponse_out( - -: 2097: opCode, - -: 2098: cmdSeq, - -: 2099: Fw::COMMAND_FORMAT_ERROR - #####: 2100: ); - -: 2101: } - -: 2102: // Don't crash the task if bad arguments were passed from the ground - #####: 2103: break; - -: 2104: } - -: 2105: - -: 2106: // Deserialize argument IdFilterEnable - -: 2107: IdFilterEnabled IdFilterEnable; - -: 2108: FwEnumStoreType IdFilterEnableInt; - 81: 2109: deserStatus = args.deserialize(IdFilterEnableInt); - 81: 2110: IdFilterEnable = (IdFilterEnabled)IdFilterEnableInt; - 81: 2111: if (deserStatus != Fw::FW_SERIALIZE_OK) { - #####: 2112: if (this->m_CmdStatus_OutputPort[0].isConnected()) { - -: 2113: this->cmdResponse_out( - -: 2114: opCode, - -: 2115: cmdSeq, - -: 2116: Fw::COMMAND_FORMAT_ERROR - #####: 2117: ); - -: 2118: } - -: 2119: // Don't crash the task if bad arguments were passed from the ground - #####: 2120: break; - -: 2121: } - -: 2122: - -: 2123: // Make sure there was no data left over. - -: 2124: // That means the argument buffer size was incorrect. - 81: 2125: if (args.getBuffLeft() != 0) { - #####: 2126: if (this->m_CmdStatus_OutputPort[0].isConnected()) { - #####: 2127: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_FORMAT_ERROR); - -: 2128: } - -: 2129: // Don't crash the task if bad arguments were passed from the ground - #####: 2130: break; - -: 2131: } - -: 2132: - -: 2133: // Call handler function - -: 2134: this->ALOG_SET_ID_FILTER_cmdHandler( - -: 2135: opCode, - -: 2136: cmdSeq, - -: 2137: ID, IdFilterEnable - 81: 2138: ); - -: 2139: - 81: 2140: break; - -: 2141: - -: 2142: } - -: 2143: - -: 2144: // Handle command ALOG_DUMP_FILTER_STATE - -: 2145: case CMD_ALOG_DUMP_FILTER_STATE: { - -: 2146: // Deserialize opcode - -: 2147: FwOpcodeType opCode; - 1: 2148: deserStatus = msg.deserialize(opCode); - -: 2149: FW_ASSERT ( - -: 2150: deserStatus == Fw::FW_SERIALIZE_OK, - -: 2151: static_cast(deserStatus) - 1: 2152: ); - -: 2153: - -: 2154: // Deserialize command sequence - -: 2155: U32 cmdSeq; - 1: 2156: deserStatus = msg.deserialize(cmdSeq); - -: 2157: FW_ASSERT ( - -: 2158: deserStatus == Fw::FW_SERIALIZE_OK, - -: 2159: static_cast(deserStatus) - 1: 2160: ); - -: 2161: - -: 2162: // Deserialize command argument buffer - 1: 2163: Fw::CmdArgBuffer args; - 1: 2164: deserStatus = msg.deserialize(args); - -: 2165: FW_ASSERT ( - -: 2166: deserStatus == Fw::FW_SERIALIZE_OK, - -: 2167: static_cast(deserStatus) - 1: 2168: ); - -: 2169: - -: 2170: // Reset buffer - 1: 2171: args.resetDeser(); - -: 2172: - -: 2173: // Make sure there was no data left over. - -: 2174: // That means the argument buffer size was incorrect. - 1: 2175: if (args.getBuffLeft() != 0) { - #####: 2176: if (this->m_CmdStatus_OutputPort[0].isConnected()) { - #####: 2177: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_FORMAT_ERROR); - -: 2178: } - -: 2179: // Don't crash the task if bad arguments were passed from the ground - #####: 2180: break; - -: 2181: } - -: 2182: - -: 2183: // Call handler function - 1: 2184: this->ALOG_DUMP_FILTER_STATE_cmdHandler(opCode, cmdSeq); - -: 2185: - 1: 2186: break; - -: 2187: - -: 2188: } - -: 2189: - -: 2190: // Handle internal interface loqQueue - -: 2191: case INT_IF_LOQQUEUE: { - -: 2192: - -: 2193: FwEventIdType id; - 168: 2194: deserStatus = msg.deserialize(id); - -: 2195: - -: 2196: // Internal interfaces should always deserialize - -: 2197: FW_ASSERT( - -: 2198: Fw::FW_SERIALIZE_OK == deserStatus, - -: 2199: static_cast(deserStatus) - 168: 2200: ); - -: 2201: - 168: 2202: Fw::Time timeTag; - 168: 2203: deserStatus = msg.deserialize(timeTag); - -: 2204: - -: 2205: // Internal interfaces should always deserialize - -: 2206: FW_ASSERT( - -: 2207: Fw::FW_SERIALIZE_OK == deserStatus, - -: 2208: static_cast(deserStatus) - 168: 2209: ); - -: 2210: - -: 2211: QueueLogSeverity severity; - -: 2212: FwEnumStoreType severityInt; - 168: 2213: deserStatus = msg.deserialize(severityInt); - 168: 2214: severity = static_cast(severityInt); - -: 2215: - -: 2216: // Internal interfaces should always deserialize - -: 2217: FW_ASSERT( - -: 2218: Fw::FW_SERIALIZE_OK == deserStatus, - -: 2219: static_cast(deserStatus) - 168: 2220: ); - -: 2221: - 336: 2222: Fw::LogBuffer args; - 168: 2223: deserStatus = msg.deserialize(args); - -: 2224: - -: 2225: // Internal interfaces should always deserialize - -: 2226: FW_ASSERT( - -: 2227: Fw::FW_SERIALIZE_OK == deserStatus, - -: 2228: static_cast(deserStatus) - 168: 2229: ); - -: 2230: - -: 2231: // Make sure there was no data left over. - -: 2232: // That means the buffer size was incorrect. - 168: 2233: FW_ASSERT( - -: 2234: msg.getBuffLeft() == 0, - -: 2235: static_cast(msg.getBuffLeft()) - 168: 2236: ); - -: 2237: - -: 2238: // Call handler function - 168: 2239: this->loqQueue_internalInterfaceHandler(id, timeTag, severity, args); - -: 2240: - 336: 2241: break; - -: 2242: - -: 2243: } - -: 2244: - -: 2245: default: - #####: 2246: return MSG_DISPATCH_ERROR; - -: 2247: - -: 2248: } - -: 2249: - 267: 2250: return MSG_DISPATCH_OK; - -: 2251: - -: 2252: } - -: 2253: - -: 2254:} // end namespace Svc diff --git a/Svc/ActiveLogger/test/ut/output/ActiveLoggerImpl.cpp.gcov b/Svc/ActiveLogger/test/ut/output/ActiveLoggerImpl.cpp.gcov deleted file mode 100644 index 88fce7733a..0000000000 --- a/Svc/ActiveLogger/test/ut/output/ActiveLoggerImpl.cpp.gcov +++ /dev/null @@ -1,536 +0,0 @@ - -: 0:Source:/home/tim/source/isf/Svc/ActiveLogger/ActiveLoggerImpl.cpp - -: 0:Programs:2 - -: 1:/* - -: 2: * TestCommand1Impl.cpp - -: 3: * - -: 4: * Created on: Mar 28, 2014 - -: 5: * Author: tcanham - -: 6: */ - -: 7: - -: 8:#include - -: 9:#include - -: 10:#include - -: 11: - -: 12:namespace Svc { - -: 13: - -: 14:#if FW_OBJECT_NAMES == 1 - 8: 15: ActiveLoggerImpl::ActiveLoggerImpl(const char* name) : ActiveLoggerComponentBase(name) - -: 16:#else - -: 17: ActiveLoggerImpl::ActiveLoggerImpl() : - -: 18: ActiveLoggerComponentBase() - -: 19:#endif - -: 20: ,m_fatalHead(0) - -: 21: ,m_warningHiHead(0) - -: 22: ,m_warningLoHead(0) - -: 23: ,m_commandHead(0) - -: 24: ,m_activityHiHead(0) - -: 25: ,m_activityLoHead(0) - 8: 26: ,m_diagnosticHead(0) - -: 27: { - -: 28: // set input filter defaults - -: 29: this->m_inFilterState[INPUT_WARNING_HI].enabled = - 8: 30: INPUT_WARNING_HI_DEFAULT?INPUT_ENABLED:INPUT_DISABLED; - -: 31: this->m_inFilterState[INPUT_WARNING_LO].enabled = - 8: 32: INPUT_WARNING_LO_DEFAULT?INPUT_ENABLED:INPUT_DISABLED; - -: 33: this->m_inFilterState[INPUT_COMMAND].enabled = - 8: 34: INPUT_COMMAND_DEFAULT?INPUT_ENABLED:INPUT_DISABLED; - -: 35: this->m_inFilterState[INPUT_ACTIVITY_HI].enabled = - 8: 36: INPUT_ACTIVITY_HI_DEFAULT?INPUT_ENABLED:INPUT_DISABLED; - -: 37: this->m_inFilterState[INPUT_ACTIVITY_LO].enabled = - 8: 38: INPUT_ACTIVITY_LO_DEFAULT?INPUT_ENABLED:INPUT_DISABLED; - -: 39: this->m_inFilterState[INPUT_DIAGNOSTIC].enabled = - 8: 40: INPUT_DIAGNOSTIC_DEFAULT?INPUT_ENABLED:INPUT_DISABLED; - -: 41: // set send filter defaults - -: 42: this->m_sendFilterState[SEND_WARNING_HI].enabled = - 8: 43: SEND_WARNING_HI_DEFAULT?SEND_ENABLED:SEND_DISABLED; - -: 44: this->m_sendFilterState[SEND_WARNING_LO].enabled = - 8: 45: SEND_WARNING_LO_DEFAULT?SEND_ENABLED:SEND_DISABLED; - -: 46: this->m_sendFilterState[SEND_COMMAND].enabled = - 8: 47: SEND_COMMAND_DEFAULT?SEND_ENABLED:SEND_DISABLED; - -: 48: this->m_sendFilterState[SEND_ACTIVITY_HI].enabled = - 8: 49: SEND_ACTIVITY_HI_DEFAULT?SEND_ENABLED:SEND_DISABLED; - -: 50: this->m_sendFilterState[SEND_ACTIVITY_LO].enabled = - 8: 51: SEND_ACTIVITY_LO_DEFAULT?SEND_ENABLED:SEND_DISABLED; - -: 52: this->m_sendFilterState[SEND_DIAGNOSTIC].enabled = - 8: 53: SEND_DIAGNOSTIC_DEFAULT?SEND_ENABLED:SEND_DISABLED; - -: 54: - 8: 55: memset(m_filteredIDs,0,sizeof(m_filteredIDs)); - -: 56: - 8: 57: } - -: 58: - 8: 59: ActiveLoggerImpl::~ActiveLoggerImpl() { - 8: 60: } - -: 61: - 8: 62: void ActiveLoggerImpl::init(NATIVE_INT_TYPE queueDepth) { - 8: 63: ActiveLoggerComponentBase::init(queueDepth); - 8: 64: } - -: 65: - 199: 66: void ActiveLoggerImpl::LogRecv_handler(NATIVE_INT_TYPE portNum, FwEventIdType id, Fw::Time &timeTag, Fw::LogSeverity severity, Fw::LogBuffer &args) { - -: 67: - -: 68: // make sure ID is not zero. Zero is reserved for ID filter. - 199: 69: FW_ASSERT(id != 0); - -: 70: - 199: 71: switch (severity) { - -: 72: case Fw::LOG_FATAL: // always pass FATAL - 9: 73: break; - -: 74: case Fw::LOG_WARNING_HI: - 15: 75: if (this->m_inFilterState[INPUT_WARNING_HI].enabled == INPUT_DISABLED) { - 1: 76: return; - -: 77: } - 14: 78: break; - -: 79: case Fw::LOG_WARNING_LO: - 24: 80: if (this->m_inFilterState[INPUT_WARNING_LO].enabled == INPUT_DISABLED) { - 1: 81: return; - -: 82: } - 23: 83: break; - -: 84: case Fw::LOG_COMMAND: - 24: 85: if (this->m_inFilterState[INPUT_COMMAND].enabled == INPUT_DISABLED) { - 1: 86: return; - -: 87: } - 23: 88: break; - -: 89: case Fw::LOG_ACTIVITY_HI: - 49: 90: if (this->m_inFilterState[INPUT_ACTIVITY_HI].enabled == INPUT_DISABLED) { - 1: 91: return; - -: 92: } - 48: 93: break; - -: 94: case Fw::LOG_ACTIVITY_LO: - 24: 95: if (this->m_inFilterState[INPUT_ACTIVITY_LO].enabled == INPUT_DISABLED) { - 1: 96: return; - -: 97: } - 23: 98: break; - -: 99: case Fw::LOG_DIAGNOSTIC: - 54: 100: if (this->m_inFilterState[INPUT_DIAGNOSTIC].enabled == INPUT_DISABLED) { - 1: 101: return; - -: 102: } - 53: 103: break; - -: 104: default: - #####: 105: FW_ASSERT(0,static_cast(severity)); - #####: 106: return; - -: 107: } - -: 108: - -: 109: // check ID filters - 4693: 110: for (NATIVE_INT_TYPE entry = 0; entry < TELEM_ID_FILTER_SIZE; entry++) { - 4525: 111: if ( - 4551: 112: (m_filteredIDs[entry] == id) && - -: 113: (severity != Fw::LOG_FATAL) - -: 114: ) { - 25: 115: return; - -: 116: } - -: 117: } - -: 118: - -: 119: // send event to the logger thread - 168: 120: this->loqQueue_internalInterfaceInvoke(id,timeTag,static_cast(severity),args); - -: 121: - -: 122: // if connected, announce the FATAL - 168: 123: if (Fw::LOG_FATAL == severity) { - 9: 124: if (this->isConnected_FatalAnnounce_OutputPort(0)) { - 9: 125: this->FatalAnnounce_out(0,id); - -: 126: } - -: 127: } - -: 128: } - -: 129: - 168: 130: void ActiveLoggerImpl::loqQueue_internalInterfaceHandler(FwEventIdType id, Fw::Time &timeTag, QueueLogSeverity severity, Fw::LogBuffer &args) { - -: 131: - -: 132: // Serialize event - 168: 133: this->m_logPacket.setId(id); - 168: 134: this->m_logPacket.setTimeTag(timeTag); - 168: 135: this->m_logPacket.setLogBuffer(args); - 168: 136: this->m_comBuffer.resetSer(); - 168: 137: Fw::SerializeStatus stat = this->m_logPacket.serialize(this->m_comBuffer); - 168: 138: FW_ASSERT(Fw::FW_SERIALIZE_OK == stat,static_cast(stat)); - -: 139: - 168: 140: switch (severity) { - -: 141: case QUEUE_LOG_FATAL: // always pass FATAL - 9: 142: this->m_fatalCb[this->m_fatalHead] = this->m_comBuffer; - 9: 143: this->m_fatalHead = (this->m_fatalHead + 1)%FW_NUM_ARRAY_ELEMENTS(this->m_fatalCb); - 9: 144: break; - -: 145: case QUEUE_LOG_WARNING_HI: - 14: 146: this->m_warningHiCb[this->m_warningHiHead] = this->m_comBuffer; - 14: 147: this->m_warningHiHead = (this->m_warningHiHead + 1)%FW_NUM_ARRAY_ELEMENTS(this->m_warningHiCb); - 14: 148: if (this->m_sendFilterState[SEND_WARNING_HI].enabled == SEND_DISABLED) { - 1: 149: return; - -: 150: } - 13: 151: break; - -: 152: case QUEUE_LOG_WARNING_LO: - 23: 153: this->m_warningLoCb[this->m_warningLoHead] = this->m_comBuffer; - 23: 154: this->m_warningLoHead = (this->m_warningLoHead + 1)%FW_NUM_ARRAY_ELEMENTS(this->m_warningLoCb); - 23: 155: if (this->m_sendFilterState[SEND_WARNING_LO].enabled == SEND_DISABLED) { - 1: 156: return; - -: 157: } - 22: 158: break; - -: 159: case QUEUE_LOG_COMMAND: - 23: 160: this->m_commandCb[this->m_commandHead] = this->m_comBuffer; - 23: 161: this->m_commandHead = (this->m_commandHead + 1)%FW_NUM_ARRAY_ELEMENTS(this->m_commandCb); - 23: 162: if (this->m_sendFilterState[SEND_COMMAND].enabled == SEND_DISABLED) { - 1: 163: return; - -: 164: } - 22: 165: break; - -: 166: case QUEUE_LOG_ACTIVITY_HI: - 23: 167: this->m_activityHiCb[this->m_activityHiHead] = this->m_comBuffer; - 23: 168: this->m_activityHiHead = (this->m_activityHiHead + 1)%FW_NUM_ARRAY_ELEMENTS(this->m_activityHiCb); - 23: 169: if (this->m_sendFilterState[SEND_ACTIVITY_HI].enabled == SEND_DISABLED) { - 1: 170: return; - -: 171: } - 22: 172: break; - -: 173: case QUEUE_LOG_ACTIVITY_LO: - 23: 174: this->m_activityLoCb[this->m_activityLoHead] = this->m_comBuffer; - 23: 175: this->m_activityLoHead = (this->m_activityLoHead + 1)%FW_NUM_ARRAY_ELEMENTS(this->m_activityLoCb); - 23: 176: if (this->m_sendFilterState[SEND_ACTIVITY_LO].enabled == SEND_DISABLED) { - 1: 177: return; - -: 178: } - 22: 179: break; - -: 180: case QUEUE_LOG_DIAGNOSTIC: - 53: 181: this->m_diagnosticCb[this->m_diagnosticHead] = this->m_comBuffer; - 53: 182: this->m_diagnosticHead = (this->m_diagnosticHead + 1)%FW_NUM_ARRAY_ELEMENTS(this->m_diagnosticCb); - 53: 183: if (this->m_sendFilterState[SEND_DIAGNOSTIC].enabled == SEND_DISABLED) { - 1: 184: return; - -: 185: } - 52: 186: break; - -: 187: default: - #####: 188: FW_ASSERT(0,static_cast(severity)); - #####: 189: return; - -: 190: } - -: 191: - 162: 192: if (this->isConnected_PktSend_OutputPort(0)) { - 162: 193: this->PktSend_out(0, this->m_comBuffer,0); - -: 194: } - -: 195: } - -: 196: - 52: 197: void ActiveLoggerImpl::ALOG_SET_EVENT_REPORT_FILTER_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, InputFilterLevel FilterLevel, InputFilterEnabled FilterEnable) { - 103: 198: if ( (FilterLevel > INPUT_DIAGNOSTIC) or - 101: 199: (FilterLevel < INPUT_WARNING_HI) or - 99: 200: (FilterEnable < INPUT_ENABLED) or - 49: 201: (FilterEnable > INPUT_DISABLED)) { - 4: 202: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_VALIDATION_ERROR); - 56: 203: return; - -: 204: } - 48: 205: this->m_inFilterState[FilterLevel].enabled = FilterEnable; - 48: 206: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_OK); - -: 207: } - -: 208: - 52: 209: void ActiveLoggerImpl::ALOG_SET_EVENT_SEND_FILTER_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, SendFilterLevel FilterLevel, SendFilterEnabled FilterEnable) { - 103: 210: if ( (FilterLevel > SEND_DIAGNOSTIC) or - 101: 211: (FilterLevel < SEND_WARNING_HI) or - 99: 212: (FilterEnable < SEND_ENABLED) or - 49: 213: (FilterEnable > SEND_DISABLED)) { - 4: 214: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_VALIDATION_ERROR); - 56: 215: return; - -: 216: } - 48: 217: this->m_sendFilterState[FilterLevel].enabled = FilterEnable; - 48: 218: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_OK); - -: 219: } - -: 220: - 17: 221: void ActiveLoggerImpl::ALOG_DUMP_EVENT_LOG_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg& filename) { - -: 222: // Walk through each event type and write it to the file - -: 223: - -: 224: static const BYTE delimiter = 0xA5; - -: 225: // open the file - 17: 226: Os::File file; - 17: 227: Os::File::Status stat = file.open(filename.toChar(),Os::File::OPEN_WRITE); - 17: 228: if (stat != Os::File::OP_OK) { - 1: 229: this->log_WARNING_HI_ALOG_FILE_WRITE_ERR(LOG_WRITE_OPEN,(I32)stat); - 1: 230: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_EXECUTION_ERROR); - 1: 231: return; - -: 232: } - -: 233: - 16: 234: NATIVE_UINT_TYPE numRecords = 0; - -: 235: - -: 236: NATIVE_INT_TYPE fileWriteSize; - -: 237: // write FATAL - 34: 238: for (NATIVE_UINT_TYPE entry = 0; entry < FW_NUM_ARRAY_ELEMENTS(this->m_fatalCb); entry++) { - -: 239: - -: 240: // if there is data, write it - 33: 241: if (this->m_fatalCb[entry].getBuffLength() != 0) { - -: 242: // write delimiter - 20: 243: fileWriteSize = sizeof(delimiter); - 20: 244: stat = file.write(&delimiter,fileWriteSize); - 20: 245: if (stat != Os::File::OP_OK) { - 1: 246: this->log_WARNING_HI_ALOG_FILE_WRITE_ERR(LOG_WRITE_FATAL_DELIMITER,stat); - 1: 247: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_EXECUTION_ERROR); - 1: 248: file.close(); - 1: 249: return; - -: 250: } - -: 251: - -: 252: // write event record - 19: 253: fileWriteSize = this->m_fatalCb[entry].getBuffLength(); - 19: 254: stat = file.write(this->m_fatalCb[entry].getBuffAddr(),fileWriteSize); - 19: 255: if (stat != Os::File::OP_OK) { - 1: 256: this->log_WARNING_HI_ALOG_FILE_WRITE_ERR(LOG_WRITE_FATAL_RECORD,stat); - 1: 257: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_EXECUTION_ERROR); - 1: 258: file.close(); - 1: 259: return; - -: 260: } - 18: 261: numRecords++; - -: 262: } else { - -: 263: // if the entry is empty, that means it is only a partially filled list, so quit writing - 13: 264: break; - -: 265: } - -: 266: } - -: 267: - -: 268: // write WARNING HI - 35: 269: for (NATIVE_UINT_TYPE entry = 0; entry < FW_NUM_ARRAY_ELEMENTS(this->m_warningHiCb); entry++) { - -: 270: // if there is data, write it - 34: 271: if (this->m_warningHiCb[entry].getBuffLength() != 0) { - -: 272: // write delimiter - 23: 273: fileWriteSize = sizeof(delimiter); - 23: 274: stat = file.write(&delimiter,fileWriteSize); - 23: 275: if (stat != Os::File::OP_OK) { - 1: 276: this->log_WARNING_HI_ALOG_FILE_WRITE_ERR(LOG_WRITE_WARNING_HI_DELIMITER,stat); - 1: 277: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_EXECUTION_ERROR); - 1: 278: file.close(); - 1: 279: return; - -: 280: } - -: 281: - -: 282: // write event record - 22: 283: fileWriteSize = this->m_warningHiCb[entry].getBuffLength(); - 22: 284: stat = file.write(this->m_warningHiCb[entry].getBuffAddr(),fileWriteSize); - 22: 285: if (stat != Os::File::OP_OK) { - 1: 286: this->log_WARNING_HI_ALOG_FILE_WRITE_ERR(LOG_WRITE_WARNING_HI_RECORD,stat); - 1: 287: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_EXECUTION_ERROR); - 1: 288: file.close(); - 1: 289: return; - -: 290: } - 21: 291: numRecords++; - -: 292: } else { - -: 293: // if the entry is empty, that means it is only a partially filled list, so quit writing - 11: 294: break; - -: 295: } - -: 296: } - -: 297: - -: 298: // write WARNING LO - 41: 299: for (NATIVE_UINT_TYPE entry = 0; entry < FW_NUM_ARRAY_ELEMENTS(this->m_warningLoCb); entry++) { - -: 300: // if there is data, write it - 40: 301: if (this->m_warningLoCb[entry].getBuffLength() != 0) { - -: 302: // write delimiter - 31: 303: fileWriteSize = sizeof(delimiter); - 31: 304: stat = file.write(&delimiter,fileWriteSize); - 31: 305: if (stat != Os::File::OP_OK) { - 1: 306: this->log_WARNING_HI_ALOG_FILE_WRITE_ERR(LOG_WRITE_WARNING_LO_DELIMITER,stat); - 1: 307: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_EXECUTION_ERROR); - 1: 308: file.close(); - 1: 309: return; - -: 310: } - -: 311: - -: 312: // write event record - 30: 313: fileWriteSize = this->m_warningLoCb[entry].getBuffLength(); - 30: 314: stat = file.write(this->m_warningLoCb[entry].getBuffAddr(),fileWriteSize); - 30: 315: if (stat != Os::File::OP_OK) { - 1: 316: this->log_WARNING_HI_ALOG_FILE_WRITE_ERR(LOG_WRITE_WARNING_LO_RECORD,stat); - 1: 317: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_EXECUTION_ERROR); - 1: 318: file.close(); - 1: 319: return; - -: 320: } - 29: 321: numRecords++; - -: 322: } else { - -: 323: // if the entry is empty, that means it is only a partially filled list, so quit writing - 9: 324: break; - -: 325: } - -: 326: } - -: 327: - -: 328: // write COMMAND - 37: 329: for (NATIVE_UINT_TYPE entry = 0; entry < FW_NUM_ARRAY_ELEMENTS(this->m_commandCb); entry++) { - -: 330: // if there is data, write it - 36: 331: if (this->m_commandCb[entry].getBuffLength() != 0) { - -: 332: // write delimiter - 29: 333: fileWriteSize = sizeof(delimiter); - 29: 334: stat = file.write(&delimiter,fileWriteSize); - 29: 335: if (stat != Os::File::OP_OK) { - 1: 336: this->log_WARNING_HI_ALOG_FILE_WRITE_ERR(LOG_WRITE_COMMAND_DELIMITER,stat); - 1: 337: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_EXECUTION_ERROR); - 1: 338: file.close(); - 1: 339: return; - -: 340: } - -: 341: - -: 342: // write event record - 28: 343: fileWriteSize = this->m_commandCb[entry].getBuffLength(); - 28: 344: stat = file.write(this->m_commandCb[entry].getBuffAddr(),fileWriteSize); - 28: 345: if (stat != Os::File::OP_OK) { - 1: 346: this->log_WARNING_HI_ALOG_FILE_WRITE_ERR(LOG_WRITE_COMMAND_RECORD,stat); - 1: 347: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_EXECUTION_ERROR); - 1: 348: file.close(); - 1: 349: return; - -: 350: } - 27: 351: numRecords++; - -: 352: } else { - -: 353: // if the entry is empty, that means it is only a partially filled list, so quit writing - 7: 354: break; - -: 355: } - -: 356: } - -: 357: - -: 358: // write ACTIVITY HI - 33: 359: for (NATIVE_UINT_TYPE entry = 0; entry < FW_NUM_ARRAY_ELEMENTS(this->m_activityHiCb); entry++) { - -: 360: // if there is data, write it - 32: 361: if (this->m_activityHiCb[entry].getBuffLength() != 0) { - -: 362: // write delimiter - 27: 363: fileWriteSize = sizeof(delimiter); - 27: 364: stat = file.write(&delimiter,fileWriteSize); - 27: 365: if (stat != Os::File::OP_OK) { - 1: 366: this->log_WARNING_HI_ALOG_FILE_WRITE_ERR(LOG_WRITE_ACTIVITY_HI_DELIMITER,stat); - 1: 367: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_EXECUTION_ERROR); - 1: 368: file.close(); - 1: 369: return; - -: 370: } - -: 371: - -: 372: // write event record - 26: 373: fileWriteSize = this->m_activityHiCb[entry].getBuffLength(); - 26: 374: stat = file.write(this->m_activityHiCb[entry].getBuffAddr(),fileWriteSize); - 26: 375: if (stat != Os::File::OP_OK) { - 1: 376: this->log_WARNING_HI_ALOG_FILE_WRITE_ERR(LOG_WRITE_ACTIVITY_HI_RECORD,stat); - 1: 377: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_EXECUTION_ERROR); - 1: 378: file.close(); - 1: 379: return; - -: 380: } - 25: 381: numRecords++; - -: 382: } else { - -: 383: // if the entry is empty, that means it is only a partially filled list, so quit writing - 5: 384: break; - -: 385: } - -: 386: } - -: 387: - -: 388: // write ACTIVITY LO - 29: 389: for (NATIVE_UINT_TYPE entry = 0; entry < FW_NUM_ARRAY_ELEMENTS(this->m_activityLoCb); entry++) { - -: 390: // if there is data, write it - 28: 391: if (this->m_activityLoCb[entry].getBuffLength() != 0) { - -: 392: // write delimiter - 25: 393: fileWriteSize = sizeof(delimiter); - 25: 394: stat = file.write(&delimiter,fileWriteSize); - 25: 395: if (stat != Os::File::OP_OK) { - 1: 396: this->log_WARNING_HI_ALOG_FILE_WRITE_ERR(LOG_WRITE_ACTIVITY_LO_DELIMITER,stat); - 1: 397: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_EXECUTION_ERROR); - 1: 398: file.close(); - 1: 399: return; - -: 400: } - -: 401: - -: 402: // write event record - 24: 403: fileWriteSize = this->m_activityLoCb[entry].getBuffLength(); - 24: 404: stat = file.write(this->m_activityLoCb[entry].getBuffAddr(),fileWriteSize); - 24: 405: if (stat != Os::File::OP_OK) { - 1: 406: this->log_WARNING_HI_ALOG_FILE_WRITE_ERR(LOG_WRITE_ACTIVITY_LO_RECORD,stat); - 1: 407: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_EXECUTION_ERROR); - 1: 408: file.close(); - 1: 409: return; - -: 410: } - 23: 411: numRecords++; - -: 412: } else { - -: 413: // if the entry is empty, that means it is only a partially filled list, so quit writing - 3: 414: break; - -: 415: } - -: 416: } - -: 417: - -: 418: // write DIAGNOSTIC - 55: 419: for (NATIVE_UINT_TYPE entry = 0; entry < FW_NUM_ARRAY_ELEMENTS(this->m_diagnosticCb); entry++) { - -: 420: // if there is data, write it - 54: 421: if (this->m_diagnosticCb[entry].getBuffLength() != 0) { - -: 422: // write delimiter - 53: 423: fileWriteSize = sizeof(delimiter); - 53: 424: stat = file.write(&delimiter,fileWriteSize); - 53: 425: if (stat != Os::File::OP_OK) { - 1: 426: this->log_WARNING_HI_ALOG_FILE_WRITE_ERR(LOG_WRITE_DIAGNOSTIC_DELIMITER,stat); - 1: 427: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_EXECUTION_ERROR); - 1: 428: file.close(); - 1: 429: return; - -: 430: } - -: 431: - -: 432: // write event record - 52: 433: fileWriteSize = this->m_diagnosticCb[entry].getBuffLength(); - 52: 434: stat = file.write(this->m_diagnosticCb[entry].getBuffAddr(),fileWriteSize); - 52: 435: if (stat != Os::File::OP_OK) { - 1: 436: this->log_WARNING_HI_ALOG_FILE_WRITE_ERR(LOG_WRITE_DIAGNOSTIC_RECORD,stat); - 1: 437: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_EXECUTION_ERROR); - 1: 438: file.close(); - 1: 439: return; - -: 440: } - 51: 441: numRecords++; - -: 442: } else { - -: 443: // if the entry is empty, that means it is only a partially filled list, so quit writing - 1: 444: break; - -: 445: } - -: 446: } - -: 447: - 2: 448: file.close(); - -: 449: - 2: 450: this->log_ACTIVITY_HI_ALOG_FILE_WRITE_COMPLETE(numRecords); - -: 451: - 2: 452: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_OK); - -: 453: } - -: 454: - 81: 455: void ActiveLoggerImpl::ALOG_SET_ID_FILTER_cmdHandler( - -: 456: FwOpcodeType opCode, //!< The opcode - -: 457: U32 cmdSeq, //!< The command sequence number - -: 458: U32 ID, - -: 459: IdFilterEnabled IdFilterEnable //!< ID filter state - -: 460: ) { - -: 461: - -: 462: // check parameter - 81: 463: switch (IdFilterEnable) { - -: 464: case ID_ENABLED: - -: 465: case ID_DISABLED: - 80: 466: break; - -: 467: default: - 1: 468: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_VALIDATION_ERROR); - 1: 469: return; - -: 470: } - -: 471: - 80: 472: if (ID_ENABLED == IdFilterEnable) { // add ID - -: 473: // search list for existing entry - 1079: 474: for (NATIVE_INT_TYPE entry = 0; entry < TELEM_ID_FILTER_SIZE; entry++) { - 1050: 475: if (this->m_filteredIDs[entry] == ID) { - 25: 476: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_OK); - 25: 477: this->log_ACTIVITY_HI_ALOG_ID_FILTER_ENABLED(ID); - 25: 478: return; - -: 479: } - -: 480: } - -: 481: // if not already a match, search for an open slot - 357: 482: for (NATIVE_INT_TYPE entry = 0; entry < TELEM_ID_FILTER_SIZE; entry++) { - 356: 483: if (this->m_filteredIDs[entry] == 0) { - 28: 484: this->m_filteredIDs[entry] = ID; - 28: 485: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_OK); - 28: 486: this->log_ACTIVITY_HI_ALOG_ID_FILTER_ENABLED(ID); - 28: 487: return; - -: 488: } - -: 489: } - -: 490: // if an empty slot was not found, send an error event - 1: 491: this->log_WARNING_LO_ALOG_ID_FILTER_LIST_FULL(ID); - 1: 492: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_EXECUTION_ERROR); - -: 493: } else { // remove ID - -: 494: // search list for existing entry - 351: 495: for (NATIVE_INT_TYPE entry = 0; entry < TELEM_ID_FILTER_SIZE; entry++) { - 350: 496: if (this->m_filteredIDs[entry] == ID) { - 25: 497: this->m_filteredIDs[entry] = 0; // zero entry - 25: 498: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_OK); - 25: 499: this->log_ACTIVITY_HI_ALOG_ID_FILTER_REMOVED(ID); - 25: 500: return; - -: 501: } - -: 502: } - -: 503: // if it gets here, wasn't found - 1: 504: this->log_WARNING_LO_ALOG_ID_FILTER_NOT_FOUND(ID); - 1: 505: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_EXECUTION_ERROR); - -: 506: } - -: 507: - -: 508: } - -: 509: - 1: 510: void ActiveLoggerImpl::ALOG_DUMP_FILTER_STATE_cmdHandler( - -: 511: FwOpcodeType opCode, //!< The opcode - -: 512: U32 cmdSeq //!< The command sequence number - -: 513: ) { - -: 514: - -: 515: // first, iterate through severity filters - 7: 516: for (NATIVE_INT_TYPE filter = 0; filter < InputFilterLevel_MAX; filter++) { - -: 517: this->log_ACTIVITY_LO_ALOG_SEVERITY_FILTER_STATE( - -: 518: static_cast(filter), - -: 519: INPUT_ENABLED == this->m_inFilterState[filter].enabled, - -: 520: SEND_ENABLED == this->m_sendFilterState[filter].enabled - 6: 521: ); - -: 522: } - -: 523: - -: 524: // iterate through ID filter - 26: 525: for (NATIVE_INT_TYPE entry = 0; entry < TELEM_ID_FILTER_SIZE; entry++) { - 25: 526: if (this->m_filteredIDs[entry] != 0) { - 3: 527: this->log_ACTIVITY_HI_ALOG_ID_FILTER_ENABLED(this->m_filteredIDs[entry]); - -: 528: } - -: 529: } - -: 530: - 1: 531: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_OK); - 1: 532: } - -: 533: - -: 534:} // namespace Svc diff --git a/Svc/ActiveLogger/test/ut/output/SvcActiveLogger_gcov.txt b/Svc/ActiveLogger/test/ut/output/SvcActiveLogger_gcov.txt deleted file mode 100644 index b4a374057b..0000000000 --- a/Svc/ActiveLogger/test/ut/output/SvcActiveLogger_gcov.txt +++ /dev/null @@ -1,9 +0,0 @@ -File '/home/tim/source/isf/Svc/ActiveLogger/ActiveLoggerImpl.cpp' -Lines executed:98.61% of 288 -Creating 'ActiveLoggerImpl.cpp.gcov' - -File '/home/tim/source/isf/Svc/ActiveLogger/ActiveLoggerComponentAc.cpp' -Lines executed:80.95% of 567 -Creating 'ActiveLoggerComponentAc.cpp.gcov' - -Lines executed:86.90% of 855 diff --git a/Svc/ActiveLogger/test/ut/output/test.txt b/Svc/ActiveLogger/test/ut/output/test.txt deleted file mode 100644 index e5ab507cb6..0000000000 --- a/Svc/ActiveLogger/test/ut/output/test.txt +++ /dev/null @@ -1,165 +0,0 @@ -Running /home/tcanham/source/isf/Svc/ActiveLogger/test/ut/linux-cygwin-x86-ut-gnu-bin/test_ut -[==========] Running 8 tests from 1 test case. -[----------] Global test environment set-up. -[----------] 8 tests from ActiveLoggerTest -[ RUN ] ActiveLoggerTest.NominalEventSend - -*************************************** -TESTCASE 100.1.1: Nominal Event Logging -*************************************** - -*************************************** -(RQ) ISF-AL-001 -*************************************** -[ OK ] ActiveLoggerTest.NominalEventSend (3 ms) -[ RUN ] ActiveLoggerTest.FilteredEventSend - -*************************************** -TESTCASE 100.1.2: Nominal Event Filtering -*************************************** - -*************************************** -(RQ) ISF-AL-004 -*************************************** - -*************************************** -(RQ) ISF-AL-005 -*************************************** - -*************************************** -(RQ) ISF-AL-006 -*************************************** - -*************************************** -(RQ) ISF-AL-004 -*************************************** - -*************************************** -(RQ) ISF-AL-005 -*************************************** - -*************************************** -(RQ) ISF-AL-006 -*************************************** - -*************************************** -(RQ) ISF-AL-004 -*************************************** - -*************************************** -(RQ) ISF-AL-005 -*************************************** - -*************************************** -(RQ) ISF-AL-006 -*************************************** - -*************************************** -(RQ) ISF-AL-004 -*************************************** - -*************************************** -(RQ) ISF-AL-005 -*************************************** - -*************************************** -(RQ) ISF-AL-006 -*************************************** - -*************************************** -(RQ) ISF-AL-004 -*************************************** - -*************************************** -(RQ) ISF-AL-005 -*************************************** - -*************************************** -(RQ) ISF-AL-006 -*************************************** - -*************************************** -(RQ) ISF-AL-004 -*************************************** - -*************************************** -(RQ) ISF-AL-005 -*************************************** - -*************************************** -(RQ) ISF-AL-006 -*************************************** -[ OK ] ActiveLoggerTest.FilteredEventSend (2 ms) -[ RUN ] ActiveLoggerTest.FilterIdTest - -*************************************** -TESTCASE 100.1.3: Filter events by ID -*************************************** - -*************************************** -(RQ) ISF-AL-007 -*************************************** -[ OK ] ActiveLoggerTest.FilterIdTest (4 ms) -[ RUN ] ActiveLoggerTest.FilterDumpTest - -*************************************** -TESTCASE 100.1.3: Dump filter values -*************************************** -[ OK ] ActiveLoggerTest.FilterDumpTest (2 ms) -[ RUN ] ActiveLoggerTest.InvalidCommands - -*************************************** -TESTCASE 100.2.1: Off-Nominal Invalid Commands -*************************************** -[ OK ] ActiveLoggerTest.InvalidCommands (3 ms) -[ RUN ] ActiveLoggerTest.FatalTesting - -*************************************** -TESTCASE 100.2.2: Off-Nominal FATAL processing -*************************************** -[ OK ] ActiveLoggerTest.FatalTesting (3 ms) -[ RUN ] ActiveLoggerTest.CircularBufferDump - -*************************************** -TESTCASE 100.1.3: File dump of event circular buffers -*************************************** - -*************************************** -(RQ) ISF-AL-002 -*************************************** - -*************************************** -(RQ) ISF-AL-003 -*************************************** -[ OK ] ActiveLoggerTest.CircularBufferDump (6 ms) -[ RUN ] ActiveLoggerTest.CircularBufferDumpWithErrors - -*************************************** -TESTCASE 100.2.3: File dump of event circular buffers with errors -*************************************** -EVENT: (512) (0:0,0) WARNING_HI: (ActiveLoggerImpl) ALOG_FILE_WRITE_ERR : Event buffer write failed in stage 0 with error 1 -EVENT: (512) (0:0,0) WARNING_HI: (ActiveLoggerImpl) ALOG_FILE_WRITE_ERR : Event buffer write failed in stage 1 with error 5 -EVENT: (512) (0:0,0) WARNING_HI: (ActiveLoggerImpl) ALOG_FILE_WRITE_ERR : Event buffer write failed in stage 2 with error 5 -EVENT: (512) (0:0,0) WARNING_HI: (ActiveLoggerImpl) ALOG_FILE_WRITE_ERR : Event buffer write failed in stage 3 with error 5 -EVENT: (512) (0:0,0) WARNING_HI: (ActiveLoggerImpl) ALOG_FILE_WRITE_ERR : Event buffer write failed in stage 4 with error 5 -EVENT: (512) (0:0,0) WARNING_HI: (ActiveLoggerImpl) ALOG_FILE_WRITE_ERR : Event buffer write failed in stage 5 with error 5 -EVENT: (512) (0:0,0) WARNING_HI: (ActiveLoggerImpl) ALOG_FILE_WRITE_ERR : Event buffer write failed in stage 6 with error 5 -EVENT: (512) (0:0,0) WARNING_HI: (ActiveLoggerImpl) ALOG_FILE_WRITE_ERR : Event buffer write failed in stage 7 with error 5 -EVENT: (512) (0:0,0) WARNING_HI: (ActiveLoggerImpl) ALOG_FILE_WRITE_ERR : Event buffer write failed in stage 8 with error 5 -EVENT: (512) (0:0,0) WARNING_HI: (ActiveLoggerImpl) ALOG_FILE_WRITE_ERR : Event buffer write failed in stage 9 with error 5 -EVENT: (512) (0:0,0) WARNING_HI: (ActiveLoggerImpl) ALOG_FILE_WRITE_ERR : Event buffer write failed in stage 10 with error 5 -EVENT: (512) (0:0,0) WARNING_HI: (ActiveLoggerImpl) ALOG_FILE_WRITE_ERR : Event buffer write failed in stage 11 with error 5 -EVENT: (512) (0:0,0) WARNING_HI: (ActiveLoggerImpl) ALOG_FILE_WRITE_ERR : Event buffer write failed in stage 12 with error 5 -EVENT: (512) (0:0,0) WARNING_HI: (ActiveLoggerImpl) ALOG_FILE_WRITE_ERR : Event buffer write failed in stage 13 with error 5 -EVENT: (512) (0:0,0) WARNING_HI: (ActiveLoggerImpl) ALOG_FILE_WRITE_ERR : Event buffer write failed in stage 14 with error 5 -EVENT: (513) (0:0,0) ACTIVITY_HI: (ActiveLoggerImpl) ALOG_FILE_WRITE_COMPLETE : Event buffer write complete. Wrote 7 records. -[ OK ] ActiveLoggerTest.CircularBufferDumpWithErrors (10 ms) -[----------] 8 tests from ActiveLoggerTest (33 ms total) - -[----------] Global test environment tear-down -[==========] 8 tests from 1 test case ran. (34 ms total) -[ PASSED ] 8 tests. -make[1]: Leaving directory '/home/tcanham/source/isf/Svc/ActiveLogger' - -08:04:52 Build Finished (took 2s.934ms) - diff --git a/Svc/ActiveRateGroup/docs/sdd.md b/Svc/ActiveRateGroup/docs/sdd.md index f25da501ae..4074ff606c 100644 --- a/Svc/ActiveRateGroup/docs/sdd.md +++ b/Svc/ActiveRateGroup/docs/sdd.md @@ -78,12 +78,7 @@ Unit Test Checklist | [Link](Checklist_Unit_Test.xlsx) ## 6. Unit Testing -The unit test results are as follows: - -Log|Link ----|---- -Test Output|[Link](../test/ut/output/test.txt) -Coverage Output|[Link](../test/ut/output/ActiveRateGroupImpl.cpp.gcov) +To see unit test coverage run fprime-util check --coverage ## 7. Change Log diff --git a/Svc/ActiveRateGroup/test/ut/output/ActiveRateGroupComponentAc.cpp.gcov b/Svc/ActiveRateGroup/test/ut/output/ActiveRateGroupComponentAc.cpp.gcov deleted file mode 100644 index 2cdce4da5d..0000000000 --- a/Svc/ActiveRateGroup/test/ut/output/ActiveRateGroupComponentAc.cpp.gcov +++ /dev/null @@ -1,996 +0,0 @@ - -: 0:Source:/home/tcanham/source/isf/Svc/ActiveRateGroup/ActiveRateGroupComponentAc.cpp - -: 0:Programs:10 - -: 1:// ====================================================================== - -: 2:// \title ActiveRateGroupComponentAc.hpp - -: 3:// \author Auto-generated - -: 4:// \brief cpp file for ActiveRateGroup component base class - -: 5:// - -: 6:// \copyright - -: 7:// Copyright 2009-2015, by the California Institute of Technology. - -: 8:// ALL RIGHTS RESERVED. United States Government Sponsorship - -: 9:// acknowledged. - -: 11:// - -: 18:// ====================================================================== - -: 19: - -: 20:#include - -: 21:#include - -: 22:#include - -: 23:#include - -: 24:#if FW_ENABLE_TEXT_LOGGING - -: 25:#include - -: 26:#endif - -: 27: - -: 28: - -: 29:namespace Svc { - -: 30: - -: 31: // ---------------------------------------------------------------------- - -: 32: // Anonymous namespace to prevent name collisions - -: 33: // ---------------------------------------------------------------------- - -: 34: - -: 35: namespace { - -: 36: - -: 37: typedef enum { - -: 38: ACTIVERATEGROUP_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT, - -: 39: CYCLEIN_CYCLE - -: 40: } MsgTypeEnum; - -: 41: - -: 42: // Get the max size by doing a union of the input port serialization sizes. - -: 43: - -: 44: typedef union { - -: 45: BYTE port1[Svc::InputCyclePort::SERIALIZED_SIZE]; - -: 46: } BuffUnion; - -: 47: - -: 48: // Define a message buffer class large enough to handle all the - -: 49: // asynchronous inputs to the component - -: 50: - 750: 51: class ComponentIpcSerializableBuffer : - -: 52: public Fw::SerializeBufferBase - -: 53: { - -: 54: - -: 55: public: - -: 56: - -: 57: enum { - -: 58: // Max. message size = size of data + message id + port - -: 59: SERIALIZATION_SIZE = - -: 60: sizeof(BuffUnion) + - -: 61: sizeof(NATIVE_INT_TYPE) + - -: 62: sizeof(NATIVE_INT_TYPE) - -: 63: }; - -: 64: - 1230: 65: NATIVE_UINT_TYPE getBuffCapacity(void) const { - 1230: 66: return sizeof(m_buff); - -: 67: } - -: 68: - 7635: 69: U8* getBuffAddr(void) { - 7635: 70: return m_buff; - -: 71: } - -: 72: - 240: 73: const U8* getBuffAddr(void) const { - 240: 74: return m_buff; - -: 75: } - -: 76: - -: 77: private: - -: 78: // Should be the max of all the input ports serialized sizes... - -: 79: U8 m_buff[SERIALIZATION_SIZE]; - -: 80: - -: 81: }; - -: 82: - -: 83: } - -: 84: - -: 85: // ---------------------------------------------------------------------- - -: 86: // Getters for numbers of input ports - -: 87: // ---------------------------------------------------------------------- - -: 88: - 30: 89: Svc::InputCyclePort *ActiveRateGroupComponentBase :: - -: 90: get_CycleIn_InputPort(NATIVE_INT_TYPE portNum) - -: 91: { - 30: 92: FW_ASSERT(portNum < this->getNum_CycleIn_InputPorts()); - 30: 93: return &this->m_CycleIn_InputPort[portNum]; - -: 94: } - -: 95: - -: 96: // ---------------------------------------------------------------------- - -: 97: // Typed connectors for output ports - -: 98: // ---------------------------------------------------------------------- - -: 99: - 150: 100: void ActiveRateGroupComponentBase :: - -: 101: set_RateGroupMemberOut_OutputPort( - -: 102: NATIVE_INT_TYPE portNum, - -: 103: Svc::InputSchedPort* port - -: 104: ) - -: 105: { - 150: 106: FW_ASSERT(portNum < this->getNum_RateGroupMemberOut_OutputPorts()); - 150: 107: this->m_RateGroupMemberOut_OutputPort[portNum].addCallPort(port); - 150: 108: } - -: 109: - 30: 110: void ActiveRateGroupComponentBase :: - -: 111: set_Tlm_OutputPort( - -: 112: NATIVE_INT_TYPE portNum, - -: 113: Fw::InputTlmPort* port - -: 114: ) - -: 115: { - 30: 116: FW_ASSERT(portNum < this->getNum_Tlm_OutputPorts()); - 30: 117: this->m_Tlm_OutputPort[portNum].addCallPort(port); - 30: 118: } - -: 119: - 30: 120: void ActiveRateGroupComponentBase :: - -: 121: set_Time_OutputPort( - -: 122: NATIVE_INT_TYPE portNum, - -: 123: Fw::InputTimePort* port - -: 124: ) - -: 125: { - 30: 126: FW_ASSERT(portNum < this->getNum_Time_OutputPorts()); - 30: 127: this->m_Time_OutputPort[portNum].addCallPort(port); - 30: 128: } - -: 129: - 30: 130: void ActiveRateGroupComponentBase :: - -: 131: set_Log_OutputPort( - -: 132: NATIVE_INT_TYPE portNum, - -: 133: Fw::InputLogPort* port - -: 134: ) - -: 135: { - 30: 136: FW_ASSERT(portNum < this->getNum_Log_OutputPorts()); - 30: 137: this->m_Log_OutputPort[portNum].addCallPort(port); - 30: 138: } - -: 139: - -: 140:#if FW_ENABLE_TEXT_LOGGING == 1 - 30: 141: void ActiveRateGroupComponentBase :: - -: 142: set_LogText_OutputPort( - -: 143: NATIVE_INT_TYPE portNum, - -: 144: Fw::InputLogTextPort* port - -: 145: ) - -: 146: { - 30: 147: FW_ASSERT(portNum < this->getNum_LogText_OutputPorts()); - 30: 148: this->m_LogText_OutputPort[portNum].addCallPort(port); - 30: 149: } - -: 150:#endif - -: 151: - -: 152: // ---------------------------------------------------------------------- - -: 153: // Serialization connectors for output ports - -: 154: // ---------------------------------------------------------------------- - -: 155: - -: 156:#if FW_PORT_SERIALIZATION - -: 157: - #####: 158: void ActiveRateGroupComponentBase :: - -: 159: set_RateGroupMemberOut_OutputPort( - -: 160: NATIVE_INT_TYPE portNum, - -: 161: Fw::InputSerializePort *port - -: 162: ) - -: 163: { - #####: 164: FW_ASSERT(portNum < this->getNum_RateGroupMemberOut_OutputPorts()); - #####: 165: return this->m_RateGroupMemberOut_OutputPort[portNum].registerSerialPort(port); - -: 166: } - -: 167: - #####: 168: void ActiveRateGroupComponentBase :: - -: 169: set_Tlm_OutputPort( - -: 170: NATIVE_INT_TYPE portNum, - -: 171: Fw::InputSerializePort *port - -: 172: ) - -: 173: { - #####: 174: FW_ASSERT(portNum < this->getNum_Tlm_OutputPorts()); - #####: 175: return this->m_Tlm_OutputPort[portNum].registerSerialPort(port); - -: 176: } - -: 177: - #####: 178: void ActiveRateGroupComponentBase :: - -: 179: set_Time_OutputPort( - -: 180: NATIVE_INT_TYPE portNum, - -: 181: Fw::InputSerializePort *port - -: 182: ) - -: 183: { - #####: 184: FW_ASSERT(portNum < this->getNum_Time_OutputPorts()); - #####: 185: return this->m_Time_OutputPort[portNum].registerSerialPort(port); - -: 186: } - -: 187: - #####: 188: void ActiveRateGroupComponentBase :: - -: 189: set_Log_OutputPort( - -: 190: NATIVE_INT_TYPE portNum, - -: 191: Fw::InputSerializePort *port - -: 192: ) - -: 193: { - #####: 194: FW_ASSERT(portNum < this->getNum_Log_OutputPorts()); - #####: 195: return this->m_Log_OutputPort[portNum].registerSerialPort(port); - -: 196: } - -: 197: - -: 198:#if FW_ENABLE_TEXT_LOGGING == 1 - #####: 199: void ActiveRateGroupComponentBase :: - -: 200: set_LogText_OutputPort( - -: 201: NATIVE_INT_TYPE portNum, - -: 202: Fw::InputSerializePort *port - -: 203: ) - -: 204: { - #####: 205: FW_ASSERT(portNum < this->getNum_LogText_OutputPorts()); - #####: 206: return this->m_LogText_OutputPort[portNum].registerSerialPort(port); - -: 207: } - -: 208:#endif - -: 209: - -: 210:#endif - -: 211: - -: 212: // ---------------------------------------------------------------------- - -: 213: // Component construction, initialization, and destruction - -: 214: // ---------------------------------------------------------------------- - -: 215: - 30: 216: ActiveRateGroupComponentBase :: - -: 217:#if FW_OBJECT_NAMES == 1 - -: 218: ActiveRateGroupComponentBase(const char* compName) : - 30: 219: Fw::ActiveComponentBase(compName) - -: 220:#else - -: 221: ActiveRateGroupComponentBase() : - -: 222: Fw::ActiveComponentBase() - -: 223:#endif - -: 224: { - -: 225: - -: 226: // Initialize telemetry channel RgMaxTime - 30: 227: this->m_first_update_RgMaxTime = true; - 30: 228: this->m_last_RgMaxTime = 0; - -: 229: - -: 230: // Initialize telemetry channel RgCycleSlips - 30: 231: this->m_first_update_RgCycleSlips = true; - 30: 232: this->m_last_RgCycleSlips = 0; - -: 233: - 30: 234: } - -: 235: - 30: 236: void ActiveRateGroupComponentBase :: - -: 237: init( - -: 238: NATIVE_INT_TYPE queueDepth, - -: 239: NATIVE_INT_TYPE instance - -: 240: ) - -: 241: { - -: 242: - -: 243: // Initialize base class - 30: 244: Fw::ActiveComponentBase::init(instance); - -: 245: - -: 246: // Connect input port CycleIn - 120: 247: for ( - 30: 248: NATIVE_INT_TYPE port = 0; - 60: 249: port < this->getNum_CycleIn_InputPorts(); - -: 250: port++ - -: 251: ) { - -: 252: - 30: 253: this->m_CycleIn_InputPort[port].init(); - -: 254: this->m_CycleIn_InputPort[port].addCallComp( - -: 255: this, - -: 256: m_p_CycleIn_in - 30: 257: ); - 30: 258: this->m_CycleIn_InputPort[port].setPortNum(port); - -: 259: - -: 260:#if FW_OBJECT_NAMES == 1 - -: 261: char portName[80]; - -: 262: (void) snprintf( - -: 263: portName, - -: 264: sizeof(portName), - -: 265: "%s_CycleIn_InputPort[%d]", - -: 266: this->m_objName, - -: 267: port - 30: 268: ); - 30: 269: this->m_CycleIn_InputPort[port].setObjName(portName); - -: 270:#endif - -: 271: - -: 272: } - -: 273: - -: 274: // Initialize output port RateGroupMemberOut - 360: 275: for ( - 30: 276: NATIVE_INT_TYPE port = 0; - 180: 277: port < this->getNum_RateGroupMemberOut_OutputPorts(); - -: 278: port++ - -: 279: ) { - 150: 280: this->m_RateGroupMemberOut_OutputPort[port].init(); - -: 281: - -: 282:#if FW_OBJECT_NAMES == 1 - -: 283: char portName[80]; - -: 284: (void) snprintf( - -: 285: portName, - -: 286: sizeof(portName), - -: 287: "%s_RateGroupMemberOut_OutputPort[%d]", - -: 288: this->m_objName, - -: 289: port - 150: 290: ); - 150: 291: this->m_RateGroupMemberOut_OutputPort[port].setObjName(portName); - -: 292:#endif - -: 293: - -: 294: } - -: 295: - -: 296: // Initialize output port Tlm - 120: 297: for ( - 30: 298: NATIVE_INT_TYPE port = 0; - 60: 299: port < this->getNum_Tlm_OutputPorts(); - -: 300: port++ - -: 301: ) { - 30: 302: this->m_Tlm_OutputPort[port].init(); - -: 303: - -: 304:#if FW_OBJECT_NAMES == 1 - -: 305: char portName[80]; - -: 306: (void) snprintf( - -: 307: portName, - -: 308: sizeof(portName), - -: 309: "%s_Tlm_OutputPort[%d]", - -: 310: this->m_objName, - -: 311: port - 30: 312: ); - 30: 313: this->m_Tlm_OutputPort[port].setObjName(portName); - -: 314:#endif - -: 315: - -: 316: } - -: 317: - -: 318: // Initialize output port Time - 120: 319: for ( - 30: 320: NATIVE_INT_TYPE port = 0; - 60: 321: port < this->getNum_Time_OutputPorts(); - -: 322: port++ - -: 323: ) { - 30: 324: this->m_Time_OutputPort[port].init(); - -: 325: - -: 326:#if FW_OBJECT_NAMES == 1 - -: 327: char portName[80]; - -: 328: (void) snprintf( - -: 329: portName, - -: 330: sizeof(portName), - -: 331: "%s_Time_OutputPort[%d]", - -: 332: this->m_objName, - -: 333: port - 30: 334: ); - 30: 335: this->m_Time_OutputPort[port].setObjName(portName); - -: 336:#endif - -: 337: - -: 338: } - -: 339: - -: 340: // Initialize output port Log - 120: 341: for ( - 30: 342: NATIVE_INT_TYPE port = 0; - 60: 343: port < this->getNum_Log_OutputPorts(); - -: 344: port++ - -: 345: ) { - 30: 346: this->m_Log_OutputPort[port].init(); - -: 347: - -: 348:#if FW_OBJECT_NAMES == 1 - -: 349: char portName[80]; - -: 350: (void) snprintf( - -: 351: portName, - -: 352: sizeof(portName), - -: 353: "%s_Log_OutputPort[%d]", - -: 354: this->m_objName, - -: 355: port - 30: 356: ); - 30: 357: this->m_Log_OutputPort[port].setObjName(portName); - -: 358:#endif - -: 359: - -: 360: } - -: 361: - -: 362: // Initialize output port LogText - -: 363:#if FW_ENABLE_TEXT_LOGGING == 1 - 120: 364: for ( - 30: 365: NATIVE_INT_TYPE port = 0; - 60: 366: port < this->getNum_LogText_OutputPorts(); - -: 367: port++ - -: 368: ) { - 30: 369: this->m_LogText_OutputPort[port].init(); - -: 370: - -: 371:#if FW_OBJECT_NAMES == 1 - -: 372: char portName[80]; - -: 373: (void) snprintf( - -: 374: portName, - -: 375: sizeof(portName), - -: 376: "%s_LogText_OutputPort[%d]", - -: 377: this->m_objName, - -: 378: port - 30: 379: ); - 30: 380: this->m_LogText_OutputPort[port].setObjName(portName); - -: 381:#endif - -: 382: - -: 383: } - -: 384:#endif - -: 385: - -: 386: Os::Queue::QueueStatus qStat = - -: 387: this->createQueue( - -: 388: queueDepth, - -: 389: ComponentIpcSerializableBuffer::SERIALIZATION_SIZE - 30: 390: ); - 30: 391: FW_ASSERT( - -: 392: Os::Queue::QUEUE_OK == qStat, - -: 393: static_cast(qStat) - 60: 394: ); - -: 395: - 30: 396: } - -: 397: - 30: 398: ActiveRateGroupComponentBase:: - 30: 399: ~ActiveRateGroupComponentBase() { - -: 400: - 30: 401: } - -: 402: - -: 403: // ---------------------------------------------------------------------- - -: 404: // Invocation functions for output ports - -: 405: // ---------------------------------------------------------------------- - -: 406: - 675: 407: void ActiveRateGroupComponentBase :: - -: 408: RateGroupMemberOut_out( - -: 409: NATIVE_INT_TYPE portNum, - -: 410: NATIVE_UINT_TYPE context - -: 411: ) - -: 412: { - 675: 413: FW_ASSERT(portNum < this->getNum_RateGroupMemberOut_OutputPorts()); - 675: 414: m_RateGroupMemberOut_OutputPort[portNum].invoke(context); - 675: 415: } - -: 416: - -: 417: // ---------------------------------------------------------------------- - -: 418: // Getters for numbers of ports - -: 419: // ---------------------------------------------------------------------- - -: 420: - 330: 421: NATIVE_INT_TYPE ActiveRateGroupComponentBase :: - -: 422: getNum_CycleIn_InputPorts(void) - -: 423: { - 330: 424: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 425: this->m_CycleIn_InputPort - -: 426: ); - -: 427: } - -: 428: - 2730: 429: NATIVE_INT_TYPE ActiveRateGroupComponentBase :: - -: 430: getNum_RateGroupMemberOut_OutputPorts(void) - -: 431: { - 2730: 432: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 433: this->m_RateGroupMemberOut_OutputPort - -: 434: ); - -: 435: } - -: 436: - 90: 437: NATIVE_INT_TYPE ActiveRateGroupComponentBase :: - -: 438: getNum_Tlm_OutputPorts(void) - -: 439: { - 90: 440: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 441: this->m_Tlm_OutputPort - -: 442: ); - -: 443: } - -: 444: - 90: 445: NATIVE_INT_TYPE ActiveRateGroupComponentBase :: - -: 446: getNum_Time_OutputPorts(void) - -: 447: { - 90: 448: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 449: this->m_Time_OutputPort - -: 450: ); - -: 451: } - -: 452: - 90: 453: NATIVE_INT_TYPE ActiveRateGroupComponentBase :: - -: 454: getNum_Log_OutputPorts(void) - -: 455: { - 90: 456: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 457: this->m_Log_OutputPort - -: 458: ); - -: 459: } - -: 460: - -: 461:#if FW_ENABLE_TEXT_LOGGING == 1 - 90: 462: NATIVE_INT_TYPE ActiveRateGroupComponentBase :: - -: 463: getNum_LogText_OutputPorts(void) - -: 464: { - 90: 465: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 466: this->m_LogText_OutputPort - -: 467: ); - -: 468: } - -: 469:#endif - -: 470: - -: 471: // ---------------------------------------------------------------------- - -: 472: // Port connection status queries - -: 473: // ---------------------------------------------------------------------- - -: 474: - 675: 475: bool ActiveRateGroupComponentBase :: - -: 476: isConnected_RateGroupMemberOut_OutputPort(NATIVE_INT_TYPE portNum) - -: 477: { - 1350: 478: FW_ASSERT( - -: 479: portNum < this->getNum_RateGroupMemberOut_OutputPorts(), - -: 480: portNum - 1350: 481: ); - 675: 482: return this->m_RateGroupMemberOut_OutputPort[portNum].isConnected(); - -: 483: } - -: 484: - #####: 485: bool ActiveRateGroupComponentBase :: - -: 486: isConnected_Tlm_OutputPort(NATIVE_INT_TYPE portNum) - -: 487: { - #####: 488: FW_ASSERT( - -: 489: portNum < this->getNum_Tlm_OutputPorts(), - -: 490: portNum - #####: 491: ); - #####: 492: return this->m_Tlm_OutputPort[portNum].isConnected(); - -: 493: } - -: 494: - #####: 495: bool ActiveRateGroupComponentBase :: - -: 496: isConnected_Time_OutputPort(NATIVE_INT_TYPE portNum) - -: 497: { - #####: 498: FW_ASSERT( - -: 499: portNum < this->getNum_Time_OutputPorts(), - -: 500: portNum - #####: 501: ); - #####: 502: return this->m_Time_OutputPort[portNum].isConnected(); - -: 503: } - -: 504: - #####: 505: bool ActiveRateGroupComponentBase :: - -: 506: isConnected_Log_OutputPort(NATIVE_INT_TYPE portNum) - -: 507: { - #####: 508: FW_ASSERT( - -: 509: portNum < this->getNum_Log_OutputPorts(), - -: 510: portNum - #####: 511: ); - #####: 512: return this->m_Log_OutputPort[portNum].isConnected(); - -: 513: } - -: 514: - -: 515:#if FW_ENABLE_TEXT_LOGGING == 1 - #####: 516: bool ActiveRateGroupComponentBase :: - -: 517: isConnected_LogText_OutputPort(NATIVE_INT_TYPE portNum) - -: 518: { - #####: 519: FW_ASSERT( - -: 520: portNum < this->getNum_LogText_OutputPorts(), - -: 521: portNum - #####: 522: ); - #####: 523: return this->m_LogText_OutputPort[portNum].isConnected(); - -: 524: } - -: 525:#endif - -: 526: - -: 527: // ---------------------------------------------------------------------- - -: 528: // Telemetry write functions - -: 529: // ---------------------------------------------------------------------- - -: 530: - 135: 531: void ActiveRateGroupComponentBase :: - -: 532: tlmWrite_RgMaxTime(U32& arg) - -: 533: { - -: 534: - -: 535: // Check to see if it is the first time - 135: 536: if (not this->m_first_update_RgMaxTime) { - -: 537: // Check to see if value has changed. If not, don't write it. - 105: 538: if (arg == this->m_last_RgMaxTime) { - 180: 539: return; - -: 540: } else { - 60: 541: this->m_last_RgMaxTime = arg; - -: 542: } - -: 543: } - -: 544: else { - 30: 545: this->m_first_update_RgMaxTime = false; - 30: 546: this->m_last_RgMaxTime = arg; - -: 547: } - -: 548: - 90: 549: if (this->m_Tlm_OutputPort[0].isConnected()) { - 90: 550: Fw::Time _timeTag = this->getTime(); - 180: 551: Fw::TlmBuffer _tlmBuff; - 90: 552: Fw::SerializeStatus _stat = _tlmBuff.serialize(arg); - 90: 553: FW_ASSERT( - -: 554: _stat == Fw::FW_SERIALIZE_OK, - -: 555: static_cast(_stat) - 180: 556: ); - -: 557: - -: 558: FwChanIdType _id; - -: 559: - 90: 560: switch (this->getInstance()) { - -: 561: case 0: - 30: 562: _id = CHANNELID_RGMAXTIME_0; - 30: 563: break; - -: 564: case 1: - 30: 565: _id = CHANNELID_RGMAXTIME_1; - 30: 566: break; - -: 567: case 2: - 30: 568: _id = CHANNELID_RGMAXTIME_2; - 30: 569: break; - -: 570: default: - #####: 571: FW_ASSERT(0,this->getInstance()); - #####: 572: break; - -: 573: } - -: 574: - -: 575: this->m_Tlm_OutputPort[0].invoke( - -: 576: _id, - -: 577: _timeTag, - -: 578: _tlmBuff - 180: 579: ); - -: 580: } - -: 581: - -: 582: } - -: 583: - 105: 584: void ActiveRateGroupComponentBase :: - -: 585: tlmWrite_RgCycleSlips(U32& arg) - -: 586: { - -: 587: - -: 588: // Check to see if it is the first time - 105: 589: if (not this->m_first_update_RgCycleSlips) { - -: 590: // Check to see if value has changed. If not, don't write it. - 90: 591: if (arg == this->m_last_RgCycleSlips) { - 105: 592: return; - -: 593: } else { - 90: 594: this->m_last_RgCycleSlips = arg; - -: 595: } - -: 596: } - -: 597: else { - 15: 598: this->m_first_update_RgCycleSlips = false; - 15: 599: this->m_last_RgCycleSlips = arg; - -: 600: } - -: 601: - 105: 602: if (this->m_Tlm_OutputPort[0].isConnected()) { - 105: 603: Fw::Time _timeTag = this->getTime(); - 210: 604: Fw::TlmBuffer _tlmBuff; - 105: 605: Fw::SerializeStatus _stat = _tlmBuff.serialize(arg); - 105: 606: FW_ASSERT( - -: 607: _stat == Fw::FW_SERIALIZE_OK, - -: 608: static_cast(_stat) - 210: 609: ); - -: 610: - -: 611: FwChanIdType _id; - -: 612: - 105: 613: switch (this->getInstance()) { - -: 614: case 0: - 35: 615: _id = CHANNELID_RGCYCLESLIPS_0; - 35: 616: break; - -: 617: case 1: - 35: 618: _id = CHANNELID_RGCYCLESLIPS_1; - 35: 619: break; - -: 620: case 2: - 35: 621: _id = CHANNELID_RGCYCLESLIPS_2; - 35: 622: break; - -: 623: default: - #####: 624: FW_ASSERT(0,this->getInstance()); - #####: 625: break; - -: 626: } - -: 627: - -: 628: this->m_Tlm_OutputPort[0].invoke( - -: 629: _id, - -: 630: _timeTag, - -: 631: _tlmBuff - 210: 632: ); - -: 633: } - -: 634: - -: 635: } - -: 636: - -: 637: // ---------------------------------------------------------------------- - -: 638: // Time - -: 639: // ---------------------------------------------------------------------- - -: 640: - 195: 641: Fw::Time ActiveRateGroupComponentBase :: - -: 642: getTime(void) - -: 643: { - 195: 644: if (this->m_Time_OutputPort[0].isConnected()) { - 195: 645: return this->m_Time_OutputPort[0].invoke(); - -: 646: } else { - #####: 647: return Fw::Time(TB_NONE,0,0); - -: 648: } - -: 649: } - -: 650: - -: 651: // ---------------------------------------------------------------------- - -: 652: // Event handling functions - -: 653: // ---------------------------------------------------------------------- - -: 654: - 30: 655: void ActiveRateGroupComponentBase :: - -: 656: log_DIAGNOSTIC_RateGroupStarted( - -: 657: void - -: 658: ) - -: 659: { - -: 660: - -: 661: // Get the time - 30: 662: Fw::Time _logTime; - 30: 663: if (this->m_Time_OutputPort[0].isConnected()) { - 30: 664: _logTime = this->m_Time_OutputPort[0].invoke(); - -: 665: } - -: 666: - -: 667: FwEventIdType _id; - -: 668: - 30: 669: switch (this->getInstance()) { - -: 670: case 0: - 10: 671: _id = EVENTID_RATEGROUPSTARTED_0; - 10: 672: break; - -: 673: case 1: - 10: 674: _id = EVENTID_RATEGROUPSTARTED_1; - 10: 675: break; - -: 676: case 2: - 10: 677: _id = EVENTID_RATEGROUPSTARTED_2; - 10: 678: break; - -: 679: default: - #####: 680: FW_ASSERT(0,this->getInstance()); - #####: 681: break; - -: 682: }; - -: 683: - -: 684: // Emit the event on the log port - 30: 685: if (this->m_Log_OutputPort[0].isConnected()) { - -: 686: - 30: 687: Fw::LogBuffer _logBuff; - -: 688: - -: 689: - -: 690: this->m_Log_OutputPort[0].invoke( - -: 691: _id, - -: 692: _logTime,Fw::LOG_DIAGNOSTIC, - -: 693: _logBuff - 30: 694: ); - -: 695: - -: 696: } - -: 697: - -: 698: // Emit the event on the text log port - -: 699:#if FW_ENABLE_TEXT_LOGGING - 30: 700: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 701: - -: 702:#if FW_OBJECT_NAMES == 1 - -: 703: const char* _formatString = - 30: 704: "(%s) %s: Rate group started."; - -: 705:#else - -: 706: const char* _formatString = - -: 707: "%s: Rate group started."; - -: 708:#endif - -: 709: - -: 710: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 711: - -: 712: (void) snprintf( - -: 713: _textBuffer, - -: 714: FW_LOG_TEXT_BUFFER_SIZE, - -: 715: _formatString, - -: 716:#if FW_OBJECT_NAMES == 1 - -: 717: this->m_objName, - -: 718:#endif - -: 719: "RateGroupStarted " - 30: 720: ); - -: 721: - -: 722: // Null terminate - 30: 723: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 30: 724: Fw::TextLogString _logString = _textBuffer; - -: 725: this->m_LogText_OutputPort[0].invoke( - -: 726: _id, - -: 727: _logTime,Fw::TEXT_LOG_DIAGNOSTIC, - -: 728: _logString - 30: 729: ); - -: 730: - 30: 731: } - -: 732:#endif - -: 733: - 30: 734: } - -: 735: - 90: 736: void ActiveRateGroupComponentBase :: - -: 737: log_WARNING_HI_RateGroupCycleSlip( - -: 738: U32 cycle - -: 739: ) - -: 740: { - -: 741: - -: 742: // Get the time - 90: 743: Fw::Time _logTime; - 90: 744: if (this->m_Time_OutputPort[0].isConnected()) { - 90: 745: _logTime = this->m_Time_OutputPort[0].invoke(); - -: 746: } - -: 747: - -: 748: FwEventIdType _id; - -: 749: - 90: 750: switch (this->getInstance()) { - -: 751: case 0: - 30: 752: _id = EVENTID_RATEGROUPCYCLESLIP_0; - 30: 753: break; - -: 754: case 1: - 30: 755: _id = EVENTID_RATEGROUPCYCLESLIP_1; - 30: 756: break; - -: 757: case 2: - 30: 758: _id = EVENTID_RATEGROUPCYCLESLIP_2; - 30: 759: break; - -: 760: default: - #####: 761: FW_ASSERT(0,this->getInstance()); - #####: 762: break; - -: 763: }; - -: 764: - -: 765: // Emit the event on the log port - 90: 766: if (this->m_Log_OutputPort[0].isConnected()) { - -: 767: - 90: 768: Fw::LogBuffer _logBuff; - -: 769: Fw::SerializeStatus _status; - -: 770: - -: 771:#if FW_AMPCS_COMPATIBLE - -: 772: // Serialize the number of arguments - -: 773: _status = _logBuff.serialize(static_cast(1)); - -: 774: FW_ASSERT( - -: 775: _status == Fw::FW_SERIALIZE_OK, - -: 776: static_cast(_status) - -: 777: ); - -: 778:#endif - -: 779: - -: 780:#if FW_AMPCS_COMPATIBLE - -: 781: // Serialize the argument size - -: 782: _status = _logBuff.serialize( - -: 783: static_cast(sizeof(cycle)) - -: 784: ); - -: 785: FW_ASSERT( - -: 786: _status == Fw::FW_SERIALIZE_OK, - -: 787: static_cast(_status) - -: 788: ); - -: 789:#endif - -: 790: - 90: 791: _status = _logBuff.serialize(cycle); - 90: 792: FW_ASSERT( - -: 793: _status == Fw::FW_SERIALIZE_OK, - -: 794: static_cast(_status) - 180: 795: ); - -: 796: - -: 797: - -: 798: this->m_Log_OutputPort[0].invoke( - -: 799: _id, - -: 800: _logTime,Fw::LOG_WARNING_HI, - -: 801: _logBuff - 90: 802: ); - -: 803: - -: 804: } - -: 805: - -: 806: // Emit the event on the text log port - -: 807:#if FW_ENABLE_TEXT_LOGGING - 90: 808: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 809: - -: 810:#if FW_OBJECT_NAMES == 1 - -: 811: const char* _formatString = - 90: 812: "(%s) %s: Rate group cycle slipped on cycle %d"; - -: 813:#else - -: 814: const char* _formatString = - -: 815: "%s: Rate group cycle slipped on cycle %d"; - -: 816:#endif - -: 817: - -: 818: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 819: - -: 820: (void) snprintf( - -: 821: _textBuffer, - -: 822: FW_LOG_TEXT_BUFFER_SIZE, - -: 823: _formatString, - -: 824:#if FW_OBJECT_NAMES == 1 - -: 825: this->m_objName, - -: 826:#endif - -: 827: "RateGroupCycleSlip " - -: 828: , cycle - 90: 829: ); - -: 830: - -: 831: // Null terminate - 90: 832: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 90: 833: Fw::TextLogString _logString = _textBuffer; - -: 834: this->m_LogText_OutputPort[0].invoke( - -: 835: _id, - -: 836: _logTime,Fw::TEXT_LOG_WARNING_HI, - -: 837: _logString - 90: 838: ); - -: 839: - 90: 840: } - -: 841:#endif - -: 842: - 90: 843: } - -: 844: - -: 845: // ---------------------------------------------------------------------- - -: 846: // Calls for messages received on typed input ports - -: 847: // ---------------------------------------------------------------------- - -: 848: - 240: 849: void ActiveRateGroupComponentBase :: - -: 850: m_p_CycleIn_in( - -: 851: Fw::PassiveComponentBase* callComp, - -: 852: NATIVE_INT_TYPE portNum, - -: 853: Svc::TimerVal cycle_start - -: 854: ) - -: 855: { - 240: 856: FW_ASSERT(callComp); - -: 857: ActiveRateGroupComponentBase* compPtr = - 240: 858: (ActiveRateGroupComponentBase*) callComp; - 240: 859: compPtr->CycleIn_handlerBase(portNum, cycle_start); - 240: 860: } - -: 861: - -: 862: // ---------------------------------------------------------------------- - -: 863: // Port handler base-class functions for typed input ports - -: 864: // ---------------------------------------------------------------------- - -: 865: - 240: 866: void ActiveRateGroupComponentBase :: - -: 867: CycleIn_handlerBase( - -: 868: NATIVE_INT_TYPE portNum, - -: 869: Svc::TimerVal cycle_start - -: 870: ) - -: 871: { - -: 872: - -: 873: // Make sure port number is valid - 240: 874: FW_ASSERT(portNum < this->getNum_CycleIn_InputPorts()); - -: 875: - -: 876: // Call pre-message hook - -: 877: CycleIn_preMsgHook( - -: 878: portNum, - -: 879: cycle_start - 240: 880: ); - -: 881: - 240: 882: ComponentIpcSerializableBuffer msg; - -: 883: Fw::SerializeStatus _status; - -: 884: - -: 885: _status = msg.serialize( - -: 886: static_cast(CYCLEIN_CYCLE) - 240: 887: ); - 240: 888: FW_ASSERT ( - -: 889: _status == Fw::FW_SERIALIZE_OK, - -: 890: static_cast(_status) - 480: 891: ); - -: 892: - 240: 893: _status = msg.serialize(portNum); - 240: 894: FW_ASSERT ( - -: 895: _status == Fw::FW_SERIALIZE_OK, - -: 896: static_cast(_status) - 480: 897: ); - -: 898: - -: 899: // Serialize argument cycle_start - 240: 900: _status = msg.serialize(cycle_start); - 240: 901: FW_ASSERT( - -: 902: _status == Fw::FW_SERIALIZE_OK, - -: 903: static_cast(_status) - 480: 904: ); - -: 905: - -: 906: Os::Queue::QueueStatus qStatus = - 240: 907: this->m_queue.send(msg, 0); - 240: 908: FW_ASSERT( - -: 909: qStatus == Os::Queue::QUEUE_OK, - -: 910: static_cast(qStatus) - 720: 911: ); - 240: 912: } - -: 913: - -: 914: // ---------------------------------------------------------------------- - -: 915: // Pre-message hooks for async input ports - -: 916: // ---------------------------------------------------------------------- - -: 917: - #####: 918: void ActiveRateGroupComponentBase :: - -: 919: CycleIn_preMsgHook( - -: 920: NATIVE_INT_TYPE portNum, - -: 921: Svc::TimerVal cycle_start - -: 922: ) - -: 923: { - -: 924: // Default: no-op - #####: 925: } - -: 926: - -: 927: // ---------------------------------------------------------------------- - -: 928: // Message dispatch method for active and queued components. Called - -: 929: // by active component thread or implementation code for queued components - -: 930: // ---------------------------------------------------------------------- - -: 931: - 135: 932: Fw::QueuedComponentBase::MsgDispatchStatus ActiveRateGroupComponentBase :: - -: 933: doDispatch(void) - -: 934: { - -: 935: - 135: 936: ComponentIpcSerializableBuffer msg; - -: 937: NATIVE_INT_TYPE priority; - -: 938: - 135: 939: Os::Queue::QueueStatus msgStatus = this->m_queue.receive(msg,priority); - 135: 940: FW_ASSERT( - -: 941: msgStatus == Os::Queue::QUEUE_OK, - -: 942: static_cast(msgStatus) - 270: 943: ); - -: 944: - -: 945: // Reset to beginning of buffer - 135: 946: msg.resetDeser(); - -: 947: - -: 948: NATIVE_INT_TYPE desMsg; - 135: 949: Fw::SerializeStatus deserStatus = msg.deserialize(desMsg); - 135: 950: FW_ASSERT( - -: 951: deserStatus == Fw::FW_SERIALIZE_OK, - -: 952: static_cast(deserStatus) - 270: 953: ); - -: 954: - 135: 955: MsgTypeEnum msgType = static_cast(desMsg); - -: 956: - 135: 957: if (msgType == ACTIVERATEGROUP_COMPONENT_EXIT) { - #####: 958: return MSG_DISPATCH_EXIT; - -: 959: } - -: 960: - -: 961: NATIVE_INT_TYPE portNum; - 135: 962: deserStatus = msg.deserialize(portNum); - 135: 963: FW_ASSERT( - -: 964: deserStatus == Fw::FW_SERIALIZE_OK, - -: 965: static_cast(deserStatus) - 270: 966: ); - -: 967: - 135: 968: switch (msgType) { - -: 969: - -: 970: // Handle async input port CycleIn - -: 971: case CYCLEIN_CYCLE: { - -: 972: - -: 973: // Deserialize argument cycle_start - 135: 974: Svc::TimerVal cycle_start; - 135: 975: deserStatus = msg.deserialize(cycle_start); - 135: 976: FW_ASSERT( - -: 977: deserStatus == Fw::FW_SERIALIZE_OK, - -: 978: static_cast(deserStatus) - 270: 979: ); - -: 980: - -: 981: // Call handler function - -: 982: this->CycleIn_handler( - -: 983: portNum, - -: 984: cycle_start - 135: 985: ); - -: 986: - 135: 987: break; - -: 988: - -: 989: } - -: 990: - -: 991: default: - #####: 992: return MSG_DISPATCH_ERROR; - -: 993: - -: 994: } - -: 995: - 270: 996: return MSG_DISPATCH_OK; - -: 997: - -: 998: } - -: 999: - -: 1000:} - -: 1001: diff --git a/Svc/ActiveRateGroup/test/ut/output/ActiveRateGroupImpl.cpp.gcov b/Svc/ActiveRateGroup/test/ut/output/ActiveRateGroupImpl.cpp.gcov deleted file mode 100644 index e80a8484a2..0000000000 --- a/Svc/ActiveRateGroup/test/ut/output/ActiveRateGroupImpl.cpp.gcov +++ /dev/null @@ -1,109 +0,0 @@ - -: 0:Source:/home/tcanham/source/isf/Svc/ActiveRateGroup/ActiveRateGroupImpl.cpp - -: 0:Programs:10 - -: 1:/* - -: 2:* \author: Tim Canham - -: 3:* \file: - -: 4:* \brief - -: 5:* - -: 6:* This file implements the ActiveRateGroup component, - -: 7:* which invokes a set of components the comprise the rate group. - -: 8:* - -: 9:* Copyright 2014-2015, by the California Institute of Technology. - -: 10:* ALL RIGHTS RESERVED. United States Government Sponsorship - -: 11:* acknowledged. - -: 13:* - -: 19:*/ - -: 20: - -: 21:#include - -: 22:#include - -: 23:#include - -: 24:#include - -: 25:#include - -: 26: - -: 27:namespace Svc { - -: 28: - -: 29:#if FW_OBJECT_NAMES == 1 - 30: 30: ActiveRateGroupImpl::ActiveRateGroupImpl(const char* compName, NATIVE_UINT_TYPE contexts[], NATIVE_UINT_TYPE numContexts) : - -: 31: ActiveRateGroupComponentBase(compName), - -: 32:#else - -: 33: ActiveRateGroupImpl::ActiveRateGroupImpl(NATIVE_UINT_TYPE contexts[], NATIVE_UINT_TYPE numContexts) : - -: 34:#endif - 30: 35: m_cycles(0), m_maxTime(0),m_cycleStarted(false),m_overrunThrottle(0),m_cycleSlips(0) { - 30: 36: FW_ASSERT(contexts); - 30: 37: FW_ASSERT(numContexts == static_cast(this->getNum_RateGroupMemberOut_OutputPorts()),numContexts,this->getNum_RateGroupMemberOut_OutputPorts()); - 60: 38: FW_ASSERT(FW_NUM_ARRAY_ELEMENTS(this->m_contexts) == this->getNum_RateGroupMemberOut_OutputPorts(), - -: 39: static_cast(FW_NUM_ARRAY_ELEMENTS(this->m_contexts)), - 60: 40: this->getNum_RateGroupMemberOut_OutputPorts()); - -: 41: - -: 42: // copy context values - 180: 43: for (NATIVE_INT_TYPE entry = 0; entry < this->getNum_RateGroupMemberOut_OutputPorts(); entry++) { - 150: 44: this->m_contexts[entry] = contexts[entry]; - -: 45: } - 30: 46: } - -: 47: - 30: 48: void ActiveRateGroupImpl::init(NATIVE_INT_TYPE queueDepth, NATIVE_INT_TYPE instance) { - 30: 49: ActiveRateGroupComponentBase::init(queueDepth,instance); - 30: 50: } - -: 51: - 30: 52: ActiveRateGroupImpl::~ActiveRateGroupImpl(void) { - -: 53: - 30: 54: } - -: 55: - 30: 56: void ActiveRateGroupImpl::preamble(void) { - 30: 57: this->log_DIAGNOSTIC_RateGroupStarted(); - 30: 58: } - -: 59: - 135: 60: void ActiveRateGroupImpl::CycleIn_handler(NATIVE_INT_TYPE portNum, Svc::TimerVal cycle_start) { - -: 61: - 135: 62: TimerVal end; - -: 63: - 135: 64: this->m_cycleStarted = false; - -: 65: - -: 66: // invoke any members of the rate group - 810: 67: for (NATIVE_INT_TYPE port = 0; port < this->getNum_RateGroupMemberOut_OutputPorts(); port++) { - 675: 68: if (this->isConnected_RateGroupMemberOut_OutputPort(port)) { - 675: 69: this->RateGroupMemberOut_out(port,this->m_contexts[port]); - -: 70: } - -: 71: } - -: 72: - -: 73: // grab timer for end of cycle - 135: 74: end.take(); - -: 75: - -: 76: // get rate group execution time - 135: 77: U32 cycle_time = end.diffUSec(cycle_start); - -: 78: - -: 79: // check to see if the time has exceeded the previous maximum - 135: 80: if (cycle_time > this->m_maxTime) { - 90: 81: this->m_maxTime = cycle_time; - -: 82: } - -: 83: - -: 84: // update cycle telemetry - 135: 85: this->tlmWrite_RgMaxTime(this->m_maxTime); - -: 86: - -: 87: // check for cycle slip. That will happen if new cycle message has been received - -: 88: // which will cause flag will be set again. - 135: 89: if (this->m_cycleStarted) { - 105: 90: this->m_cycleSlips++; - 105: 91: if (this->m_overrunThrottle < ACTIVE_RATE_GROUP_OVERRUN_THROTTLE) { - 90: 92: this->log_WARNING_HI_RateGroupCycleSlip(this->m_cycles); - 90: 93: this->m_overrunThrottle++; - -: 94: } - -: 95: // update cycle cycle slips - 105: 96: this->tlmWrite_RgCycleSlips(this->m_cycleSlips); - -: 97: } else { // if cycle is okay start decrementing throttle value - 30: 98: if (this->m_overrunThrottle > 0) { - 15: 99: this->m_overrunThrottle--; - -: 100: } - -: 101: } - -: 102: - -: 103: // increment cycle - 135: 104: this->m_cycles++; - -: 105: - 135: 106: } - -: 107: - 240: 108: void ActiveRateGroupImpl::CycleIn_preMsgHook(NATIVE_INT_TYPE portNum, Svc::TimerVal cycle_start) { - -: 109: // set flag to indicate cycle has started. Check in thread for overflow. - 240: 110: this->m_cycleStarted = true; - 240: 111: } - -: 112: - -: 113:} diff --git a/Svc/ActiveRateGroup/test/ut/output/SvcActiveRateGroup_gcov.txt b/Svc/ActiveRateGroup/test/ut/output/SvcActiveRateGroup_gcov.txt deleted file mode 100644 index a14726328a..0000000000 --- a/Svc/ActiveRateGroup/test/ut/output/SvcActiveRateGroup_gcov.txt +++ /dev/null @@ -1,13 +0,0 @@ -File '/home/tcanham/source/isf/Svc/ActiveRateGroup/ActiveRateGroupImpl.cpp' -Lines executed:100.00% of 41 -Creating 'ActiveRateGroupImpl.cpp.gcov' - -File '/home/tcanham/source/isf/Svc/Cycle/TimerVal.hpp' -Lines executed:0.00% of 1 -Creating 'TimerVal.hpp.gcov' - -File '/home/tcanham/source/isf/Svc/ActiveRateGroup/ActiveRateGroupComponentAc.cpp' -Lines executed:84.51% of 284 -Creating 'ActiveRateGroupComponentAc.cpp.gcov' - -Lines executed:86.20% of 326 diff --git a/Svc/ActiveRateGroup/test/ut/output/test.txt b/Svc/ActiveRateGroup/test/ut/output/test.txt deleted file mode 100644 index 59cb1cb372..0000000000 --- a/Svc/ActiveRateGroup/test/ut/output/test.txt +++ /dev/null @@ -1,161 +0,0 @@ -Running /home/tcanham/source/isf/Svc/ActiveRateGroup/test/ut/linux-cygwin-x86-ut-gnu-bin/test_ut -profiling:/home/tcanham/source/isf/gtest/src/linux-cygwin-x86-ut-gnu-bin/gtest-all.gcda:Version mismatch - expected 504* got 409* -[==========] Running 3 tests from 1 test case. -[----------] Global test environment set-up. -[----------] 3 tests from ActiveRateGroupTest -[ RUN ] ActiveRateGroupTest.NominalSchedule - -*************************************** -TESTCASE 101.1.1: Run nominal rate group execution -*************************************** - -*************************************** -(RQ) ISF-ARG-001 -*************************************** - -*************************************** -(RQ) ISF-ARG-002 -*************************************** - -*************************************** -(RQ) ISF-ARG-003 -*************************************** - -*************************************** -TESTCASE 101.1.1: Run nominal rate group execution -*************************************** - -*************************************** -(RQ) ISF-ARG-001 -*************************************** - -*************************************** -(RQ) ISF-ARG-002 -*************************************** - -*************************************** -(RQ) ISF-ARG-003 -*************************************** - -*************************************** -TESTCASE 101.1.1: Run nominal rate group execution -*************************************** - -*************************************** -(RQ) ISF-ARG-001 -*************************************** - -*************************************** -(RQ) ISF-ARG-002 -*************************************** - -*************************************** -(RQ) ISF-ARG-003 -*************************************** -[ OK ] ActiveRateGroupTest.NominalSchedule (0 ms) -[ RUN ] ActiveRateGroupTest.CycleOverrun - -*************************************** -TESTCASE 101.2.1: Run cycle slip scenario -*************************************** - -*************************************** -(RQ) ISF-ARG-004 -*************************************** - -*************************************** -(RQ) ISF-ARG-004 -*************************************** - -*************************************** -(RQ) ISF-ARG-004 -*************************************** - -*************************************** -profiling:/home/tcanham/source/isf/Svc/ActiveRateGroup/test/ut/linux-cygwin-x86-ut-gnu-bin/ActiveRateGroupTester.gcda:Version mismatch - expected 504* got 409* -(RQ) ISF-ARG-004 -profiling:/home/tcanham/source/isf/Svc/ActiveRateGroup/test/ut/linux-cygwin-x86-ut-gnu-bin/ActiveRateGroupImplTester.gcda:Version mismatch - expected 504* got 409* -*************************************** -profiling:/home/tcanham/source/isf/Svc/ActiveRateGroup/test/ut/linux-cygwin-x86-ut-gnu-bin/TesterBase.gcda:Version mismatch - expected 504* got 409* - -profiling:/home/tcanham/source/isf/Svc/ActiveRateGroup/test/ut/linux-cygwin-x86-ut-gnu-bin/GTestBase.gcda:Version mismatch - expected 504* got 409* -*************************************** -profiling:/home/tcanham/source/isf/Svc/ActiveRateGroup/linux-cygwin-x86-ut-gnu-bin/ActiveRateGroupImpl.gcda:Version mismatch - expected 504* got 409* -(RQ) ISF-ARG-004 -profiling:/home/tcanham/source/isf/Svc/ActiveRateGroup/linux-cygwin-x86-ut-gnu-bin/ActiveRateGroupComponentAc.gcda:Version mismatch - expected 504* got 409* -*************************************** - -*************************************** -TESTCASE 101.2.1: Run cycle slip scenario -*************************************** - -*************************************** -(RQ) ISF-ARG-004 -*************************************** - -*************************************** -(RQ) ISF-ARG-004 -*************************************** - -*************************************** -(RQ) ISF-ARG-004 -*************************************** - -*************************************** -(RQ) ISF-ARG-004 -*************************************** - -profiling:/home/tcanham/source/isf/Svc/Cycle/linux-cygwin-x86-ut-gnu-bin/TimerVal.gcda:Version mismatch - expected 504* got 409* -*************************************** -profiling:/home/tcanham/source/isf/Svc/Cycle/linux-cygwin-x86-ut-gnu-bin/CyclePortAc.gcda:Version mismatch - expected 504* got 409* -(RQ) ISF-ARG-004 -*************************************** - -*************************************** -TESTCASE 101.2.1: Run cycle slip scenario -profiling:/home/tcanham/source/isf/Fw/Tlm/linux-cygwin-x86-ut-gnu-bin/TlmBuffer.gcda:Version mismatch - expected 504* got 409* -*************************************** -profiling:/home/tcanham/source/isf/Fw/Tlm/linux-cygwin-x86-ut-gnu-bin/TlmPortAc.gcda:Version mismatch - expected 504* got 409* - -*************************************** -(RQ) ISF-ARG-004 -*************************************** - -profiling:/home/tcanham/source/isf/Fw/Port/linux-cygwin-x86-ut-gnu-bin/PortBase.gcda:Version mismatch - expected 504* got 409* -*************************************** -profiling:/home/tcanham/source/isf/Fw/Port/linux-cygwin-x86-ut-gnu-bin/InputPortBase.gcda:Version mismatch - expected 504* got 409* -(RQ) ISF-ARG-004 -*************************************** - -*************************************** -(RQ) ISF-ARG-004 -profiling:/home/tcanham/source/isf/Fw/Port/linux-cygwin-x86-ut-gnu-bin/OutputPortBase.gcda:Version mismatch - expected 504* got 409* -*************************************** -profiling:/home/tcanham/source/isf/Fw/Comp/linux-cygwin-x86-ut-gnu-bin/PassiveComponentBase.gcda:Version mismatch - expected 504* got 409* - -profiling:/home/tcanham/source/isf/Fw/Obj/linux-cygwin-x86-ut-gnu-bin/ObjBase.gcda:Version mismatch - expected 504* got 409* -*************************************** -profiling:/home/tcanham/source/isf/Fw/Time/linux-cygwin-x86-ut-gnu-bin/Time.gcda:Version mismatch - expected 504* got 409* -(RQ) ISF-ARG-004 -profiling:/home/tcanham/source/isf/Fw/Types/linux-cygwin-x86-ut-gnu-bin/StringType.gcda:Version mismatch - expected 504* got 409* -*************************************** - -*************************************** -(RQ) ISF-ARG-004 -profiling:/home/tcanham/source/isf/Fw/Types/linux-cygwin-x86-ut-gnu-bin/Serializable.gcda:Version mismatch - expected 504* got 409* -*************************************** -profiling:/home/tcanham/source/isf/Fw/Types/linux-cygwin-x86-ut-gnu-bin/Assert.gcda:Version mismatch - expected 504* got 409* -[ OK ] ActiveRateGroupTest.CycleOverrun (1 ms) -profiling:/home/tcanham/source/isf/Os/linux-cygwin-x86-ut-gnu-bin/LogPrintf.gcda:Version mismatch - expected 504* got 409* -[ RUN ] ActiveRateGroupTest.PingPort -profiling:/home/tcanham/source/isf/Os/Linux/linux-cygwin-x86-ut-gnu-bin/IntervalTimer.gcda:Version mismatch - expected 504* got 409* -[ OK ] ActiveRateGroupTest.PingPort (0 ms) -[----------] 3 tests from ActiveRateGroupTest (3 ms total) - -[----------] Global test environment tear-down -[==========] 3 tests from 1 test case ran. (3 ms total) -[ PASSED ] 3 tests. -make[1]: Leaving directory '/home/tcanham/source/isf/Svc/ActiveRateGroup' - -08:52:19 Build Finished (took 7s.999ms) - diff --git a/Svc/AssertFatalAdapter/test/ut/output/AssertFatalAdapterComponentAc.cpp.gcov b/Svc/AssertFatalAdapter/test/ut/output/AssertFatalAdapterComponentAc.cpp.gcov deleted file mode 100644 index 31f92e4351..0000000000 --- a/Svc/AssertFatalAdapter/test/ut/output/AssertFatalAdapterComponentAc.cpp.gcov +++ /dev/null @@ -1,1538 +0,0 @@ - -: 0:Source:/home/tcanham/source/isf/Svc/AssertFatalAdapter/AssertFatalAdapterComponentAc.cpp - -: 0:Programs:2 - -: 1:// ====================================================================== - -: 2:// \title AssertFatalAdapterComponentAc.hpp - -: 3:// \author Auto-generated - -: 4:// \brief cpp file for AssertFatalAdapter component base class - -: 5:// - -: 6:// \copyright - -: 7:// Copyright 2009-2015, by the California Institute of Technology. - -: 8:// ALL RIGHTS RESERVED. United States Government Sponsorship - -: 9:// acknowledged. - -: 11:// - -: 18:// ====================================================================== - -: 19: - -: 20:#include - -: 21:#include - -: 22:#include - -: 23:#include - -: 24:#if FW_ENABLE_TEXT_LOGGING - -: 25:#include - -: 26:#endif - -: 27: - -: 28: - -: 29:namespace Svc { - -: 30: - -: 31: // ---------------------------------------------------------------------- - -: 32: // Typed connectors for output ports - -: 33: // ---------------------------------------------------------------------- - -: 34: - 1: 35: void AssertFatalAdapterComponentBase :: - -: 36: set_Time_OutputPort( - -: 37: NATIVE_INT_TYPE portNum, - -: 38: Fw::InputTimePort* port - -: 39: ) - -: 40: { - 1: 41: FW_ASSERT(portNum < this->getNum_Time_OutputPorts(),static_cast(portNum)); - 1: 42: this->m_Time_OutputPort[portNum].addCallPort(port); - 1: 43: } - -: 44: - 1: 45: void AssertFatalAdapterComponentBase :: - -: 46: set_Log_OutputPort( - -: 47: NATIVE_INT_TYPE portNum, - -: 48: Fw::InputLogPort* port - -: 49: ) - -: 50: { - 1: 51: FW_ASSERT(portNum < this->getNum_Log_OutputPorts(),static_cast(portNum)); - 1: 52: this->m_Log_OutputPort[portNum].addCallPort(port); - 1: 53: } - -: 54: - -: 55:#if FW_ENABLE_TEXT_LOGGING == 1 - 1: 56: void AssertFatalAdapterComponentBase :: - -: 57: set_LogText_OutputPort( - -: 58: NATIVE_INT_TYPE portNum, - -: 59: Fw::InputLogTextPort* port - -: 60: ) - -: 61: { - 1: 62: FW_ASSERT(portNum < this->getNum_LogText_OutputPorts(),static_cast(portNum)); - 1: 63: this->m_LogText_OutputPort[portNum].addCallPort(port); - 1: 64: } - -: 65:#endif - -: 66: - -: 67: // ---------------------------------------------------------------------- - -: 68: // Serialization connectors for output ports - -: 69: // ---------------------------------------------------------------------- - -: 70: - -: 71:#if FW_PORT_SERIALIZATION - -: 72: - #####: 73: void AssertFatalAdapterComponentBase :: - -: 74: set_Time_OutputPort( - -: 75: NATIVE_INT_TYPE portNum, - -: 76: Fw::InputSerializePort *port - -: 77: ) - -: 78: { - #####: 79: FW_ASSERT(portNum < this->getNum_Time_OutputPorts(),static_cast(portNum)); - #####: 80: return this->m_Time_OutputPort[portNum].registerSerialPort(port); - -: 81: } - -: 82: - #####: 83: void AssertFatalAdapterComponentBase :: - -: 84: set_Log_OutputPort( - -: 85: NATIVE_INT_TYPE portNum, - -: 86: Fw::InputSerializePort *port - -: 87: ) - -: 88: { - #####: 89: FW_ASSERT(portNum < this->getNum_Log_OutputPorts(),static_cast(portNum)); - #####: 90: return this->m_Log_OutputPort[portNum].registerSerialPort(port); - -: 91: } - -: 92: - -: 93:#if FW_ENABLE_TEXT_LOGGING == 1 - #####: 94: void AssertFatalAdapterComponentBase :: - -: 95: set_LogText_OutputPort( - -: 96: NATIVE_INT_TYPE portNum, - -: 97: Fw::InputSerializePort *port - -: 98: ) - -: 99: { - #####: 100: FW_ASSERT(portNum < this->getNum_LogText_OutputPorts(),static_cast(portNum)); - #####: 101: return this->m_LogText_OutputPort[portNum].registerSerialPort(port); - -: 102: } - -: 103:#endif - -: 104: - -: 105:#endif - -: 106: - -: 107: // ---------------------------------------------------------------------- - -: 108: // Component construction, initialization, and destruction - -: 109: // ---------------------------------------------------------------------- - -: 110: - 1: 111: AssertFatalAdapterComponentBase :: - -: 112:#if FW_OBJECT_NAMES == 1 - -: 113: AssertFatalAdapterComponentBase(const char* compName) : - 1: 114: Fw::PassiveComponentBase(compName) - -: 115:#else - -: 116: AssertFatalAdapterComponentBase() : - -: 117: Fw::PassiveComponentBase() - -: 118:#endif - -: 119: { - -: 120: - -: 121: - -: 122: - -: 123: - 1: 124: } - -: 125: - 1: 126: void AssertFatalAdapterComponentBase :: - -: 127: init(NATIVE_INT_TYPE instance) - -: 128: { - -: 129: - -: 130: // Initialize base class - 1: 131: Fw::PassiveComponentBase::init(instance); - -: 132: - -: 133: // Initialize output port Time - 3: 134: for ( - 1: 135: NATIVE_INT_TYPE port = 0; - 2: 136: port < this->getNum_Time_OutputPorts(); - -: 137: port++ - -: 138: ) { - 1: 139: this->m_Time_OutputPort[port].init(); - -: 140: - -: 141:#if FW_OBJECT_NAMES == 1 - -: 142: char portName[80]; - 1: 143: (void) snprintf( - -: 144: portName, - -: 145: sizeof(portName), - -: 146: "%s_Time_OutputPort[%d]", - -: 147: this->m_objName, - -: 148: port - 1: 149: ); - 1: 150: this->m_Time_OutputPort[port].setObjName(portName); - -: 151:#endif - -: 152: - -: 153: } - -: 154: - -: 155: // Initialize output port Log - 3: 156: for ( - 1: 157: NATIVE_INT_TYPE port = 0; - 2: 158: port < this->getNum_Log_OutputPorts(); - -: 159: port++ - -: 160: ) { - 1: 161: this->m_Log_OutputPort[port].init(); - -: 162: - -: 163:#if FW_OBJECT_NAMES == 1 - -: 164: char portName[80]; - 1: 165: (void) snprintf( - -: 166: portName, - -: 167: sizeof(portName), - -: 168: "%s_Log_OutputPort[%d]", - -: 169: this->m_objName, - -: 170: port - 1: 171: ); - 1: 172: this->m_Log_OutputPort[port].setObjName(portName); - -: 173:#endif - -: 174: - -: 175: } - -: 176: - -: 177: // Initialize output port LogText - -: 178:#if FW_ENABLE_TEXT_LOGGING == 1 - 3: 179: for ( - 1: 180: NATIVE_INT_TYPE port = 0; - 2: 181: port < this->getNum_LogText_OutputPorts(); - -: 182: port++ - -: 183: ) { - 1: 184: this->m_LogText_OutputPort[port].init(); - -: 185: - -: 186:#if FW_OBJECT_NAMES == 1 - -: 187: char portName[80]; - 1: 188: (void) snprintf( - -: 189: portName, - -: 190: sizeof(portName), - -: 191: "%s_LogText_OutputPort[%d]", - -: 192: this->m_objName, - -: 193: port - 1: 194: ); - 1: 195: this->m_LogText_OutputPort[port].setObjName(portName); - -: 196:#endif - -: 197: - -: 198: } - -: 199:#endif - -: 200: - -: 201: - 1: 202: } - -: 203: - 1: 204: AssertFatalAdapterComponentBase:: - 1: 205: ~AssertFatalAdapterComponentBase() { - -: 206: - 1: 207: } - -: 208: - -: 209: // ---------------------------------------------------------------------- - -: 210: // Invocation functions for output ports - -: 211: // ---------------------------------------------------------------------- - -: 212: - -: 213: // ---------------------------------------------------------------------- - -: 214: // Getters for numbers of ports - -: 215: // ---------------------------------------------------------------------- - -: 216: - 3: 217: NATIVE_INT_TYPE AssertFatalAdapterComponentBase :: - -: 218: getNum_Time_OutputPorts(void) - -: 219: { - 3: 220: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 221: this->m_Time_OutputPort - -: 222: ); - -: 223: } - -: 224: - 3: 225: NATIVE_INT_TYPE AssertFatalAdapterComponentBase :: - -: 226: getNum_Log_OutputPorts(void) - -: 227: { - 3: 228: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 229: this->m_Log_OutputPort - -: 230: ); - -: 231: } - -: 232: - -: 233:#if FW_ENABLE_TEXT_LOGGING == 1 - 3: 234: NATIVE_INT_TYPE AssertFatalAdapterComponentBase :: - -: 235: getNum_LogText_OutputPorts(void) - -: 236: { - 3: 237: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 238: this->m_LogText_OutputPort - -: 239: ); - -: 240: } - -: 241:#endif - -: 242: - -: 243: // ---------------------------------------------------------------------- - -: 244: // Port connection status queries - -: 245: // ---------------------------------------------------------------------- - -: 246: - #####: 247: bool AssertFatalAdapterComponentBase :: - -: 248: isConnected_Time_OutputPort(NATIVE_INT_TYPE portNum) - -: 249: { - #####: 250: FW_ASSERT( - -: 251: portNum < this->getNum_Time_OutputPorts(), - -: 252: static_cast(portNum) - #####: 253: ); - #####: 254: return this->m_Time_OutputPort[portNum].isConnected(); - -: 255: } - -: 256: - #####: 257: bool AssertFatalAdapterComponentBase :: - -: 258: isConnected_Log_OutputPort(NATIVE_INT_TYPE portNum) - -: 259: { - #####: 260: FW_ASSERT( - -: 261: portNum < this->getNum_Log_OutputPorts(), - -: 262: static_cast(portNum) - #####: 263: ); - #####: 264: return this->m_Log_OutputPort[portNum].isConnected(); - -: 265: } - -: 266: - -: 267:#if FW_ENABLE_TEXT_LOGGING == 1 - #####: 268: bool AssertFatalAdapterComponentBase :: - -: 269: isConnected_LogText_OutputPort(NATIVE_INT_TYPE portNum) - -: 270: { - #####: 271: FW_ASSERT( - -: 272: portNum < this->getNum_LogText_OutputPorts(), - -: 273: static_cast(portNum) - #####: 274: ); - #####: 275: return this->m_LogText_OutputPort[portNum].isConnected(); - -: 276: } - -: 277:#endif - -: 278: - -: 279: // ---------------------------------------------------------------------- - -: 280: // Time - -: 281: // ---------------------------------------------------------------------- - -: 282: - #####: 283: Fw::Time AssertFatalAdapterComponentBase :: - -: 284: getTime(void) - -: 285: { - #####: 286: if (this->m_Time_OutputPort[0].isConnected()) { - #####: 287: Fw::Time _time; - #####: 288: this->m_Time_OutputPort[0].invoke(_time); - #####: 289: return _time; - -: 290: } else { - #####: 291: return Fw::Time(TB_NONE,0,0); - -: 292: } - -: 293: } - -: 294: - -: 295: // ---------------------------------------------------------------------- - -: 296: // Event handling functions - -: 297: // ---------------------------------------------------------------------- - -: 298: - 1: 299: void AssertFatalAdapterComponentBase :: - -: 300: log_FATAL_AF_ASSERT_0( - -: 301: Fw::LogStringArg& file, U32 line - -: 302: ) - -: 303: { - -: 304: - -: 305: - -: 306: // Get the time - 2: 307: Fw::Time _logTime; - 1: 308: if (this->m_Time_OutputPort[0].isConnected()) { - 1: 309: this->m_Time_OutputPort[0].invoke( _logTime); - -: 310: } - -: 311: - 1: 312: FwEventIdType _id = static_cast(0); - -: 313: - 1: 314: _id = this->getIdBase() + EVENTID_AF_ASSERT_0; - -: 315: - -: 316: // Emit the event on the log port - 1: 317: if (this->m_Log_OutputPort[0].isConnected()) { - -: 318: - 2: 319: Fw::LogBuffer _logBuff; - 1: 320: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 321: - -: 322:#if FW_AMPCS_COMPATIBLE - -: 323: // Serialize the number of arguments - -: 324: _status = _logBuff.serialize(static_cast(2)); - -: 325: FW_ASSERT( - -: 326: _status == Fw::FW_SERIALIZE_OK, - -: 327: static_cast(_status) - -: 328: ); - -: 329:#endif - -: 330: - 1: 331: file.setMaxSerialize(80); - 1: 332: _status = _logBuff.serialize(file); - -: 333: FW_ASSERT( - -: 334: _status == Fw::FW_SERIALIZE_OK, - -: 335: static_cast(_status) - 1: 336: ); - -: 337: - -: 338:#if FW_AMPCS_COMPATIBLE - -: 339: // Serialize the argument size - -: 340: _status = _logBuff.serialize( - -: 341: static_cast(sizeof(line)) - -: 342: ); - -: 343: FW_ASSERT( - -: 344: _status == Fw::FW_SERIALIZE_OK, - -: 345: static_cast(_status) - -: 346: ); - -: 347:#endif - -: 348: - 1: 349: _status = _logBuff.serialize(line); - -: 350: FW_ASSERT( - -: 351: _status == Fw::FW_SERIALIZE_OK, - -: 352: static_cast(_status) - 1: 353: ); - -: 354: - -: 355: - 1: 356: this->m_Log_OutputPort[0].invoke( - -: 357: _id, - -: 358: _logTime,Fw::LOG_FATAL, - -: 359: _logBuff - 1: 360: ); - -: 361: - -: 362: } - -: 363: - -: 364: // Emit the event on the text log port - -: 365:#if FW_ENABLE_TEXT_LOGGING - 1: 366: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 367: - -: 368:#if FW_OBJECT_NAMES == 1 - -: 369: const char* _formatString = - 1: 370: "(%s) %s: Assert in file %s, line %d"; - -: 371:#else - -: 372: const char* _formatString = - -: 373: "%s: Assert in file %s, line %d"; - -: 374:#endif - -: 375: - -: 376: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 377: - 1: 378: (void) snprintf( - -: 379: _textBuffer, - -: 380: FW_LOG_TEXT_BUFFER_SIZE, - -: 381: _formatString, - -: 382:#if FW_OBJECT_NAMES == 1 - -: 383: this->m_objName, - -: 384:#endif - -: 385: "AF_ASSERT_0 " - 1: 386: , file.toChar() - -: 387: , line - 1: 388: ); - -: 389: - -: 390: // Null terminate - 1: 391: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 2: 392: Fw::TextLogString _logString = _textBuffer; - 1: 393: this->m_LogText_OutputPort[0].invoke( - -: 394: _id, - -: 395: _logTime,Fw::TEXT_LOG_FATAL, - -: 396: _logString - 1: 397: ); - -: 398: - -: 399: } - -: 400:#endif - -: 401: - 1: 402: } - -: 403: - -: 404: - 1: 405: void AssertFatalAdapterComponentBase :: - -: 406: log_FATAL_AF_ASSERT_1( - -: 407: Fw::LogStringArg& file, U32 line, U32 arg1 - -: 408: ) - -: 409: { - -: 410: - -: 411: - -: 412: // Get the time - 2: 413: Fw::Time _logTime; - 1: 414: if (this->m_Time_OutputPort[0].isConnected()) { - 1: 415: this->m_Time_OutputPort[0].invoke( _logTime); - -: 416: } - -: 417: - 1: 418: FwEventIdType _id = static_cast(0); - -: 419: - 1: 420: _id = this->getIdBase() + EVENTID_AF_ASSERT_1; - -: 421: - -: 422: // Emit the event on the log port - 1: 423: if (this->m_Log_OutputPort[0].isConnected()) { - -: 424: - 2: 425: Fw::LogBuffer _logBuff; - 1: 426: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 427: - -: 428:#if FW_AMPCS_COMPATIBLE - -: 429: // Serialize the number of arguments - -: 430: _status = _logBuff.serialize(static_cast(3)); - -: 431: FW_ASSERT( - -: 432: _status == Fw::FW_SERIALIZE_OK, - -: 433: static_cast(_status) - -: 434: ); - -: 435:#endif - -: 436: - 1: 437: file.setMaxSerialize(80); - 1: 438: _status = _logBuff.serialize(file); - -: 439: FW_ASSERT( - -: 440: _status == Fw::FW_SERIALIZE_OK, - -: 441: static_cast(_status) - 1: 442: ); - -: 443: - -: 444:#if FW_AMPCS_COMPATIBLE - -: 445: // Serialize the argument size - -: 446: _status = _logBuff.serialize( - -: 447: static_cast(sizeof(line)) - -: 448: ); - -: 449: FW_ASSERT( - -: 450: _status == Fw::FW_SERIALIZE_OK, - -: 451: static_cast(_status) - -: 452: ); - -: 453:#endif - -: 454: - 1: 455: _status = _logBuff.serialize(line); - -: 456: FW_ASSERT( - -: 457: _status == Fw::FW_SERIALIZE_OK, - -: 458: static_cast(_status) - 1: 459: ); - -: 460: - -: 461:#if FW_AMPCS_COMPATIBLE - -: 462: // Serialize the argument size - -: 463: _status = _logBuff.serialize( - -: 464: static_cast(sizeof(arg1)) - -: 465: ); - -: 466: FW_ASSERT( - -: 467: _status == Fw::FW_SERIALIZE_OK, - -: 468: static_cast(_status) - -: 469: ); - -: 470:#endif - -: 471: - 1: 472: _status = _logBuff.serialize(arg1); - -: 473: FW_ASSERT( - -: 474: _status == Fw::FW_SERIALIZE_OK, - -: 475: static_cast(_status) - 1: 476: ); - -: 477: - -: 478: - 1: 479: this->m_Log_OutputPort[0].invoke( - -: 480: _id, - -: 481: _logTime,Fw::LOG_FATAL, - -: 482: _logBuff - 1: 483: ); - -: 484: - -: 485: } - -: 486: - -: 487: // Emit the event on the text log port - -: 488:#if FW_ENABLE_TEXT_LOGGING - 1: 489: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 490: - -: 491:#if FW_OBJECT_NAMES == 1 - -: 492: const char* _formatString = - 1: 493: "(%s) %s: Assert in file %s, line %d: %d"; - -: 494:#else - -: 495: const char* _formatString = - -: 496: "%s: Assert in file %s, line %d: %d"; - -: 497:#endif - -: 498: - -: 499: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 500: - 1: 501: (void) snprintf( - -: 502: _textBuffer, - -: 503: FW_LOG_TEXT_BUFFER_SIZE, - -: 504: _formatString, - -: 505:#if FW_OBJECT_NAMES == 1 - -: 506: this->m_objName, - -: 507:#endif - -: 508: "AF_ASSERT_1 " - 1: 509: , file.toChar() - -: 510: , line - -: 511: , arg1 - 1: 512: ); - -: 513: - -: 514: // Null terminate - 1: 515: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 2: 516: Fw::TextLogString _logString = _textBuffer; - 1: 517: this->m_LogText_OutputPort[0].invoke( - -: 518: _id, - -: 519: _logTime,Fw::TEXT_LOG_FATAL, - -: 520: _logString - 1: 521: ); - -: 522: - -: 523: } - -: 524:#endif - -: 525: - 1: 526: } - -: 527: - -: 528: - 1: 529: void AssertFatalAdapterComponentBase :: - -: 530: log_FATAL_AF_ASSERT_2( - -: 531: Fw::LogStringArg& file, U32 line, U32 arg1, U32 arg2 - -: 532: ) - -: 533: { - -: 534: - -: 535: - -: 536: // Get the time - 2: 537: Fw::Time _logTime; - 1: 538: if (this->m_Time_OutputPort[0].isConnected()) { - 1: 539: this->m_Time_OutputPort[0].invoke( _logTime); - -: 540: } - -: 541: - 1: 542: FwEventIdType _id = static_cast(0); - -: 543: - 1: 544: _id = this->getIdBase() + EVENTID_AF_ASSERT_2; - -: 545: - -: 546: // Emit the event on the log port - 1: 547: if (this->m_Log_OutputPort[0].isConnected()) { - -: 548: - 2: 549: Fw::LogBuffer _logBuff; - 1: 550: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 551: - -: 552:#if FW_AMPCS_COMPATIBLE - -: 553: // Serialize the number of arguments - -: 554: _status = _logBuff.serialize(static_cast(4)); - -: 555: FW_ASSERT( - -: 556: _status == Fw::FW_SERIALIZE_OK, - -: 557: static_cast(_status) - -: 558: ); - -: 559:#endif - -: 560: - 1: 561: file.setMaxSerialize(80); - 1: 562: _status = _logBuff.serialize(file); - -: 563: FW_ASSERT( - -: 564: _status == Fw::FW_SERIALIZE_OK, - -: 565: static_cast(_status) - 1: 566: ); - -: 567: - -: 568:#if FW_AMPCS_COMPATIBLE - -: 569: // Serialize the argument size - -: 570: _status = _logBuff.serialize( - -: 571: static_cast(sizeof(line)) - -: 572: ); - -: 573: FW_ASSERT( - -: 574: _status == Fw::FW_SERIALIZE_OK, - -: 575: static_cast(_status) - -: 576: ); - -: 577:#endif - -: 578: - 1: 579: _status = _logBuff.serialize(line); - -: 580: FW_ASSERT( - -: 581: _status == Fw::FW_SERIALIZE_OK, - -: 582: static_cast(_status) - 1: 583: ); - -: 584: - -: 585:#if FW_AMPCS_COMPATIBLE - -: 586: // Serialize the argument size - -: 587: _status = _logBuff.serialize( - -: 588: static_cast(sizeof(arg1)) - -: 589: ); - -: 590: FW_ASSERT( - -: 591: _status == Fw::FW_SERIALIZE_OK, - -: 592: static_cast(_status) - -: 593: ); - -: 594:#endif - -: 595: - 1: 596: _status = _logBuff.serialize(arg1); - -: 597: FW_ASSERT( - -: 598: _status == Fw::FW_SERIALIZE_OK, - -: 599: static_cast(_status) - 1: 600: ); - -: 601: - -: 602:#if FW_AMPCS_COMPATIBLE - -: 603: // Serialize the argument size - -: 604: _status = _logBuff.serialize( - -: 605: static_cast(sizeof(arg2)) - -: 606: ); - -: 607: FW_ASSERT( - -: 608: _status == Fw::FW_SERIALIZE_OK, - -: 609: static_cast(_status) - -: 610: ); - -: 611:#endif - -: 612: - 1: 613: _status = _logBuff.serialize(arg2); - -: 614: FW_ASSERT( - -: 615: _status == Fw::FW_SERIALIZE_OK, - -: 616: static_cast(_status) - 1: 617: ); - -: 618: - -: 619: - 1: 620: this->m_Log_OutputPort[0].invoke( - -: 621: _id, - -: 622: _logTime,Fw::LOG_FATAL, - -: 623: _logBuff - 1: 624: ); - -: 625: - -: 626: } - -: 627: - -: 628: // Emit the event on the text log port - -: 629:#if FW_ENABLE_TEXT_LOGGING - 1: 630: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 631: - -: 632:#if FW_OBJECT_NAMES == 1 - -: 633: const char* _formatString = - 1: 634: "(%s) %s: Assert in file %s, line %d: %d %d"; - -: 635:#else - -: 636: const char* _formatString = - -: 637: "%s: Assert in file %s, line %d: %d %d"; - -: 638:#endif - -: 639: - -: 640: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 641: - 1: 642: (void) snprintf( - -: 643: _textBuffer, - -: 644: FW_LOG_TEXT_BUFFER_SIZE, - -: 645: _formatString, - -: 646:#if FW_OBJECT_NAMES == 1 - -: 647: this->m_objName, - -: 648:#endif - -: 649: "AF_ASSERT_2 " - 1: 650: , file.toChar() - -: 651: , line - -: 652: , arg1 - -: 653: , arg2 - 1: 654: ); - -: 655: - -: 656: // Null terminate - 1: 657: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 2: 658: Fw::TextLogString _logString = _textBuffer; - 1: 659: this->m_LogText_OutputPort[0].invoke( - -: 660: _id, - -: 661: _logTime,Fw::TEXT_LOG_FATAL, - -: 662: _logString - 1: 663: ); - -: 664: - -: 665: } - -: 666:#endif - -: 667: - 1: 668: } - -: 669: - -: 670: - 1: 671: void AssertFatalAdapterComponentBase :: - -: 672: log_FATAL_AF_ASSERT_3( - -: 673: Fw::LogStringArg& file, U32 line, U32 arg1, U32 arg2, U32 arg3 - -: 674: ) - -: 675: { - -: 676: - -: 677: - -: 678: // Get the time - 2: 679: Fw::Time _logTime; - 1: 680: if (this->m_Time_OutputPort[0].isConnected()) { - 1: 681: this->m_Time_OutputPort[0].invoke( _logTime); - -: 682: } - -: 683: - 1: 684: FwEventIdType _id = static_cast(0); - -: 685: - 1: 686: _id = this->getIdBase() + EVENTID_AF_ASSERT_3; - -: 687: - -: 688: // Emit the event on the log port - 1: 689: if (this->m_Log_OutputPort[0].isConnected()) { - -: 690: - 2: 691: Fw::LogBuffer _logBuff; - 1: 692: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 693: - -: 694:#if FW_AMPCS_COMPATIBLE - -: 695: // Serialize the number of arguments - -: 696: _status = _logBuff.serialize(static_cast(5)); - -: 697: FW_ASSERT( - -: 698: _status == Fw::FW_SERIALIZE_OK, - -: 699: static_cast(_status) - -: 700: ); - -: 701:#endif - -: 702: - 1: 703: file.setMaxSerialize(80); - 1: 704: _status = _logBuff.serialize(file); - -: 705: FW_ASSERT( - -: 706: _status == Fw::FW_SERIALIZE_OK, - -: 707: static_cast(_status) - 1: 708: ); - -: 709: - -: 710:#if FW_AMPCS_COMPATIBLE - -: 711: // Serialize the argument size - -: 712: _status = _logBuff.serialize( - -: 713: static_cast(sizeof(line)) - -: 714: ); - -: 715: FW_ASSERT( - -: 716: _status == Fw::FW_SERIALIZE_OK, - -: 717: static_cast(_status) - -: 718: ); - -: 719:#endif - -: 720: - 1: 721: _status = _logBuff.serialize(line); - -: 722: FW_ASSERT( - -: 723: _status == Fw::FW_SERIALIZE_OK, - -: 724: static_cast(_status) - 1: 725: ); - -: 726: - -: 727:#if FW_AMPCS_COMPATIBLE - -: 728: // Serialize the argument size - -: 729: _status = _logBuff.serialize( - -: 730: static_cast(sizeof(arg1)) - -: 731: ); - -: 732: FW_ASSERT( - -: 733: _status == Fw::FW_SERIALIZE_OK, - -: 734: static_cast(_status) - -: 735: ); - -: 736:#endif - -: 737: - 1: 738: _status = _logBuff.serialize(arg1); - -: 739: FW_ASSERT( - -: 740: _status == Fw::FW_SERIALIZE_OK, - -: 741: static_cast(_status) - 1: 742: ); - -: 743: - -: 744:#if FW_AMPCS_COMPATIBLE - -: 745: // Serialize the argument size - -: 746: _status = _logBuff.serialize( - -: 747: static_cast(sizeof(arg2)) - -: 748: ); - -: 749: FW_ASSERT( - -: 750: _status == Fw::FW_SERIALIZE_OK, - -: 751: static_cast(_status) - -: 752: ); - -: 753:#endif - -: 754: - 1: 755: _status = _logBuff.serialize(arg2); - -: 756: FW_ASSERT( - -: 757: _status == Fw::FW_SERIALIZE_OK, - -: 758: static_cast(_status) - 1: 759: ); - -: 760: - -: 761:#if FW_AMPCS_COMPATIBLE - -: 762: // Serialize the argument size - -: 763: _status = _logBuff.serialize( - -: 764: static_cast(sizeof(arg3)) - -: 765: ); - -: 766: FW_ASSERT( - -: 767: _status == Fw::FW_SERIALIZE_OK, - -: 768: static_cast(_status) - -: 769: ); - -: 770:#endif - -: 771: - 1: 772: _status = _logBuff.serialize(arg3); - -: 773: FW_ASSERT( - -: 774: _status == Fw::FW_SERIALIZE_OK, - -: 775: static_cast(_status) - 1: 776: ); - -: 777: - -: 778: - 1: 779: this->m_Log_OutputPort[0].invoke( - -: 780: _id, - -: 781: _logTime,Fw::LOG_FATAL, - -: 782: _logBuff - 1: 783: ); - -: 784: - -: 785: } - -: 786: - -: 787: // Emit the event on the text log port - -: 788:#if FW_ENABLE_TEXT_LOGGING - 1: 789: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 790: - -: 791:#if FW_OBJECT_NAMES == 1 - -: 792: const char* _formatString = - 1: 793: "(%s) %s: Assert in file %s, line %d: %d %d %d"; - -: 794:#else - -: 795: const char* _formatString = - -: 796: "%s: Assert in file %s, line %d: %d %d %d"; - -: 797:#endif - -: 798: - -: 799: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 800: - 1: 801: (void) snprintf( - -: 802: _textBuffer, - -: 803: FW_LOG_TEXT_BUFFER_SIZE, - -: 804: _formatString, - -: 805:#if FW_OBJECT_NAMES == 1 - -: 806: this->m_objName, - -: 807:#endif - -: 808: "AF_ASSERT_3 " - 1: 809: , file.toChar() - -: 810: , line - -: 811: , arg1 - -: 812: , arg2 - -: 813: , arg3 - 1: 814: ); - -: 815: - -: 816: // Null terminate - 1: 817: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 2: 818: Fw::TextLogString _logString = _textBuffer; - 1: 819: this->m_LogText_OutputPort[0].invoke( - -: 820: _id, - -: 821: _logTime,Fw::TEXT_LOG_FATAL, - -: 822: _logString - 1: 823: ); - -: 824: - -: 825: } - -: 826:#endif - -: 827: - 1: 828: } - -: 829: - -: 830: - 1: 831: void AssertFatalAdapterComponentBase :: - -: 832: log_FATAL_AF_ASSERT_4( - -: 833: Fw::LogStringArg& file, U32 line, U32 arg1, U32 arg2, U32 arg3, U32 arg4 - -: 834: ) - -: 835: { - -: 836: - -: 837: - -: 838: // Get the time - 2: 839: Fw::Time _logTime; - 1: 840: if (this->m_Time_OutputPort[0].isConnected()) { - 1: 841: this->m_Time_OutputPort[0].invoke( _logTime); - -: 842: } - -: 843: - 1: 844: FwEventIdType _id = static_cast(0); - -: 845: - 1: 846: _id = this->getIdBase() + EVENTID_AF_ASSERT_4; - -: 847: - -: 848: // Emit the event on the log port - 1: 849: if (this->m_Log_OutputPort[0].isConnected()) { - -: 850: - 2: 851: Fw::LogBuffer _logBuff; - 1: 852: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 853: - -: 854:#if FW_AMPCS_COMPATIBLE - -: 855: // Serialize the number of arguments - -: 856: _status = _logBuff.serialize(static_cast(6)); - -: 857: FW_ASSERT( - -: 858: _status == Fw::FW_SERIALIZE_OK, - -: 859: static_cast(_status) - -: 860: ); - -: 861:#endif - -: 862: - 1: 863: file.setMaxSerialize(80); - 1: 864: _status = _logBuff.serialize(file); - -: 865: FW_ASSERT( - -: 866: _status == Fw::FW_SERIALIZE_OK, - -: 867: static_cast(_status) - 1: 868: ); - -: 869: - -: 870:#if FW_AMPCS_COMPATIBLE - -: 871: // Serialize the argument size - -: 872: _status = _logBuff.serialize( - -: 873: static_cast(sizeof(line)) - -: 874: ); - -: 875: FW_ASSERT( - -: 876: _status == Fw::FW_SERIALIZE_OK, - -: 877: static_cast(_status) - -: 878: ); - -: 879:#endif - -: 880: - 1: 881: _status = _logBuff.serialize(line); - -: 882: FW_ASSERT( - -: 883: _status == Fw::FW_SERIALIZE_OK, - -: 884: static_cast(_status) - 1: 885: ); - -: 886: - -: 887:#if FW_AMPCS_COMPATIBLE - -: 888: // Serialize the argument size - -: 889: _status = _logBuff.serialize( - -: 890: static_cast(sizeof(arg1)) - -: 891: ); - -: 892: FW_ASSERT( - -: 893: _status == Fw::FW_SERIALIZE_OK, - -: 894: static_cast(_status) - -: 895: ); - -: 896:#endif - -: 897: - 1: 898: _status = _logBuff.serialize(arg1); - -: 899: FW_ASSERT( - -: 900: _status == Fw::FW_SERIALIZE_OK, - -: 901: static_cast(_status) - 1: 902: ); - -: 903: - -: 904:#if FW_AMPCS_COMPATIBLE - -: 905: // Serialize the argument size - -: 906: _status = _logBuff.serialize( - -: 907: static_cast(sizeof(arg2)) - -: 908: ); - -: 909: FW_ASSERT( - -: 910: _status == Fw::FW_SERIALIZE_OK, - -: 911: static_cast(_status) - -: 912: ); - -: 913:#endif - -: 914: - 1: 915: _status = _logBuff.serialize(arg2); - -: 916: FW_ASSERT( - -: 917: _status == Fw::FW_SERIALIZE_OK, - -: 918: static_cast(_status) - 1: 919: ); - -: 920: - -: 921:#if FW_AMPCS_COMPATIBLE - -: 922: // Serialize the argument size - -: 923: _status = _logBuff.serialize( - -: 924: static_cast(sizeof(arg3)) - -: 925: ); - -: 926: FW_ASSERT( - -: 927: _status == Fw::FW_SERIALIZE_OK, - -: 928: static_cast(_status) - -: 929: ); - -: 930:#endif - -: 931: - 1: 932: _status = _logBuff.serialize(arg3); - -: 933: FW_ASSERT( - -: 934: _status == Fw::FW_SERIALIZE_OK, - -: 935: static_cast(_status) - 1: 936: ); - -: 937: - -: 938:#if FW_AMPCS_COMPATIBLE - -: 939: // Serialize the argument size - -: 940: _status = _logBuff.serialize( - -: 941: static_cast(sizeof(arg4)) - -: 942: ); - -: 943: FW_ASSERT( - -: 944: _status == Fw::FW_SERIALIZE_OK, - -: 945: static_cast(_status) - -: 946: ); - -: 947:#endif - -: 948: - 1: 949: _status = _logBuff.serialize(arg4); - -: 950: FW_ASSERT( - -: 951: _status == Fw::FW_SERIALIZE_OK, - -: 952: static_cast(_status) - 1: 953: ); - -: 954: - -: 955: - 1: 956: this->m_Log_OutputPort[0].invoke( - -: 957: _id, - -: 958: _logTime,Fw::LOG_FATAL, - -: 959: _logBuff - 1: 960: ); - -: 961: - -: 962: } - -: 963: - -: 964: // Emit the event on the text log port - -: 965:#if FW_ENABLE_TEXT_LOGGING - 1: 966: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 967: - -: 968:#if FW_OBJECT_NAMES == 1 - -: 969: const char* _formatString = - 1: 970: "(%s) %s: Assert in file %s, line %d: %d %d %d %d"; - -: 971:#else - -: 972: const char* _formatString = - -: 973: "%s: Assert in file %s, line %d: %d %d %d %d"; - -: 974:#endif - -: 975: - -: 976: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 977: - 1: 978: (void) snprintf( - -: 979: _textBuffer, - -: 980: FW_LOG_TEXT_BUFFER_SIZE, - -: 981: _formatString, - -: 982:#if FW_OBJECT_NAMES == 1 - -: 983: this->m_objName, - -: 984:#endif - -: 985: "AF_ASSERT_4 " - 1: 986: , file.toChar() - -: 987: , line - -: 988: , arg1 - -: 989: , arg2 - -: 990: , arg3 - -: 991: , arg4 - 1: 992: ); - -: 993: - -: 994: // Null terminate - 1: 995: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 2: 996: Fw::TextLogString _logString = _textBuffer; - 1: 997: this->m_LogText_OutputPort[0].invoke( - -: 998: _id, - -: 999: _logTime,Fw::TEXT_LOG_FATAL, - -: 1000: _logString - 1: 1001: ); - -: 1002: - -: 1003: } - -: 1004:#endif - -: 1005: - 1: 1006: } - -: 1007: - -: 1008: - 1: 1009: void AssertFatalAdapterComponentBase :: - -: 1010: log_FATAL_AF_ASSERT_5( - -: 1011: Fw::LogStringArg& file, U32 line, U32 arg1, U32 arg2, U32 arg3, U32 arg4, U32 arg5 - -: 1012: ) - -: 1013: { - -: 1014: - -: 1015: - -: 1016: // Get the time - 2: 1017: Fw::Time _logTime; - 1: 1018: if (this->m_Time_OutputPort[0].isConnected()) { - 1: 1019: this->m_Time_OutputPort[0].invoke( _logTime); - -: 1020: } - -: 1021: - 1: 1022: FwEventIdType _id = static_cast(0); - -: 1023: - 1: 1024: _id = this->getIdBase() + EVENTID_AF_ASSERT_5; - -: 1025: - -: 1026: // Emit the event on the log port - 1: 1027: if (this->m_Log_OutputPort[0].isConnected()) { - -: 1028: - 2: 1029: Fw::LogBuffer _logBuff; - 1: 1030: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 1031: - -: 1032:#if FW_AMPCS_COMPATIBLE - -: 1033: // Serialize the number of arguments - -: 1034: _status = _logBuff.serialize(static_cast(7)); - -: 1035: FW_ASSERT( - -: 1036: _status == Fw::FW_SERIALIZE_OK, - -: 1037: static_cast(_status) - -: 1038: ); - -: 1039:#endif - -: 1040: - 1: 1041: file.setMaxSerialize(80); - 1: 1042: _status = _logBuff.serialize(file); - -: 1043: FW_ASSERT( - -: 1044: _status == Fw::FW_SERIALIZE_OK, - -: 1045: static_cast(_status) - 1: 1046: ); - -: 1047: - -: 1048:#if FW_AMPCS_COMPATIBLE - -: 1049: // Serialize the argument size - -: 1050: _status = _logBuff.serialize( - -: 1051: static_cast(sizeof(line)) - -: 1052: ); - -: 1053: FW_ASSERT( - -: 1054: _status == Fw::FW_SERIALIZE_OK, - -: 1055: static_cast(_status) - -: 1056: ); - -: 1057:#endif - -: 1058: - 1: 1059: _status = _logBuff.serialize(line); - -: 1060: FW_ASSERT( - -: 1061: _status == Fw::FW_SERIALIZE_OK, - -: 1062: static_cast(_status) - 1: 1063: ); - -: 1064: - -: 1065:#if FW_AMPCS_COMPATIBLE - -: 1066: // Serialize the argument size - -: 1067: _status = _logBuff.serialize( - -: 1068: static_cast(sizeof(arg1)) - -: 1069: ); - -: 1070: FW_ASSERT( - -: 1071: _status == Fw::FW_SERIALIZE_OK, - -: 1072: static_cast(_status) - -: 1073: ); - -: 1074:#endif - -: 1075: - 1: 1076: _status = _logBuff.serialize(arg1); - -: 1077: FW_ASSERT( - -: 1078: _status == Fw::FW_SERIALIZE_OK, - -: 1079: static_cast(_status) - 1: 1080: ); - -: 1081: - -: 1082:#if FW_AMPCS_COMPATIBLE - -: 1083: // Serialize the argument size - -: 1084: _status = _logBuff.serialize( - -: 1085: static_cast(sizeof(arg2)) - -: 1086: ); - -: 1087: FW_ASSERT( - -: 1088: _status == Fw::FW_SERIALIZE_OK, - -: 1089: static_cast(_status) - -: 1090: ); - -: 1091:#endif - -: 1092: - 1: 1093: _status = _logBuff.serialize(arg2); - -: 1094: FW_ASSERT( - -: 1095: _status == Fw::FW_SERIALIZE_OK, - -: 1096: static_cast(_status) - 1: 1097: ); - -: 1098: - -: 1099:#if FW_AMPCS_COMPATIBLE - -: 1100: // Serialize the argument size - -: 1101: _status = _logBuff.serialize( - -: 1102: static_cast(sizeof(arg3)) - -: 1103: ); - -: 1104: FW_ASSERT( - -: 1105: _status == Fw::FW_SERIALIZE_OK, - -: 1106: static_cast(_status) - -: 1107: ); - -: 1108:#endif - -: 1109: - 1: 1110: _status = _logBuff.serialize(arg3); - -: 1111: FW_ASSERT( - -: 1112: _status == Fw::FW_SERIALIZE_OK, - -: 1113: static_cast(_status) - 1: 1114: ); - -: 1115: - -: 1116:#if FW_AMPCS_COMPATIBLE - -: 1117: // Serialize the argument size - -: 1118: _status = _logBuff.serialize( - -: 1119: static_cast(sizeof(arg4)) - -: 1120: ); - -: 1121: FW_ASSERT( - -: 1122: _status == Fw::FW_SERIALIZE_OK, - -: 1123: static_cast(_status) - -: 1124: ); - -: 1125:#endif - -: 1126: - 1: 1127: _status = _logBuff.serialize(arg4); - -: 1128: FW_ASSERT( - -: 1129: _status == Fw::FW_SERIALIZE_OK, - -: 1130: static_cast(_status) - 1: 1131: ); - -: 1132: - -: 1133:#if FW_AMPCS_COMPATIBLE - -: 1134: // Serialize the argument size - -: 1135: _status = _logBuff.serialize( - -: 1136: static_cast(sizeof(arg5)) - -: 1137: ); - -: 1138: FW_ASSERT( - -: 1139: _status == Fw::FW_SERIALIZE_OK, - -: 1140: static_cast(_status) - -: 1141: ); - -: 1142:#endif - -: 1143: - 1: 1144: _status = _logBuff.serialize(arg5); - -: 1145: FW_ASSERT( - -: 1146: _status == Fw::FW_SERIALIZE_OK, - -: 1147: static_cast(_status) - 1: 1148: ); - -: 1149: - -: 1150: - 1: 1151: this->m_Log_OutputPort[0].invoke( - -: 1152: _id, - -: 1153: _logTime,Fw::LOG_FATAL, - -: 1154: _logBuff - 1: 1155: ); - -: 1156: - -: 1157: } - -: 1158: - -: 1159: // Emit the event on the text log port - -: 1160:#if FW_ENABLE_TEXT_LOGGING - 1: 1161: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 1162: - -: 1163:#if FW_OBJECT_NAMES == 1 - -: 1164: const char* _formatString = - 1: 1165: "(%s) %s: Assert in file %s, line %d: %d %d %d %d %d"; - -: 1166:#else - -: 1167: const char* _formatString = - -: 1168: "%s: Assert in file %s, line %d: %d %d %d %d %d"; - -: 1169:#endif - -: 1170: - -: 1171: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 1172: - 1: 1173: (void) snprintf( - -: 1174: _textBuffer, - -: 1175: FW_LOG_TEXT_BUFFER_SIZE, - -: 1176: _formatString, - -: 1177:#if FW_OBJECT_NAMES == 1 - -: 1178: this->m_objName, - -: 1179:#endif - -: 1180: "AF_ASSERT_5 " - 1: 1181: , file.toChar() - -: 1182: , line - -: 1183: , arg1 - -: 1184: , arg2 - -: 1185: , arg3 - -: 1186: , arg4 - -: 1187: , arg5 - 1: 1188: ); - -: 1189: - -: 1190: // Null terminate - 1: 1191: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 2: 1192: Fw::TextLogString _logString = _textBuffer; - 1: 1193: this->m_LogText_OutputPort[0].invoke( - -: 1194: _id, - -: 1195: _logTime,Fw::TEXT_LOG_FATAL, - -: 1196: _logString - 1: 1197: ); - -: 1198: - -: 1199: } - -: 1200:#endif - -: 1201: - 1: 1202: } - -: 1203: - -: 1204: - 1: 1205: void AssertFatalAdapterComponentBase :: - -: 1206: log_FATAL_AF_ASSERT_6( - -: 1207: Fw::LogStringArg& file, U32 line, U32 arg1, U32 arg2, U32 arg3, U32 arg4, U32 arg5, U32 arg6 - -: 1208: ) - -: 1209: { - -: 1210: - -: 1211: - -: 1212: // Get the time - 2: 1213: Fw::Time _logTime; - 1: 1214: if (this->m_Time_OutputPort[0].isConnected()) { - 1: 1215: this->m_Time_OutputPort[0].invoke( _logTime); - -: 1216: } - -: 1217: - 1: 1218: FwEventIdType _id = static_cast(0); - -: 1219: - 1: 1220: _id = this->getIdBase() + EVENTID_AF_ASSERT_6; - -: 1221: - -: 1222: // Emit the event on the log port - 1: 1223: if (this->m_Log_OutputPort[0].isConnected()) { - -: 1224: - 2: 1225: Fw::LogBuffer _logBuff; - 1: 1226: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 1227: - -: 1228:#if FW_AMPCS_COMPATIBLE - -: 1229: // Serialize the number of arguments - -: 1230: _status = _logBuff.serialize(static_cast(8)); - -: 1231: FW_ASSERT( - -: 1232: _status == Fw::FW_SERIALIZE_OK, - -: 1233: static_cast(_status) - -: 1234: ); - -: 1235:#endif - -: 1236: - 1: 1237: file.setMaxSerialize(80); - 1: 1238: _status = _logBuff.serialize(file); - -: 1239: FW_ASSERT( - -: 1240: _status == Fw::FW_SERIALIZE_OK, - -: 1241: static_cast(_status) - 1: 1242: ); - -: 1243: - -: 1244:#if FW_AMPCS_COMPATIBLE - -: 1245: // Serialize the argument size - -: 1246: _status = _logBuff.serialize( - -: 1247: static_cast(sizeof(line)) - -: 1248: ); - -: 1249: FW_ASSERT( - -: 1250: _status == Fw::FW_SERIALIZE_OK, - -: 1251: static_cast(_status) - -: 1252: ); - -: 1253:#endif - -: 1254: - 1: 1255: _status = _logBuff.serialize(line); - -: 1256: FW_ASSERT( - -: 1257: _status == Fw::FW_SERIALIZE_OK, - -: 1258: static_cast(_status) - 1: 1259: ); - -: 1260: - -: 1261:#if FW_AMPCS_COMPATIBLE - -: 1262: // Serialize the argument size - -: 1263: _status = _logBuff.serialize( - -: 1264: static_cast(sizeof(arg1)) - -: 1265: ); - -: 1266: FW_ASSERT( - -: 1267: _status == Fw::FW_SERIALIZE_OK, - -: 1268: static_cast(_status) - -: 1269: ); - -: 1270:#endif - -: 1271: - 1: 1272: _status = _logBuff.serialize(arg1); - -: 1273: FW_ASSERT( - -: 1274: _status == Fw::FW_SERIALIZE_OK, - -: 1275: static_cast(_status) - 1: 1276: ); - -: 1277: - -: 1278:#if FW_AMPCS_COMPATIBLE - -: 1279: // Serialize the argument size - -: 1280: _status = _logBuff.serialize( - -: 1281: static_cast(sizeof(arg2)) - -: 1282: ); - -: 1283: FW_ASSERT( - -: 1284: _status == Fw::FW_SERIALIZE_OK, - -: 1285: static_cast(_status) - -: 1286: ); - -: 1287:#endif - -: 1288: - 1: 1289: _status = _logBuff.serialize(arg2); - -: 1290: FW_ASSERT( - -: 1291: _status == Fw::FW_SERIALIZE_OK, - -: 1292: static_cast(_status) - 1: 1293: ); - -: 1294: - -: 1295:#if FW_AMPCS_COMPATIBLE - -: 1296: // Serialize the argument size - -: 1297: _status = _logBuff.serialize( - -: 1298: static_cast(sizeof(arg3)) - -: 1299: ); - -: 1300: FW_ASSERT( - -: 1301: _status == Fw::FW_SERIALIZE_OK, - -: 1302: static_cast(_status) - -: 1303: ); - -: 1304:#endif - -: 1305: - 1: 1306: _status = _logBuff.serialize(arg3); - -: 1307: FW_ASSERT( - -: 1308: _status == Fw::FW_SERIALIZE_OK, - -: 1309: static_cast(_status) - 1: 1310: ); - -: 1311: - -: 1312:#if FW_AMPCS_COMPATIBLE - -: 1313: // Serialize the argument size - -: 1314: _status = _logBuff.serialize( - -: 1315: static_cast(sizeof(arg4)) - -: 1316: ); - -: 1317: FW_ASSERT( - -: 1318: _status == Fw::FW_SERIALIZE_OK, - -: 1319: static_cast(_status) - -: 1320: ); - -: 1321:#endif - -: 1322: - 1: 1323: _status = _logBuff.serialize(arg4); - -: 1324: FW_ASSERT( - -: 1325: _status == Fw::FW_SERIALIZE_OK, - -: 1326: static_cast(_status) - 1: 1327: ); - -: 1328: - -: 1329:#if FW_AMPCS_COMPATIBLE - -: 1330: // Serialize the argument size - -: 1331: _status = _logBuff.serialize( - -: 1332: static_cast(sizeof(arg5)) - -: 1333: ); - -: 1334: FW_ASSERT( - -: 1335: _status == Fw::FW_SERIALIZE_OK, - -: 1336: static_cast(_status) - -: 1337: ); - -: 1338:#endif - -: 1339: - 1: 1340: _status = _logBuff.serialize(arg5); - -: 1341: FW_ASSERT( - -: 1342: _status == Fw::FW_SERIALIZE_OK, - -: 1343: static_cast(_status) - 1: 1344: ); - -: 1345: - -: 1346:#if FW_AMPCS_COMPATIBLE - -: 1347: // Serialize the argument size - -: 1348: _status = _logBuff.serialize( - -: 1349: static_cast(sizeof(arg6)) - -: 1350: ); - -: 1351: FW_ASSERT( - -: 1352: _status == Fw::FW_SERIALIZE_OK, - -: 1353: static_cast(_status) - -: 1354: ); - -: 1355:#endif - -: 1356: - 1: 1357: _status = _logBuff.serialize(arg6); - -: 1358: FW_ASSERT( - -: 1359: _status == Fw::FW_SERIALIZE_OK, - -: 1360: static_cast(_status) - 1: 1361: ); - -: 1362: - -: 1363: - 1: 1364: this->m_Log_OutputPort[0].invoke( - -: 1365: _id, - -: 1366: _logTime,Fw::LOG_FATAL, - -: 1367: _logBuff - 1: 1368: ); - -: 1369: - -: 1370: } - -: 1371: - -: 1372: // Emit the event on the text log port - -: 1373:#if FW_ENABLE_TEXT_LOGGING - 1: 1374: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 1375: - -: 1376:#if FW_OBJECT_NAMES == 1 - -: 1377: const char* _formatString = - 1: 1378: "(%s) %s: Assert in file %s, line %d: %d %d %d %d %d %d"; - -: 1379:#else - -: 1380: const char* _formatString = - -: 1381: "%s: Assert in file %s, line %d: %d %d %d %d %d %d"; - -: 1382:#endif - -: 1383: - -: 1384: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 1385: - 1: 1386: (void) snprintf( - -: 1387: _textBuffer, - -: 1388: FW_LOG_TEXT_BUFFER_SIZE, - -: 1389: _formatString, - -: 1390:#if FW_OBJECT_NAMES == 1 - -: 1391: this->m_objName, - -: 1392:#endif - -: 1393: "AF_ASSERT_6 " - 1: 1394: , file.toChar() - -: 1395: , line - -: 1396: , arg1 - -: 1397: , arg2 - -: 1398: , arg3 - -: 1399: , arg4 - -: 1400: , arg5 - -: 1401: , arg6 - 1: 1402: ); - -: 1403: - -: 1404: // Null terminate - 1: 1405: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 2: 1406: Fw::TextLogString _logString = _textBuffer; - 1: 1407: this->m_LogText_OutputPort[0].invoke( - -: 1408: _id, - -: 1409: _logTime,Fw::TEXT_LOG_FATAL, - -: 1410: _logString - 1: 1411: ); - -: 1412: - -: 1413: } - -: 1414:#endif - -: 1415: - 1: 1416: } - -: 1417: - -: 1418: - 1: 1419: void AssertFatalAdapterComponentBase :: - -: 1420: log_FATAL_AF_UNEXPECTED_ASSERT( - -: 1421: Fw::LogStringArg& file, U32 line, U32 numArgs - -: 1422: ) - -: 1423: { - -: 1424: - -: 1425: - -: 1426: // Get the time - 2: 1427: Fw::Time _logTime; - 1: 1428: if (this->m_Time_OutputPort[0].isConnected()) { - 1: 1429: this->m_Time_OutputPort[0].invoke( _logTime); - -: 1430: } - -: 1431: - 1: 1432: FwEventIdType _id = static_cast(0); - -: 1433: - 1: 1434: _id = this->getIdBase() + EVENTID_AF_UNEXPECTED_ASSERT; - -: 1435: - -: 1436: // Emit the event on the log port - 1: 1437: if (this->m_Log_OutputPort[0].isConnected()) { - -: 1438: - 2: 1439: Fw::LogBuffer _logBuff; - 1: 1440: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 1441: - -: 1442:#if FW_AMPCS_COMPATIBLE - -: 1443: // Serialize the number of arguments - -: 1444: _status = _logBuff.serialize(static_cast(3)); - -: 1445: FW_ASSERT( - -: 1446: _status == Fw::FW_SERIALIZE_OK, - -: 1447: static_cast(_status) - -: 1448: ); - -: 1449:#endif - -: 1450: - 1: 1451: file.setMaxSerialize(80); - 1: 1452: _status = _logBuff.serialize(file); - -: 1453: FW_ASSERT( - -: 1454: _status == Fw::FW_SERIALIZE_OK, - -: 1455: static_cast(_status) - 1: 1456: ); - -: 1457: - -: 1458:#if FW_AMPCS_COMPATIBLE - -: 1459: // Serialize the argument size - -: 1460: _status = _logBuff.serialize( - -: 1461: static_cast(sizeof(line)) - -: 1462: ); - -: 1463: FW_ASSERT( - -: 1464: _status == Fw::FW_SERIALIZE_OK, - -: 1465: static_cast(_status) - -: 1466: ); - -: 1467:#endif - -: 1468: - 1: 1469: _status = _logBuff.serialize(line); - -: 1470: FW_ASSERT( - -: 1471: _status == Fw::FW_SERIALIZE_OK, - -: 1472: static_cast(_status) - 1: 1473: ); - -: 1474: - -: 1475:#if FW_AMPCS_COMPATIBLE - -: 1476: // Serialize the argument size - -: 1477: _status = _logBuff.serialize( - -: 1478: static_cast(sizeof(numArgs)) - -: 1479: ); - -: 1480: FW_ASSERT( - -: 1481: _status == Fw::FW_SERIALIZE_OK, - -: 1482: static_cast(_status) - -: 1483: ); - -: 1484:#endif - -: 1485: - 1: 1486: _status = _logBuff.serialize(numArgs); - -: 1487: FW_ASSERT( - -: 1488: _status == Fw::FW_SERIALIZE_OK, - -: 1489: static_cast(_status) - 1: 1490: ); - -: 1491: - -: 1492: - 1: 1493: this->m_Log_OutputPort[0].invoke( - -: 1494: _id, - -: 1495: _logTime,Fw::LOG_FATAL, - -: 1496: _logBuff - 1: 1497: ); - -: 1498: - -: 1499: } - -: 1500: - -: 1501: // Emit the event on the text log port - -: 1502:#if FW_ENABLE_TEXT_LOGGING - 1: 1503: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 1504: - -: 1505:#if FW_OBJECT_NAMES == 1 - -: 1506: const char* _formatString = - 1: 1507: "(%s) %s: Unexpected assert in file %s, line %d, args %d"; - -: 1508:#else - -: 1509: const char* _formatString = - -: 1510: "%s: Unexpected assert in file %s, line %d, args %d"; - -: 1511:#endif - -: 1512: - -: 1513: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 1514: - 1: 1515: (void) snprintf( - -: 1516: _textBuffer, - -: 1517: FW_LOG_TEXT_BUFFER_SIZE, - -: 1518: _formatString, - -: 1519:#if FW_OBJECT_NAMES == 1 - -: 1520: this->m_objName, - -: 1521:#endif - -: 1522: "AF_UNEXPECTED_ASSERT " - 1: 1523: , file.toChar() - -: 1524: , line - -: 1525: , numArgs - 1: 1526: ); - -: 1527: - -: 1528: // Null terminate - 1: 1529: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 2: 1530: Fw::TextLogString _logString = _textBuffer; - 1: 1531: this->m_LogText_OutputPort[0].invoke( - -: 1532: _id, - -: 1533: _logTime,Fw::TEXT_LOG_FATAL, - -: 1534: _logString - 1: 1535: ); - -: 1536: - -: 1537: } - -: 1538:#endif - -: 1539: - 1: 1540: } - -: 1541: - -: 1542: - 3: 1543:} // end namespace Svc diff --git a/Svc/AssertFatalAdapter/test/ut/output/AssertFatalAdapterComponentImpl.cpp.gcov b/Svc/AssertFatalAdapter/test/ut/output/AssertFatalAdapterComponentImpl.cpp.gcov deleted file mode 100644 index 3d381979d2..0000000000 --- a/Svc/AssertFatalAdapter/test/ut/output/AssertFatalAdapterComponentImpl.cpp.gcov +++ /dev/null @@ -1,141 +0,0 @@ - -: 0:Source:/home/tcanham/source/isf/Svc/AssertFatalAdapter/AssertFatalAdapterComponentImpl.cpp - -: 0:Programs:2 - -: 1:// ====================================================================== - -: 2:// \title AssertFatalAdapterImpl.cpp - -: 3:// \author tcanham - -: 4:// \brief cpp file for AssertFatalAdapter component implementation class - -: 5:// - -: 6:// \copyright - -: 7:// Copyright 2009-2015, by the California Institute of Technology. - -: 8:// ALL RIGHTS RESERVED. United States Government Sponsorship - -: 9:// acknowledged. - -: 11:// - -: 18:// ====================================================================== - -: 19: - -: 20: - -: 21:#include - -: 22:#include "Fw/Types/BasicTypes.hpp" - -: 23:#include - -: 24:#include - -: 25: - -: 26:namespace Svc { - -: 27: - -: 28: // ---------------------------------------------------------------------- - -: 29: // Construction, initialization, and destruction - -: 30: // ---------------------------------------------------------------------- - -: 31: - 1: 32: AssertFatalAdapterComponentImpl :: - -: 33:#if FW_OBJECT_NAMES == 1 - -: 34: AssertFatalAdapterComponentImpl( - -: 35: const char *const compName - -: 36: ) : - 1: 37: AssertFatalAdapterComponentBase(compName) - -: 38:#else - -: 39: AssertFatalAdapterImpl(void) - -: 40:#endif - -: 41: { - -: 42: // register component with adapter - 1: 43: this->m_adapter.regAssertReporter(this); - -: 44: // register adapter - 1: 45: this->m_adapter.registerHook(); - -: 46: - 1: 47: } - -: 48: - 1: 49: void AssertFatalAdapterComponentImpl :: - -: 50: init( - -: 51: const NATIVE_INT_TYPE instance - -: 52: ) - -: 53: { - 1: 54: AssertFatalAdapterComponentBase::init(instance); - 1: 55: } - -: 56: - 1: 57: AssertFatalAdapterComponentImpl :: - 1: 58: ~AssertFatalAdapterComponentImpl(void) - -: 59: { - -: 60: - 1: 61: } - -: 62: - 7: 63: void AssertFatalAdapterComponentImpl::AssertFatalAdapter::reportAssert( - -: 64: FILE_NAME_ARG file, - -: 65: NATIVE_UINT_TYPE lineNo, - -: 66: NATIVE_UINT_TYPE numArgs, - -: 67: AssertArg arg1, - -: 68: AssertArg arg2, - -: 69: AssertArg arg3, - -: 70: AssertArg arg4, - -: 71: AssertArg arg5, - -: 72: AssertArg arg6 - -: 73: ) { - -: 74: - 7: 75: if (m_compPtr) { - 7: 76: m_compPtr->reportAssert(file,lineNo,numArgs, - 7: 77: arg1,arg2,arg3,arg4,arg5,arg6); - -: 78: } else { - -: 79: // Can't assert, what else can we do? Maybe somebody will see it. - #####: 80: printf("Svc::AssertFatalAdapter not registered!\n"); - -: 81: } - 7: 82: } - -: 83: - 1: 84: void AssertFatalAdapterComponentImpl::AssertFatalAdapter::regAssertReporter(AssertFatalAdapterComponentImpl* compPtr) { - 1: 85: this->m_compPtr = compPtr; - 1: 86: } - -: 87: - 1: 88: AssertFatalAdapterComponentImpl::AssertFatalAdapter::AssertFatalAdapter() { - 1: 89: } - -: 90: - 1: 91: AssertFatalAdapterComponentImpl::AssertFatalAdapter::~AssertFatalAdapter() { - 1: 92: } - -: 93: - 7: 94: void AssertFatalAdapterComponentImpl::AssertFatalAdapter::doAssert(void) { - -: 95: // do nothing since there will be a FATAL - 7: 96: } - -: 97: - 8: 98: void AssertFatalAdapterComponentImpl::reportAssert( - -: 99: FILE_NAME_ARG file, - -: 100: NATIVE_UINT_TYPE lineNo, - -: 101: NATIVE_UINT_TYPE numArgs, - -: 102: AssertArg arg1, - -: 103: AssertArg arg2, - -: 104: AssertArg arg3, - -: 105: AssertArg arg4, - -: 106: AssertArg arg5, - -: 107: AssertArg arg6 - -: 108: ) { - -: 109: - -: 110: - -: 111:#if FW_ASSERT_LEVEL == FW_FILEID_ASSERT - -: 112: Fw::LogStringArg fileArg; - -: 113: fileArg.format("%d",file); - -: 114:#else - 16: 115: Fw::LogStringArg fileArg((const char*)file); - -: 116:#endif - -: 117: - 8: 118: switch (numArgs) { - -: 119: case 0: - 1: 120: this->log_FATAL_AF_ASSERT_0(fileArg,lineNo); - 1: 121: break; - -: 122: case 1: - 1: 123: this->log_FATAL_AF_ASSERT_1(fileArg,lineNo,arg1); - 1: 124: break; - -: 125: case 2: - 1: 126: this->log_FATAL_AF_ASSERT_2(fileArg,lineNo,arg1,arg2); - 1: 127: break; - -: 128: case 3: - 1: 129: this->log_FATAL_AF_ASSERT_3(fileArg,lineNo,arg1,arg2,arg3); - 1: 130: break; - -: 131: case 4: - 1: 132: this->log_FATAL_AF_ASSERT_4(fileArg,lineNo,arg1,arg2,arg3,arg4); - 1: 133: break; - -: 134: case 5: - 1: 135: this->log_FATAL_AF_ASSERT_5(fileArg,lineNo,arg1,arg2,arg3,arg4,arg5); - 1: 136: break; - -: 137: case 6: - 1: 138: this->log_FATAL_AF_ASSERT_6(fileArg,lineNo,arg1,arg2,arg3,arg4,arg5,arg6); - 1: 139: break; - -: 140: default: - 1: 141: this->log_FATAL_AF_UNEXPECTED_ASSERT(fileArg,lineNo,numArgs); - 1: 142: break; - -: 143: } - -: 144: - 8: 145: } - 3: 146:} // end namespace Svc diff --git a/Svc/AssertFatalAdapter/test/ut/output/test.txt b/Svc/AssertFatalAdapter/test/ut/output/test.txt deleted file mode 100644 index b4c3df028d..0000000000 --- a/Svc/AssertFatalAdapter/test/ut/output/test.txt +++ /dev/null @@ -1,20 +0,0 @@ -Running /home/tcanham/source/isf/Svc/AssertFatalAdapter/test/ut/linux-linux-x86-debug-gnu-ut-bin/test_ut -[==========] Running 1 test from 1 test case. -[----------] Global test environment set-up. -[----------] 1 test from Nominal -[ RUN ] Nominal.NominalInit -EVENT: (0) (0:0,0) FATAL: (AssertFatalAdapter) AF_ASSERT_0 : Assert in file /home/tcanham/source/isf/Svc/AssertFatalAdapter/test/ut/Tester.cpp, line 59 -EVENT: (1) (0:0,0) FATAL: (AssertFatalAdapter) AF_ASSERT_1 : Assert in file /home/tcanham/source/isf/Svc/AssertFatalAdapter/test/ut/Tester.cpp, line 65: 1 -EVENT: (2) (0:0,0) FATAL: (AssertFatalAdapter) AF_ASSERT_2 : Assert in file /home/tcanham/source/isf/Svc/AssertFatalAdapter/test/ut/Tester.cpp, line 71: 1 2 -EVENT: (3) (0:0,0) FATAL: (AssertFatalAdapter) AF_ASSERT_3 : Assert in file /home/tcanham/source/isf/Svc/AssertFatalAdapter/test/ut/Tester.cpp, line 77: 1 2 3 -EVENT: (4) (0:0,0) FATAL: (AssertFatalAdapter) AF_ASSERT_4 : Assert in file /home/tcanham/source/isf/Svc/AssertFatalAdapter/test/ut/Tester.cpp, line 83: 1 2 3 4 -EVENT: (5) (0:0,0) FATAL: (AssertFatalAdapter) AF_ASSERT_5 : Assert in file /home/tcanham/source/isf/Svc/AssertFatalAdapter/test/ut/Tester.cpp, line 89: 1 2 3 4 5 -EVENT: (6) (0:0,0) FATAL: (AssertFatalAdapter) AF_ASSERT_6 : Assert in file /home/tcanham/source/isf/Svc/AssertFatalAdapter/test/ut/Tester.cpp, line 95: 1 2 3 4 5 6 -EVENT: (7) (0:0,0) FATAL: (AssertFatalAdapter) AF_UNEXPECTED_ASSERT : Unexpected assert in file foo, line 1000, args 10 -[ OK ] Nominal.NominalInit (0 ms) -Build Time: 0:00.70 -[----------] 1 test from Nominal (7 ms total) - -[----------] Global test environment tear-down -[==========] 1 test from 1 test case ran. (10 ms total) -[ PASSED ] 1 test. \ No newline at end of file diff --git a/Svc/CmdSequencer/docs/sdd.md b/Svc/CmdSequencer/docs/sdd.md index a8304ceed8..75b6723033 100644 --- a/Svc/CmdSequencer/docs/sdd.md +++ b/Svc/CmdSequencer/docs/sdd.md @@ -320,9 +320,7 @@ TBD ## 5 Unit Testing -[CmdSequencerImpl.cpp](../test/ut/output/CmdSequencerImpl.cpp.gcov) - -[CmdSequencerComponentAc.cpp](../test/ut/output/CmdSequencerComponentAc.cpp.gcov) +To see unit test coverage run fprime-util check --coverage ## 6 Change log Date | Change Description diff --git a/Svc/CmdSequencer/test/ut/output/CmdSequencerComponentAc.cpp.gcov b/Svc/CmdSequencer/test/ut/output/CmdSequencerComponentAc.cpp.gcov deleted file mode 100644 index 981b2ac5f9..0000000000 --- a/Svc/CmdSequencer/test/ut/output/CmdSequencerComponentAc.cpp.gcov +++ /dev/null @@ -1,4990 +0,0 @@ - -: 0:Source:/home/tim/source/isf/Svc/CmdSequencer/CmdSequencerComponentAc.cpp - -: 0:Programs:11 - -: 1:// ====================================================================== - -: 2:// \title CmdSequencerComponentAc.hpp - -: 3:// \author Auto-generated - -: 4:// \brief cpp file for CmdSequencer component base class - -: 5:// - -: 6:// \copyright - -: 7:// Copyright 2009-2015, by the California Institute of Technology. - -: 8:// ALL RIGHTS RESERVED. United States Government Sponsorship - -: 9:// acknowledged. - -: 11:// - -: 18:// ====================================================================== - -: 19: - -: 20:#include - -: 21:#include - -: 22:#include - -: 23:#include - -: 24:#if FW_ENABLE_TEXT_LOGGING - -: 25:#include - -: 26:#endif - -: 27: - -: 28: - -: 29:namespace Svc { - -: 30: - -: 31: // ---------------------------------------------------------------------- - -: 32: // Anonymous namespace to prevent name collisions - -: 33: // ---------------------------------------------------------------------- - -: 34: - -: 35: namespace { - -: 36: - -: 37: typedef enum { - -: 38: CMDSEQUENCER_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT, - -: 39: PINGIN_PING, - -: 40: CMDRESPONSEIN_CMDRESPONSE, - -: 41: SCHEDIN_SCHED, - -: 42: SEQRUNIN_CMDSEQIN, - -: 43: CMD_CS_RUN, - -: 44: CMD_CS_VALIDATE, - -: 45: CMD_CS_CANCEL, - -: 46: CMD_CS_START, - -: 47: CMD_CS_STEP, - -: 48: CMD_CS_AUTO, - -: 49: CMD_CS_MANUAL - -: 50: } MsgTypeEnum; - -: 51: - -: 52: // Get the max size by doing a union of the input port serialization sizes. - -: 53: - -: 54: typedef union { - -: 55: BYTE port1[Svc::InputPingPort::SERIALIZED_SIZE]; - -: 56: BYTE port2[Fw::InputCmdResponsePort::SERIALIZED_SIZE]; - -: 57: BYTE port3[Svc::InputSchedPort::SERIALIZED_SIZE]; - -: 58: BYTE port4[Svc::InputCmdSeqInPort::SERIALIZED_SIZE]; - -: 59: BYTE cmdPort[Fw::InputCmdPort::SERIALIZED_SIZE]; - -: 60: } BuffUnion; - -: 61: - -: 62: // Define a message buffer class large enough to handle all the - -: 63: // asynchronous inputs to the component - -: 64: - 4348: 65: class ComponentIpcSerializableBuffer : - -: 66: public Fw::SerializeBufferBase - -: 67: { - -: 68: - -: 69: public: - -: 70: - -: 71: enum { - -: 72: // Max. message size = size of data + message id + port - -: 73: SERIALIZATION_SIZE = - -: 74: sizeof(BuffUnion) + - -: 75: sizeof(NATIVE_INT_TYPE) + - -: 76: sizeof(NATIVE_INT_TYPE) - -: 77: }; - -: 78: - 7949: 79: NATIVE_UINT_TYPE getBuffCapacity(void) const { - 7949: 80: return sizeof(m_buff); - -: 81: } - -: 82: - 52530: 83: U8* getBuffAddr(void) { - 52530: 84: return m_buff; - -: 85: } - -: 86: - 1087: 87: const U8* getBuffAddr(void) const { - 1087: 88: return m_buff; - -: 89: } - -: 90: - -: 91: private: - -: 92: // Should be the max of all the input ports serialized sizes... - -: 93: U8 m_buff[SERIALIZATION_SIZE]; - -: 94: - -: 95: }; - -: 96: - -: 97: } - -: 98: - -: 99: // ---------------------------------------------------------------------- - -: 100: // Getters for numbers of input ports - -: 101: // ---------------------------------------------------------------------- - -: 102: - 213: 103: Svc::InputPingPort *CmdSequencerComponentBase :: - -: 104: get_pingIn_InputPort(NATIVE_INT_TYPE portNum) - -: 105: { - 213: 106: FW_ASSERT(portNum < this->getNum_pingIn_InputPorts(),static_cast(portNum)); - 213: 107: return &this->m_pingIn_InputPort[portNum]; - -: 108: } - -: 109: - 213: 110: Fw::InputCmdResponsePort *CmdSequencerComponentBase :: - -: 111: get_cmdResponseIn_InputPort(NATIVE_INT_TYPE portNum) - -: 112: { - 213: 113: FW_ASSERT(portNum < this->getNum_cmdResponseIn_InputPorts(),static_cast(portNum)); - 213: 114: return &this->m_cmdResponseIn_InputPort[portNum]; - -: 115: } - -: 116: - 213: 117: Fw::InputCmdPort *CmdSequencerComponentBase :: - -: 118: get_cmdIn_InputPort(NATIVE_INT_TYPE portNum) - -: 119: { - 213: 120: FW_ASSERT(portNum < this->getNum_cmdIn_InputPorts(),static_cast(portNum)); - 213: 121: return &this->m_cmdIn_InputPort[portNum]; - -: 122: } - -: 123: - 213: 124: Svc::InputSchedPort *CmdSequencerComponentBase :: - -: 125: get_schedIn_InputPort(NATIVE_INT_TYPE portNum) - -: 126: { - 213: 127: FW_ASSERT(portNum < this->getNum_schedIn_InputPorts(),static_cast(portNum)); - 213: 128: return &this->m_schedIn_InputPort[portNum]; - -: 129: } - -: 130: - 213: 131: Svc::InputCmdSeqInPort *CmdSequencerComponentBase :: - -: 132: get_seqRunIn_InputPort(NATIVE_INT_TYPE portNum) - -: 133: { - 213: 134: FW_ASSERT(portNum < this->getNum_seqRunIn_InputPorts(),static_cast(portNum)); - 213: 135: return &this->m_seqRunIn_InputPort[portNum]; - -: 136: } - -: 137: - -: 138: // ---------------------------------------------------------------------- - -: 139: // Typed connectors for output ports - -: 140: // ---------------------------------------------------------------------- - -: 141: - 213: 142: void CmdSequencerComponentBase :: - -: 143: set_cmdRegOut_OutputPort( - -: 144: NATIVE_INT_TYPE portNum, - -: 145: Fw::InputCmdRegPort* port - -: 146: ) - -: 147: { - 213: 148: FW_ASSERT(portNum < this->getNum_cmdRegOut_OutputPorts(),static_cast(portNum)); - 213: 149: this->m_cmdRegOut_OutputPort[portNum].addCallPort(port); - 213: 150: } - -: 151: - -: 152:#if FW_ENABLE_TEXT_LOGGING == 1 - 213: 153: void CmdSequencerComponentBase :: - -: 154: set_LogText_OutputPort( - -: 155: NATIVE_INT_TYPE portNum, - -: 156: Fw::InputLogTextPort* port - -: 157: ) - -: 158: { - 213: 159: FW_ASSERT(portNum < this->getNum_LogText_OutputPorts(),static_cast(portNum)); - 213: 160: this->m_LogText_OutputPort[portNum].addCallPort(port); - 213: 161: } - -: 162:#endif - -: 163: - 213: 164: void CmdSequencerComponentBase :: - -: 165: set_tlmOut_OutputPort( - -: 166: NATIVE_INT_TYPE portNum, - -: 167: Fw::InputTlmPort* port - -: 168: ) - -: 169: { - 213: 170: FW_ASSERT(portNum < this->getNum_tlmOut_OutputPorts(),static_cast(portNum)); - 213: 171: this->m_tlmOut_OutputPort[portNum].addCallPort(port); - 213: 172: } - -: 173: - 213: 174: void CmdSequencerComponentBase :: - -: 175: set_cmdResponseOut_OutputPort( - -: 176: NATIVE_INT_TYPE portNum, - -: 177: Fw::InputCmdResponsePort* port - -: 178: ) - -: 179: { - 213: 180: FW_ASSERT(portNum < this->getNum_cmdResponseOut_OutputPorts(),static_cast(portNum)); - 213: 181: this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port); - 213: 182: } - -: 183: - 213: 184: void CmdSequencerComponentBase :: - -: 185: set_timeCaller_OutputPort( - -: 186: NATIVE_INT_TYPE portNum, - -: 187: Fw::InputTimePort* port - -: 188: ) - -: 189: { - 213: 190: FW_ASSERT(portNum < this->getNum_timeCaller_OutputPorts(),static_cast(portNum)); - 213: 191: this->m_timeCaller_OutputPort[portNum].addCallPort(port); - 213: 192: } - -: 193: - 213: 194: void CmdSequencerComponentBase :: - -: 195: set_comCmdOut_OutputPort( - -: 196: NATIVE_INT_TYPE portNum, - -: 197: Fw::InputComPort* port - -: 198: ) - -: 199: { - 213: 200: FW_ASSERT(portNum < this->getNum_comCmdOut_OutputPorts(),static_cast(portNum)); - 213: 201: this->m_comCmdOut_OutputPort[portNum].addCallPort(port); - 213: 202: } - -: 203: - 213: 204: void CmdSequencerComponentBase :: - -: 205: set_pingOut_OutputPort( - -: 206: NATIVE_INT_TYPE portNum, - -: 207: Svc::InputPingPort* port - -: 208: ) - -: 209: { - 213: 210: FW_ASSERT(portNum < this->getNum_pingOut_OutputPorts(),static_cast(portNum)); - 213: 211: this->m_pingOut_OutputPort[portNum].addCallPort(port); - 213: 212: } - -: 213: - 213: 214: void CmdSequencerComponentBase :: - -: 215: set_logOut_OutputPort( - -: 216: NATIVE_INT_TYPE portNum, - -: 217: Fw::InputLogPort* port - -: 218: ) - -: 219: { - 213: 220: FW_ASSERT(portNum < this->getNum_logOut_OutputPorts(),static_cast(portNum)); - 213: 221: this->m_logOut_OutputPort[portNum].addCallPort(port); - 213: 222: } - -: 223: - 213: 224: void CmdSequencerComponentBase :: - -: 225: set_seqDone_OutputPort( - -: 226: NATIVE_INT_TYPE portNum, - -: 227: Fw::InputCmdResponsePort* port - -: 228: ) - -: 229: { - 213: 230: FW_ASSERT(portNum < this->getNum_seqDone_OutputPorts(),static_cast(portNum)); - 213: 231: this->m_seqDone_OutputPort[portNum].addCallPort(port); - 213: 232: } - -: 233: - -: 234: // ---------------------------------------------------------------------- - -: 235: // Serialization connectors for output ports - -: 236: // ---------------------------------------------------------------------- - -: 237: - -: 238:#if FW_PORT_SERIALIZATION - -: 239: - #####: 240: void CmdSequencerComponentBase :: - -: 241: set_cmdRegOut_OutputPort( - -: 242: NATIVE_INT_TYPE portNum, - -: 243: Fw::InputSerializePort *port - -: 244: ) - -: 245: { - #####: 246: FW_ASSERT(portNum < this->getNum_cmdRegOut_OutputPorts(),static_cast(portNum)); - #####: 247: return this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port); - -: 248: } - -: 249: - -: 250:#if FW_ENABLE_TEXT_LOGGING == 1 - #####: 251: void CmdSequencerComponentBase :: - -: 252: set_LogText_OutputPort( - -: 253: NATIVE_INT_TYPE portNum, - -: 254: Fw::InputSerializePort *port - -: 255: ) - -: 256: { - #####: 257: FW_ASSERT(portNum < this->getNum_LogText_OutputPorts(),static_cast(portNum)); - #####: 258: return this->m_LogText_OutputPort[portNum].registerSerialPort(port); - -: 259: } - -: 260:#endif - -: 261: - #####: 262: void CmdSequencerComponentBase :: - -: 263: set_tlmOut_OutputPort( - -: 264: NATIVE_INT_TYPE portNum, - -: 265: Fw::InputSerializePort *port - -: 266: ) - -: 267: { - #####: 268: FW_ASSERT(portNum < this->getNum_tlmOut_OutputPorts(),static_cast(portNum)); - #####: 269: return this->m_tlmOut_OutputPort[portNum].registerSerialPort(port); - -: 270: } - -: 271: - #####: 272: void CmdSequencerComponentBase :: - -: 273: set_cmdResponseOut_OutputPort( - -: 274: NATIVE_INT_TYPE portNum, - -: 275: Fw::InputSerializePort *port - -: 276: ) - -: 277: { - #####: 278: FW_ASSERT(portNum < this->getNum_cmdResponseOut_OutputPorts(),static_cast(portNum)); - #####: 279: return this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port); - -: 280: } - -: 281: - #####: 282: void CmdSequencerComponentBase :: - -: 283: set_timeCaller_OutputPort( - -: 284: NATIVE_INT_TYPE portNum, - -: 285: Fw::InputSerializePort *port - -: 286: ) - -: 287: { - #####: 288: FW_ASSERT(portNum < this->getNum_timeCaller_OutputPorts(),static_cast(portNum)); - #####: 289: return this->m_timeCaller_OutputPort[portNum].registerSerialPort(port); - -: 290: } - -: 291: - #####: 292: void CmdSequencerComponentBase :: - -: 293: set_comCmdOut_OutputPort( - -: 294: NATIVE_INT_TYPE portNum, - -: 295: Fw::InputSerializePort *port - -: 296: ) - -: 297: { - #####: 298: FW_ASSERT(portNum < this->getNum_comCmdOut_OutputPorts(),static_cast(portNum)); - #####: 299: return this->m_comCmdOut_OutputPort[portNum].registerSerialPort(port); - -: 300: } - -: 301: - #####: 302: void CmdSequencerComponentBase :: - -: 303: set_pingOut_OutputPort( - -: 304: NATIVE_INT_TYPE portNum, - -: 305: Fw::InputSerializePort *port - -: 306: ) - -: 307: { - #####: 308: FW_ASSERT(portNum < this->getNum_pingOut_OutputPorts(),static_cast(portNum)); - #####: 309: return this->m_pingOut_OutputPort[portNum].registerSerialPort(port); - -: 310: } - -: 311: - #####: 312: void CmdSequencerComponentBase :: - -: 313: set_logOut_OutputPort( - -: 314: NATIVE_INT_TYPE portNum, - -: 315: Fw::InputSerializePort *port - -: 316: ) - -: 317: { - #####: 318: FW_ASSERT(portNum < this->getNum_logOut_OutputPorts(),static_cast(portNum)); - #####: 319: return this->m_logOut_OutputPort[portNum].registerSerialPort(port); - -: 320: } - -: 321: - #####: 322: void CmdSequencerComponentBase :: - -: 323: set_seqDone_OutputPort( - -: 324: NATIVE_INT_TYPE portNum, - -: 325: Fw::InputSerializePort *port - -: 326: ) - -: 327: { - #####: 328: FW_ASSERT(portNum < this->getNum_seqDone_OutputPorts(),static_cast(portNum)); - #####: 329: return this->m_seqDone_OutputPort[portNum].registerSerialPort(port); - -: 330: } - -: 331: - -: 332:#endif - -: 333: - -: 334: // ---------------------------------------------------------------------- - -: 335: // Command registration - -: 336: // ---------------------------------------------------------------------- - -: 337: - 9: 338: void CmdSequencerComponentBase :: - -: 339: regCommands(void) - -: 340: { - 9: 341: FW_ASSERT(this->m_cmdRegOut_OutputPort[0].isConnected()); - 9: 342: this->m_cmdRegOut_OutputPort[0].invoke( - -: 343: this->getIdBase() + OPCODE_CS_RUN - 9: 344: ); - 9: 345: this->m_cmdRegOut_OutputPort[0].invoke( - 9: 346: this->getIdBase() + OPCODE_CS_VALIDATE - 9: 347: ); - 9: 348: this->m_cmdRegOut_OutputPort[0].invoke( - 9: 349: this->getIdBase() + OPCODE_CS_CANCEL - 9: 350: ); - 9: 351: this->m_cmdRegOut_OutputPort[0].invoke( - 9: 352: this->getIdBase() + OPCODE_CS_START - 9: 353: ); - 9: 354: this->m_cmdRegOut_OutputPort[0].invoke( - 9: 355: this->getIdBase() + OPCODE_CS_STEP - 9: 356: ); - 9: 357: this->m_cmdRegOut_OutputPort[0].invoke( - 9: 358: this->getIdBase() + OPCODE_CS_AUTO - 9: 359: ); - 9: 360: this->m_cmdRegOut_OutputPort[0].invoke( - 9: 361: this->getIdBase() + OPCODE_CS_MANUAL - 9: 362: ); - 9: 363: } - -: 364: - -: 365: // ---------------------------------------------------------------------- - -: 366: // Component construction, initialization, and destruction - -: 367: // ---------------------------------------------------------------------- - -: 368: - 213: 369: CmdSequencerComponentBase :: - -: 370:#if FW_OBJECT_NAMES == 1 - -: 371: CmdSequencerComponentBase(const char* compName) : - 213: 372: Fw::ActiveComponentBase(compName) - -: 373:#else - -: 374: CmdSequencerComponentBase() : - -: 375: Fw::ActiveComponentBase() - -: 376:#endif - -: 377: { - -: 378: - -: 379: - -: 380: - 213: 381: } - -: 382: - 213: 383: void CmdSequencerComponentBase :: - -: 384: init( - -: 385: NATIVE_INT_TYPE queueDepth, - -: 386: NATIVE_INT_TYPE instance - -: 387: ) - -: 388: { - -: 389: - -: 390: // Initialize base class - 213: 391: Fw::ActiveComponentBase::init(instance); - -: 392: - -: 393: // Connect input port pingIn - 639: 394: for ( - 213: 395: NATIVE_INT_TYPE port = 0; - 426: 396: port < this->getNum_pingIn_InputPorts(); - -: 397: port++ - -: 398: ) { - -: 399: - 213: 400: this->m_pingIn_InputPort[port].init(); - 213: 401: this->m_pingIn_InputPort[port].addCallComp( - -: 402: this, - -: 403: m_p_pingIn_in - 213: 404: ); - 213: 405: this->m_pingIn_InputPort[port].setPortNum(port); - -: 406: - -: 407:#if FW_OBJECT_NAMES == 1 - -: 408: char portName[80]; - 213: 409: (void) snprintf( - -: 410: portName, - -: 411: sizeof(portName), - -: 412: "%s_pingIn_InputPort[%d]", - -: 413: this->m_objName, - -: 414: port - 213: 415: ); - 213: 416: this->m_pingIn_InputPort[port].setObjName(portName); - -: 417:#endif - -: 418: - -: 419: } - -: 420: - -: 421: // Connect input port cmdResponseIn - 639: 422: for ( - 213: 423: NATIVE_INT_TYPE port = 0; - 426: 424: port < this->getNum_cmdResponseIn_InputPorts(); - -: 425: port++ - -: 426: ) { - -: 427: - 213: 428: this->m_cmdResponseIn_InputPort[port].init(); - 213: 429: this->m_cmdResponseIn_InputPort[port].addCallComp( - -: 430: this, - -: 431: m_p_cmdResponseIn_in - 213: 432: ); - 213: 433: this->m_cmdResponseIn_InputPort[port].setPortNum(port); - -: 434: - -: 435:#if FW_OBJECT_NAMES == 1 - -: 436: char portName[80]; - 213: 437: (void) snprintf( - -: 438: portName, - -: 439: sizeof(portName), - -: 440: "%s_cmdResponseIn_InputPort[%d]", - -: 441: this->m_objName, - -: 442: port - 213: 443: ); - 213: 444: this->m_cmdResponseIn_InputPort[port].setObjName(portName); - -: 445:#endif - -: 446: - -: 447: } - -: 448: - -: 449: // Connect input port cmdIn - 639: 450: for ( - 213: 451: NATIVE_INT_TYPE port = 0; - 426: 452: port < this->getNum_cmdIn_InputPorts(); - -: 453: port++ - -: 454: ) { - -: 455: - 213: 456: this->m_cmdIn_InputPort[port].init(); - 213: 457: this->m_cmdIn_InputPort[port].addCallComp( - -: 458: this, - -: 459: m_p_cmdIn_in - 213: 460: ); - 213: 461: this->m_cmdIn_InputPort[port].setPortNum(port); - -: 462: - -: 463:#if FW_OBJECT_NAMES == 1 - -: 464: char portName[80]; - 213: 465: (void) snprintf( - -: 466: portName, - -: 467: sizeof(portName), - -: 468: "%s_cmdIn_InputPort[%d]", - -: 469: this->m_objName, - -: 470: port - 213: 471: ); - 213: 472: this->m_cmdIn_InputPort[port].setObjName(portName); - -: 473:#endif - -: 474: - -: 475: } - -: 476: - -: 477: // Connect input port schedIn - 639: 478: for ( - 213: 479: NATIVE_INT_TYPE port = 0; - 426: 480: port < this->getNum_schedIn_InputPorts(); - -: 481: port++ - -: 482: ) { - -: 483: - 213: 484: this->m_schedIn_InputPort[port].init(); - 213: 485: this->m_schedIn_InputPort[port].addCallComp( - -: 486: this, - -: 487: m_p_schedIn_in - 213: 488: ); - 213: 489: this->m_schedIn_InputPort[port].setPortNum(port); - -: 490: - -: 491:#if FW_OBJECT_NAMES == 1 - -: 492: char portName[80]; - 213: 493: (void) snprintf( - -: 494: portName, - -: 495: sizeof(portName), - -: 496: "%s_schedIn_InputPort[%d]", - -: 497: this->m_objName, - -: 498: port - 213: 499: ); - 213: 500: this->m_schedIn_InputPort[port].setObjName(portName); - -: 501:#endif - -: 502: - -: 503: } - -: 504: - -: 505: // Connect input port seqRunIn - 639: 506: for ( - 213: 507: NATIVE_INT_TYPE port = 0; - 426: 508: port < this->getNum_seqRunIn_InputPorts(); - -: 509: port++ - -: 510: ) { - -: 511: - 213: 512: this->m_seqRunIn_InputPort[port].init(); - 213: 513: this->m_seqRunIn_InputPort[port].addCallComp( - -: 514: this, - -: 515: m_p_seqRunIn_in - 213: 516: ); - 213: 517: this->m_seqRunIn_InputPort[port].setPortNum(port); - -: 518: - -: 519:#if FW_OBJECT_NAMES == 1 - -: 520: char portName[80]; - 213: 521: (void) snprintf( - -: 522: portName, - -: 523: sizeof(portName), - -: 524: "%s_seqRunIn_InputPort[%d]", - -: 525: this->m_objName, - -: 526: port - 213: 527: ); - 213: 528: this->m_seqRunIn_InputPort[port].setObjName(portName); - -: 529:#endif - -: 530: - -: 531: } - -: 532: - -: 533: // Initialize output port cmdRegOut - 639: 534: for ( - 213: 535: NATIVE_INT_TYPE port = 0; - 426: 536: port < this->getNum_cmdRegOut_OutputPorts(); - -: 537: port++ - -: 538: ) { - 213: 539: this->m_cmdRegOut_OutputPort[port].init(); - -: 540: - -: 541:#if FW_OBJECT_NAMES == 1 - -: 542: char portName[80]; - 213: 543: (void) snprintf( - -: 544: portName, - -: 545: sizeof(portName), - -: 546: "%s_cmdRegOut_OutputPort[%d]", - -: 547: this->m_objName, - -: 548: port - 213: 549: ); - 213: 550: this->m_cmdRegOut_OutputPort[port].setObjName(portName); - -: 551:#endif - -: 552: - -: 553: } - -: 554: - -: 555: // Initialize output port LogText - -: 556:#if FW_ENABLE_TEXT_LOGGING == 1 - 639: 557: for ( - 213: 558: NATIVE_INT_TYPE port = 0; - 426: 559: port < this->getNum_LogText_OutputPorts(); - -: 560: port++ - -: 561: ) { - 213: 562: this->m_LogText_OutputPort[port].init(); - -: 563: - -: 564:#if FW_OBJECT_NAMES == 1 - -: 565: char portName[80]; - 213: 566: (void) snprintf( - -: 567: portName, - -: 568: sizeof(portName), - -: 569: "%s_LogText_OutputPort[%d]", - -: 570: this->m_objName, - -: 571: port - 213: 572: ); - 213: 573: this->m_LogText_OutputPort[port].setObjName(portName); - -: 574:#endif - -: 575: - -: 576: } - -: 577:#endif - -: 578: - -: 579: // Initialize output port tlmOut - 639: 580: for ( - 213: 581: NATIVE_INT_TYPE port = 0; - 426: 582: port < this->getNum_tlmOut_OutputPorts(); - -: 583: port++ - -: 584: ) { - 213: 585: this->m_tlmOut_OutputPort[port].init(); - -: 586: - -: 587:#if FW_OBJECT_NAMES == 1 - -: 588: char portName[80]; - 213: 589: (void) snprintf( - -: 590: portName, - -: 591: sizeof(portName), - -: 592: "%s_tlmOut_OutputPort[%d]", - -: 593: this->m_objName, - -: 594: port - 213: 595: ); - 213: 596: this->m_tlmOut_OutputPort[port].setObjName(portName); - -: 597:#endif - -: 598: - -: 599: } - -: 600: - -: 601: // Initialize output port cmdResponseOut - 639: 602: for ( - 213: 603: NATIVE_INT_TYPE port = 0; - 426: 604: port < this->getNum_cmdResponseOut_OutputPorts(); - -: 605: port++ - -: 606: ) { - 213: 607: this->m_cmdResponseOut_OutputPort[port].init(); - -: 608: - -: 609:#if FW_OBJECT_NAMES == 1 - -: 610: char portName[80]; - 213: 611: (void) snprintf( - -: 612: portName, - -: 613: sizeof(portName), - -: 614: "%s_cmdResponseOut_OutputPort[%d]", - -: 615: this->m_objName, - -: 616: port - 213: 617: ); - 213: 618: this->m_cmdResponseOut_OutputPort[port].setObjName(portName); - -: 619:#endif - -: 620: - -: 621: } - -: 622: - -: 623: // Initialize output port timeCaller - 639: 624: for ( - 213: 625: NATIVE_INT_TYPE port = 0; - 426: 626: port < this->getNum_timeCaller_OutputPorts(); - -: 627: port++ - -: 628: ) { - 213: 629: this->m_timeCaller_OutputPort[port].init(); - -: 630: - -: 631:#if FW_OBJECT_NAMES == 1 - -: 632: char portName[80]; - 213: 633: (void) snprintf( - -: 634: portName, - -: 635: sizeof(portName), - -: 636: "%s_timeCaller_OutputPort[%d]", - -: 637: this->m_objName, - -: 638: port - 213: 639: ); - 213: 640: this->m_timeCaller_OutputPort[port].setObjName(portName); - -: 641:#endif - -: 642: - -: 643: } - -: 644: - -: 645: // Initialize output port comCmdOut - 639: 646: for ( - 213: 647: NATIVE_INT_TYPE port = 0; - 426: 648: port < this->getNum_comCmdOut_OutputPorts(); - -: 649: port++ - -: 650: ) { - 213: 651: this->m_comCmdOut_OutputPort[port].init(); - -: 652: - -: 653:#if FW_OBJECT_NAMES == 1 - -: 654: char portName[80]; - 213: 655: (void) snprintf( - -: 656: portName, - -: 657: sizeof(portName), - -: 658: "%s_comCmdOut_OutputPort[%d]", - -: 659: this->m_objName, - -: 660: port - 213: 661: ); - 213: 662: this->m_comCmdOut_OutputPort[port].setObjName(portName); - -: 663:#endif - -: 664: - -: 665: } - -: 666: - -: 667: // Initialize output port pingOut - 639: 668: for ( - 213: 669: NATIVE_INT_TYPE port = 0; - 426: 670: port < this->getNum_pingOut_OutputPorts(); - -: 671: port++ - -: 672: ) { - 213: 673: this->m_pingOut_OutputPort[port].init(); - -: 674: - -: 675:#if FW_OBJECT_NAMES == 1 - -: 676: char portName[80]; - 213: 677: (void) snprintf( - -: 678: portName, - -: 679: sizeof(portName), - -: 680: "%s_pingOut_OutputPort[%d]", - -: 681: this->m_objName, - -: 682: port - 213: 683: ); - 213: 684: this->m_pingOut_OutputPort[port].setObjName(portName); - -: 685:#endif - -: 686: - -: 687: } - -: 688: - -: 689: // Initialize output port logOut - 639: 690: for ( - 213: 691: NATIVE_INT_TYPE port = 0; - 426: 692: port < this->getNum_logOut_OutputPorts(); - -: 693: port++ - -: 694: ) { - 213: 695: this->m_logOut_OutputPort[port].init(); - -: 696: - -: 697:#if FW_OBJECT_NAMES == 1 - -: 698: char portName[80]; - 213: 699: (void) snprintf( - -: 700: portName, - -: 701: sizeof(portName), - -: 702: "%s_logOut_OutputPort[%d]", - -: 703: this->m_objName, - -: 704: port - 213: 705: ); - 213: 706: this->m_logOut_OutputPort[port].setObjName(portName); - -: 707:#endif - -: 708: - -: 709: } - -: 710: - -: 711: // Initialize output port seqDone - 639: 712: for ( - 213: 713: NATIVE_INT_TYPE port = 0; - 426: 714: port < this->getNum_seqDone_OutputPorts(); - -: 715: port++ - -: 716: ) { - 213: 717: this->m_seqDone_OutputPort[port].init(); - -: 718: - -: 719:#if FW_OBJECT_NAMES == 1 - -: 720: char portName[80]; - 213: 721: (void) snprintf( - -: 722: portName, - -: 723: sizeof(portName), - -: 724: "%s_seqDone_OutputPort[%d]", - -: 725: this->m_objName, - -: 726: port - 213: 727: ); - 213: 728: this->m_seqDone_OutputPort[port].setObjName(portName); - -: 729:#endif - -: 730: - -: 731: } - -: 732: - -: 733: Os::Queue::QueueStatus qStat = - 213: 734: this->createQueue( - -: 735: queueDepth, - -: 736: ComponentIpcSerializableBuffer::SERIALIZATION_SIZE - 213: 737: ); - -: 738: FW_ASSERT( - -: 739: Os::Queue::QUEUE_OK == qStat, - -: 740: static_cast(qStat) - 213: 741: ); - -: 742: - 213: 743: } - -: 744: - 213: 745: CmdSequencerComponentBase:: - 213: 746: ~CmdSequencerComponentBase() { - -: 747: - 213: 748: } - -: 749: - -: 750: // ---------------------------------------------------------------------- - -: 751: // Invocation functions for output ports - -: 752: // ---------------------------------------------------------------------- - -: 753: - 360: 754: void CmdSequencerComponentBase :: - -: 755: comCmdOut_out( - -: 756: NATIVE_INT_TYPE portNum, - -: 757: Fw::ComBuffer &data, U32 context - -: 758: ) - -: 759: { - 360: 760: FW_ASSERT(portNum < this->getNum_comCmdOut_OutputPorts(),static_cast(portNum)); - 360: 761: this->m_comCmdOut_OutputPort[portNum].invoke(data, context); - 360: 762: } - -: 763: - 9: 764: void CmdSequencerComponentBase :: - -: 765: pingOut_out( - -: 766: NATIVE_INT_TYPE portNum, - -: 767: U32 key - -: 768: ) - -: 769: { - 9: 770: FW_ASSERT(portNum < this->getNum_pingOut_OutputPorts(),static_cast(portNum)); - 9: 771: this->m_pingOut_OutputPort[portNum].invoke(key); - 9: 772: } - -: 773: - 117: 774: void CmdSequencerComponentBase :: - -: 775: seqDone_out( - -: 776: NATIVE_INT_TYPE portNum, - -: 777: FwOpcodeType opCode, U32 cmdSeq, Fw::CommandResponse response - -: 778: ) - -: 779: { - 117: 780: FW_ASSERT(portNum < this->getNum_seqDone_OutputPorts(),static_cast(portNum)); - 117: 781: this->m_seqDone_OutputPort[portNum].invoke(opCode, cmdSeq, response); - 117: 782: } - -: 783: - -: 784: // ---------------------------------------------------------------------- - -: 785: // Getters for numbers of ports - -: 786: // ---------------------------------------------------------------------- - -: 787: - 639: 788: NATIVE_INT_TYPE CmdSequencerComponentBase :: - -: 789: getNum_cmdRegOut_OutputPorts(void) - -: 790: { - 639: 791: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 792: this->m_cmdRegOut_OutputPort - -: 793: ); - -: 794: } - -: 795: - -: 796:#if FW_ENABLE_TEXT_LOGGING == 1 - 639: 797: NATIVE_INT_TYPE CmdSequencerComponentBase :: - -: 798: getNum_LogText_OutputPorts(void) - -: 799: { - 639: 800: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 801: this->m_LogText_OutputPort - -: 802: ); - -: 803: } - -: 804:#endif - -: 805: - 648: 806: NATIVE_INT_TYPE CmdSequencerComponentBase :: - -: 807: getNum_pingIn_InputPorts(void) - -: 808: { - 648: 809: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 810: this->m_pingIn_InputPort - -: 811: ); - -: 812: } - -: 813: - 639: 814: NATIVE_INT_TYPE CmdSequencerComponentBase :: - -: 815: getNum_tlmOut_OutputPorts(void) - -: 816: { - 639: 817: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 818: this->m_tlmOut_OutputPort - -: 819: ); - -: 820: } - -: 821: - 639: 822: NATIVE_INT_TYPE CmdSequencerComponentBase :: - -: 823: getNum_cmdResponseOut_OutputPorts(void) - -: 824: { - 639: 825: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 826: this->m_cmdResponseOut_OutputPort - -: 827: ); - -: 828: } - -: 829: - 639: 830: NATIVE_INT_TYPE CmdSequencerComponentBase :: - -: 831: getNum_timeCaller_OutputPorts(void) - -: 832: { - 639: 833: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 834: this->m_timeCaller_OutputPort - -: 835: ); - -: 836: } - -: 837: - 999: 838: NATIVE_INT_TYPE CmdSequencerComponentBase :: - -: 839: getNum_comCmdOut_OutputPorts(void) - -: 840: { - 999: 841: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 842: this->m_comCmdOut_OutputPort - -: 843: ); - -: 844: } - -: 845: - 648: 846: NATIVE_INT_TYPE CmdSequencerComponentBase :: - -: 847: getNum_pingOut_OutputPorts(void) - -: 848: { - 648: 849: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 850: this->m_pingOut_OutputPort - -: 851: ); - -: 852: } - -: 853: - 981: 854: NATIVE_INT_TYPE CmdSequencerComponentBase :: - -: 855: getNum_cmdResponseIn_InputPorts(void) - -: 856: { - 981: 857: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 858: this->m_cmdResponseIn_InputPort - -: 859: ); - -: 860: } - -: 861: - 639: 862: NATIVE_INT_TYPE CmdSequencerComponentBase :: - -: 863: getNum_cmdIn_InputPorts(void) - -: 864: { - 639: 865: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 866: this->m_cmdIn_InputPort - -: 867: ); - -: 868: } - -: 869: - 747: 870: NATIVE_INT_TYPE CmdSequencerComponentBase :: - -: 871: getNum_schedIn_InputPorts(void) - -: 872: { - 747: 873: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 874: this->m_schedIn_InputPort - -: 875: ); - -: 876: } - -: 877: - 666: 878: NATIVE_INT_TYPE CmdSequencerComponentBase :: - -: 879: getNum_seqRunIn_InputPorts(void) - -: 880: { - 666: 881: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 882: this->m_seqRunIn_InputPort - -: 883: ); - -: 884: } - -: 885: - 639: 886: NATIVE_INT_TYPE CmdSequencerComponentBase :: - -: 887: getNum_logOut_OutputPorts(void) - -: 888: { - 639: 889: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 890: this->m_logOut_OutputPort - -: 891: ); - -: 892: } - -: 893: - 855: 894: NATIVE_INT_TYPE CmdSequencerComponentBase :: - -: 895: getNum_seqDone_OutputPorts(void) - -: 896: { - 855: 897: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 898: this->m_seqDone_OutputPort - -: 899: ); - -: 900: } - -: 901: - -: 902: // ---------------------------------------------------------------------- - -: 903: // Port connection status queries - -: 904: // ---------------------------------------------------------------------- - -: 905: - #####: 906: bool CmdSequencerComponentBase :: - -: 907: isConnected_cmdRegOut_OutputPort(NATIVE_INT_TYPE portNum) - -: 908: { - #####: 909: FW_ASSERT( - -: 910: portNum < this->getNum_cmdRegOut_OutputPorts(), - -: 911: static_cast(portNum) - #####: 912: ); - #####: 913: return this->m_cmdRegOut_OutputPort[portNum].isConnected(); - -: 914: } - -: 915: - -: 916:#if FW_ENABLE_TEXT_LOGGING == 1 - #####: 917: bool CmdSequencerComponentBase :: - -: 918: isConnected_LogText_OutputPort(NATIVE_INT_TYPE portNum) - -: 919: { - #####: 920: FW_ASSERT( - -: 921: portNum < this->getNum_LogText_OutputPorts(), - -: 922: static_cast(portNum) - #####: 923: ); - #####: 924: return this->m_LogText_OutputPort[portNum].isConnected(); - -: 925: } - -: 926:#endif - -: 927: - #####: 928: bool CmdSequencerComponentBase :: - -: 929: isConnected_tlmOut_OutputPort(NATIVE_INT_TYPE portNum) - -: 930: { - #####: 931: FW_ASSERT( - -: 932: portNum < this->getNum_tlmOut_OutputPorts(), - -: 933: static_cast(portNum) - #####: 934: ); - #####: 935: return this->m_tlmOut_OutputPort[portNum].isConnected(); - -: 936: } - -: 937: - #####: 938: bool CmdSequencerComponentBase :: - -: 939: isConnected_cmdResponseOut_OutputPort(NATIVE_INT_TYPE portNum) - -: 940: { - #####: 941: FW_ASSERT( - -: 942: portNum < this->getNum_cmdResponseOut_OutputPorts(), - -: 943: static_cast(portNum) - #####: 944: ); - #####: 945: return this->m_cmdResponseOut_OutputPort[portNum].isConnected(); - -: 946: } - -: 947: - #####: 948: bool CmdSequencerComponentBase :: - -: 949: isConnected_timeCaller_OutputPort(NATIVE_INT_TYPE portNum) - -: 950: { - #####: 951: FW_ASSERT( - -: 952: portNum < this->getNum_timeCaller_OutputPorts(), - -: 953: static_cast(portNum) - #####: 954: ); - #####: 955: return this->m_timeCaller_OutputPort[portNum].isConnected(); - -: 956: } - -: 957: - #####: 958: bool CmdSequencerComponentBase :: - -: 959: isConnected_comCmdOut_OutputPort(NATIVE_INT_TYPE portNum) - -: 960: { - #####: 961: FW_ASSERT( - -: 962: portNum < this->getNum_comCmdOut_OutputPorts(), - -: 963: static_cast(portNum) - #####: 964: ); - #####: 965: return this->m_comCmdOut_OutputPort[portNum].isConnected(); - -: 966: } - -: 967: - #####: 968: bool CmdSequencerComponentBase :: - -: 969: isConnected_pingOut_OutputPort(NATIVE_INT_TYPE portNum) - -: 970: { - #####: 971: FW_ASSERT( - -: 972: portNum < this->getNum_pingOut_OutputPorts(), - -: 973: static_cast(portNum) - #####: 974: ); - #####: 975: return this->m_pingOut_OutputPort[portNum].isConnected(); - -: 976: } - -: 977: - #####: 978: bool CmdSequencerComponentBase :: - -: 979: isConnected_logOut_OutputPort(NATIVE_INT_TYPE portNum) - -: 980: { - #####: 981: FW_ASSERT( - -: 982: portNum < this->getNum_logOut_OutputPorts(), - -: 983: static_cast(portNum) - #####: 984: ); - #####: 985: return this->m_logOut_OutputPort[portNum].isConnected(); - -: 986: } - -: 987: - 99: 988: bool CmdSequencerComponentBase :: - -: 989: isConnected_seqDone_OutputPort(NATIVE_INT_TYPE portNum) - -: 990: { - 99: 991: FW_ASSERT( - -: 992: portNum < this->getNum_seqDone_OutputPorts(), - -: 993: static_cast(portNum) - 99: 994: ); - 99: 995: return this->m_seqDone_OutputPort[portNum].isConnected(); - -: 996: } - -: 997: - -: 998: // ---------------------------------------------------------------------- - -: 999: // Calls for messages received on command input ports - -: 1000: // ---------------------------------------------------------------------- - -: 1001: - 601: 1002: void CmdSequencerComponentBase :: - -: 1003: m_p_cmdIn_in( - -: 1004: Fw::PassiveComponentBase* callComp, - -: 1005: NATIVE_INT_TYPE portNum, - -: 1006: FwOpcodeType opCode, - -: 1007: U32 cmdSeq, - -: 1008: Fw::CmdArgBuffer &args - -: 1009: ) - -: 1010: { - -: 1011: - -: 1012: // Select base class function based on opcode - 601: 1013: FW_ASSERT(callComp); - -: 1014: CmdSequencerComponentBase* compPtr = - 601: 1015: (CmdSequencerComponentBase*) callComp; - -: 1016: - 601: 1017: const U32 idBase = callComp->getIdBase(); - 601: 1018: FW_ASSERT(opCode >= idBase, opCode, idBase); - 601: 1019: switch (opCode - idBase) { - -: 1020: - -: 1021: case OPCODE_CS_RUN: /*!< Run a command sequence file */ - -: 1022: compPtr->CS_Run_cmdHandlerBase( - -: 1023: opCode, - -: 1024: cmdSeq, - -: 1025: args - 190: 1026: ); - 190: 1027: break; - -: 1028: - -: 1029: case OPCODE_CS_VALIDATE: /*!< Validate a command sequence file */ - -: 1030: compPtr->CS_Validate_cmdHandlerBase( - -: 1031: opCode, - -: 1032: cmdSeq, - -: 1033: args - 231: 1034: ); - 231: 1035: break; - -: 1036: - -: 1037: case OPCODE_CS_CANCEL: /*!< Cancel a command sequence */ - -: 1038: compPtr->CS_Cancel_cmdHandlerBase( - -: 1039: opCode, - -: 1040: cmdSeq, - -: 1041: args - 18: 1042: ); - 18: 1043: break; - -: 1044: - -: 1045: case OPCODE_CS_START: /*!< Start running a command sequence */ - -: 1046: compPtr->CS_Start_cmdHandlerBase( - -: 1047: opCode, - -: 1048: cmdSeq, - -: 1049: args - 36: 1050: ); - 36: 1051: break; - -: 1052: - -: 1053: case OPCODE_CS_STEP: /*!< Perform one step in a command sequence. Valid only if CmdSequencer is in MANUAL run mode. */ - -: 1054: compPtr->CS_Step_cmdHandlerBase( - -: 1055: opCode, - -: 1056: cmdSeq, - -: 1057: args - 81: 1058: ); - 81: 1059: break; - -: 1060: - -: 1061: case OPCODE_CS_AUTO: /*!< Set the run mode to AUTO. */ - -: 1062: compPtr->CS_Auto_cmdHandlerBase( - -: 1063: opCode, - -: 1064: cmdSeq, - -: 1065: args - 18: 1066: ); - 18: 1067: break; - -: 1068: - -: 1069: case OPCODE_CS_MANUAL: /*!< Set the run mode to MANUAL. */ - -: 1070: compPtr->CS_Manual_cmdHandlerBase( - -: 1071: opCode, - -: 1072: cmdSeq, - -: 1073: args - 27: 1074: ); - 27: 1075: break; - -: 1076: - -: 1077: default: { - -: 1078: compPtr->cmdResponse_out( - -: 1079: opCode,cmdSeq, - -: 1080: Fw::COMMAND_INVALID_OPCODE - #####: 1081: ); - #####: 1082: break; - -: 1083: } - -: 1084: - -: 1085: } - -: 1086: - 601: 1087: } - -: 1088: - 601: 1089: void CmdSequencerComponentBase :: - -: 1090: cmdResponse_out( - -: 1091: FwOpcodeType opCode, - -: 1092: U32 cmdSeq, - -: 1093: Fw::CommandResponse response - -: 1094: ) - -: 1095: { - 601: 1096: FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected()); - 601: 1097: this->m_cmdResponseOut_OutputPort[0].invoke(opCode,cmdSeq,response); - 601: 1098: } - -: 1099: - -: 1100: // ---------------------------------------------------------------------- - -: 1101: // Base class command functions - -: 1102: // ---------------------------------------------------------------------- - -: 1103: - 190: 1104: void CmdSequencerComponentBase :: - -: 1105: CS_Run_cmdHandlerBase( - -: 1106: FwOpcodeType opCode, - -: 1107: U32 cmdSeq, - -: 1108: Fw::CmdArgBuffer &args - -: 1109: ) - -: 1110: { - -: 1111: - -: 1112: // Call pre-message hook - 190: 1113: this->CS_Run_preMsgHook(opCode,cmdSeq); - -: 1114: - -: 1115: // Defer deserializing arguments to the message dispatcher - -: 1116: // to avoid deserializing and reserializing just for IPC - 380: 1117: ComponentIpcSerializableBuffer msg; - 190: 1118: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 1119: - -: 1120: // Serialize for IPC - 190: 1121: _status = msg.serialize((NATIVE_INT_TYPE)CMD_CS_RUN); - -: 1122: FW_ASSERT ( - -: 1123: _status == Fw::FW_SERIALIZE_OK, - -: 1124: static_cast(_status) - 190: 1125: ); - -: 1126: - -: 1127: // Fake port number to make message dequeue work - 190: 1128: NATIVE_INT_TYPE port = 0; - 190: 1129: _status = msg.serialize(port); - -: 1130: FW_ASSERT ( - -: 1131: _status == Fw::FW_SERIALIZE_OK, - -: 1132: static_cast(_status) - 190: 1133: ); - -: 1134: - 190: 1135: _status = msg.serialize(opCode); - -: 1136: FW_ASSERT ( - -: 1137: _status == Fw::FW_SERIALIZE_OK, - -: 1138: static_cast(_status) - 190: 1139: ); - -: 1140: - 190: 1141: _status = msg.serialize(cmdSeq); - -: 1142: FW_ASSERT ( - -: 1143: _status == Fw::FW_SERIALIZE_OK, - -: 1144: static_cast(_status) - 190: 1145: ); - -: 1146: - 190: 1147: _status = msg.serialize(args); - -: 1148: FW_ASSERT ( - -: 1149: _status == Fw::FW_SERIALIZE_OK, - -: 1150: static_cast(_status) - 190: 1151: ); - -: 1152: - -: 1153: // send message - -: 1154: Os::Queue::QueueBlocking _block = - 190: 1155: Os::Queue::QUEUE_NONBLOCKING; - -: 1156: Os::Queue::QueueStatus qStatus = - 190: 1157: this->m_queue.send(msg, 0,_block); - -: 1158: FW_ASSERT( - -: 1159: qStatus == Os::Queue::QUEUE_OK, - -: 1160: static_cast(qStatus) - 190: 1161: ); - -: 1162: - 190: 1163: } - -: 1164: - 190: 1165: void CmdSequencerComponentBase:: - -: 1166: CS_Run_preMsgHook( - -: 1167: FwOpcodeType opCode, - -: 1168: U32 cmdSeq - -: 1169: ) - -: 1170: { - -: 1171: // Defaults to no-op; can be overridden - 190: 1172: } - -: 1173: - 231: 1174: void CmdSequencerComponentBase :: - -: 1175: CS_Validate_cmdHandlerBase( - -: 1176: FwOpcodeType opCode, - -: 1177: U32 cmdSeq, - -: 1178: Fw::CmdArgBuffer &args - -: 1179: ) - -: 1180: { - -: 1181: - -: 1182: // Call pre-message hook - 231: 1183: this->CS_Validate_preMsgHook(opCode,cmdSeq); - -: 1184: - -: 1185: // Defer deserializing arguments to the message dispatcher - -: 1186: // to avoid deserializing and reserializing just for IPC - 462: 1187: ComponentIpcSerializableBuffer msg; - 231: 1188: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 1189: - -: 1190: // Serialize for IPC - 231: 1191: _status = msg.serialize((NATIVE_INT_TYPE)CMD_CS_VALIDATE); - -: 1192: FW_ASSERT ( - -: 1193: _status == Fw::FW_SERIALIZE_OK, - -: 1194: static_cast(_status) - 231: 1195: ); - -: 1196: - -: 1197: // Fake port number to make message dequeue work - 231: 1198: NATIVE_INT_TYPE port = 0; - 231: 1199: _status = msg.serialize(port); - -: 1200: FW_ASSERT ( - -: 1201: _status == Fw::FW_SERIALIZE_OK, - -: 1202: static_cast(_status) - 231: 1203: ); - -: 1204: - 231: 1205: _status = msg.serialize(opCode); - -: 1206: FW_ASSERT ( - -: 1207: _status == Fw::FW_SERIALIZE_OK, - -: 1208: static_cast(_status) - 231: 1209: ); - -: 1210: - 231: 1211: _status = msg.serialize(cmdSeq); - -: 1212: FW_ASSERT ( - -: 1213: _status == Fw::FW_SERIALIZE_OK, - -: 1214: static_cast(_status) - 231: 1215: ); - -: 1216: - 231: 1217: _status = msg.serialize(args); - -: 1218: FW_ASSERT ( - -: 1219: _status == Fw::FW_SERIALIZE_OK, - -: 1220: static_cast(_status) - 231: 1221: ); - -: 1222: - -: 1223: // send message - -: 1224: Os::Queue::QueueBlocking _block = - 231: 1225: Os::Queue::QUEUE_NONBLOCKING; - -: 1226: Os::Queue::QueueStatus qStatus = - 231: 1227: this->m_queue.send(msg, 0,_block); - -: 1228: FW_ASSERT( - -: 1229: qStatus == Os::Queue::QUEUE_OK, - -: 1230: static_cast(qStatus) - 231: 1231: ); - -: 1232: - 231: 1233: } - -: 1234: - 231: 1235: void CmdSequencerComponentBase:: - -: 1236: CS_Validate_preMsgHook( - -: 1237: FwOpcodeType opCode, - -: 1238: U32 cmdSeq - -: 1239: ) - -: 1240: { - -: 1241: // Defaults to no-op; can be overridden - 231: 1242: } - -: 1243: - 18: 1244: void CmdSequencerComponentBase :: - -: 1245: CS_Cancel_cmdHandlerBase( - -: 1246: FwOpcodeType opCode, - -: 1247: U32 cmdSeq, - -: 1248: Fw::CmdArgBuffer &args - -: 1249: ) - -: 1250: { - -: 1251: - -: 1252: // Call pre-message hook - 18: 1253: this->CS_Cancel_preMsgHook(opCode,cmdSeq); - -: 1254: - -: 1255: // Defer deserializing arguments to the message dispatcher - -: 1256: // to avoid deserializing and reserializing just for IPC - 36: 1257: ComponentIpcSerializableBuffer msg; - 18: 1258: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 1259: - -: 1260: // Serialize for IPC - 18: 1261: _status = msg.serialize((NATIVE_INT_TYPE)CMD_CS_CANCEL); - -: 1262: FW_ASSERT ( - -: 1263: _status == Fw::FW_SERIALIZE_OK, - -: 1264: static_cast(_status) - 18: 1265: ); - -: 1266: - -: 1267: // Fake port number to make message dequeue work - 18: 1268: NATIVE_INT_TYPE port = 0; - 18: 1269: _status = msg.serialize(port); - -: 1270: FW_ASSERT ( - -: 1271: _status == Fw::FW_SERIALIZE_OK, - -: 1272: static_cast(_status) - 18: 1273: ); - -: 1274: - 18: 1275: _status = msg.serialize(opCode); - -: 1276: FW_ASSERT ( - -: 1277: _status == Fw::FW_SERIALIZE_OK, - -: 1278: static_cast(_status) - 18: 1279: ); - -: 1280: - 18: 1281: _status = msg.serialize(cmdSeq); - -: 1282: FW_ASSERT ( - -: 1283: _status == Fw::FW_SERIALIZE_OK, - -: 1284: static_cast(_status) - 18: 1285: ); - -: 1286: - 18: 1287: _status = msg.serialize(args); - -: 1288: FW_ASSERT ( - -: 1289: _status == Fw::FW_SERIALIZE_OK, - -: 1290: static_cast(_status) - 18: 1291: ); - -: 1292: - -: 1293: // send message - -: 1294: Os::Queue::QueueBlocking _block = - 18: 1295: Os::Queue::QUEUE_NONBLOCKING; - -: 1296: Os::Queue::QueueStatus qStatus = - 18: 1297: this->m_queue.send(msg, 0,_block); - -: 1298: FW_ASSERT( - -: 1299: qStatus == Os::Queue::QUEUE_OK, - -: 1300: static_cast(qStatus) - 18: 1301: ); - -: 1302: - 18: 1303: } - -: 1304: - 18: 1305: void CmdSequencerComponentBase:: - -: 1306: CS_Cancel_preMsgHook( - -: 1307: FwOpcodeType opCode, - -: 1308: U32 cmdSeq - -: 1309: ) - -: 1310: { - -: 1311: // Defaults to no-op; can be overridden - 18: 1312: } - -: 1313: - 36: 1314: void CmdSequencerComponentBase :: - -: 1315: CS_Start_cmdHandlerBase( - -: 1316: FwOpcodeType opCode, - -: 1317: U32 cmdSeq, - -: 1318: Fw::CmdArgBuffer &args - -: 1319: ) - -: 1320: { - -: 1321: - -: 1322: // Call pre-message hook - 36: 1323: this->CS_Start_preMsgHook(opCode,cmdSeq); - -: 1324: - -: 1325: // Defer deserializing arguments to the message dispatcher - -: 1326: // to avoid deserializing and reserializing just for IPC - 72: 1327: ComponentIpcSerializableBuffer msg; - 36: 1328: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 1329: - -: 1330: // Serialize for IPC - 36: 1331: _status = msg.serialize((NATIVE_INT_TYPE)CMD_CS_START); - -: 1332: FW_ASSERT ( - -: 1333: _status == Fw::FW_SERIALIZE_OK, - -: 1334: static_cast(_status) - 36: 1335: ); - -: 1336: - -: 1337: // Fake port number to make message dequeue work - 36: 1338: NATIVE_INT_TYPE port = 0; - 36: 1339: _status = msg.serialize(port); - -: 1340: FW_ASSERT ( - -: 1341: _status == Fw::FW_SERIALIZE_OK, - -: 1342: static_cast(_status) - 36: 1343: ); - -: 1344: - 36: 1345: _status = msg.serialize(opCode); - -: 1346: FW_ASSERT ( - -: 1347: _status == Fw::FW_SERIALIZE_OK, - -: 1348: static_cast(_status) - 36: 1349: ); - -: 1350: - 36: 1351: _status = msg.serialize(cmdSeq); - -: 1352: FW_ASSERT ( - -: 1353: _status == Fw::FW_SERIALIZE_OK, - -: 1354: static_cast(_status) - 36: 1355: ); - -: 1356: - 36: 1357: _status = msg.serialize(args); - -: 1358: FW_ASSERT ( - -: 1359: _status == Fw::FW_SERIALIZE_OK, - -: 1360: static_cast(_status) - 36: 1361: ); - -: 1362: - -: 1363: // send message - -: 1364: Os::Queue::QueueBlocking _block = - 36: 1365: Os::Queue::QUEUE_NONBLOCKING; - -: 1366: Os::Queue::QueueStatus qStatus = - 36: 1367: this->m_queue.send(msg, 0,_block); - -: 1368: FW_ASSERT( - -: 1369: qStatus == Os::Queue::QUEUE_OK, - -: 1370: static_cast(qStatus) - 36: 1371: ); - -: 1372: - 36: 1373: } - -: 1374: - 36: 1375: void CmdSequencerComponentBase:: - -: 1376: CS_Start_preMsgHook( - -: 1377: FwOpcodeType opCode, - -: 1378: U32 cmdSeq - -: 1379: ) - -: 1380: { - -: 1381: // Defaults to no-op; can be overridden - 36: 1382: } - -: 1383: - 81: 1384: void CmdSequencerComponentBase :: - -: 1385: CS_Step_cmdHandlerBase( - -: 1386: FwOpcodeType opCode, - -: 1387: U32 cmdSeq, - -: 1388: Fw::CmdArgBuffer &args - -: 1389: ) - -: 1390: { - -: 1391: - -: 1392: // Call pre-message hook - 81: 1393: this->CS_Step_preMsgHook(opCode,cmdSeq); - -: 1394: - -: 1395: // Defer deserializing arguments to the message dispatcher - -: 1396: // to avoid deserializing and reserializing just for IPC - 162: 1397: ComponentIpcSerializableBuffer msg; - 81: 1398: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 1399: - -: 1400: // Serialize for IPC - 81: 1401: _status = msg.serialize((NATIVE_INT_TYPE)CMD_CS_STEP); - -: 1402: FW_ASSERT ( - -: 1403: _status == Fw::FW_SERIALIZE_OK, - -: 1404: static_cast(_status) - 81: 1405: ); - -: 1406: - -: 1407: // Fake port number to make message dequeue work - 81: 1408: NATIVE_INT_TYPE port = 0; - 81: 1409: _status = msg.serialize(port); - -: 1410: FW_ASSERT ( - -: 1411: _status == Fw::FW_SERIALIZE_OK, - -: 1412: static_cast(_status) - 81: 1413: ); - -: 1414: - 81: 1415: _status = msg.serialize(opCode); - -: 1416: FW_ASSERT ( - -: 1417: _status == Fw::FW_SERIALIZE_OK, - -: 1418: static_cast(_status) - 81: 1419: ); - -: 1420: - 81: 1421: _status = msg.serialize(cmdSeq); - -: 1422: FW_ASSERT ( - -: 1423: _status == Fw::FW_SERIALIZE_OK, - -: 1424: static_cast(_status) - 81: 1425: ); - -: 1426: - 81: 1427: _status = msg.serialize(args); - -: 1428: FW_ASSERT ( - -: 1429: _status == Fw::FW_SERIALIZE_OK, - -: 1430: static_cast(_status) - 81: 1431: ); - -: 1432: - -: 1433: // send message - -: 1434: Os::Queue::QueueBlocking _block = - 81: 1435: Os::Queue::QUEUE_NONBLOCKING; - -: 1436: Os::Queue::QueueStatus qStatus = - 81: 1437: this->m_queue.send(msg, 0,_block); - -: 1438: FW_ASSERT( - -: 1439: qStatus == Os::Queue::QUEUE_OK, - -: 1440: static_cast(qStatus) - 81: 1441: ); - -: 1442: - 81: 1443: } - -: 1444: - 81: 1445: void CmdSequencerComponentBase:: - -: 1446: CS_Step_preMsgHook( - -: 1447: FwOpcodeType opCode, - -: 1448: U32 cmdSeq - -: 1449: ) - -: 1450: { - -: 1451: // Defaults to no-op; can be overridden - 81: 1452: } - -: 1453: - 18: 1454: void CmdSequencerComponentBase :: - -: 1455: CS_Auto_cmdHandlerBase( - -: 1456: FwOpcodeType opCode, - -: 1457: U32 cmdSeq, - -: 1458: Fw::CmdArgBuffer &args - -: 1459: ) - -: 1460: { - -: 1461: - -: 1462: // Call pre-message hook - 18: 1463: this->CS_Auto_preMsgHook(opCode,cmdSeq); - -: 1464: - -: 1465: // Defer deserializing arguments to the message dispatcher - -: 1466: // to avoid deserializing and reserializing just for IPC - 36: 1467: ComponentIpcSerializableBuffer msg; - 18: 1468: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 1469: - -: 1470: // Serialize for IPC - 18: 1471: _status = msg.serialize((NATIVE_INT_TYPE)CMD_CS_AUTO); - -: 1472: FW_ASSERT ( - -: 1473: _status == Fw::FW_SERIALIZE_OK, - -: 1474: static_cast(_status) - 18: 1475: ); - -: 1476: - -: 1477: // Fake port number to make message dequeue work - 18: 1478: NATIVE_INT_TYPE port = 0; - 18: 1479: _status = msg.serialize(port); - -: 1480: FW_ASSERT ( - -: 1481: _status == Fw::FW_SERIALIZE_OK, - -: 1482: static_cast(_status) - 18: 1483: ); - -: 1484: - 18: 1485: _status = msg.serialize(opCode); - -: 1486: FW_ASSERT ( - -: 1487: _status == Fw::FW_SERIALIZE_OK, - -: 1488: static_cast(_status) - 18: 1489: ); - -: 1490: - 18: 1491: _status = msg.serialize(cmdSeq); - -: 1492: FW_ASSERT ( - -: 1493: _status == Fw::FW_SERIALIZE_OK, - -: 1494: static_cast(_status) - 18: 1495: ); - -: 1496: - 18: 1497: _status = msg.serialize(args); - -: 1498: FW_ASSERT ( - -: 1499: _status == Fw::FW_SERIALIZE_OK, - -: 1500: static_cast(_status) - 18: 1501: ); - -: 1502: - -: 1503: // send message - -: 1504: Os::Queue::QueueBlocking _block = - 18: 1505: Os::Queue::QUEUE_NONBLOCKING; - -: 1506: Os::Queue::QueueStatus qStatus = - 18: 1507: this->m_queue.send(msg, 0,_block); - -: 1508: FW_ASSERT( - -: 1509: qStatus == Os::Queue::QUEUE_OK, - -: 1510: static_cast(qStatus) - 18: 1511: ); - -: 1512: - 18: 1513: } - -: 1514: - 18: 1515: void CmdSequencerComponentBase:: - -: 1516: CS_Auto_preMsgHook( - -: 1517: FwOpcodeType opCode, - -: 1518: U32 cmdSeq - -: 1519: ) - -: 1520: { - -: 1521: // Defaults to no-op; can be overridden - 18: 1522: } - -: 1523: - 27: 1524: void CmdSequencerComponentBase :: - -: 1525: CS_Manual_cmdHandlerBase( - -: 1526: FwOpcodeType opCode, - -: 1527: U32 cmdSeq, - -: 1528: Fw::CmdArgBuffer &args - -: 1529: ) - -: 1530: { - -: 1531: - -: 1532: // Call pre-message hook - 27: 1533: this->CS_Manual_preMsgHook(opCode,cmdSeq); - -: 1534: - -: 1535: // Defer deserializing arguments to the message dispatcher - -: 1536: // to avoid deserializing and reserializing just for IPC - 54: 1537: ComponentIpcSerializableBuffer msg; - 27: 1538: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 1539: - -: 1540: // Serialize for IPC - 27: 1541: _status = msg.serialize((NATIVE_INT_TYPE)CMD_CS_MANUAL); - -: 1542: FW_ASSERT ( - -: 1543: _status == Fw::FW_SERIALIZE_OK, - -: 1544: static_cast(_status) - 27: 1545: ); - -: 1546: - -: 1547: // Fake port number to make message dequeue work - 27: 1548: NATIVE_INT_TYPE port = 0; - 27: 1549: _status = msg.serialize(port); - -: 1550: FW_ASSERT ( - -: 1551: _status == Fw::FW_SERIALIZE_OK, - -: 1552: static_cast(_status) - 27: 1553: ); - -: 1554: - 27: 1555: _status = msg.serialize(opCode); - -: 1556: FW_ASSERT ( - -: 1557: _status == Fw::FW_SERIALIZE_OK, - -: 1558: static_cast(_status) - 27: 1559: ); - -: 1560: - 27: 1561: _status = msg.serialize(cmdSeq); - -: 1562: FW_ASSERT ( - -: 1563: _status == Fw::FW_SERIALIZE_OK, - -: 1564: static_cast(_status) - 27: 1565: ); - -: 1566: - 27: 1567: _status = msg.serialize(args); - -: 1568: FW_ASSERT ( - -: 1569: _status == Fw::FW_SERIALIZE_OK, - -: 1570: static_cast(_status) - 27: 1571: ); - -: 1572: - -: 1573: // send message - -: 1574: Os::Queue::QueueBlocking _block = - 27: 1575: Os::Queue::QUEUE_NONBLOCKING; - -: 1576: Os::Queue::QueueStatus qStatus = - 27: 1577: this->m_queue.send(msg, 0,_block); - -: 1578: FW_ASSERT( - -: 1579: qStatus == Os::Queue::QUEUE_OK, - -: 1580: static_cast(qStatus) - 27: 1581: ); - -: 1582: - 27: 1583: } - -: 1584: - 27: 1585: void CmdSequencerComponentBase:: - -: 1586: CS_Manual_preMsgHook( - -: 1587: FwOpcodeType opCode, - -: 1588: U32 cmdSeq - -: 1589: ) - -: 1590: { - -: 1591: // Defaults to no-op; can be overridden - 27: 1592: } - -: 1593: - -: 1594: // ---------------------------------------------------------------------- - -: 1595: // Telemetry write functions - -: 1596: // ---------------------------------------------------------------------- - -: 1597: - 216: 1598: void CmdSequencerComponentBase :: - -: 1599: tlmWrite_CS_LoadCommands(U32 arg) - -: 1600: { - -: 1601: - 216: 1602: if (this->m_tlmOut_OutputPort[0].isConnected()) { - 432: 1603: Fw::Time _tlmTime; - 216: 1604: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 216: 1605: this->m_timeCaller_OutputPort[0].invoke( _tlmTime); - -: 1606: } - 432: 1607: Fw::TlmBuffer _tlmBuff; - 216: 1608: Fw::SerializeStatus _stat = _tlmBuff.serialize(arg); - -: 1609: FW_ASSERT( - -: 1610: _stat == Fw::FW_SERIALIZE_OK, - -: 1611: static_cast(_stat) - 216: 1612: ); - -: 1613: - -: 1614: FwChanIdType _id; - -: 1615: - 216: 1616: _id = this->getIdBase() + CHANNELID_CS_LOADCOMMANDS; - -: 1617: - 216: 1618: this->m_tlmOut_OutputPort[0].invoke( - -: 1619: _id, - -: 1620: _tlmTime, - -: 1621: _tlmBuff - 216: 1622: ); - -: 1623: } - -: 1624: - 216: 1625: } - -: 1626: - 9: 1627: void CmdSequencerComponentBase :: - -: 1628: tlmWrite_CS_CancelCommands(U32 arg) - -: 1629: { - -: 1630: - 9: 1631: if (this->m_tlmOut_OutputPort[0].isConnected()) { - 18: 1632: Fw::Time _tlmTime; - 9: 1633: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 9: 1634: this->m_timeCaller_OutputPort[0].invoke( _tlmTime); - -: 1635: } - 18: 1636: Fw::TlmBuffer _tlmBuff; - 9: 1637: Fw::SerializeStatus _stat = _tlmBuff.serialize(arg); - -: 1638: FW_ASSERT( - -: 1639: _stat == Fw::FW_SERIALIZE_OK, - -: 1640: static_cast(_stat) - 9: 1641: ); - -: 1642: - -: 1643: FwChanIdType _id; - -: 1644: - 9: 1645: _id = this->getIdBase() + CHANNELID_CS_CANCELCOMMANDS; - -: 1646: - 9: 1647: this->m_tlmOut_OutputPort[0].invoke( - -: 1648: _id, - -: 1649: _tlmTime, - -: 1650: _tlmBuff - 9: 1651: ); - -: 1652: } - -: 1653: - 9: 1654: } - -: 1655: - 207: 1656: void CmdSequencerComponentBase :: - -: 1657: tlmWrite_CS_Errors(U32 arg) - -: 1658: { - -: 1659: - 207: 1660: if (this->m_tlmOut_OutputPort[0].isConnected()) { - 414: 1661: Fw::Time _tlmTime; - 207: 1662: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 207: 1663: this->m_timeCaller_OutputPort[0].invoke( _tlmTime); - -: 1664: } - 414: 1665: Fw::TlmBuffer _tlmBuff; - 207: 1666: Fw::SerializeStatus _stat = _tlmBuff.serialize(arg); - -: 1667: FW_ASSERT( - -: 1668: _stat == Fw::FW_SERIALIZE_OK, - -: 1669: static_cast(_stat) - 207: 1670: ); - -: 1671: - -: 1672: FwChanIdType _id; - -: 1673: - 207: 1674: _id = this->getIdBase() + CHANNELID_CS_ERRORS; - -: 1675: - 207: 1676: this->m_tlmOut_OutputPort[0].invoke( - -: 1677: _id, - -: 1678: _tlmTime, - -: 1679: _tlmBuff - 207: 1680: ); - -: 1681: } - -: 1682: - 207: 1683: } - -: 1684: - 324: 1685: void CmdSequencerComponentBase :: - -: 1686: tlmWrite_CS_CommandsExecuted(U32 arg) - -: 1687: { - -: 1688: - 324: 1689: if (this->m_tlmOut_OutputPort[0].isConnected()) { - 648: 1690: Fw::Time _tlmTime; - 324: 1691: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 324: 1692: this->m_timeCaller_OutputPort[0].invoke( _tlmTime); - -: 1693: } - 648: 1694: Fw::TlmBuffer _tlmBuff; - 324: 1695: Fw::SerializeStatus _stat = _tlmBuff.serialize(arg); - -: 1696: FW_ASSERT( - -: 1697: _stat == Fw::FW_SERIALIZE_OK, - -: 1698: static_cast(_stat) - 324: 1699: ); - -: 1700: - -: 1701: FwChanIdType _id; - -: 1702: - 324: 1703: _id = this->getIdBase() + CHANNELID_CS_COMMANDSEXECUTED; - -: 1704: - 324: 1705: this->m_tlmOut_OutputPort[0].invoke( - -: 1706: _id, - -: 1707: _tlmTime, - -: 1708: _tlmBuff - 324: 1709: ); - -: 1710: } - -: 1711: - 324: 1712: } - -: 1713: - 72: 1714: void CmdSequencerComponentBase :: - -: 1715: tlmWrite_CS_SequencesCompleted(U32 arg) - -: 1716: { - -: 1717: - 72: 1718: if (this->m_tlmOut_OutputPort[0].isConnected()) { - 144: 1719: Fw::Time _tlmTime; - 72: 1720: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 72: 1721: this->m_timeCaller_OutputPort[0].invoke( _tlmTime); - -: 1722: } - 144: 1723: Fw::TlmBuffer _tlmBuff; - 72: 1724: Fw::SerializeStatus _stat = _tlmBuff.serialize(arg); - -: 1725: FW_ASSERT( - -: 1726: _stat == Fw::FW_SERIALIZE_OK, - -: 1727: static_cast(_stat) - 72: 1728: ); - -: 1729: - -: 1730: FwChanIdType _id; - -: 1731: - 72: 1732: _id = this->getIdBase() + CHANNELID_CS_SEQUENCESCOMPLETED; - -: 1733: - 72: 1734: this->m_tlmOut_OutputPort[0].invoke( - -: 1735: _id, - -: 1736: _tlmTime, - -: 1737: _tlmBuff - 72: 1738: ); - -: 1739: } - -: 1740: - 72: 1741: } - -: 1742: - -: 1743: // ---------------------------------------------------------------------- - -: 1744: // Time - -: 1745: // ---------------------------------------------------------------------- - -: 1746: - 943: 1747: Fw::Time CmdSequencerComponentBase :: - -: 1748: getTime(void) - -: 1749: { - 943: 1750: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 1886: 1751: Fw::Time _time; - 943: 1752: this->m_timeCaller_OutputPort[0].invoke(_time); - 943: 1753: return _time; - -: 1754: } else { - #####: 1755: return Fw::Time(TB_NONE,0,0); - -: 1756: } - -: 1757: } - -: 1758: - -: 1759: // ---------------------------------------------------------------------- - -: 1760: // Event handling functions - -: 1761: // ---------------------------------------------------------------------- - -: 1762: - 216: 1763: void CmdSequencerComponentBase :: - -: 1764: log_ACTIVITY_LO_CS_SequenceLoaded( - -: 1765: Fw::LogStringArg& fileName - -: 1766: ) - -: 1767: { - -: 1768: - -: 1769: - -: 1770: // Get the time - 432: 1771: Fw::Time _logTime; - 216: 1772: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 216: 1773: this->m_timeCaller_OutputPort[0].invoke( _logTime); - -: 1774: } - -: 1775: - 216: 1776: FwEventIdType _id = static_cast(0); - -: 1777: - 216: 1778: _id = this->getIdBase() + EVENTID_CS_SEQUENCELOADED; - -: 1779: - -: 1780: // Emit the event on the log port - 216: 1781: if (this->m_logOut_OutputPort[0].isConnected()) { - -: 1782: - 432: 1783: Fw::LogBuffer _logBuff; - 216: 1784: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 1785: - -: 1786:#if FW_AMPCS_COMPATIBLE - -: 1787: // Serialize the number of arguments - -: 1788: _status = _logBuff.serialize(static_cast(1)); - -: 1789: FW_ASSERT( - -: 1790: _status == Fw::FW_SERIALIZE_OK, - -: 1791: static_cast(_status) - -: 1792: ); - -: 1793:#endif - -: 1794: - 216: 1795: fileName.setMaxSerialize(60); - 216: 1796: _status = _logBuff.serialize(fileName); - -: 1797: FW_ASSERT( - -: 1798: _status == Fw::FW_SERIALIZE_OK, - -: 1799: static_cast(_status) - 216: 1800: ); - -: 1801: - -: 1802: - 216: 1803: this->m_logOut_OutputPort[0].invoke( - -: 1804: _id, - -: 1805: _logTime,Fw::LOG_ACTIVITY_LO, - -: 1806: _logBuff - 216: 1807: ); - -: 1808: - -: 1809: } - -: 1810: - -: 1811: // Emit the event on the text log port - -: 1812:#if FW_ENABLE_TEXT_LOGGING - 216: 1813: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 1814: - -: 1815:#if FW_OBJECT_NAMES == 1 - -: 1816: const char* _formatString = - 216: 1817: "(%s) %s: Loaded sequence %s"; - -: 1818:#else - -: 1819: const char* _formatString = - -: 1820: "%s: Loaded sequence %s"; - -: 1821:#endif - -: 1822: - -: 1823: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 1824: - 216: 1825: (void) snprintf( - -: 1826: _textBuffer, - -: 1827: FW_LOG_TEXT_BUFFER_SIZE, - -: 1828: _formatString, - -: 1829:#if FW_OBJECT_NAMES == 1 - -: 1830: this->m_objName, - -: 1831:#endif - -: 1832: "CS_SequenceLoaded " - 216: 1833: , fileName.toChar() - 216: 1834: ); - -: 1835: - -: 1836: // Null terminate - 216: 1837: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 432: 1838: Fw::TextLogString _logString = _textBuffer; - 216: 1839: this->m_LogText_OutputPort[0].invoke( - -: 1840: _id, - -: 1841: _logTime,Fw::TEXT_LOG_ACTIVITY_LO, - -: 1842: _logString - 216: 1843: ); - -: 1844: - -: 1845: } - -: 1846:#endif - -: 1847: - 216: 1848: } - -: 1849: - -: 1850: - 9: 1851: void CmdSequencerComponentBase :: - -: 1852: log_ACTIVITY_HI_CS_SequenceCanceled( - -: 1853: Fw::LogStringArg& fileName - -: 1854: ) - -: 1855: { - -: 1856: - -: 1857: - -: 1858: // Get the time - 18: 1859: Fw::Time _logTime; - 9: 1860: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 9: 1861: this->m_timeCaller_OutputPort[0].invoke( _logTime); - -: 1862: } - -: 1863: - 9: 1864: FwEventIdType _id = static_cast(0); - -: 1865: - 9: 1866: _id = this->getIdBase() + EVENTID_CS_SEQUENCECANCELED; - -: 1867: - -: 1868: // Emit the event on the log port - 9: 1869: if (this->m_logOut_OutputPort[0].isConnected()) { - -: 1870: - 18: 1871: Fw::LogBuffer _logBuff; - 9: 1872: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 1873: - -: 1874:#if FW_AMPCS_COMPATIBLE - -: 1875: // Serialize the number of arguments - -: 1876: _status = _logBuff.serialize(static_cast(1)); - -: 1877: FW_ASSERT( - -: 1878: _status == Fw::FW_SERIALIZE_OK, - -: 1879: static_cast(_status) - -: 1880: ); - -: 1881:#endif - -: 1882: - 9: 1883: fileName.setMaxSerialize(60); - 9: 1884: _status = _logBuff.serialize(fileName); - -: 1885: FW_ASSERT( - -: 1886: _status == Fw::FW_SERIALIZE_OK, - -: 1887: static_cast(_status) - 9: 1888: ); - -: 1889: - -: 1890: - 9: 1891: this->m_logOut_OutputPort[0].invoke( - -: 1892: _id, - -: 1893: _logTime,Fw::LOG_ACTIVITY_HI, - -: 1894: _logBuff - 9: 1895: ); - -: 1896: - -: 1897: } - -: 1898: - -: 1899: // Emit the event on the text log port - -: 1900:#if FW_ENABLE_TEXT_LOGGING - 9: 1901: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 1902: - -: 1903:#if FW_OBJECT_NAMES == 1 - -: 1904: const char* _formatString = - 9: 1905: "(%s) %s: Sequence file %s canceled"; - -: 1906:#else - -: 1907: const char* _formatString = - -: 1908: "%s: Sequence file %s canceled"; - -: 1909:#endif - -: 1910: - -: 1911: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 1912: - 9: 1913: (void) snprintf( - -: 1914: _textBuffer, - -: 1915: FW_LOG_TEXT_BUFFER_SIZE, - -: 1916: _formatString, - -: 1917:#if FW_OBJECT_NAMES == 1 - -: 1918: this->m_objName, - -: 1919:#endif - -: 1920: "CS_SequenceCanceled " - 9: 1921: , fileName.toChar() - 9: 1922: ); - -: 1923: - -: 1924: // Null terminate - 9: 1925: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 18: 1926: Fw::TextLogString _logString = _textBuffer; - 9: 1927: this->m_LogText_OutputPort[0].invoke( - -: 1928: _id, - -: 1929: _logTime,Fw::TEXT_LOG_ACTIVITY_HI, - -: 1930: _logString - 9: 1931: ); - -: 1932: - -: 1933: } - -: 1934:#endif - -: 1935: - 9: 1936: } - -: 1937: - -: 1938: - 9: 1939: void CmdSequencerComponentBase :: - -: 1940: log_WARNING_HI_CS_FileReadError( - -: 1941: Fw::LogStringArg& fileName - -: 1942: ) - -: 1943: { - -: 1944: - -: 1945: - -: 1946: // Get the time - 18: 1947: Fw::Time _logTime; - 9: 1948: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 9: 1949: this->m_timeCaller_OutputPort[0].invoke( _logTime); - -: 1950: } - -: 1951: - 9: 1952: FwEventIdType _id = static_cast(0); - -: 1953: - 9: 1954: _id = this->getIdBase() + EVENTID_CS_FILEREADERROR; - -: 1955: - -: 1956: // Emit the event on the log port - 9: 1957: if (this->m_logOut_OutputPort[0].isConnected()) { - -: 1958: - 18: 1959: Fw::LogBuffer _logBuff; - 9: 1960: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 1961: - -: 1962:#if FW_AMPCS_COMPATIBLE - -: 1963: // Serialize the number of arguments - -: 1964: _status = _logBuff.serialize(static_cast(1)); - -: 1965: FW_ASSERT( - -: 1966: _status == Fw::FW_SERIALIZE_OK, - -: 1967: static_cast(_status) - -: 1968: ); - -: 1969:#endif - -: 1970: - 9: 1971: fileName.setMaxSerialize(60); - 9: 1972: _status = _logBuff.serialize(fileName); - -: 1973: FW_ASSERT( - -: 1974: _status == Fw::FW_SERIALIZE_OK, - -: 1975: static_cast(_status) - 9: 1976: ); - -: 1977: - -: 1978: - 9: 1979: this->m_logOut_OutputPort[0].invoke( - -: 1980: _id, - -: 1981: _logTime,Fw::LOG_WARNING_HI, - -: 1982: _logBuff - 9: 1983: ); - -: 1984: - -: 1985: } - -: 1986: - -: 1987: // Emit the event on the text log port - -: 1988:#if FW_ENABLE_TEXT_LOGGING - 9: 1989: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 1990: - -: 1991:#if FW_OBJECT_NAMES == 1 - -: 1992: const char* _formatString = - 9: 1993: "(%s) %s: Error reading sequence file %s"; - -: 1994:#else - -: 1995: const char* _formatString = - -: 1996: "%s: Error reading sequence file %s"; - -: 1997:#endif - -: 1998: - -: 1999: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 2000: - 9: 2001: (void) snprintf( - -: 2002: _textBuffer, - -: 2003: FW_LOG_TEXT_BUFFER_SIZE, - -: 2004: _formatString, - -: 2005:#if FW_OBJECT_NAMES == 1 - -: 2006: this->m_objName, - -: 2007:#endif - -: 2008: "CS_FileReadError " - 9: 2009: , fileName.toChar() - 9: 2010: ); - -: 2011: - -: 2012: // Null terminate - 9: 2013: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 18: 2014: Fw::TextLogString _logString = _textBuffer; - 9: 2015: this->m_LogText_OutputPort[0].invoke( - -: 2016: _id, - -: 2017: _logTime,Fw::TEXT_LOG_WARNING_HI, - -: 2018: _logString - 9: 2019: ); - -: 2020: - -: 2021: } - -: 2022:#endif - -: 2023: - 9: 2024: } - -: 2025: - -: 2026: - 63: 2027: void CmdSequencerComponentBase :: - -: 2028: log_WARNING_HI_CS_FileInvalid( - -: 2029: Fw::LogStringArg& fileName, FileReadStage stage, I32 error - -: 2030: ) - -: 2031: { - -: 2032: - -: 2033: - -: 2034: // Get the time - 126: 2035: Fw::Time _logTime; - 63: 2036: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 63: 2037: this->m_timeCaller_OutputPort[0].invoke( _logTime); - -: 2038: } - -: 2039: - 63: 2040: FwEventIdType _id = static_cast(0); - -: 2041: - 63: 2042: _id = this->getIdBase() + EVENTID_CS_FILEINVALID; - -: 2043: - -: 2044: // Emit the event on the log port - 63: 2045: if (this->m_logOut_OutputPort[0].isConnected()) { - -: 2046: - 126: 2047: Fw::LogBuffer _logBuff; - 63: 2048: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 2049: - -: 2050:#if FW_AMPCS_COMPATIBLE - -: 2051: // Serialize the number of arguments - -: 2052: _status = _logBuff.serialize(static_cast(3)); - -: 2053: FW_ASSERT( - -: 2054: _status == Fw::FW_SERIALIZE_OK, - -: 2055: static_cast(_status) - -: 2056: ); - -: 2057:#endif - -: 2058: - 63: 2059: fileName.setMaxSerialize(60); - 63: 2060: _status = _logBuff.serialize(fileName); - -: 2061: FW_ASSERT( - -: 2062: _status == Fw::FW_SERIALIZE_OK, - -: 2063: static_cast(_status) - 63: 2064: ); - -: 2065: - -: 2066:#if FW_AMPCS_COMPATIBLE - -: 2067: // Serialize the argument size - -: 2068: _status = _logBuff.serialize(static_cast(sizeof(FwEnumStoreType))); - -: 2069: FW_ASSERT( - -: 2070: _status == Fw::FW_SERIALIZE_OK, - -: 2071: static_cast(_status) - -: 2072: ); - -: 2073:#endif - -: 2074: - 63: 2075: _status = _logBuff.serialize( - -: 2076: static_cast(stage) - 63: 2077: ); - -: 2078: FW_ASSERT( - -: 2079: _status == Fw::FW_SERIALIZE_OK, - -: 2080: static_cast(_status) - 63: 2081: ); - -: 2082: - -: 2083:#if FW_AMPCS_COMPATIBLE - -: 2084: // Serialize the argument size - -: 2085: _status = _logBuff.serialize( - -: 2086: static_cast(sizeof(error)) - -: 2087: ); - -: 2088: FW_ASSERT( - -: 2089: _status == Fw::FW_SERIALIZE_OK, - -: 2090: static_cast(_status) - -: 2091: ); - -: 2092:#endif - -: 2093: - 63: 2094: _status = _logBuff.serialize(error); - -: 2095: FW_ASSERT( - -: 2096: _status == Fw::FW_SERIALIZE_OK, - -: 2097: static_cast(_status) - 63: 2098: ); - -: 2099: - -: 2100: - 63: 2101: this->m_logOut_OutputPort[0].invoke( - -: 2102: _id, - -: 2103: _logTime,Fw::LOG_WARNING_HI, - -: 2104: _logBuff - 63: 2105: ); - -: 2106: - -: 2107: } - -: 2108: - -: 2109: // Emit the event on the text log port - -: 2110:#if FW_ENABLE_TEXT_LOGGING - 63: 2111: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 2112: - -: 2113:#if FW_OBJECT_NAMES == 1 - -: 2114: const char* _formatString = - 63: 2115: "(%s) %s: Sequence file %s invalid. Stage: %d Error: %d"; - -: 2116:#else - -: 2117: const char* _formatString = - -: 2118: "%s: Sequence file %s invalid. Stage: %d Error: %d"; - -: 2119:#endif - -: 2120: - -: 2121: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 2122: - 126: 2123: (void) snprintf( - -: 2124: _textBuffer, - -: 2125: FW_LOG_TEXT_BUFFER_SIZE, - -: 2126: _formatString, - -: 2127:#if FW_OBJECT_NAMES == 1 - -: 2128: this->m_objName, - -: 2129:#endif - -: 2130: "CS_FileInvalid " - 63: 2131: , fileName.toChar() - -: 2132: , stage - -: 2133: , error - 63: 2134: ); - -: 2135: - -: 2136: // Null terminate - 63: 2137: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 126: 2138: Fw::TextLogString _logString = _textBuffer; - 63: 2139: this->m_LogText_OutputPort[0].invoke( - -: 2140: _id, - -: 2141: _logTime,Fw::TEXT_LOG_WARNING_HI, - -: 2142: _logString - 63: 2143: ); - -: 2144: - -: 2145: } - -: 2146:#endif - -: 2147: - 63: 2148: } - -: 2149: - -: 2150: - 72: 2151: void CmdSequencerComponentBase :: - -: 2152: log_WARNING_HI_CS_RecordInvalid( - -: 2153: Fw::LogStringArg& fileName, U32 recordNumber, I32 error - -: 2154: ) - -: 2155: { - -: 2156: - -: 2157: - -: 2158: // Get the time - 144: 2159: Fw::Time _logTime; - 72: 2160: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 72: 2161: this->m_timeCaller_OutputPort[0].invoke( _logTime); - -: 2162: } - -: 2163: - 72: 2164: FwEventIdType _id = static_cast(0); - -: 2165: - 72: 2166: _id = this->getIdBase() + EVENTID_CS_RECORDINVALID; - -: 2167: - -: 2168: // Emit the event on the log port - 72: 2169: if (this->m_logOut_OutputPort[0].isConnected()) { - -: 2170: - 144: 2171: Fw::LogBuffer _logBuff; - 72: 2172: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 2173: - -: 2174:#if FW_AMPCS_COMPATIBLE - -: 2175: // Serialize the number of arguments - -: 2176: _status = _logBuff.serialize(static_cast(3)); - -: 2177: FW_ASSERT( - -: 2178: _status == Fw::FW_SERIALIZE_OK, - -: 2179: static_cast(_status) - -: 2180: ); - -: 2181:#endif - -: 2182: - 72: 2183: fileName.setMaxSerialize(60); - 72: 2184: _status = _logBuff.serialize(fileName); - -: 2185: FW_ASSERT( - -: 2186: _status == Fw::FW_SERIALIZE_OK, - -: 2187: static_cast(_status) - 72: 2188: ); - -: 2189: - -: 2190:#if FW_AMPCS_COMPATIBLE - -: 2191: // Serialize the argument size - -: 2192: _status = _logBuff.serialize( - -: 2193: static_cast(sizeof(recordNumber)) - -: 2194: ); - -: 2195: FW_ASSERT( - -: 2196: _status == Fw::FW_SERIALIZE_OK, - -: 2197: static_cast(_status) - -: 2198: ); - -: 2199:#endif - -: 2200: - 72: 2201: _status = _logBuff.serialize(recordNumber); - -: 2202: FW_ASSERT( - -: 2203: _status == Fw::FW_SERIALIZE_OK, - -: 2204: static_cast(_status) - 72: 2205: ); - -: 2206: - -: 2207:#if FW_AMPCS_COMPATIBLE - -: 2208: // Serialize the argument size - -: 2209: _status = _logBuff.serialize( - -: 2210: static_cast(sizeof(error)) - -: 2211: ); - -: 2212: FW_ASSERT( - -: 2213: _status == Fw::FW_SERIALIZE_OK, - -: 2214: static_cast(_status) - -: 2215: ); - -: 2216:#endif - -: 2217: - 72: 2218: _status = _logBuff.serialize(error); - -: 2219: FW_ASSERT( - -: 2220: _status == Fw::FW_SERIALIZE_OK, - -: 2221: static_cast(_status) - 72: 2222: ); - -: 2223: - -: 2224: - 72: 2225: this->m_logOut_OutputPort[0].invoke( - -: 2226: _id, - -: 2227: _logTime,Fw::LOG_WARNING_HI, - -: 2228: _logBuff - 72: 2229: ); - -: 2230: - -: 2231: } - -: 2232: - -: 2233: // Emit the event on the text log port - -: 2234:#if FW_ENABLE_TEXT_LOGGING - 72: 2235: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 2236: - -: 2237:#if FW_OBJECT_NAMES == 1 - -: 2238: const char* _formatString = - 72: 2239: "(%s) %s: Sequence file %s: Record %d invalid. Err: %d"; - -: 2240:#else - -: 2241: const char* _formatString = - -: 2242: "%s: Sequence file %s: Record %d invalid. Err: %d"; - -: 2243:#endif - -: 2244: - -: 2245: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 2246: - 72: 2247: (void) snprintf( - -: 2248: _textBuffer, - -: 2249: FW_LOG_TEXT_BUFFER_SIZE, - -: 2250: _formatString, - -: 2251:#if FW_OBJECT_NAMES == 1 - -: 2252: this->m_objName, - -: 2253:#endif - -: 2254: "CS_RecordInvalid " - 72: 2255: , fileName.toChar() - -: 2256: , recordNumber - -: 2257: , error - 72: 2258: ); - -: 2259: - -: 2260: // Null terminate - 72: 2261: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 144: 2262: Fw::TextLogString _logString = _textBuffer; - 72: 2263: this->m_LogText_OutputPort[0].invoke( - -: 2264: _id, - -: 2265: _logTime,Fw::TEXT_LOG_WARNING_HI, - -: 2266: _logString - 72: 2267: ); - -: 2268: - -: 2269: } - -: 2270:#endif - -: 2271: - 72: 2272: } - -: 2273: - -: 2274: - 9: 2275: void CmdSequencerComponentBase :: - -: 2276: log_WARNING_HI_CS_FileSizeError( - -: 2277: Fw::LogStringArg& fileName, U32 size - -: 2278: ) - -: 2279: { - -: 2280: - -: 2281: - -: 2282: // Get the time - 18: 2283: Fw::Time _logTime; - 9: 2284: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 9: 2285: this->m_timeCaller_OutputPort[0].invoke( _logTime); - -: 2286: } - -: 2287: - 9: 2288: FwEventIdType _id = static_cast(0); - -: 2289: - 9: 2290: _id = this->getIdBase() + EVENTID_CS_FILESIZEERROR; - -: 2291: - -: 2292: // Emit the event on the log port - 9: 2293: if (this->m_logOut_OutputPort[0].isConnected()) { - -: 2294: - 18: 2295: Fw::LogBuffer _logBuff; - 9: 2296: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 2297: - -: 2298:#if FW_AMPCS_COMPATIBLE - -: 2299: // Serialize the number of arguments - -: 2300: _status = _logBuff.serialize(static_cast(2)); - -: 2301: FW_ASSERT( - -: 2302: _status == Fw::FW_SERIALIZE_OK, - -: 2303: static_cast(_status) - -: 2304: ); - -: 2305:#endif - -: 2306: - 9: 2307: fileName.setMaxSerialize(60); - 9: 2308: _status = _logBuff.serialize(fileName); - -: 2309: FW_ASSERT( - -: 2310: _status == Fw::FW_SERIALIZE_OK, - -: 2311: static_cast(_status) - 9: 2312: ); - -: 2313: - -: 2314:#if FW_AMPCS_COMPATIBLE - -: 2315: // Serialize the argument size - -: 2316: _status = _logBuff.serialize( - -: 2317: static_cast(sizeof(size)) - -: 2318: ); - -: 2319: FW_ASSERT( - -: 2320: _status == Fw::FW_SERIALIZE_OK, - -: 2321: static_cast(_status) - -: 2322: ); - -: 2323:#endif - -: 2324: - 9: 2325: _status = _logBuff.serialize(size); - -: 2326: FW_ASSERT( - -: 2327: _status == Fw::FW_SERIALIZE_OK, - -: 2328: static_cast(_status) - 9: 2329: ); - -: 2330: - -: 2331: - 9: 2332: this->m_logOut_OutputPort[0].invoke( - -: 2333: _id, - -: 2334: _logTime,Fw::LOG_WARNING_HI, - -: 2335: _logBuff - 9: 2336: ); - -: 2337: - -: 2338: } - -: 2339: - -: 2340: // Emit the event on the text log port - -: 2341:#if FW_ENABLE_TEXT_LOGGING - 9: 2342: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 2343: - -: 2344:#if FW_OBJECT_NAMES == 1 - -: 2345: const char* _formatString = - 9: 2346: "(%s) %s: Sequence file %s too large. Size: %d"; - -: 2347:#else - -: 2348: const char* _formatString = - -: 2349: "%s: Sequence file %s too large. Size: %d"; - -: 2350:#endif - -: 2351: - -: 2352: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 2353: - 9: 2354: (void) snprintf( - -: 2355: _textBuffer, - -: 2356: FW_LOG_TEXT_BUFFER_SIZE, - -: 2357: _formatString, - -: 2358:#if FW_OBJECT_NAMES == 1 - -: 2359: this->m_objName, - -: 2360:#endif - -: 2361: "CS_FileSizeError " - 9: 2362: , fileName.toChar() - -: 2363: , size - 9: 2364: ); - -: 2365: - -: 2366: // Null terminate - 9: 2367: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 18: 2368: Fw::TextLogString _logString = _textBuffer; - 9: 2369: this->m_LogText_OutputPort[0].invoke( - -: 2370: _id, - -: 2371: _logTime,Fw::TEXT_LOG_WARNING_HI, - -: 2372: _logString - 9: 2373: ); - -: 2374: - -: 2375: } - -: 2376:#endif - -: 2377: - 9: 2378: } - -: 2379: - -: 2380: - 18: 2381: void CmdSequencerComponentBase :: - -: 2382: log_WARNING_HI_CS_FileNotFound( - -: 2383: Fw::LogStringArg& fileName - -: 2384: ) - -: 2385: { - -: 2386: - -: 2387: - -: 2388: // Get the time - 36: 2389: Fw::Time _logTime; - 18: 2390: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 18: 2391: this->m_timeCaller_OutputPort[0].invoke( _logTime); - -: 2392: } - -: 2393: - 18: 2394: FwEventIdType _id = static_cast(0); - -: 2395: - 18: 2396: _id = this->getIdBase() + EVENTID_CS_FILENOTFOUND; - -: 2397: - -: 2398: // Emit the event on the log port - 18: 2399: if (this->m_logOut_OutputPort[0].isConnected()) { - -: 2400: - 36: 2401: Fw::LogBuffer _logBuff; - 18: 2402: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 2403: - -: 2404:#if FW_AMPCS_COMPATIBLE - -: 2405: // Serialize the number of arguments - -: 2406: _status = _logBuff.serialize(static_cast(1)); - -: 2407: FW_ASSERT( - -: 2408: _status == Fw::FW_SERIALIZE_OK, - -: 2409: static_cast(_status) - -: 2410: ); - -: 2411:#endif - -: 2412: - 18: 2413: fileName.setMaxSerialize(60); - 18: 2414: _status = _logBuff.serialize(fileName); - -: 2415: FW_ASSERT( - -: 2416: _status == Fw::FW_SERIALIZE_OK, - -: 2417: static_cast(_status) - 18: 2418: ); - -: 2419: - -: 2420: - 18: 2421: this->m_logOut_OutputPort[0].invoke( - -: 2422: _id, - -: 2423: _logTime,Fw::LOG_WARNING_HI, - -: 2424: _logBuff - 18: 2425: ); - -: 2426: - -: 2427: } - -: 2428: - -: 2429: // Emit the event on the text log port - -: 2430:#if FW_ENABLE_TEXT_LOGGING - 18: 2431: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 2432: - -: 2433:#if FW_OBJECT_NAMES == 1 - -: 2434: const char* _formatString = - 18: 2435: "(%s) %s: Sequence file %s not found."; - -: 2436:#else - -: 2437: const char* _formatString = - -: 2438: "%s: Sequence file %s not found."; - -: 2439:#endif - -: 2440: - -: 2441: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 2442: - 18: 2443: (void) snprintf( - -: 2444: _textBuffer, - -: 2445: FW_LOG_TEXT_BUFFER_SIZE, - -: 2446: _formatString, - -: 2447:#if FW_OBJECT_NAMES == 1 - -: 2448: this->m_objName, - -: 2449:#endif - -: 2450: "CS_FileNotFound " - 18: 2451: , fileName.toChar() - 18: 2452: ); - -: 2453: - -: 2454: // Null terminate - 18: 2455: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 36: 2456: Fw::TextLogString _logString = _textBuffer; - 18: 2457: this->m_LogText_OutputPort[0].invoke( - -: 2458: _id, - -: 2459: _logTime,Fw::TEXT_LOG_WARNING_HI, - -: 2460: _logString - 18: 2461: ); - -: 2462: - -: 2463: } - -: 2464:#endif - -: 2465: - 18: 2466: } - -: 2467: - -: 2468: - 9: 2469: void CmdSequencerComponentBase :: - -: 2470: log_WARNING_HI_CS_FileCrcFailure( - -: 2471: Fw::LogStringArg& fileName, U32 storedCRC, U32 computedCRC - -: 2472: ) - -: 2473: { - -: 2474: - -: 2475: - -: 2476: // Get the time - 18: 2477: Fw::Time _logTime; - 9: 2478: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 9: 2479: this->m_timeCaller_OutputPort[0].invoke( _logTime); - -: 2480: } - -: 2481: - 9: 2482: FwEventIdType _id = static_cast(0); - -: 2483: - 9: 2484: _id = this->getIdBase() + EVENTID_CS_FILECRCFAILURE; - -: 2485: - -: 2486: // Emit the event on the log port - 9: 2487: if (this->m_logOut_OutputPort[0].isConnected()) { - -: 2488: - 18: 2489: Fw::LogBuffer _logBuff; - 9: 2490: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 2491: - -: 2492:#if FW_AMPCS_COMPATIBLE - -: 2493: // Serialize the number of arguments - -: 2494: _status = _logBuff.serialize(static_cast(3)); - -: 2495: FW_ASSERT( - -: 2496: _status == Fw::FW_SERIALIZE_OK, - -: 2497: static_cast(_status) - -: 2498: ); - -: 2499:#endif - -: 2500: - 9: 2501: fileName.setMaxSerialize(60); - 9: 2502: _status = _logBuff.serialize(fileName); - -: 2503: FW_ASSERT( - -: 2504: _status == Fw::FW_SERIALIZE_OK, - -: 2505: static_cast(_status) - 9: 2506: ); - -: 2507: - -: 2508:#if FW_AMPCS_COMPATIBLE - -: 2509: // Serialize the argument size - -: 2510: _status = _logBuff.serialize( - -: 2511: static_cast(sizeof(storedCRC)) - -: 2512: ); - -: 2513: FW_ASSERT( - -: 2514: _status == Fw::FW_SERIALIZE_OK, - -: 2515: static_cast(_status) - -: 2516: ); - -: 2517:#endif - -: 2518: - 9: 2519: _status = _logBuff.serialize(storedCRC); - -: 2520: FW_ASSERT( - -: 2521: _status == Fw::FW_SERIALIZE_OK, - -: 2522: static_cast(_status) - 9: 2523: ); - -: 2524: - -: 2525:#if FW_AMPCS_COMPATIBLE - -: 2526: // Serialize the argument size - -: 2527: _status = _logBuff.serialize( - -: 2528: static_cast(sizeof(computedCRC)) - -: 2529: ); - -: 2530: FW_ASSERT( - -: 2531: _status == Fw::FW_SERIALIZE_OK, - -: 2532: static_cast(_status) - -: 2533: ); - -: 2534:#endif - -: 2535: - 9: 2536: _status = _logBuff.serialize(computedCRC); - -: 2537: FW_ASSERT( - -: 2538: _status == Fw::FW_SERIALIZE_OK, - -: 2539: static_cast(_status) - 9: 2540: ); - -: 2541: - -: 2542: - 9: 2543: this->m_logOut_OutputPort[0].invoke( - -: 2544: _id, - -: 2545: _logTime,Fw::LOG_WARNING_HI, - -: 2546: _logBuff - 9: 2547: ); - -: 2548: - -: 2549: } - -: 2550: - -: 2551: // Emit the event on the text log port - -: 2552:#if FW_ENABLE_TEXT_LOGGING - 9: 2553: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 2554: - -: 2555:#if FW_OBJECT_NAMES == 1 - -: 2556: const char* _formatString = - 9: 2557: "(%s) %s: Sequence file %s had invalid CRC. Stored 0x%08X, Computed 0x%08X."; - -: 2558:#else - -: 2559: const char* _formatString = - -: 2560: "%s: Sequence file %s had invalid CRC. Stored 0x%08X, Computed 0x%08X."; - -: 2561:#endif - -: 2562: - -: 2563: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 2564: - 9: 2565: (void) snprintf( - -: 2566: _textBuffer, - -: 2567: FW_LOG_TEXT_BUFFER_SIZE, - -: 2568: _formatString, - -: 2569:#if FW_OBJECT_NAMES == 1 - -: 2570: this->m_objName, - -: 2571:#endif - -: 2572: "CS_FileCrcFailure " - 9: 2573: , fileName.toChar() - -: 2574: , storedCRC - -: 2575: , computedCRC - 9: 2576: ); - -: 2577: - -: 2578: // Null terminate - 9: 2579: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 18: 2580: Fw::TextLogString _logString = _textBuffer; - 9: 2581: this->m_LogText_OutputPort[0].invoke( - -: 2582: _id, - -: 2583: _logTime,Fw::TEXT_LOG_WARNING_HI, - -: 2584: _logString - 9: 2585: ); - -: 2586: - -: 2587: } - -: 2588:#endif - -: 2589: - 9: 2590: } - -: 2591: - -: 2592: - 324: 2593: void CmdSequencerComponentBase :: - -: 2594: log_ACTIVITY_LO_CS_CommandComplete( - -: 2595: Fw::LogStringArg& fileName, U32 recordNumber, U32 opCode - -: 2596: ) - -: 2597: { - -: 2598: - -: 2599: - -: 2600: // Get the time - 648: 2601: Fw::Time _logTime; - 324: 2602: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 324: 2603: this->m_timeCaller_OutputPort[0].invoke( _logTime); - -: 2604: } - -: 2605: - 324: 2606: FwEventIdType _id = static_cast(0); - -: 2607: - 324: 2608: _id = this->getIdBase() + EVENTID_CS_COMMANDCOMPLETE; - -: 2609: - -: 2610: // Emit the event on the log port - 324: 2611: if (this->m_logOut_OutputPort[0].isConnected()) { - -: 2612: - 648: 2613: Fw::LogBuffer _logBuff; - 324: 2614: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 2615: - -: 2616:#if FW_AMPCS_COMPATIBLE - -: 2617: // Serialize the number of arguments - -: 2618: _status = _logBuff.serialize(static_cast(3)); - -: 2619: FW_ASSERT( - -: 2620: _status == Fw::FW_SERIALIZE_OK, - -: 2621: static_cast(_status) - -: 2622: ); - -: 2623:#endif - -: 2624: - 324: 2625: fileName.setMaxSerialize(60); - 324: 2626: _status = _logBuff.serialize(fileName); - -: 2627: FW_ASSERT( - -: 2628: _status == Fw::FW_SERIALIZE_OK, - -: 2629: static_cast(_status) - 324: 2630: ); - -: 2631: - -: 2632:#if FW_AMPCS_COMPATIBLE - -: 2633: // Serialize the argument size - -: 2634: _status = _logBuff.serialize( - -: 2635: static_cast(sizeof(recordNumber)) - -: 2636: ); - -: 2637: FW_ASSERT( - -: 2638: _status == Fw::FW_SERIALIZE_OK, - -: 2639: static_cast(_status) - -: 2640: ); - -: 2641:#endif - -: 2642: - 324: 2643: _status = _logBuff.serialize(recordNumber); - -: 2644: FW_ASSERT( - -: 2645: _status == Fw::FW_SERIALIZE_OK, - -: 2646: static_cast(_status) - 324: 2647: ); - -: 2648: - -: 2649:#if FW_AMPCS_COMPATIBLE - -: 2650: // Serialize the argument size - -: 2651: _status = _logBuff.serialize( - -: 2652: static_cast(sizeof(opCode)) - -: 2653: ); - -: 2654: FW_ASSERT( - -: 2655: _status == Fw::FW_SERIALIZE_OK, - -: 2656: static_cast(_status) - -: 2657: ); - -: 2658:#endif - -: 2659: - 324: 2660: _status = _logBuff.serialize(opCode); - -: 2661: FW_ASSERT( - -: 2662: _status == Fw::FW_SERIALIZE_OK, - -: 2663: static_cast(_status) - 324: 2664: ); - -: 2665: - -: 2666: - 324: 2667: this->m_logOut_OutputPort[0].invoke( - -: 2668: _id, - -: 2669: _logTime,Fw::LOG_ACTIVITY_LO, - -: 2670: _logBuff - 324: 2671: ); - -: 2672: - -: 2673: } - -: 2674: - -: 2675: // Emit the event on the text log port - -: 2676:#if FW_ENABLE_TEXT_LOGGING - 324: 2677: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 2678: - -: 2679:#if FW_OBJECT_NAMES == 1 - -: 2680: const char* _formatString = - 324: 2681: "(%s) %s: Sequence file %s: Command %d (opcode %d) complete"; - -: 2682:#else - -: 2683: const char* _formatString = - -: 2684: "%s: Sequence file %s: Command %d (opcode %d) complete"; - -: 2685:#endif - -: 2686: - -: 2687: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 2688: - 324: 2689: (void) snprintf( - -: 2690: _textBuffer, - -: 2691: FW_LOG_TEXT_BUFFER_SIZE, - -: 2692: _formatString, - -: 2693:#if FW_OBJECT_NAMES == 1 - -: 2694: this->m_objName, - -: 2695:#endif - -: 2696: "CS_CommandComplete " - 324: 2697: , fileName.toChar() - -: 2698: , recordNumber - -: 2699: , opCode - 324: 2700: ); - -: 2701: - -: 2702: // Null terminate - 324: 2703: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 648: 2704: Fw::TextLogString _logString = _textBuffer; - 324: 2705: this->m_LogText_OutputPort[0].invoke( - -: 2706: _id, - -: 2707: _logTime,Fw::TEXT_LOG_ACTIVITY_LO, - -: 2708: _logString - 324: 2709: ); - -: 2710: - -: 2711: } - -: 2712:#endif - -: 2713: - 324: 2714: } - -: 2715: - -: 2716: - 72: 2717: void CmdSequencerComponentBase :: - -: 2718: log_ACTIVITY_HI_CS_SequenceComplete( - -: 2719: Fw::LogStringArg& fileName - -: 2720: ) - -: 2721: { - -: 2722: - -: 2723: - -: 2724: // Get the time - 144: 2725: Fw::Time _logTime; - 72: 2726: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 72: 2727: this->m_timeCaller_OutputPort[0].invoke( _logTime); - -: 2728: } - -: 2729: - 72: 2730: FwEventIdType _id = static_cast(0); - -: 2731: - 72: 2732: _id = this->getIdBase() + EVENTID_CS_SEQUENCECOMPLETE; - -: 2733: - -: 2734: // Emit the event on the log port - 72: 2735: if (this->m_logOut_OutputPort[0].isConnected()) { - -: 2736: - 144: 2737: Fw::LogBuffer _logBuff; - 72: 2738: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 2739: - -: 2740:#if FW_AMPCS_COMPATIBLE - -: 2741: // Serialize the number of arguments - -: 2742: _status = _logBuff.serialize(static_cast(1)); - -: 2743: FW_ASSERT( - -: 2744: _status == Fw::FW_SERIALIZE_OK, - -: 2745: static_cast(_status) - -: 2746: ); - -: 2747:#endif - -: 2748: - 72: 2749: fileName.setMaxSerialize(60); - 72: 2750: _status = _logBuff.serialize(fileName); - -: 2751: FW_ASSERT( - -: 2752: _status == Fw::FW_SERIALIZE_OK, - -: 2753: static_cast(_status) - 72: 2754: ); - -: 2755: - -: 2756: - 72: 2757: this->m_logOut_OutputPort[0].invoke( - -: 2758: _id, - -: 2759: _logTime,Fw::LOG_ACTIVITY_HI, - -: 2760: _logBuff - 72: 2761: ); - -: 2762: - -: 2763: } - -: 2764: - -: 2765: // Emit the event on the text log port - -: 2766:#if FW_ENABLE_TEXT_LOGGING - 72: 2767: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 2768: - -: 2769:#if FW_OBJECT_NAMES == 1 - -: 2770: const char* _formatString = - 72: 2771: "(%s) %s: Sequence file %s complete"; - -: 2772:#else - -: 2773: const char* _formatString = - -: 2774: "%s: Sequence file %s complete"; - -: 2775:#endif - -: 2776: - -: 2777: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 2778: - 72: 2779: (void) snprintf( - -: 2780: _textBuffer, - -: 2781: FW_LOG_TEXT_BUFFER_SIZE, - -: 2782: _formatString, - -: 2783:#if FW_OBJECT_NAMES == 1 - -: 2784: this->m_objName, - -: 2785:#endif - -: 2786: "CS_SequenceComplete " - 72: 2787: , fileName.toChar() - 72: 2788: ); - -: 2789: - -: 2790: // Null terminate - 72: 2791: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 144: 2792: Fw::TextLogString _logString = _textBuffer; - 72: 2793: this->m_LogText_OutputPort[0].invoke( - -: 2794: _id, - -: 2795: _logTime,Fw::TEXT_LOG_ACTIVITY_HI, - -: 2796: _logString - 72: 2797: ); - -: 2798: - -: 2799: } - -: 2800:#endif - -: 2801: - 72: 2802: } - -: 2803: - -: 2804: - 9: 2805: void CmdSequencerComponentBase :: - -: 2806: log_WARNING_HI_CS_CommandError( - -: 2807: Fw::LogStringArg& fileName, U32 recordNumber, U32 opCode, U32 errorStatus - -: 2808: ) - -: 2809: { - -: 2810: - -: 2811: - -: 2812: // Get the time - 18: 2813: Fw::Time _logTime; - 9: 2814: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 9: 2815: this->m_timeCaller_OutputPort[0].invoke( _logTime); - -: 2816: } - -: 2817: - 9: 2818: FwEventIdType _id = static_cast(0); - -: 2819: - 9: 2820: _id = this->getIdBase() + EVENTID_CS_COMMANDERROR; - -: 2821: - -: 2822: // Emit the event on the log port - 9: 2823: if (this->m_logOut_OutputPort[0].isConnected()) { - -: 2824: - 18: 2825: Fw::LogBuffer _logBuff; - 9: 2826: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 2827: - -: 2828:#if FW_AMPCS_COMPATIBLE - -: 2829: // Serialize the number of arguments - -: 2830: _status = _logBuff.serialize(static_cast(4)); - -: 2831: FW_ASSERT( - -: 2832: _status == Fw::FW_SERIALIZE_OK, - -: 2833: static_cast(_status) - -: 2834: ); - -: 2835:#endif - -: 2836: - 9: 2837: fileName.setMaxSerialize(60); - 9: 2838: _status = _logBuff.serialize(fileName); - -: 2839: FW_ASSERT( - -: 2840: _status == Fw::FW_SERIALIZE_OK, - -: 2841: static_cast(_status) - 9: 2842: ); - -: 2843: - -: 2844:#if FW_AMPCS_COMPATIBLE - -: 2845: // Serialize the argument size - -: 2846: _status = _logBuff.serialize( - -: 2847: static_cast(sizeof(recordNumber)) - -: 2848: ); - -: 2849: FW_ASSERT( - -: 2850: _status == Fw::FW_SERIALIZE_OK, - -: 2851: static_cast(_status) - -: 2852: ); - -: 2853:#endif - -: 2854: - 9: 2855: _status = _logBuff.serialize(recordNumber); - -: 2856: FW_ASSERT( - -: 2857: _status == Fw::FW_SERIALIZE_OK, - -: 2858: static_cast(_status) - 9: 2859: ); - -: 2860: - -: 2861:#if FW_AMPCS_COMPATIBLE - -: 2862: // Serialize the argument size - -: 2863: _status = _logBuff.serialize( - -: 2864: static_cast(sizeof(opCode)) - -: 2865: ); - -: 2866: FW_ASSERT( - -: 2867: _status == Fw::FW_SERIALIZE_OK, - -: 2868: static_cast(_status) - -: 2869: ); - -: 2870:#endif - -: 2871: - 9: 2872: _status = _logBuff.serialize(opCode); - -: 2873: FW_ASSERT( - -: 2874: _status == Fw::FW_SERIALIZE_OK, - -: 2875: static_cast(_status) - 9: 2876: ); - -: 2877: - -: 2878:#if FW_AMPCS_COMPATIBLE - -: 2879: // Serialize the argument size - -: 2880: _status = _logBuff.serialize( - -: 2881: static_cast(sizeof(errorStatus)) - -: 2882: ); - -: 2883: FW_ASSERT( - -: 2884: _status == Fw::FW_SERIALIZE_OK, - -: 2885: static_cast(_status) - -: 2886: ); - -: 2887:#endif - -: 2888: - 9: 2889: _status = _logBuff.serialize(errorStatus); - -: 2890: FW_ASSERT( - -: 2891: _status == Fw::FW_SERIALIZE_OK, - -: 2892: static_cast(_status) - 9: 2893: ); - -: 2894: - -: 2895: - 9: 2896: this->m_logOut_OutputPort[0].invoke( - -: 2897: _id, - -: 2898: _logTime,Fw::LOG_WARNING_HI, - -: 2899: _logBuff - 9: 2900: ); - -: 2901: - -: 2902: } - -: 2903: - -: 2904: // Emit the event on the text log port - -: 2905:#if FW_ENABLE_TEXT_LOGGING - 9: 2906: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 2907: - -: 2908:#if FW_OBJECT_NAMES == 1 - -: 2909: const char* _formatString = - 9: 2910: "(%s) %s: Sequence file %s: Command %d (opcode %d) completed with error %d"; - -: 2911:#else - -: 2912: const char* _formatString = - -: 2913: "%s: Sequence file %s: Command %d (opcode %d) completed with error %d"; - -: 2914:#endif - -: 2915: - -: 2916: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 2917: - 9: 2918: (void) snprintf( - -: 2919: _textBuffer, - -: 2920: FW_LOG_TEXT_BUFFER_SIZE, - -: 2921: _formatString, - -: 2922:#if FW_OBJECT_NAMES == 1 - -: 2923: this->m_objName, - -: 2924:#endif - -: 2925: "CS_CommandError " - 9: 2926: , fileName.toChar() - -: 2927: , recordNumber - -: 2928: , opCode - -: 2929: , errorStatus - 9: 2930: ); - -: 2931: - -: 2932: // Null terminate - 9: 2933: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 18: 2934: Fw::TextLogString _logString = _textBuffer; - 9: 2935: this->m_LogText_OutputPort[0].invoke( - -: 2936: _id, - -: 2937: _logTime,Fw::TEXT_LOG_WARNING_HI, - -: 2938: _logString - 9: 2939: ); - -: 2940: - -: 2941: } - -: 2942:#endif - -: 2943: - 9: 2944: } - -: 2945: - -: 2946: - 63: 2947: void CmdSequencerComponentBase :: - -: 2948: log_WARNING_HI_CS_InvalidMode( - -: 2949: void - -: 2950: ) - -: 2951: { - -: 2952: - -: 2953: - -: 2954: // Get the time - 126: 2955: Fw::Time _logTime; - 63: 2956: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 63: 2957: this->m_timeCaller_OutputPort[0].invoke( _logTime); - -: 2958: } - -: 2959: - 63: 2960: FwEventIdType _id = static_cast(0); - -: 2961: - 63: 2962: _id = this->getIdBase() + EVENTID_CS_INVALIDMODE; - -: 2963: - -: 2964: // Emit the event on the log port - 63: 2965: if (this->m_logOut_OutputPort[0].isConnected()) { - -: 2966: - 126: 2967: Fw::LogBuffer _logBuff; - -: 2968:#if FW_AMPCS_COMPATIBLE - -: 2969: // for AMPCS, need to encode zero arguments - -: 2970: Fw::SerializeStatus _zero_status = Fw::FW_SERIALIZE_OK; - -: 2971: _zero_status = _logBuff.serialize(static_cast(0)); - -: 2972: FW_ASSERT( - -: 2973: _zero_status == Fw::FW_SERIALIZE_OK, - -: 2974: static_cast(_zero_status) - -: 2975: ); - -: 2976:#endif - -: 2977: - -: 2978: - 63: 2979: this->m_logOut_OutputPort[0].invoke( - -: 2980: _id, - -: 2981: _logTime,Fw::LOG_WARNING_HI, - -: 2982: _logBuff - 63: 2983: ); - -: 2984: - -: 2985: } - -: 2986: - -: 2987: // Emit the event on the text log port - -: 2988:#if FW_ENABLE_TEXT_LOGGING - 63: 2989: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 2990: - -: 2991:#if FW_OBJECT_NAMES == 1 - -: 2992: const char* _formatString = - 63: 2993: "(%s) %s: Invalid mode"; - -: 2994:#else - -: 2995: const char* _formatString = - -: 2996: "%s: Invalid mode"; - -: 2997:#endif - -: 2998: - -: 2999: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 3000: - 63: 3001: (void) snprintf( - -: 3002: _textBuffer, - -: 3003: FW_LOG_TEXT_BUFFER_SIZE, - -: 3004: _formatString, - -: 3005:#if FW_OBJECT_NAMES == 1 - -: 3006: this->m_objName, - -: 3007:#endif - -: 3008: "CS_InvalidMode " - 63: 3009: ); - -: 3010: - -: 3011: // Null terminate - 63: 3012: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 126: 3013: Fw::TextLogString _logString = _textBuffer; - 63: 3014: this->m_LogText_OutputPort[0].invoke( - -: 3015: _id, - -: 3016: _logTime,Fw::TEXT_LOG_WARNING_HI, - -: 3017: _logString - 63: 3018: ); - -: 3019: - -: 3020: } - -: 3021:#endif - -: 3022: - 63: 3023: } - -: 3024: - -: 3025: - 7: 3026: void CmdSequencerComponentBase :: - -: 3027: log_WARNING_HI_CS_RecordMismatch( - -: 3028: Fw::LogStringArg& fileName, U32 header_records, U32 extra_bytes - -: 3029: ) - -: 3030: { - -: 3031: - -: 3032: - -: 3033: // Get the time - 14: 3034: Fw::Time _logTime; - 7: 3035: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 7: 3036: this->m_timeCaller_OutputPort[0].invoke( _logTime); - -: 3037: } - -: 3038: - 7: 3039: FwEventIdType _id = static_cast(0); - -: 3040: - 7: 3041: _id = this->getIdBase() + EVENTID_CS_RECORDMISMATCH; - -: 3042: - -: 3043: // Emit the event on the log port - 7: 3044: if (this->m_logOut_OutputPort[0].isConnected()) { - -: 3045: - 14: 3046: Fw::LogBuffer _logBuff; - 7: 3047: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 3048: - -: 3049:#if FW_AMPCS_COMPATIBLE - -: 3050: // Serialize the number of arguments - -: 3051: _status = _logBuff.serialize(static_cast(3)); - -: 3052: FW_ASSERT( - -: 3053: _status == Fw::FW_SERIALIZE_OK, - -: 3054: static_cast(_status) - -: 3055: ); - -: 3056:#endif - -: 3057: - 7: 3058: fileName.setMaxSerialize(60); - 7: 3059: _status = _logBuff.serialize(fileName); - -: 3060: FW_ASSERT( - -: 3061: _status == Fw::FW_SERIALIZE_OK, - -: 3062: static_cast(_status) - 7: 3063: ); - -: 3064: - -: 3065:#if FW_AMPCS_COMPATIBLE - -: 3066: // Serialize the argument size - -: 3067: _status = _logBuff.serialize( - -: 3068: static_cast(sizeof(header_records)) - -: 3069: ); - -: 3070: FW_ASSERT( - -: 3071: _status == Fw::FW_SERIALIZE_OK, - -: 3072: static_cast(_status) - -: 3073: ); - -: 3074:#endif - -: 3075: - 7: 3076: _status = _logBuff.serialize(header_records); - -: 3077: FW_ASSERT( - -: 3078: _status == Fw::FW_SERIALIZE_OK, - -: 3079: static_cast(_status) - 7: 3080: ); - -: 3081: - -: 3082:#if FW_AMPCS_COMPATIBLE - -: 3083: // Serialize the argument size - -: 3084: _status = _logBuff.serialize( - -: 3085: static_cast(sizeof(extra_bytes)) - -: 3086: ); - -: 3087: FW_ASSERT( - -: 3088: _status == Fw::FW_SERIALIZE_OK, - -: 3089: static_cast(_status) - -: 3090: ); - -: 3091:#endif - -: 3092: - 7: 3093: _status = _logBuff.serialize(extra_bytes); - -: 3094: FW_ASSERT( - -: 3095: _status == Fw::FW_SERIALIZE_OK, - -: 3096: static_cast(_status) - 7: 3097: ); - -: 3098: - -: 3099: - 7: 3100: this->m_logOut_OutputPort[0].invoke( - -: 3101: _id, - -: 3102: _logTime,Fw::LOG_WARNING_HI, - -: 3103: _logBuff - 7: 3104: ); - -: 3105: - -: 3106: } - -: 3107: - -: 3108: // Emit the event on the text log port - -: 3109:#if FW_ENABLE_TEXT_LOGGING - 7: 3110: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 3111: - -: 3112:#if FW_OBJECT_NAMES == 1 - -: 3113: const char* _formatString = - 7: 3114: "(%s) %s: Sequence file %s header records mismatch: %d in header, found %d extra bytes."; - -: 3115:#else - -: 3116: const char* _formatString = - -: 3117: "%s: Sequence file %s header records mismatch: %d in header, found %d extra bytes."; - -: 3118:#endif - -: 3119: - -: 3120: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 3121: - 7: 3122: (void) snprintf( - -: 3123: _textBuffer, - -: 3124: FW_LOG_TEXT_BUFFER_SIZE, - -: 3125: _formatString, - -: 3126:#if FW_OBJECT_NAMES == 1 - -: 3127: this->m_objName, - -: 3128:#endif - -: 3129: "CS_RecordMismatch " - 7: 3130: , fileName.toChar() - -: 3131: , header_records - -: 3132: , extra_bytes - 7: 3133: ); - -: 3134: - -: 3135: // Null terminate - 7: 3136: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 14: 3137: Fw::TextLogString _logString = _textBuffer; - 7: 3138: this->m_LogText_OutputPort[0].invoke( - -: 3139: _id, - -: 3140: _logTime,Fw::TEXT_LOG_WARNING_HI, - -: 3141: _logString - 7: 3142: ); - -: 3143: - -: 3144: } - -: 3145:#endif - -: 3146: - 7: 3147: } - -: 3148: - -: 3149: - 9: 3150: void CmdSequencerComponentBase :: - -: 3151: log_WARNING_HI_CS_TimeBaseMismatch( - -: 3152: Fw::LogStringArg& fileName, U16 time_base, U16 seq_time_base - -: 3153: ) - -: 3154: { - -: 3155: - -: 3156: - -: 3157: // Get the time - 18: 3158: Fw::Time _logTime; - 9: 3159: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 9: 3160: this->m_timeCaller_OutputPort[0].invoke( _logTime); - -: 3161: } - -: 3162: - 9: 3163: FwEventIdType _id = static_cast(0); - -: 3164: - 9: 3165: _id = this->getIdBase() + EVENTID_CS_TIMEBASEMISMATCH; - -: 3166: - -: 3167: // Emit the event on the log port - 9: 3168: if (this->m_logOut_OutputPort[0].isConnected()) { - -: 3169: - 18: 3170: Fw::LogBuffer _logBuff; - 9: 3171: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 3172: - -: 3173:#if FW_AMPCS_COMPATIBLE - -: 3174: // Serialize the number of arguments - -: 3175: _status = _logBuff.serialize(static_cast(3)); - -: 3176: FW_ASSERT( - -: 3177: _status == Fw::FW_SERIALIZE_OK, - -: 3178: static_cast(_status) - -: 3179: ); - -: 3180:#endif - -: 3181: - 9: 3182: fileName.setMaxSerialize(60); - 9: 3183: _status = _logBuff.serialize(fileName); - -: 3184: FW_ASSERT( - -: 3185: _status == Fw::FW_SERIALIZE_OK, - -: 3186: static_cast(_status) - 9: 3187: ); - -: 3188: - -: 3189:#if FW_AMPCS_COMPATIBLE - -: 3190: // Serialize the argument size - -: 3191: _status = _logBuff.serialize( - -: 3192: static_cast(sizeof(time_base)) - -: 3193: ); - -: 3194: FW_ASSERT( - -: 3195: _status == Fw::FW_SERIALIZE_OK, - -: 3196: static_cast(_status) - -: 3197: ); - -: 3198:#endif - -: 3199: - 9: 3200: _status = _logBuff.serialize(time_base); - -: 3201: FW_ASSERT( - -: 3202: _status == Fw::FW_SERIALIZE_OK, - -: 3203: static_cast(_status) - 9: 3204: ); - -: 3205: - -: 3206:#if FW_AMPCS_COMPATIBLE - -: 3207: // Serialize the argument size - -: 3208: _status = _logBuff.serialize( - -: 3209: static_cast(sizeof(seq_time_base)) - -: 3210: ); - -: 3211: FW_ASSERT( - -: 3212: _status == Fw::FW_SERIALIZE_OK, - -: 3213: static_cast(_status) - -: 3214: ); - -: 3215:#endif - -: 3216: - 9: 3217: _status = _logBuff.serialize(seq_time_base); - -: 3218: FW_ASSERT( - -: 3219: _status == Fw::FW_SERIALIZE_OK, - -: 3220: static_cast(_status) - 9: 3221: ); - -: 3222: - -: 3223: - 9: 3224: this->m_logOut_OutputPort[0].invoke( - -: 3225: _id, - -: 3226: _logTime,Fw::LOG_WARNING_HI, - -: 3227: _logBuff - 9: 3228: ); - -: 3229: - -: 3230: } - -: 3231: - -: 3232: // Emit the event on the text log port - -: 3233:#if FW_ENABLE_TEXT_LOGGING - 9: 3234: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 3235: - -: 3236:#if FW_OBJECT_NAMES == 1 - -: 3237: const char* _formatString = - 9: 3238: "(%s) %s: Sequence file %s: Current time base doesn't match sequence time: base: %d seq: %d"; - -: 3239:#else - -: 3240: const char* _formatString = - -: 3241: "%s: Sequence file %s: Current time base doesn't match sequence time: base: %d seq: %d"; - -: 3242:#endif - -: 3243: - -: 3244: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 3245: - 18: 3246: (void) snprintf( - -: 3247: _textBuffer, - -: 3248: FW_LOG_TEXT_BUFFER_SIZE, - -: 3249: _formatString, - -: 3250:#if FW_OBJECT_NAMES == 1 - -: 3251: this->m_objName, - -: 3252:#endif - -: 3253: "CS_TimeBaseMismatch " - 9: 3254: , fileName.toChar() - -: 3255: , time_base - -: 3256: , seq_time_base - 9: 3257: ); - -: 3258: - -: 3259: // Null terminate - 9: 3260: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 18: 3261: Fw::TextLogString _logString = _textBuffer; - 9: 3262: this->m_LogText_OutputPort[0].invoke( - -: 3263: _id, - -: 3264: _logTime,Fw::TEXT_LOG_WARNING_HI, - -: 3265: _logString - 9: 3266: ); - -: 3267: - -: 3268: } - -: 3269:#endif - -: 3270: - 9: 3271: } - -: 3272: - -: 3273: - 9: 3274: void CmdSequencerComponentBase :: - -: 3275: log_WARNING_HI_CS_TimeContextMismatch( - -: 3276: Fw::LogStringArg& fileName, U8 currTimeBase, U8 seqTimeBase - -: 3277: ) - -: 3278: { - -: 3279: - -: 3280: - -: 3281: // Get the time - 18: 3282: Fw::Time _logTime; - 9: 3283: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 9: 3284: this->m_timeCaller_OutputPort[0].invoke( _logTime); - -: 3285: } - -: 3286: - 9: 3287: FwEventIdType _id = static_cast(0); - -: 3288: - 9: 3289: _id = this->getIdBase() + EVENTID_CS_TIMECONTEXTMISMATCH; - -: 3290: - -: 3291: // Emit the event on the log port - 9: 3292: if (this->m_logOut_OutputPort[0].isConnected()) { - -: 3293: - 18: 3294: Fw::LogBuffer _logBuff; - 9: 3295: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 3296: - -: 3297:#if FW_AMPCS_COMPATIBLE - -: 3298: // Serialize the number of arguments - -: 3299: _status = _logBuff.serialize(static_cast(3)); - -: 3300: FW_ASSERT( - -: 3301: _status == Fw::FW_SERIALIZE_OK, - -: 3302: static_cast(_status) - -: 3303: ); - -: 3304:#endif - -: 3305: - 9: 3306: fileName.setMaxSerialize(60); - 9: 3307: _status = _logBuff.serialize(fileName); - -: 3308: FW_ASSERT( - -: 3309: _status == Fw::FW_SERIALIZE_OK, - -: 3310: static_cast(_status) - 9: 3311: ); - -: 3312: - -: 3313:#if FW_AMPCS_COMPATIBLE - -: 3314: // Serialize the argument size - -: 3315: _status = _logBuff.serialize( - -: 3316: static_cast(sizeof(currTimeBase)) - -: 3317: ); - -: 3318: FW_ASSERT( - -: 3319: _status == Fw::FW_SERIALIZE_OK, - -: 3320: static_cast(_status) - -: 3321: ); - -: 3322:#endif - -: 3323: - 9: 3324: _status = _logBuff.serialize(currTimeBase); - -: 3325: FW_ASSERT( - -: 3326: _status == Fw::FW_SERIALIZE_OK, - -: 3327: static_cast(_status) - 9: 3328: ); - -: 3329: - -: 3330:#if FW_AMPCS_COMPATIBLE - -: 3331: // Serialize the argument size - -: 3332: _status = _logBuff.serialize( - -: 3333: static_cast(sizeof(seqTimeBase)) - -: 3334: ); - -: 3335: FW_ASSERT( - -: 3336: _status == Fw::FW_SERIALIZE_OK, - -: 3337: static_cast(_status) - -: 3338: ); - -: 3339:#endif - -: 3340: - 9: 3341: _status = _logBuff.serialize(seqTimeBase); - -: 3342: FW_ASSERT( - -: 3343: _status == Fw::FW_SERIALIZE_OK, - -: 3344: static_cast(_status) - 9: 3345: ); - -: 3346: - -: 3347: - 9: 3348: this->m_logOut_OutputPort[0].invoke( - -: 3349: _id, - -: 3350: _logTime,Fw::LOG_WARNING_HI, - -: 3351: _logBuff - 9: 3352: ); - -: 3353: - -: 3354: } - -: 3355: - -: 3356: // Emit the event on the text log port - -: 3357:#if FW_ENABLE_TEXT_LOGGING - 9: 3358: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 3359: - -: 3360:#if FW_OBJECT_NAMES == 1 - -: 3361: const char* _formatString = - 9: 3362: "(%s) %s: Sequence file %s: Current time context doesn't match sequence context: base: %d seq: %d"; - -: 3363:#else - -: 3364: const char* _formatString = - -: 3365: "%s: Sequence file %s: Current time context doesn't match sequence context: base: %d seq: %d"; - -: 3366:#endif - -: 3367: - -: 3368: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 3369: - 18: 3370: (void) snprintf( - -: 3371: _textBuffer, - -: 3372: FW_LOG_TEXT_BUFFER_SIZE, - -: 3373: _formatString, - -: 3374:#if FW_OBJECT_NAMES == 1 - -: 3375: this->m_objName, - -: 3376:#endif - -: 3377: "CS_TimeContextMismatch " - 9: 3378: , fileName.toChar() - -: 3379: , currTimeBase - -: 3380: , seqTimeBase - 9: 3381: ); - -: 3382: - -: 3383: // Null terminate - 9: 3384: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 18: 3385: Fw::TextLogString _logString = _textBuffer; - 9: 3386: this->m_LogText_OutputPort[0].invoke( - -: 3387: _id, - -: 3388: _logTime,Fw::TEXT_LOG_WARNING_HI, - -: 3389: _logString - 9: 3390: ); - -: 3391: - -: 3392: } - -: 3393:#endif - -: 3394: - 9: 3395: } - -: 3396: - -: 3397: - 9: 3398: void CmdSequencerComponentBase :: - -: 3399: log_ACTIVITY_HI_CS_PortSequenceStarted( - -: 3400: Fw::LogStringArg& filename - -: 3401: ) - -: 3402: { - -: 3403: - -: 3404: - -: 3405: // Get the time - 18: 3406: Fw::Time _logTime; - 9: 3407: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 9: 3408: this->m_timeCaller_OutputPort[0].invoke( _logTime); - -: 3409: } - -: 3410: - 9: 3411: FwEventIdType _id = static_cast(0); - -: 3412: - 9: 3413: _id = this->getIdBase() + EVENTID_CS_PORTSEQUENCESTARTED; - -: 3414: - -: 3415: // Emit the event on the log port - 9: 3416: if (this->m_logOut_OutputPort[0].isConnected()) { - -: 3417: - 18: 3418: Fw::LogBuffer _logBuff; - 9: 3419: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 3420: - -: 3421:#if FW_AMPCS_COMPATIBLE - -: 3422: // Serialize the number of arguments - -: 3423: _status = _logBuff.serialize(static_cast(1)); - -: 3424: FW_ASSERT( - -: 3425: _status == Fw::FW_SERIALIZE_OK, - -: 3426: static_cast(_status) - -: 3427: ); - -: 3428:#endif - -: 3429: - 9: 3430: filename.setMaxSerialize(60); - 9: 3431: _status = _logBuff.serialize(filename); - -: 3432: FW_ASSERT( - -: 3433: _status == Fw::FW_SERIALIZE_OK, - -: 3434: static_cast(_status) - 9: 3435: ); - -: 3436: - -: 3437: - 9: 3438: this->m_logOut_OutputPort[0].invoke( - -: 3439: _id, - -: 3440: _logTime,Fw::LOG_ACTIVITY_HI, - -: 3441: _logBuff - 9: 3442: ); - -: 3443: - -: 3444: } - -: 3445: - -: 3446: // Emit the event on the text log port - -: 3447:#if FW_ENABLE_TEXT_LOGGING - 9: 3448: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 3449: - -: 3450:#if FW_OBJECT_NAMES == 1 - -: 3451: const char* _formatString = - 9: 3452: "(%s) %s: Local request for sequence %s started."; - -: 3453:#else - -: 3454: const char* _formatString = - -: 3455: "%s: Local request for sequence %s started."; - -: 3456:#endif - -: 3457: - -: 3458: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 3459: - 9: 3460: (void) snprintf( - -: 3461: _textBuffer, - -: 3462: FW_LOG_TEXT_BUFFER_SIZE, - -: 3463: _formatString, - -: 3464:#if FW_OBJECT_NAMES == 1 - -: 3465: this->m_objName, - -: 3466:#endif - -: 3467: "CS_PortSequenceStarted " - 9: 3468: , filename.toChar() - 9: 3469: ); - -: 3470: - -: 3471: // Null terminate - 9: 3472: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 18: 3473: Fw::TextLogString _logString = _textBuffer; - 9: 3474: this->m_LogText_OutputPort[0].invoke( - -: 3475: _id, - -: 3476: _logTime,Fw::TEXT_LOG_ACTIVITY_HI, - -: 3477: _logString - 9: 3478: ); - -: 3479: - -: 3480: } - -: 3481:#endif - -: 3482: - 9: 3483: } - -: 3484: - -: 3485: - 9: 3486: void CmdSequencerComponentBase :: - -: 3487: log_WARNING_HI_CS_UnexpectedCompletion( - -: 3488: U32 opcode - -: 3489: ) - -: 3490: { - -: 3491: - -: 3492: - -: 3493: // Get the time - 18: 3494: Fw::Time _logTime; - 9: 3495: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 9: 3496: this->m_timeCaller_OutputPort[0].invoke( _logTime); - -: 3497: } - -: 3498: - 9: 3499: FwEventIdType _id = static_cast(0); - -: 3500: - 9: 3501: _id = this->getIdBase() + EVENTID_CS_UNEXPECTEDCOMPLETION; - -: 3502: - -: 3503: // Emit the event on the log port - 9: 3504: if (this->m_logOut_OutputPort[0].isConnected()) { - -: 3505: - 18: 3506: Fw::LogBuffer _logBuff; - 9: 3507: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 3508: - -: 3509:#if FW_AMPCS_COMPATIBLE - -: 3510: // Serialize the number of arguments - -: 3511: _status = _logBuff.serialize(static_cast(1)); - -: 3512: FW_ASSERT( - -: 3513: _status == Fw::FW_SERIALIZE_OK, - -: 3514: static_cast(_status) - -: 3515: ); - -: 3516:#endif - -: 3517: - -: 3518:#if FW_AMPCS_COMPATIBLE - -: 3519: // Serialize the argument size - -: 3520: _status = _logBuff.serialize( - -: 3521: static_cast(sizeof(opcode)) - -: 3522: ); - -: 3523: FW_ASSERT( - -: 3524: _status == Fw::FW_SERIALIZE_OK, - -: 3525: static_cast(_status) - -: 3526: ); - -: 3527:#endif - -: 3528: - 9: 3529: _status = _logBuff.serialize(opcode); - -: 3530: FW_ASSERT( - -: 3531: _status == Fw::FW_SERIALIZE_OK, - -: 3532: static_cast(_status) - 9: 3533: ); - -: 3534: - -: 3535: - 9: 3536: this->m_logOut_OutputPort[0].invoke( - -: 3537: _id, - -: 3538: _logTime,Fw::LOG_WARNING_HI, - -: 3539: _logBuff - 9: 3540: ); - -: 3541: - -: 3542: } - -: 3543: - -: 3544: // Emit the event on the text log port - -: 3545:#if FW_ENABLE_TEXT_LOGGING - 9: 3546: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 3547: - -: 3548:#if FW_OBJECT_NAMES == 1 - -: 3549: const char* _formatString = - 9: 3550: "(%s) %s: Command complete status received while no sequences active. Opcode: %d"; - -: 3551:#else - -: 3552: const char* _formatString = - -: 3553: "%s: Command complete status received while no sequences active. Opcode: %d"; - -: 3554:#endif - -: 3555: - -: 3556: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 3557: - 9: 3558: (void) snprintf( - -: 3559: _textBuffer, - -: 3560: FW_LOG_TEXT_BUFFER_SIZE, - -: 3561: _formatString, - -: 3562:#if FW_OBJECT_NAMES == 1 - -: 3563: this->m_objName, - -: 3564:#endif - -: 3565: "CS_UnexpectedCompletion " - -: 3566: , opcode - 9: 3567: ); - -: 3568: - -: 3569: // Null terminate - 9: 3570: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 18: 3571: Fw::TextLogString _logString = _textBuffer; - 9: 3572: this->m_LogText_OutputPort[0].invoke( - -: 3573: _id, - -: 3574: _logTime,Fw::TEXT_LOG_WARNING_HI, - -: 3575: _logString - 9: 3576: ); - -: 3577: - -: 3578: } - -: 3579:#endif - -: 3580: - 9: 3581: } - -: 3582: - -: 3583: - 27: 3584: void CmdSequencerComponentBase :: - -: 3585: log_ACTIVITY_HI_CS_ModeSwitched( - -: 3586: SeqMode mode - -: 3587: ) - -: 3588: { - -: 3589: - -: 3590: - -: 3591: // Get the time - 54: 3592: Fw::Time _logTime; - 27: 3593: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 27: 3594: this->m_timeCaller_OutputPort[0].invoke( _logTime); - -: 3595: } - -: 3596: - 27: 3597: FwEventIdType _id = static_cast(0); - -: 3598: - 27: 3599: _id = this->getIdBase() + EVENTID_CS_MODESWITCHED; - -: 3600: - -: 3601: // Emit the event on the log port - 27: 3602: if (this->m_logOut_OutputPort[0].isConnected()) { - -: 3603: - 54: 3604: Fw::LogBuffer _logBuff; - 27: 3605: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 3606: - -: 3607:#if FW_AMPCS_COMPATIBLE - -: 3608: // Serialize the number of arguments - -: 3609: _status = _logBuff.serialize(static_cast(1)); - -: 3610: FW_ASSERT( - -: 3611: _status == Fw::FW_SERIALIZE_OK, - -: 3612: static_cast(_status) - -: 3613: ); - -: 3614:#endif - -: 3615: - -: 3616:#if FW_AMPCS_COMPATIBLE - -: 3617: // Serialize the argument size - -: 3618: _status = _logBuff.serialize(static_cast(sizeof(FwEnumStoreType))); - -: 3619: FW_ASSERT( - -: 3620: _status == Fw::FW_SERIALIZE_OK, - -: 3621: static_cast(_status) - -: 3622: ); - -: 3623:#endif - -: 3624: - 27: 3625: _status = _logBuff.serialize( - -: 3626: static_cast(mode) - 27: 3627: ); - -: 3628: FW_ASSERT( - -: 3629: _status == Fw::FW_SERIALIZE_OK, - -: 3630: static_cast(_status) - 27: 3631: ); - -: 3632: - -: 3633: - 27: 3634: this->m_logOut_OutputPort[0].invoke( - -: 3635: _id, - -: 3636: _logTime,Fw::LOG_ACTIVITY_HI, - -: 3637: _logBuff - 27: 3638: ); - -: 3639: - -: 3640: } - -: 3641: - -: 3642: // Emit the event on the text log port - -: 3643:#if FW_ENABLE_TEXT_LOGGING - 27: 3644: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 3645: - -: 3646:#if FW_OBJECT_NAMES == 1 - -: 3647: const char* _formatString = - 27: 3648: "(%s) %s: Sequencer switched to %d step mode"; - -: 3649:#else - -: 3650: const char* _formatString = - -: 3651: "%s: Sequencer switched to %d step mode"; - -: 3652:#endif - -: 3653: - -: 3654: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 3655: - 27: 3656: (void) snprintf( - -: 3657: _textBuffer, - -: 3658: FW_LOG_TEXT_BUFFER_SIZE, - -: 3659: _formatString, - -: 3660:#if FW_OBJECT_NAMES == 1 - -: 3661: this->m_objName, - -: 3662:#endif - -: 3663: "CS_ModeSwitched " - -: 3664: , mode - 27: 3665: ); - -: 3666: - -: 3667: // Null terminate - 27: 3668: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 54: 3669: Fw::TextLogString _logString = _textBuffer; - 27: 3670: this->m_LogText_OutputPort[0].invoke( - -: 3671: _id, - -: 3672: _logTime,Fw::TEXT_LOG_ACTIVITY_HI, - -: 3673: _logString - 27: 3674: ); - -: 3675: - -: 3676: } - -: 3677:#endif - -: 3678: - 27: 3679: } - -: 3680: - -: 3681: - 18: 3682: void CmdSequencerComponentBase :: - -: 3683: log_WARNING_LO_CS_NoSequenceActive( - -: 3684: void - -: 3685: ) - -: 3686: { - -: 3687: - -: 3688: - -: 3689: // Get the time - 36: 3690: Fw::Time _logTime; - 18: 3691: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 18: 3692: this->m_timeCaller_OutputPort[0].invoke( _logTime); - -: 3693: } - -: 3694: - 18: 3695: FwEventIdType _id = static_cast(0); - -: 3696: - 18: 3697: _id = this->getIdBase() + EVENTID_CS_NOSEQUENCEACTIVE; - -: 3698: - -: 3699: // Emit the event on the log port - 18: 3700: if (this->m_logOut_OutputPort[0].isConnected()) { - -: 3701: - 36: 3702: Fw::LogBuffer _logBuff; - -: 3703:#if FW_AMPCS_COMPATIBLE - -: 3704: // for AMPCS, need to encode zero arguments - -: 3705: Fw::SerializeStatus _zero_status = Fw::FW_SERIALIZE_OK; - -: 3706: _zero_status = _logBuff.serialize(static_cast(0)); - -: 3707: FW_ASSERT( - -: 3708: _zero_status == Fw::FW_SERIALIZE_OK, - -: 3709: static_cast(_zero_status) - -: 3710: ); - -: 3711:#endif - -: 3712: - -: 3713: - 18: 3714: this->m_logOut_OutputPort[0].invoke( - -: 3715: _id, - -: 3716: _logTime,Fw::LOG_WARNING_LO, - -: 3717: _logBuff - 18: 3718: ); - -: 3719: - -: 3720: } - -: 3721: - -: 3722: // Emit the event on the text log port - -: 3723:#if FW_ENABLE_TEXT_LOGGING - 18: 3724: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 3725: - -: 3726:#if FW_OBJECT_NAMES == 1 - -: 3727: const char* _formatString = - 18: 3728: "(%s) %s: No sequence active."; - -: 3729:#else - -: 3730: const char* _formatString = - -: 3731: "%s: No sequence active."; - -: 3732:#endif - -: 3733: - -: 3734: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 3735: - 18: 3736: (void) snprintf( - -: 3737: _textBuffer, - -: 3738: FW_LOG_TEXT_BUFFER_SIZE, - -: 3739: _formatString, - -: 3740:#if FW_OBJECT_NAMES == 1 - -: 3741: this->m_objName, - -: 3742:#endif - -: 3743: "CS_NoSequenceActive " - 18: 3744: ); - -: 3745: - -: 3746: // Null terminate - 18: 3747: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 36: 3748: Fw::TextLogString _logString = _textBuffer; - 18: 3749: this->m_LogText_OutputPort[0].invoke( - -: 3750: _id, - -: 3751: _logTime,Fw::TEXT_LOG_WARNING_LO, - -: 3752: _logString - 18: 3753: ); - -: 3754: - -: 3755: } - -: 3756:#endif - -: 3757: - 18: 3758: } - -: 3759: - -: 3760: - 108: 3761: void CmdSequencerComponentBase :: - -: 3762: log_ACTIVITY_HI_CS_SequenceValid( - -: 3763: Fw::LogStringArg& filename - -: 3764: ) - -: 3765: { - -: 3766: - -: 3767: - -: 3768: // Get the time - 216: 3769: Fw::Time _logTime; - 108: 3770: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 108: 3771: this->m_timeCaller_OutputPort[0].invoke( _logTime); - -: 3772: } - -: 3773: - 108: 3774: FwEventIdType _id = static_cast(0); - -: 3775: - 108: 3776: _id = this->getIdBase() + EVENTID_CS_SEQUENCEVALID; - -: 3777: - -: 3778: // Emit the event on the log port - 108: 3779: if (this->m_logOut_OutputPort[0].isConnected()) { - -: 3780: - 216: 3781: Fw::LogBuffer _logBuff; - 108: 3782: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 3783: - -: 3784:#if FW_AMPCS_COMPATIBLE - -: 3785: // Serialize the number of arguments - -: 3786: _status = _logBuff.serialize(static_cast(1)); - -: 3787: FW_ASSERT( - -: 3788: _status == Fw::FW_SERIALIZE_OK, - -: 3789: static_cast(_status) - -: 3790: ); - -: 3791:#endif - -: 3792: - 108: 3793: filename.setMaxSerialize(60); - 108: 3794: _status = _logBuff.serialize(filename); - -: 3795: FW_ASSERT( - -: 3796: _status == Fw::FW_SERIALIZE_OK, - -: 3797: static_cast(_status) - 108: 3798: ); - -: 3799: - -: 3800: - 108: 3801: this->m_logOut_OutputPort[0].invoke( - -: 3802: _id, - -: 3803: _logTime,Fw::LOG_ACTIVITY_HI, - -: 3804: _logBuff - 108: 3805: ); - -: 3806: - -: 3807: } - -: 3808: - -: 3809: // Emit the event on the text log port - -: 3810:#if FW_ENABLE_TEXT_LOGGING - 108: 3811: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 3812: - -: 3813:#if FW_OBJECT_NAMES == 1 - -: 3814: const char* _formatString = - 108: 3815: "(%s) %s: Sequence %s is valid."; - -: 3816:#else - -: 3817: const char* _formatString = - -: 3818: "%s: Sequence %s is valid."; - -: 3819:#endif - -: 3820: - -: 3821: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 3822: - 108: 3823: (void) snprintf( - -: 3824: _textBuffer, - -: 3825: FW_LOG_TEXT_BUFFER_SIZE, - -: 3826: _formatString, - -: 3827:#if FW_OBJECT_NAMES == 1 - -: 3828: this->m_objName, - -: 3829:#endif - -: 3830: "CS_SequenceValid " - 108: 3831: , filename.toChar() - 108: 3832: ); - -: 3833: - -: 3834: // Null terminate - 108: 3835: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 216: 3836: Fw::TextLogString _logString = _textBuffer; - 108: 3837: this->m_LogText_OutputPort[0].invoke( - -: 3838: _id, - -: 3839: _logTime,Fw::TEXT_LOG_ACTIVITY_HI, - -: 3840: _logString - 108: 3841: ); - -: 3842: - -: 3843: } - -: 3844:#endif - -: 3845: - 108: 3846: } - -: 3847: - -: 3848: - 9: 3849: void CmdSequencerComponentBase :: - -: 3850: log_WARNING_HI_CS_SequenceTimeout( - -: 3851: Fw::LogStringArg& filename, U32 command - -: 3852: ) - -: 3853: { - -: 3854: - -: 3855: - -: 3856: // Get the time - 18: 3857: Fw::Time _logTime; - 9: 3858: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 9: 3859: this->m_timeCaller_OutputPort[0].invoke( _logTime); - -: 3860: } - -: 3861: - 9: 3862: FwEventIdType _id = static_cast(0); - -: 3863: - 9: 3864: _id = this->getIdBase() + EVENTID_CS_SEQUENCETIMEOUT; - -: 3865: - -: 3866: // Emit the event on the log port - 9: 3867: if (this->m_logOut_OutputPort[0].isConnected()) { - -: 3868: - 18: 3869: Fw::LogBuffer _logBuff; - 9: 3870: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 3871: - -: 3872:#if FW_AMPCS_COMPATIBLE - -: 3873: // Serialize the number of arguments - -: 3874: _status = _logBuff.serialize(static_cast(2)); - -: 3875: FW_ASSERT( - -: 3876: _status == Fw::FW_SERIALIZE_OK, - -: 3877: static_cast(_status) - -: 3878: ); - -: 3879:#endif - -: 3880: - 9: 3881: filename.setMaxSerialize(60); - 9: 3882: _status = _logBuff.serialize(filename); - -: 3883: FW_ASSERT( - -: 3884: _status == Fw::FW_SERIALIZE_OK, - -: 3885: static_cast(_status) - 9: 3886: ); - -: 3887: - -: 3888:#if FW_AMPCS_COMPATIBLE - -: 3889: // Serialize the argument size - -: 3890: _status = _logBuff.serialize( - -: 3891: static_cast(sizeof(command)) - -: 3892: ); - -: 3893: FW_ASSERT( - -: 3894: _status == Fw::FW_SERIALIZE_OK, - -: 3895: static_cast(_status) - -: 3896: ); - -: 3897:#endif - -: 3898: - 9: 3899: _status = _logBuff.serialize(command); - -: 3900: FW_ASSERT( - -: 3901: _status == Fw::FW_SERIALIZE_OK, - -: 3902: static_cast(_status) - 9: 3903: ); - -: 3904: - -: 3905: - 9: 3906: this->m_logOut_OutputPort[0].invoke( - -: 3907: _id, - -: 3908: _logTime,Fw::LOG_WARNING_HI, - -: 3909: _logBuff - 9: 3910: ); - -: 3911: - -: 3912: } - -: 3913: - -: 3914: // Emit the event on the text log port - -: 3915:#if FW_ENABLE_TEXT_LOGGING - 9: 3916: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 3917: - -: 3918:#if FW_OBJECT_NAMES == 1 - -: 3919: const char* _formatString = - 9: 3920: "(%s) %s: Sequence %s timed out on command %d"; - -: 3921:#else - -: 3922: const char* _formatString = - -: 3923: "%s: Sequence %s timed out on command %d"; - -: 3924:#endif - -: 3925: - -: 3926: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 3927: - 9: 3928: (void) snprintf( - -: 3929: _textBuffer, - -: 3930: FW_LOG_TEXT_BUFFER_SIZE, - -: 3931: _formatString, - -: 3932:#if FW_OBJECT_NAMES == 1 - -: 3933: this->m_objName, - -: 3934:#endif - -: 3935: "CS_SequenceTimeout " - 9: 3936: , filename.toChar() - -: 3937: , command - 9: 3938: ); - -: 3939: - -: 3940: // Null terminate - 9: 3941: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 18: 3942: Fw::TextLogString _logString = _textBuffer; - 9: 3943: this->m_LogText_OutputPort[0].invoke( - -: 3944: _id, - -: 3945: _logTime,Fw::TEXT_LOG_WARNING_HI, - -: 3946: _logString - 9: 3947: ); - -: 3948: - -: 3949: } - -: 3950:#endif - -: 3951: - 9: 3952: } - -: 3953: - -: 3954: - 63: 3955: void CmdSequencerComponentBase :: - -: 3956: log_ACTIVITY_HI_CS_CmdStepped( - -: 3957: Fw::LogStringArg& filename, U32 command - -: 3958: ) - -: 3959: { - -: 3960: - -: 3961: - -: 3962: // Get the time - 126: 3963: Fw::Time _logTime; - 63: 3964: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 63: 3965: this->m_timeCaller_OutputPort[0].invoke( _logTime); - -: 3966: } - -: 3967: - 63: 3968: FwEventIdType _id = static_cast(0); - -: 3969: - 63: 3970: _id = this->getIdBase() + EVENTID_CS_CMDSTEPPED; - -: 3971: - -: 3972: // Emit the event on the log port - 63: 3973: if (this->m_logOut_OutputPort[0].isConnected()) { - -: 3974: - 126: 3975: Fw::LogBuffer _logBuff; - 63: 3976: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 3977: - -: 3978:#if FW_AMPCS_COMPATIBLE - -: 3979: // Serialize the number of arguments - -: 3980: _status = _logBuff.serialize(static_cast(2)); - -: 3981: FW_ASSERT( - -: 3982: _status == Fw::FW_SERIALIZE_OK, - -: 3983: static_cast(_status) - -: 3984: ); - -: 3985:#endif - -: 3986: - 63: 3987: filename.setMaxSerialize(60); - 63: 3988: _status = _logBuff.serialize(filename); - -: 3989: FW_ASSERT( - -: 3990: _status == Fw::FW_SERIALIZE_OK, - -: 3991: static_cast(_status) - 63: 3992: ); - -: 3993: - -: 3994:#if FW_AMPCS_COMPATIBLE - -: 3995: // Serialize the argument size - -: 3996: _status = _logBuff.serialize( - -: 3997: static_cast(sizeof(command)) - -: 3998: ); - -: 3999: FW_ASSERT( - -: 4000: _status == Fw::FW_SERIALIZE_OK, - -: 4001: static_cast(_status) - -: 4002: ); - -: 4003:#endif - -: 4004: - 63: 4005: _status = _logBuff.serialize(command); - -: 4006: FW_ASSERT( - -: 4007: _status == Fw::FW_SERIALIZE_OK, - -: 4008: static_cast(_status) - 63: 4009: ); - -: 4010: - -: 4011: - 63: 4012: this->m_logOut_OutputPort[0].invoke( - -: 4013: _id, - -: 4014: _logTime,Fw::LOG_ACTIVITY_HI, - -: 4015: _logBuff - 63: 4016: ); - -: 4017: - -: 4018: } - -: 4019: - -: 4020: // Emit the event on the text log port - -: 4021:#if FW_ENABLE_TEXT_LOGGING - 63: 4022: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 4023: - -: 4024:#if FW_OBJECT_NAMES == 1 - -: 4025: const char* _formatString = - 63: 4026: "(%s) %s: Sequence %s command %d stepped"; - -: 4027:#else - -: 4028: const char* _formatString = - -: 4029: "%s: Sequence %s command %d stepped"; - -: 4030:#endif - -: 4031: - -: 4032: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 4033: - 63: 4034: (void) snprintf( - -: 4035: _textBuffer, - -: 4036: FW_LOG_TEXT_BUFFER_SIZE, - -: 4037: _formatString, - -: 4038:#if FW_OBJECT_NAMES == 1 - -: 4039: this->m_objName, - -: 4040:#endif - -: 4041: "CS_CmdStepped " - 63: 4042: , filename.toChar() - -: 4043: , command - 63: 4044: ); - -: 4045: - -: 4046: // Null terminate - 63: 4047: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 126: 4048: Fw::TextLogString _logString = _textBuffer; - 63: 4049: this->m_LogText_OutputPort[0].invoke( - -: 4050: _id, - -: 4051: _logTime,Fw::TEXT_LOG_ACTIVITY_HI, - -: 4052: _logString - 63: 4053: ); - -: 4054: - -: 4055: } - -: 4056:#endif - -: 4057: - 63: 4058: } - -: 4059: - -: 4060: - 18: 4061: void CmdSequencerComponentBase :: - -: 4062: log_ACTIVITY_HI_CS_CmdStarted( - -: 4063: Fw::LogStringArg& filename - -: 4064: ) - -: 4065: { - -: 4066: - -: 4067: - -: 4068: // Get the time - 36: 4069: Fw::Time _logTime; - 18: 4070: if (this->m_timeCaller_OutputPort[0].isConnected()) { - 18: 4071: this->m_timeCaller_OutputPort[0].invoke( _logTime); - -: 4072: } - -: 4073: - 18: 4074: FwEventIdType _id = static_cast(0); - -: 4075: - 18: 4076: _id = this->getIdBase() + EVENTID_CS_CMDSTARTED; - -: 4077: - -: 4078: // Emit the event on the log port - 18: 4079: if (this->m_logOut_OutputPort[0].isConnected()) { - -: 4080: - 36: 4081: Fw::LogBuffer _logBuff; - 18: 4082: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 4083: - -: 4084:#if FW_AMPCS_COMPATIBLE - -: 4085: // Serialize the number of arguments - -: 4086: _status = _logBuff.serialize(static_cast(1)); - -: 4087: FW_ASSERT( - -: 4088: _status == Fw::FW_SERIALIZE_OK, - -: 4089: static_cast(_status) - -: 4090: ); - -: 4091:#endif - -: 4092: - 18: 4093: filename.setMaxSerialize(60); - 18: 4094: _status = _logBuff.serialize(filename); - -: 4095: FW_ASSERT( - -: 4096: _status == Fw::FW_SERIALIZE_OK, - -: 4097: static_cast(_status) - 18: 4098: ); - -: 4099: - -: 4100: - 18: 4101: this->m_logOut_OutputPort[0].invoke( - -: 4102: _id, - -: 4103: _logTime,Fw::LOG_ACTIVITY_HI, - -: 4104: _logBuff - 18: 4105: ); - -: 4106: - -: 4107: } - -: 4108: - -: 4109: // Emit the event on the text log port - -: 4110:#if FW_ENABLE_TEXT_LOGGING - 18: 4111: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 4112: - -: 4113:#if FW_OBJECT_NAMES == 1 - -: 4114: const char* _formatString = - 18: 4115: "(%s) %s: Sequence %s started"; - -: 4116:#else - -: 4117: const char* _formatString = - -: 4118: "%s: Sequence %s started"; - -: 4119:#endif - -: 4120: - -: 4121: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 4122: - 18: 4123: (void) snprintf( - -: 4124: _textBuffer, - -: 4125: FW_LOG_TEXT_BUFFER_SIZE, - -: 4126: _formatString, - -: 4127:#if FW_OBJECT_NAMES == 1 - -: 4128: this->m_objName, - -: 4129:#endif - -: 4130: "CS_CmdStarted " - 18: 4131: , filename.toChar() - 18: 4132: ); - -: 4133: - -: 4134: // Null terminate - 18: 4135: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 36: 4136: Fw::TextLogString _logString = _textBuffer; - 18: 4137: this->m_LogText_OutputPort[0].invoke( - -: 4138: _id, - -: 4139: _logTime,Fw::TEXT_LOG_ACTIVITY_HI, - -: 4140: _logString - 18: 4141: ); - -: 4142: - -: 4143: } - -: 4144:#endif - -: 4145: - 18: 4146: } - -: 4147: - -: 4148: - -: 4149: // ---------------------------------------------------------------------- - -: 4150: // Calls for invocations received on typed input ports - -: 4151: // ---------------------------------------------------------------------- - -: 4152: - 9: 4153: void CmdSequencerComponentBase :: - -: 4154: m_p_pingIn_in( - -: 4155: Fw::PassiveComponentBase* callComp, - -: 4156: NATIVE_INT_TYPE portNum, - -: 4157: U32 key - -: 4158: ) - -: 4159: { - 9: 4160: FW_ASSERT(callComp); - -: 4161: CmdSequencerComponentBase* compPtr = - 9: 4162: (CmdSequencerComponentBase*) callComp; - 9: 4163: compPtr->pingIn_handlerBase(portNum, key); - 9: 4164: } - -: 4165: - 342: 4166: void CmdSequencerComponentBase :: - -: 4167: m_p_cmdResponseIn_in( - -: 4168: Fw::PassiveComponentBase* callComp, - -: 4169: NATIVE_INT_TYPE portNum, - -: 4170: FwOpcodeType opCode, U32 cmdSeq, Fw::CommandResponse response - -: 4171: ) - -: 4172: { - 342: 4173: FW_ASSERT(callComp); - -: 4174: CmdSequencerComponentBase* compPtr = - 342: 4175: (CmdSequencerComponentBase*) callComp; - 342: 4176: compPtr->cmdResponseIn_handlerBase(portNum, opCode, cmdSeq, response); - 342: 4177: } - -: 4178: - 108: 4179: void CmdSequencerComponentBase :: - -: 4180: m_p_schedIn_in( - -: 4181: Fw::PassiveComponentBase* callComp, - -: 4182: NATIVE_INT_TYPE portNum, - -: 4183: NATIVE_UINT_TYPE context - -: 4184: ) - -: 4185: { - 108: 4186: FW_ASSERT(callComp); - -: 4187: CmdSequencerComponentBase* compPtr = - 108: 4188: (CmdSequencerComponentBase*) callComp; - 108: 4189: compPtr->schedIn_handlerBase(portNum, context); - 108: 4190: } - -: 4191: - 27: 4192: void CmdSequencerComponentBase :: - -: 4193: m_p_seqRunIn_in( - -: 4194: Fw::PassiveComponentBase* callComp, - -: 4195: NATIVE_INT_TYPE portNum, - -: 4196: Fw::EightyCharString &filename - -: 4197: ) - -: 4198: { - 27: 4199: FW_ASSERT(callComp); - -: 4200: CmdSequencerComponentBase* compPtr = - 27: 4201: (CmdSequencerComponentBase*) callComp; - 27: 4202: compPtr->seqRunIn_handlerBase(portNum, filename); - 27: 4203: } - -: 4204: - -: 4205: // ---------------------------------------------------------------------- - -: 4206: // Port handler base-class functions for typed input ports - -: 4207: // ---------------------------------------------------------------------- - -: 4208: - 9: 4209: void CmdSequencerComponentBase :: - -: 4210: pingIn_handlerBase( - -: 4211: NATIVE_INT_TYPE portNum, - -: 4212: U32 key - -: 4213: ) - -: 4214: { - -: 4215: - -: 4216: // Make sure port number is valid - 9: 4217: FW_ASSERT(portNum < this->getNum_pingIn_InputPorts(),static_cast(portNum)); - -: 4218: - -: 4219: // Call pre-message hook - -: 4220: pingIn_preMsgHook( - -: 4221: portNum, - -: 4222: key - 9: 4223: ); - -: 4224: - 18: 4225: ComponentIpcSerializableBuffer msg; - 9: 4226: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 4227: - -: 4228: _status = msg.serialize( - -: 4229: static_cast(PINGIN_PING) - 9: 4230: ); - -: 4231: FW_ASSERT ( - -: 4232: _status == Fw::FW_SERIALIZE_OK, - -: 4233: static_cast(_status) - 9: 4234: ); - -: 4235: - 9: 4236: _status = msg.serialize(portNum); - -: 4237: FW_ASSERT ( - -: 4238: _status == Fw::FW_SERIALIZE_OK, - -: 4239: static_cast(_status) - 9: 4240: ); - -: 4241: - -: 4242: // Serialize argument key - 9: 4243: _status = msg.serialize(key); - -: 4244: FW_ASSERT( - -: 4245: _status == Fw::FW_SERIALIZE_OK, - -: 4246: static_cast(_status) - 9: 4247: ); - -: 4248: - -: 4249: - -: 4250: // send message - -: 4251: Os::Queue::QueueBlocking _block = - 9: 4252: Os::Queue::QUEUE_NONBLOCKING; - -: 4253: Os::Queue::QueueStatus qStatus = - 9: 4254: this->m_queue.send(msg, 0,_block); - -: 4255: FW_ASSERT( - -: 4256: qStatus == Os::Queue::QUEUE_OK, - -: 4257: static_cast(qStatus) - 9: 4258: ); - -: 4259: - 9: 4260: } - -: 4261: - 342: 4262: void CmdSequencerComponentBase :: - -: 4263: cmdResponseIn_handlerBase( - -: 4264: NATIVE_INT_TYPE portNum, - -: 4265: FwOpcodeType opCode, U32 cmdSeq, Fw::CommandResponse response - -: 4266: ) - -: 4267: { - -: 4268: - -: 4269: // Make sure port number is valid - 342: 4270: FW_ASSERT(portNum < this->getNum_cmdResponseIn_InputPorts(),static_cast(portNum)); - -: 4271: - -: 4272: // Call pre-message hook - -: 4273: cmdResponseIn_preMsgHook( - -: 4274: portNum, - -: 4275: opCode, cmdSeq, response - 342: 4276: ); - -: 4277: - 684: 4278: ComponentIpcSerializableBuffer msg; - 342: 4279: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 4280: - -: 4281: _status = msg.serialize( - -: 4282: static_cast(CMDRESPONSEIN_CMDRESPONSE) - 342: 4283: ); - -: 4284: FW_ASSERT ( - -: 4285: _status == Fw::FW_SERIALIZE_OK, - -: 4286: static_cast(_status) - 342: 4287: ); - -: 4288: - 342: 4289: _status = msg.serialize(portNum); - -: 4290: FW_ASSERT ( - -: 4291: _status == Fw::FW_SERIALIZE_OK, - -: 4292: static_cast(_status) - 342: 4293: ); - -: 4294: - -: 4295: // Serialize argument opCode - 342: 4296: _status = msg.serialize(opCode); - -: 4297: FW_ASSERT( - -: 4298: _status == Fw::FW_SERIALIZE_OK, - -: 4299: static_cast(_status) - 342: 4300: ); - -: 4301: - -: 4302: // Serialize argument cmdSeq - 342: 4303: _status = msg.serialize(cmdSeq); - -: 4304: FW_ASSERT( - -: 4305: _status == Fw::FW_SERIALIZE_OK, - -: 4306: static_cast(_status) - 342: 4307: ); - -: 4308: - -: 4309: // Serialize argument response - 342: 4310: _status = msg.serialize(static_cast(response)); - -: 4311: FW_ASSERT( - -: 4312: _status == Fw::FW_SERIALIZE_OK, - -: 4313: static_cast(_status) - 342: 4314: ); - -: 4315: - -: 4316: - -: 4317: // send message - -: 4318: Os::Queue::QueueBlocking _block = - 342: 4319: Os::Queue::QUEUE_NONBLOCKING; - -: 4320: Os::Queue::QueueStatus qStatus = - 342: 4321: this->m_queue.send(msg, 0,_block); - -: 4322: FW_ASSERT( - -: 4323: qStatus == Os::Queue::QUEUE_OK, - -: 4324: static_cast(qStatus) - 342: 4325: ); - -: 4326: - 342: 4327: } - -: 4328: - 108: 4329: void CmdSequencerComponentBase :: - -: 4330: schedIn_handlerBase( - -: 4331: NATIVE_INT_TYPE portNum, - -: 4332: NATIVE_UINT_TYPE context - -: 4333: ) - -: 4334: { - -: 4335: - -: 4336: // Make sure port number is valid - 108: 4337: FW_ASSERT(portNum < this->getNum_schedIn_InputPorts(),static_cast(portNum)); - -: 4338: - -: 4339: // Call pre-message hook - -: 4340: schedIn_preMsgHook( - -: 4341: portNum, - -: 4342: context - 108: 4343: ); - -: 4344: - 216: 4345: ComponentIpcSerializableBuffer msg; - 108: 4346: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 4347: - -: 4348: _status = msg.serialize( - -: 4349: static_cast(SCHEDIN_SCHED) - 108: 4350: ); - -: 4351: FW_ASSERT ( - -: 4352: _status == Fw::FW_SERIALIZE_OK, - -: 4353: static_cast(_status) - 108: 4354: ); - -: 4355: - 108: 4356: _status = msg.serialize(portNum); - -: 4357: FW_ASSERT ( - -: 4358: _status == Fw::FW_SERIALIZE_OK, - -: 4359: static_cast(_status) - 108: 4360: ); - -: 4361: - -: 4362: // Serialize argument context - 108: 4363: _status = msg.serialize(context); - -: 4364: FW_ASSERT( - -: 4365: _status == Fw::FW_SERIALIZE_OK, - -: 4366: static_cast(_status) - 108: 4367: ); - -: 4368: - -: 4369: - -: 4370: // send message - -: 4371: Os::Queue::QueueBlocking _block = - 108: 4372: Os::Queue::QUEUE_NONBLOCKING; - -: 4373: Os::Queue::QueueStatus qStatus = - 108: 4374: this->m_queue.send(msg, 0,_block); - -: 4375: FW_ASSERT( - -: 4376: qStatus == Os::Queue::QUEUE_OK, - -: 4377: static_cast(qStatus) - 108: 4378: ); - -: 4379: - 108: 4380: } - -: 4381: - 27: 4382: void CmdSequencerComponentBase :: - -: 4383: seqRunIn_handlerBase( - -: 4384: NATIVE_INT_TYPE portNum, - -: 4385: Fw::EightyCharString &filename - -: 4386: ) - -: 4387: { - -: 4388: - -: 4389: // Make sure port number is valid - 27: 4390: FW_ASSERT(portNum < this->getNum_seqRunIn_InputPorts(),static_cast(portNum)); - -: 4391: - -: 4392: // Call pre-message hook - -: 4393: seqRunIn_preMsgHook( - -: 4394: portNum, - -: 4395: filename - 27: 4396: ); - -: 4397: - 54: 4398: ComponentIpcSerializableBuffer msg; - 27: 4399: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 4400: - -: 4401: _status = msg.serialize( - -: 4402: static_cast(SEQRUNIN_CMDSEQIN) - 27: 4403: ); - -: 4404: FW_ASSERT ( - -: 4405: _status == Fw::FW_SERIALIZE_OK, - -: 4406: static_cast(_status) - 27: 4407: ); - -: 4408: - 27: 4409: _status = msg.serialize(portNum); - -: 4410: FW_ASSERT ( - -: 4411: _status == Fw::FW_SERIALIZE_OK, - -: 4412: static_cast(_status) - 27: 4413: ); - -: 4414: - -: 4415: // Serialize argument filename - 27: 4416: _status = msg.serialize(filename); - -: 4417: FW_ASSERT( - -: 4418: _status == Fw::FW_SERIALIZE_OK, - -: 4419: static_cast(_status) - 27: 4420: ); - -: 4421: - -: 4422: - -: 4423: // send message - -: 4424: Os::Queue::QueueBlocking _block = - 27: 4425: Os::Queue::QUEUE_NONBLOCKING; - -: 4426: Os::Queue::QueueStatus qStatus = - 27: 4427: this->m_queue.send(msg, 0,_block); - -: 4428: FW_ASSERT( - -: 4429: qStatus == Os::Queue::QUEUE_OK, - -: 4430: static_cast(qStatus) - 27: 4431: ); - -: 4432: - 27: 4433: } - -: 4434: - -: 4435: // ---------------------------------------------------------------------- - -: 4436: // Pre-message hooks for async input ports - -: 4437: // ---------------------------------------------------------------------- - -: 4438: - 9: 4439: void CmdSequencerComponentBase :: - -: 4440: pingIn_preMsgHook( - -: 4441: NATIVE_INT_TYPE portNum, - -: 4442: U32 key - -: 4443: ) - -: 4444: { - -: 4445: // Default: no-op - 9: 4446: } - -: 4447: - 342: 4448: void CmdSequencerComponentBase :: - -: 4449: cmdResponseIn_preMsgHook( - -: 4450: NATIVE_INT_TYPE portNum, - -: 4451: FwOpcodeType opCode, U32 cmdSeq, Fw::CommandResponse response - -: 4452: ) - -: 4453: { - -: 4454: // Default: no-op - 342: 4455: } - -: 4456: - 108: 4457: void CmdSequencerComponentBase :: - -: 4458: schedIn_preMsgHook( - -: 4459: NATIVE_INT_TYPE portNum, - -: 4460: NATIVE_UINT_TYPE context - -: 4461: ) - -: 4462: { - -: 4463: // Default: no-op - 108: 4464: } - -: 4465: - 27: 4466: void CmdSequencerComponentBase :: - -: 4467: seqRunIn_preMsgHook( - -: 4468: NATIVE_INT_TYPE portNum, - -: 4469: Fw::EightyCharString &filename - -: 4470: ) - -: 4471: { - -: 4472: // Default: no-op - 27: 4473: } - -: 4474: - -: 4475: // ---------------------------------------------------------------------- - -: 4476: // Message dispatch method for active and queued components. Called - -: 4477: // by active component thread or implementation code for queued components - -: 4478: // ---------------------------------------------------------------------- - -: 4479: - 1087: 4480: Fw::QueuedComponentBase::MsgDispatchStatus CmdSequencerComponentBase :: - -: 4481: doDispatch(void) - -: 4482: { - 2174: 4483: ComponentIpcSerializableBuffer msg; - -: 4484: NATIVE_INT_TYPE priority; - -: 4485: - 1087: 4486: Os::Queue::QueueStatus msgStatus = this->m_queue.receive(msg,priority,Os::Queue::QUEUE_BLOCKING); - -: 4487: FW_ASSERT( - -: 4488: msgStatus == Os::Queue::QUEUE_OK, - -: 4489: static_cast(msgStatus) - 1087: 4490: ); - -: 4491: - -: 4492: // Reset to beginning of buffer - 1087: 4493: msg.resetDeser(); - -: 4494: - -: 4495: NATIVE_INT_TYPE desMsg; - 1087: 4496: Fw::SerializeStatus deserStatus = msg.deserialize(desMsg); - -: 4497: FW_ASSERT( - -: 4498: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4499: static_cast(deserStatus) - 1087: 4500: ); - -: 4501: - 1087: 4502: MsgTypeEnum msgType = static_cast(desMsg); - -: 4503: - 1087: 4504: if (msgType == CMDSEQUENCER_COMPONENT_EXIT) { - #####: 4505: return MSG_DISPATCH_EXIT; - -: 4506: } - -: 4507: - -: 4508: NATIVE_INT_TYPE portNum; - 1087: 4509: deserStatus = msg.deserialize(portNum); - -: 4510: FW_ASSERT( - -: 4511: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4512: static_cast(deserStatus) - 1087: 4513: ); - -: 4514: - 1087: 4515: switch (msgType) { - -: 4516: - -: 4517: // Handle async input port pingIn - -: 4518: case PINGIN_PING: { - -: 4519: - -: 4520: // Deserialize argument key - -: 4521: U32 key; - 9: 4522: deserStatus = msg.deserialize(key); - -: 4523: FW_ASSERT( - -: 4524: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4525: static_cast(deserStatus) - 9: 4526: ); - -: 4527: - -: 4528: // Call handler function - -: 4529: this->pingIn_handler( - -: 4530: portNum, - -: 4531: key - 9: 4532: ); - -: 4533: - 9: 4534: break; - -: 4535: - -: 4536: } - -: 4537: - -: 4538: // Handle async input port cmdResponseIn - -: 4539: case CMDRESPONSEIN_CMDRESPONSE: { - -: 4540: - -: 4541: // Deserialize argument opCode - -: 4542: FwOpcodeType opCode; - 342: 4543: deserStatus = msg.deserialize(opCode); - -: 4544: FW_ASSERT( - -: 4545: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4546: static_cast(deserStatus) - 342: 4547: ); - -: 4548: - -: 4549: // Deserialize argument cmdSeq - -: 4550: U32 cmdSeq; - 342: 4551: deserStatus = msg.deserialize(cmdSeq); - -: 4552: FW_ASSERT( - -: 4553: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4554: static_cast(deserStatus) - 342: 4555: ); - -: 4556: - -: 4557: // Deserialize argument response - -: 4558: Fw::CommandResponse response; - -: 4559: FwEnumStoreType responseInt; - 342: 4560: deserStatus = msg.deserialize(responseInt); - 342: 4561: response = (Fw::CommandResponse) responseInt; - -: 4562: FW_ASSERT( - -: 4563: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4564: static_cast(deserStatus) - 342: 4565: ); - -: 4566: - -: 4567: // Call handler function - -: 4568: this->cmdResponseIn_handler( - -: 4569: portNum, - -: 4570: opCode, cmdSeq, response - 342: 4571: ); - -: 4572: - 342: 4573: break; - -: 4574: - -: 4575: } - -: 4576: - -: 4577: // Handle async input port schedIn - -: 4578: case SCHEDIN_SCHED: { - -: 4579: - -: 4580: // Deserialize argument context - -: 4581: NATIVE_UINT_TYPE context; - 108: 4582: deserStatus = msg.deserialize(context); - -: 4583: FW_ASSERT( - -: 4584: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4585: static_cast(deserStatus) - 108: 4586: ); - -: 4587: - -: 4588: // Call handler function - -: 4589: this->schedIn_handler( - -: 4590: portNum, - -: 4591: context - 108: 4592: ); - -: 4593: - 108: 4594: break; - -: 4595: - -: 4596: } - -: 4597: - -: 4598: // Handle async input port seqRunIn - -: 4599: case SEQRUNIN_CMDSEQIN: { - -: 4600: - -: 4601: // Deserialize argument filename - 54: 4602: Fw::EightyCharString filename; - 27: 4603: deserStatus = msg.deserialize(filename); - -: 4604: FW_ASSERT( - -: 4605: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4606: static_cast(deserStatus) - 27: 4607: ); - -: 4608: - -: 4609: // Call handler function - -: 4610: this->seqRunIn_handler( - -: 4611: portNum, - -: 4612: filename - 27: 4613: ); - -: 4614: - 27: 4615: break; - -: 4616: - -: 4617: } - -: 4618: - -: 4619: // Handle command CS_Run - -: 4620: case CMD_CS_RUN: { - -: 4621: // Deserialize opcode - -: 4622: FwOpcodeType opCode; - 190: 4623: deserStatus = msg.deserialize(opCode); - -: 4624: FW_ASSERT ( - -: 4625: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4626: static_cast(deserStatus) - 190: 4627: ); - -: 4628: - -: 4629: // Deserialize command sequence - -: 4630: U32 cmdSeq; - 190: 4631: deserStatus = msg.deserialize(cmdSeq); - -: 4632: FW_ASSERT ( - -: 4633: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4634: static_cast(deserStatus) - 190: 4635: ); - -: 4636: - -: 4637: // Deserialize command argument buffer - 380: 4638: Fw::CmdArgBuffer args; - 190: 4639: deserStatus = msg.deserialize(args); - -: 4640: FW_ASSERT ( - -: 4641: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4642: static_cast(deserStatus) - 190: 4643: ); - -: 4644: - -: 4645: // Reset buffer - 190: 4646: args.resetDeser(); - -: 4647: - -: 4648: // Deserialize argument fileName - 380: 4649: Fw::CmdStringArg fileName; - 190: 4650: deserStatus = args.deserialize(fileName); - 190: 4651: if (deserStatus != Fw::FW_SERIALIZE_OK) { - #####: 4652: if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { - -: 4653: this->cmdResponse_out( - -: 4654: opCode, - -: 4655: cmdSeq, - -: 4656: Fw::COMMAND_FORMAT_ERROR - #####: 4657: ); - -: 4658: } - -: 4659: // Don't crash the task if bad arguments were passed from the ground - #####: 4660: break; - -: 4661: } - -: 4662: - -: 4663: // Make sure there was no data left over. - -: 4664: // That means the argument buffer size was incorrect. - -: 4665:#if FW_CMD_CHECK_RESIDUAL - 190: 4666: if (args.getBuffLeft() != 0) { - #####: 4667: if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { - #####: 4668: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_FORMAT_ERROR); - -: 4669: } - -: 4670: // Don't crash the task if bad arguments were passed from the ground - #####: 4671: break; - -: 4672: } - -: 4673:#endif - -: 4674: // Call handler function - -: 4675: this->CS_Run_cmdHandler( - -: 4676: opCode, - -: 4677: cmdSeq, - -: 4678: fileName - 190: 4679: ); - -: 4680: - 190: 4681: break; - -: 4682: - -: 4683: } - -: 4684: - -: 4685: // Handle command CS_Validate - -: 4686: case CMD_CS_VALIDATE: { - -: 4687: // Deserialize opcode - -: 4688: FwOpcodeType opCode; - 231: 4689: deserStatus = msg.deserialize(opCode); - -: 4690: FW_ASSERT ( - -: 4691: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4692: static_cast(deserStatus) - 231: 4693: ); - -: 4694: - -: 4695: // Deserialize command sequence - -: 4696: U32 cmdSeq; - 231: 4697: deserStatus = msg.deserialize(cmdSeq); - -: 4698: FW_ASSERT ( - -: 4699: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4700: static_cast(deserStatus) - 231: 4701: ); - -: 4702: - -: 4703: // Deserialize command argument buffer - 462: 4704: Fw::CmdArgBuffer args; - 231: 4705: deserStatus = msg.deserialize(args); - -: 4706: FW_ASSERT ( - -: 4707: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4708: static_cast(deserStatus) - 231: 4709: ); - -: 4710: - -: 4711: // Reset buffer - 231: 4712: args.resetDeser(); - -: 4713: - -: 4714: // Deserialize argument fileName - 462: 4715: Fw::CmdStringArg fileName; - 231: 4716: deserStatus = args.deserialize(fileName); - 231: 4717: if (deserStatus != Fw::FW_SERIALIZE_OK) { - #####: 4718: if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { - -: 4719: this->cmdResponse_out( - -: 4720: opCode, - -: 4721: cmdSeq, - -: 4722: Fw::COMMAND_FORMAT_ERROR - #####: 4723: ); - -: 4724: } - -: 4725: // Don't crash the task if bad arguments were passed from the ground - #####: 4726: break; - -: 4727: } - -: 4728: - -: 4729: // Make sure there was no data left over. - -: 4730: // That means the argument buffer size was incorrect. - -: 4731:#if FW_CMD_CHECK_RESIDUAL - 231: 4732: if (args.getBuffLeft() != 0) { - #####: 4733: if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { - #####: 4734: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_FORMAT_ERROR); - -: 4735: } - -: 4736: // Don't crash the task if bad arguments were passed from the ground - #####: 4737: break; - -: 4738: } - -: 4739:#endif - -: 4740: // Call handler function - -: 4741: this->CS_Validate_cmdHandler( - -: 4742: opCode, - -: 4743: cmdSeq, - -: 4744: fileName - 231: 4745: ); - -: 4746: - 231: 4747: break; - -: 4748: - -: 4749: } - -: 4750: - -: 4751: // Handle command CS_Cancel - -: 4752: case CMD_CS_CANCEL: { - -: 4753: // Deserialize opcode - -: 4754: FwOpcodeType opCode; - 18: 4755: deserStatus = msg.deserialize(opCode); - -: 4756: FW_ASSERT ( - -: 4757: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4758: static_cast(deserStatus) - 18: 4759: ); - -: 4760: - -: 4761: // Deserialize command sequence - -: 4762: U32 cmdSeq; - 18: 4763: deserStatus = msg.deserialize(cmdSeq); - -: 4764: FW_ASSERT ( - -: 4765: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4766: static_cast(deserStatus) - 18: 4767: ); - -: 4768: - -: 4769: // Deserialize command argument buffer - 36: 4770: Fw::CmdArgBuffer args; - 18: 4771: deserStatus = msg.deserialize(args); - -: 4772: FW_ASSERT ( - -: 4773: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4774: static_cast(deserStatus) - 18: 4775: ); - -: 4776: - -: 4777: // Reset buffer - 18: 4778: args.resetDeser(); - -: 4779: - -: 4780: // Make sure there was no data left over. - -: 4781: // That means the argument buffer size was incorrect. - -: 4782:#if FW_CMD_CHECK_RESIDUAL - 18: 4783: if (args.getBuffLeft() != 0) { - #####: 4784: if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { - #####: 4785: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_FORMAT_ERROR); - -: 4786: } - -: 4787: // Don't crash the task if bad arguments were passed from the ground - #####: 4788: break; - -: 4789: } - -: 4790:#endif - -: 4791: // Call handler function - 18: 4792: this->CS_Cancel_cmdHandler(opCode, cmdSeq); - -: 4793: - 18: 4794: break; - -: 4795: - -: 4796: } - -: 4797: - -: 4798: // Handle command CS_Start - -: 4799: case CMD_CS_START: { - -: 4800: // Deserialize opcode - -: 4801: FwOpcodeType opCode; - 36: 4802: deserStatus = msg.deserialize(opCode); - -: 4803: FW_ASSERT ( - -: 4804: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4805: static_cast(deserStatus) - 36: 4806: ); - -: 4807: - -: 4808: // Deserialize command sequence - -: 4809: U32 cmdSeq; - 36: 4810: deserStatus = msg.deserialize(cmdSeq); - -: 4811: FW_ASSERT ( - -: 4812: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4813: static_cast(deserStatus) - 36: 4814: ); - -: 4815: - -: 4816: // Deserialize command argument buffer - 72: 4817: Fw::CmdArgBuffer args; - 36: 4818: deserStatus = msg.deserialize(args); - -: 4819: FW_ASSERT ( - -: 4820: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4821: static_cast(deserStatus) - 36: 4822: ); - -: 4823: - -: 4824: // Reset buffer - 36: 4825: args.resetDeser(); - -: 4826: - -: 4827: // Make sure there was no data left over. - -: 4828: // That means the argument buffer size was incorrect. - -: 4829:#if FW_CMD_CHECK_RESIDUAL - 36: 4830: if (args.getBuffLeft() != 0) { - #####: 4831: if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { - #####: 4832: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_FORMAT_ERROR); - -: 4833: } - -: 4834: // Don't crash the task if bad arguments were passed from the ground - #####: 4835: break; - -: 4836: } - -: 4837:#endif - -: 4838: // Call handler function - 36: 4839: this->CS_Start_cmdHandler(opCode, cmdSeq); - -: 4840: - 36: 4841: break; - -: 4842: - -: 4843: } - -: 4844: - -: 4845: // Handle command CS_Step - -: 4846: case CMD_CS_STEP: { - -: 4847: // Deserialize opcode - -: 4848: FwOpcodeType opCode; - 81: 4849: deserStatus = msg.deserialize(opCode); - -: 4850: FW_ASSERT ( - -: 4851: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4852: static_cast(deserStatus) - 81: 4853: ); - -: 4854: - -: 4855: // Deserialize command sequence - -: 4856: U32 cmdSeq; - 81: 4857: deserStatus = msg.deserialize(cmdSeq); - -: 4858: FW_ASSERT ( - -: 4859: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4860: static_cast(deserStatus) - 81: 4861: ); - -: 4862: - -: 4863: // Deserialize command argument buffer - 162: 4864: Fw::CmdArgBuffer args; - 81: 4865: deserStatus = msg.deserialize(args); - -: 4866: FW_ASSERT ( - -: 4867: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4868: static_cast(deserStatus) - 81: 4869: ); - -: 4870: - -: 4871: // Reset buffer - 81: 4872: args.resetDeser(); - -: 4873: - -: 4874: // Make sure there was no data left over. - -: 4875: // That means the argument buffer size was incorrect. - -: 4876:#if FW_CMD_CHECK_RESIDUAL - 81: 4877: if (args.getBuffLeft() != 0) { - #####: 4878: if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { - #####: 4879: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_FORMAT_ERROR); - -: 4880: } - -: 4881: // Don't crash the task if bad arguments were passed from the ground - #####: 4882: break; - -: 4883: } - -: 4884:#endif - -: 4885: // Call handler function - 81: 4886: this->CS_Step_cmdHandler(opCode, cmdSeq); - -: 4887: - 81: 4888: break; - -: 4889: - -: 4890: } - -: 4891: - -: 4892: // Handle command CS_Auto - -: 4893: case CMD_CS_AUTO: { - -: 4894: // Deserialize opcode - -: 4895: FwOpcodeType opCode; - 18: 4896: deserStatus = msg.deserialize(opCode); - -: 4897: FW_ASSERT ( - -: 4898: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4899: static_cast(deserStatus) - 18: 4900: ); - -: 4901: - -: 4902: // Deserialize command sequence - -: 4903: U32 cmdSeq; - 18: 4904: deserStatus = msg.deserialize(cmdSeq); - -: 4905: FW_ASSERT ( - -: 4906: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4907: static_cast(deserStatus) - 18: 4908: ); - -: 4909: - -: 4910: // Deserialize command argument buffer - 36: 4911: Fw::CmdArgBuffer args; - 18: 4912: deserStatus = msg.deserialize(args); - -: 4913: FW_ASSERT ( - -: 4914: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4915: static_cast(deserStatus) - 18: 4916: ); - -: 4917: - -: 4918: // Reset buffer - 18: 4919: args.resetDeser(); - -: 4920: - -: 4921: // Make sure there was no data left over. - -: 4922: // That means the argument buffer size was incorrect. - -: 4923:#if FW_CMD_CHECK_RESIDUAL - 18: 4924: if (args.getBuffLeft() != 0) { - #####: 4925: if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { - #####: 4926: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_FORMAT_ERROR); - -: 4927: } - -: 4928: // Don't crash the task if bad arguments were passed from the ground - #####: 4929: break; - -: 4930: } - -: 4931:#endif - -: 4932: // Call handler function - 18: 4933: this->CS_Auto_cmdHandler(opCode, cmdSeq); - -: 4934: - 18: 4935: break; - -: 4936: - -: 4937: } - -: 4938: - -: 4939: // Handle command CS_Manual - -: 4940: case CMD_CS_MANUAL: { - -: 4941: // Deserialize opcode - -: 4942: FwOpcodeType opCode; - 27: 4943: deserStatus = msg.deserialize(opCode); - -: 4944: FW_ASSERT ( - -: 4945: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4946: static_cast(deserStatus) - 27: 4947: ); - -: 4948: - -: 4949: // Deserialize command sequence - -: 4950: U32 cmdSeq; - 27: 4951: deserStatus = msg.deserialize(cmdSeq); - -: 4952: FW_ASSERT ( - -: 4953: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4954: static_cast(deserStatus) - 27: 4955: ); - -: 4956: - -: 4957: // Deserialize command argument buffer - 54: 4958: Fw::CmdArgBuffer args; - 27: 4959: deserStatus = msg.deserialize(args); - -: 4960: FW_ASSERT ( - -: 4961: deserStatus == Fw::FW_SERIALIZE_OK, - -: 4962: static_cast(deserStatus) - 27: 4963: ); - -: 4964: - -: 4965: // Reset buffer - 27: 4966: args.resetDeser(); - -: 4967: - -: 4968: // Make sure there was no data left over. - -: 4969: // That means the argument buffer size was incorrect. - -: 4970:#if FW_CMD_CHECK_RESIDUAL - 27: 4971: if (args.getBuffLeft() != 0) { - #####: 4972: if (this->m_cmdResponseOut_OutputPort[0].isConnected()) { - #####: 4973: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_FORMAT_ERROR); - -: 4974: } - -: 4975: // Don't crash the task if bad arguments were passed from the ground - #####: 4976: break; - -: 4977: } - -: 4978:#endif - -: 4979: // Call handler function - 27: 4980: this->CS_Manual_cmdHandler(opCode, cmdSeq); - -: 4981: - 27: 4982: break; - -: 4983: - -: 4984: } - -: 4985: - -: 4986: default: - #####: 4987: return MSG_DISPATCH_ERROR; - -: 4988: - -: 4989: } - -: 4990: - 1087: 4991: return MSG_DISPATCH_OK; - -: 4992: - -: 4993: } - -: 4994: - 27: 4995:} // end namespace Svc diff --git a/Svc/CmdSequencer/test/ut/output/CmdSequencerImpl.cpp.gcov b/Svc/CmdSequencer/test/ut/output/CmdSequencerImpl.cpp.gcov deleted file mode 100644 index dea4ff331a..0000000000 --- a/Svc/CmdSequencer/test/ut/output/CmdSequencerImpl.cpp.gcov +++ /dev/null @@ -1,771 +0,0 @@ - -: 0:Source:/home/tim/source/isf/Svc/CmdSequencer/CmdSequencerImpl.cpp - -: 0:Programs:11 - -: 1:// ====================================================================== - -: 2:// \title CmdSequencerImpl.cpp - -: 3:// \author Bocchino/Canham - -: 4:// \brief cpp file for CmdDispatcherComponentBase component implementation class - -: 5:// - -: 6:// \copyright - -: 7:// Copyright (C) 2009-2016 California Institute of Technology. - -: 8:// ALL RIGHTS RESERVED. United States Government Sponsorship - -: 9:// acknowledged. - -: 11:// - -: 18:// ====================================================================== - -: 19: - -: 20:#include - -: 21:#include - -: 22:#include - -: 23:#include - -: 24:#include - -: 25:extern "C" { - -: 26: #include - -: 27:} - -: 28: - -: 29:namespace Svc { - -: 30: - -: 31: // ---------------------------------------------------------------------- - -: 32: // Construction, initialization, and destruction - -: 33: // ---------------------------------------------------------------------- - -: 34: - 96: 35: CmdSequencerComponentImpl:: - -: 36:#if FW_OBJECT_NAMES == 1 - -: 37: CmdSequencerComponentImpl(const char* name) : - -: 38: CmdSequencerComponentBase(name), - -: 39:#else - -: 40: CmdSequencerComponentImpl(void) : - -: 41: CmdSequencerComponentBase(), - -: 42:#endif - -: 43: m_numRecords(0), - -: 44: m_timeBase(TB_DONT_CARE), - -: 45: m_timeContext(FW_CONTEXT_DONT_CARE), - -: 46: m_fileCRC(0), - -: 47: m_allocatorId(0), - -: 48: m_loadCmdCount(0), - -: 49: m_cancelCmdCount(0), - -: 50: m_errorCount(0), - -: 51: m_queueDepth(0), - -: 52: m_runMode(STOPPED), - -: 53: m_stepMode(AUTO), - -: 54: m_executedCount(0), - -: 55: m_totalExecutedCount(0), - -: 56: m_sequencesCompletedCount(0), - 96: 57: m_timeout(0) - -: 58: { - -: 59: - 96: 60: } - -: 61: - 96: 62: void CmdSequencerComponentImpl::init(const NATIVE_INT_TYPE queueDepth, - -: 63: const NATIVE_INT_TYPE instance) { - 96: 64: CmdSequencerComponentBase::init(queueDepth, instance); - 96: 65: } - -: 66: - 48: 67: void CmdSequencerComponentImpl::setTimeout(NATIVE_UINT_TYPE timeout) { - 48: 68: this->m_timeout = timeout; - 48: 69: } - -: 70: - 96: 71: void CmdSequencerComponentImpl::allocateBuffer(NATIVE_INT_TYPE identifier, Fw::MemAllocator& allocator, NATIVE_UINT_TYPE bytes) { - -: 72: // has to be at least as big as a header - 96: 73: FW_ASSERT(bytes >= SEQ_FILE_HEADER_SIZE); - 96: 74: this->m_allocatorId = identifier; - 96: 75: this->m_seqBuffer.setExtBuffer(static_cast(allocator.allocate(identifier,bytes)),bytes); - 96: 76: } - -: 77: - 87: 78: void CmdSequencerComponentImpl::deallocateBuffer(Fw::MemAllocator& allocator) { - 87: 79: allocator.deallocate(this->m_allocatorId,this->m_seqBuffer.getBuffAddr()); - 87: 80: this->m_seqBuffer.clear(); - 87: 81: } - -: 82: - 96: 83: CmdSequencerComponentImpl::~CmdSequencerComponentImpl(void) { - -: 84: - 96: 85: } - -: 86: - -: 87: // ---------------------------------------------------------------------- - -: 88: // Handler implementations - -: 89: // ---------------------------------------------------------------------- - -: 90: - 84: 91: void CmdSequencerComponentImpl::CS_Run_cmdHandler( - -: 92: FwOpcodeType opCode, - -: 93: U32 cmdSeq, - -: 94: const Fw::CmdStringArg& fileName) { - -: 95: - 84: 96: if (!this->requireRunMode(STOPPED)) { - 4: 97: this->cmdResponse_out(opCode, cmdSeq, Fw::COMMAND_EXECUTION_ERROR); - 4: 98: return; - -: 99: } - -: 100: - -: 101: // load commands - 80: 102: if (not this->performCmd_Load(fileName)) { - 36: 103: this->cmdResponse_out(opCode, cmdSeq, Fw::COMMAND_EXECUTION_ERROR); - 36: 104: return; - -: 105: } - -: 106: - 44: 107: this->m_executedCount = 0; - -: 108: - -: 109: // Check the step mode. If it is auto, start the sequence - 44: 110: if (AUTO == this->m_stepMode) { - 36: 111: this->m_runMode = RUNNING; - 36: 112: this->performCmd_Step(); - -: 113: } - -: 114: - 44: 115: this->cmdResponse_out(opCode, cmdSeq, Fw::COMMAND_OK); - -: 116: } - -: 117: - 104: 118: void CmdSequencerComponentImpl::CS_Validate_cmdHandler( - -: 119: FwOpcodeType opCode, /*!< The opcode*/ - -: 120: U32 cmdSeq, /*!< The command sequence number*/ - -: 121: const Fw::CmdStringArg& fileName) { /*!< The name of the sequence file*/ - -: 122: - 104: 123: if (!this->requireRunMode(STOPPED)) { - 4: 124: this->cmdResponse_out(opCode, cmdSeq, Fw::COMMAND_EXECUTION_ERROR); - 4: 125: return; - -: 126: } - -: 127: - -: 128: // load commands - 100: 129: if (not this->performCmd_Load(fileName)) { - 52: 130: this->cmdResponse_out(opCode, cmdSeq, Fw::COMMAND_EXECUTION_ERROR); - 52: 131: return; - -: 132: } - -: 133: - -: 134: // reset buffer - 48: 135: this->m_seqBuffer.resetSer(); - -: 136: - 48: 137: this->log_ACTIVITY_HI_CS_SequenceValid(this->m_logFileName); - -: 138: - 48: 139: this->cmdResponse_out(opCode, cmdSeq, Fw::COMMAND_OK); - -: 140: - -: 141: } - -: 142: - -: 143: //! Handler for input port seqRunIn - 12: 144: void CmdSequencerComponentImpl::seqRunIn_handler( - -: 145: NATIVE_INT_TYPE portNum, /*!< The port number*/ - -: 146: Fw::EightyCharString &filename /*!< The sequence file*/ - -: 147: ) { - -: 148: - 12: 149: if (!this->requireRunMode(STOPPED)) { - 4: 150: this->seqDone_out(0,0,0,Fw::COMMAND_EXECUTION_ERROR); - 12: 151: return; - -: 152: } - -: 153: - -: 154: // load commands - 12: 155: Fw::CmdStringArg cmdStr(filename); - 8: 156: if (not this->performCmd_Load(cmdStr)) { - 4: 157: this->seqDone_out(0,0,0,Fw::COMMAND_EXECUTION_ERROR); - 4: 158: return; - -: 159: } - -: 160: - 4: 161: this->m_executedCount = 0; - -: 162: - -: 163: // Check the step mode. If it is auto, start the sequence - 4: 164: if (AUTO == this->m_stepMode) { - 4: 165: this->m_runMode = RUNNING; - 4: 166: this->performCmd_Step(); - -: 167: } - -: 168: - 4: 169: this->log_ACTIVITY_HI_CS_PortSequenceStarted(this->m_logFileName); - -: 170: } - -: 171: - 8: 172: void CmdSequencerComponentImpl::CS_Cancel_cmdHandler( - -: 173: FwOpcodeType opCode, U32 cmdSeq) { - 8: 174: if (RUNNING == this->m_runMode) { - 4: 175: this->performCmd_Cancel(); - 8: 176: Fw::LogStringArg logStringArg(this->m_fileName); - 4: 177: this->log_ACTIVITY_HI_CS_SequenceCanceled(logStringArg); - 4: 178: ++this->m_cancelCmdCount; - 4: 179: this->tlmWrite_CS_CancelCommands(this->m_cancelCmdCount); - -: 180: } else { - 4: 181: this->log_WARNING_LO_CS_NoSequenceActive(); - -: 182: } - 8: 183: this->cmdResponse_out(opCode, cmdSeq, Fw::COMMAND_OK); - 8: 184: } - -: 185: - -: 186: // ---------------------------------------------------------------------- - -: 187: // Private helper methods - -: 188: // ---------------------------------------------------------------------- - -: 189: - 92: 190: void CmdSequencerComponentImpl::error(void) { - 92: 191: ++this->m_errorCount; - 92: 192: this->m_fileName = ""; - 92: 193: this->m_logFileName = ""; - 92: 194: this->tlmWrite_CS_Errors(m_errorCount); - 92: 195: } - -: 196: - 28: 197: void CmdSequencerComponentImpl::eventFileInvalid(FileReadStage stage, I32 error) { - 28: 198: this->log_WARNING_HI_CS_FileInvalid(this->m_logFileName,stage,error); - 28: 199: this->error(); - 28: 200: } - -: 201: - 4: 202: void CmdSequencerComponentImpl::eventTimeBaseMismatch(U32 currTimeBase, U32 seqTimeBase) { - 4: 203: this->log_WARNING_HI_CS_TimeBaseMismatch(this->m_logFileName,currTimeBase,seqTimeBase); - 4: 204: this->error(); - 4: 205: } - -: 206: - 4: 207: void CmdSequencerComponentImpl::eventTimeContextMismatch(U32 currTimeContext, U32 seqTimeContext) { - 4: 208: this->log_WARNING_HI_CS_TimeContextMismatch(this->m_logFileName,currTimeContext,seqTimeContext); - 4: 209: this->error(); - 4: 210: } - -: 211: - 4: 212: void CmdSequencerComponentImpl::eventFileReadError(void) { - 4: 213: this->log_WARNING_HI_CS_FileReadError(this->m_logFileName); - 4: 214: this->error(); - 4: 215: } - -: 216: - 4: 217: void CmdSequencerComponentImpl::eventFileSizeError(U32 size) { - 4: 218: this->log_WARNING_HI_CS_FileSizeError(this->m_logFileName,size); - 4: 219: this->error(); - 4: 220: } - -: 221: - 32: 222: void CmdSequencerComponentImpl::eventRecordInvalid(U32 n, I32 error) { - 32: 223: this->log_WARNING_HI_CS_RecordInvalid(this->m_logFileName, n, error); - 32: 224: this->error(); - 32: 225: } - -: 226: - 12: 227: void CmdSequencerComponentImpl::performCmd_Cancel(void) { - 12: 228: this->m_seqBuffer.resetDeser(); - 12: 229: this->m_runMode = STOPPED; - 12: 230: this->m_cmdTimer.clear(); - 12: 231: this->m_cmdTimeoutTimer.clear(); - 12: 232: this->m_executedCount = 0; - -: 233: // write sequence done port with error, if connected - 12: 234: if (this->isConnected_seqDone_OutputPort(0)) { - 12: 235: this->seqDone_out(0,0,0,Fw::COMMAND_EXECUTION_ERROR); - -: 236: } - -: 237: - 12: 238: } - -: 239: - 188: 240: bool CmdSequencerComponentImpl::performCmd_Load(const Fw::CmdStringArg& fileName) { - -: 241: - -: 242: // make sure there is a buffer allocated - 188: 243: FW_ASSERT(this->m_seqBuffer.getBuffAddr()); - -: 244: - 188: 245: this->m_fileName = fileName; - -: 246: // copy for events - 188: 247: this->m_logFileName = fileName; - -: 248: - 188: 249: if (!this->readSequenceFile()) { - 52: 250: return false; - -: 251: } - -: 252: - 136: 253: if (!this->validateBuffer()) { - 40: 254: return false; - -: 255: } - -: 256: - 96: 257: this->log_ACTIVITY_LO_CS_SequenceLoaded(this->m_logFileName); - 96: 258: ++this->m_loadCmdCount; - 96: 259: this->tlmWrite_CS_LoadCommands(this->m_loadCmdCount); - -: 260: - 96: 261: return true; - -: 262: - -: 263: } - -: 264: - 188: 265: bool CmdSequencerComponentImpl::readSequenceFile(void) { - -: 266: - -: 267: bool result; - -: 268: - 188: 269: Os::File::Status status = this->m_sequenceFile.open( - 188: 270: this->m_fileName.toChar(), Os::File::OPEN_READ); - -: 271: - 188: 272: if (status == Os::File::OP_OK) { - 176: 273: result = this->readOpenSequenceFile(); - 12: 274: } else if (status == Os::File::DOESNT_EXIST) { - 8: 275: this->log_WARNING_HI_CS_FileNotFound(this->m_logFileName); - 8: 276: this->error(); - 8: 277: result = false; - -: 278: } else { - 4: 279: this->eventFileReadError(); - 4: 280: result = false; - -: 281: } - -: 282: - 188: 283: this->m_sequenceFile.close(); - 188: 284: return result; - -: 285: - -: 286: } - -: 287: - 176: 288: bool CmdSequencerComponentImpl::readOpenSequenceFile(void) { - -: 289: - -: 290: U32 fileSize; - -: 291: - 176: 292: NATIVE_INT_TYPE readLen = SEQ_FILE_HEADER_SIZE; - -: 293: // temporarily borrow sequence buffer for header - 176: 294: Os::File::Status status = this->m_sequenceFile.read(this->m_seqBuffer.getBuffAddr(),readLen); - -: 295: - -: 296: // check read status - 176: 297: if (status != Os::File::OP_OK) { - 4: 298: this->eventFileInvalid(SEQ_READ_HEADER,this->m_sequenceFile.getLastError()); - 4: 299: return false; - -: 300: } - -: 301: - -: 302: // check read size - 172: 303: if (SEQ_FILE_HEADER_SIZE != readLen) { - 4: 304: this->eventFileInvalid(SEQ_READ_HEADER_SIZE,readLen); - 4: 305: return false; - -: 306: } - -: 307: - -: 308: // set buffer length to read size - 168: 309: FW_ASSERT(Fw::FW_SERIALIZE_OK == this->m_seqBuffer.setBuffLen(readLen)); - -: 310: - -: 311: // deserialize size of file - 168: 312: Fw::SerializeStatus stat = this->m_seqBuffer.deserialize(fileSize); - 168: 313: if (stat != Fw::FW_SERIALIZE_OK) { - #####: 314: this->eventFileInvalid(SEQ_DESER_SIZE,stat); - #####: 315: return false; - -: 316: } - -: 317: - 168: 318: if (fileSize > this->m_seqBuffer.getBuffCapacity()) { - 4: 319: this->eventFileSizeError(fileSize); - 4: 320: return false; - -: 321: } - -: 322: - -: 323: // deserialize number of records - 164: 324: stat = this->m_seqBuffer.deserialize(this->m_numRecords); - 164: 325: if (stat != Fw::FW_SERIALIZE_OK) { - #####: 326: this->eventFileInvalid(SEQ_DESER_NUM_RECORDS,stat); - #####: 327: return false; - -: 328: } - -: 329: - -: 330: // deserialize time base of sequence - -: 331: FwTimeBaseStoreType tbase; - 164: 332: stat = this->m_seqBuffer.deserialize(tbase); - 164: 333: if (stat != Fw::FW_SERIALIZE_OK) { - #####: 334: this->eventFileInvalid(SEQ_DESER_TIME_BASE,stat); - #####: 335: return false; - -: 336: } - -: 337: - 164: 338: this->m_timeBase = static_cast(tbase); - -: 339: - -: 340: // check time base - 328: 341: Fw::Time check = this->getTime(); - 164: 342: if ( - 168: 343: (check.getTimeBase() != this->m_timeBase) and - 4: 344: (this->m_timeBase != TB_DONT_CARE) - -: 345: ) { - 4: 346: this->eventTimeBaseMismatch(check.getTimeBase(),this->m_timeBase); - 4: 347: return false; - -: 348: } - -: 349: // set to actual time base for later - 160: 350: this->m_timeBase = check.getTimeBase(); - -: 351: - -: 352: // deserialize time context - 160: 353: stat = this->m_seqBuffer.deserialize(this->m_timeContext); - 160: 354: if (stat != Fw::FW_SERIALIZE_OK) { - #####: 355: this->eventFileInvalid(SEQ_DESER_TIME_CONTEXT,stat); - #####: 356: return false; - -: 357: } - -: 358: - -: 359: // check time context - 160: 360: if ( - 164: 361: (check.getContext() != this->m_timeContext) and - 4: 362: (this->m_timeContext != FW_CONTEXT_DONT_CARE) - -: 363: ) { - 4: 364: this->eventTimeContextMismatch(check.getContext(),this->m_timeContext); - 4: 365: return false; - -: 366: } - -: 367: - -: 368: // set to actual time context for later - 156: 369: this->m_timeContext = check.getContext(); - -: 370: - -: 371: // compute CRC over header - 156: 372: this->initCrc(this->m_fileCRC); - -: 373: - 156: 374: this->updateCRC(this->m_fileCRC,this->m_seqBuffer.getBuffAddr(),SEQ_FILE_HEADER_SIZE); - -: 375: - -: 376: // read sequence data - -: 377: - 156: 378: readLen = fileSize; - 156: 379: status = this->m_sequenceFile.read(this->m_seqBuffer.getBuffAddr(),readLen); - -: 380: // check read status - 156: 381: if (status != Os::File::OP_OK) { - 4: 382: this->eventFileInvalid(SEQ_READ_SEQ_DATA,this->m_sequenceFile.getLastError()); - 4: 383: return false; - -: 384: } - -: 385: - -: 386: // check read size - 152: 387: if ((NATIVE_INT_TYPE)fileSize != readLen) { - 4: 388: this->eventFileInvalid(SEQ_READ_SEQ_DATA_SIZE,readLen); - 4: 389: return false; - -: 390: } - -: 391: - -: 392: // set sequence buffer size - 148: 393: FW_ASSERT(Fw::FW_SERIALIZE_OK == this->m_seqBuffer.setBuffLen(fileSize)); - -: 394: - -: 395: // compute CRC over rest of file. Will be checked in validateBuffer() - -: 396: - -: 397: // buffer should be at least as large as a CRC - 148: 398: if (this->m_seqBuffer.getBuffLength() < sizeof(this->m_fileCRC)) { - 12: 399: this->eventFileInvalid(SEQ_READ_SEQ_CRC,this->m_seqBuffer.getBuffLength()); - 12: 400: return false; - -: 401: } else { - 272: 402: this->updateCRC(this->m_fileCRC, - 136: 403: this->m_seqBuffer.getBuffAddr(), - 136: 404: fileSize-sizeof(this->m_fileCRC)); - -: 405: - -: 406: // finalize CRC - 136: 407: this->finalizeCRC(this->m_fileCRC); - 136: 408: return true; - -: 409: } - -: 410: - -: 411: - -: 412: } - -: 413: - 136: 414: bool CmdSequencerComponentImpl::validateBuffer(void) { - -: 415: - -: 416: // validate CRC - -: 417: - -: 418: // Get CRC from the data file - -: 419: U32 storedCrc; - -: 420: - -: 421: // point at CRC bytes - 136: 422: Fw::ExternalSerializeBuffer crcBuff(&this->m_seqBuffer.getBuffAddr()[this->m_seqBuffer.getBuffLength()-sizeof(storedCrc)], - 272: 423: sizeof(storedCrc)); - -: 424: // set buffer size to length of CRC - 136: 425: FW_ASSERT(Fw::FW_SERIALIZE_OK == crcBuff.setBuffLen(sizeof(storedCrc))); - -: 426: - -: 427: // deserialize CRC value - 136: 428: Fw::SerializeStatus stat = crcBuff.deserialize(storedCrc); - 136: 429: FW_ASSERT(stat == Fw::FW_SERIALIZE_OK,stat); - -: 430: - -: 431: // compare CRC - 136: 432: if (storedCrc != this->m_fileCRC) { - 4: 433: this->log_WARNING_HI_CS_FileCrcFailure(this->m_logFileName,storedCrc,this->m_fileCRC); - 4: 434: this->error(); - 4: 435: return false; - -: 436: } - -: 437: - 264: 438: CmdRecord rec; - -: 439: - 592: 440: for (NATIVE_UINT_TYPE record = 0; record < this->m_numRecords; record++) { - 492: 441: Fw::SerializeStatus stat = rec.deserialize(this->m_seqBuffer); - 492: 442: if (stat != Fw::FW_SERIALIZE_OK) { - 32: 443: this->eventRecordInvalid(record,stat); - 32: 444: return false; - -: 445: } - -: 446: } - -: 447: - -: 448: // there should only be the CRC left - 100: 449: if (this->m_seqBuffer.getBuffLeft() != sizeof(this->m_fileCRC)) { - 4: 450: this->log_WARNING_HI_CS_RecordMismatch(this->m_logFileName,this->m_numRecords,this->m_seqBuffer.getBuffLeft()-sizeof(this->m_fileCRC)); - 4: 451: return false; - -: 452: } - -: 453: - -: 454: // rewind deserialization - 96: 455: this->m_seqBuffer.resetDeser(); - -: 456: // set buffer to size minus CRC now that it's validated - 96: 457: FW_ASSERT(Fw::FW_SERIALIZE_OK == this->m_seqBuffer.setBuffLen(this->m_seqBuffer.getBuffLength()-sizeof(this->m_fileCRC))); - -: 458: - 96: 459: return true; - -: 460: - -: 461: } - -: 462: - 152: 463: void CmdSequencerComponentImpl::cmdResponseIn_handler( - -: 464: NATIVE_INT_TYPE portNum, - -: 465: FwOpcodeType opcode, U32 cmdSeq, Fw::CommandResponse response) { - -: 466: // check to see if sequencer is running - -: 467: - 152: 468: if (this->m_runMode == STOPPED) { - 4: 469: this->log_WARNING_HI_CS_UnexpectedCompletion(opcode); - -: 470: } else { - -: 471: // clear command timeout - 148: 472: this->m_cmdTimeoutTimer.clear(); - 148: 473: if (response != Fw::COMMAND_OK) { - 4: 474: this->commandError(this->m_executedCount, opcode, response); - 4: 475: this->performCmd_Cancel(); - 144: 476: } else if (this->m_runMode == RUNNING && this->m_stepMode == AUTO) { - 108: 477: this->commandComplete(opcode); - -: 478: // check to see if there is any data left - 216: 479: if (this->m_seqBuffer.getBuffLeft() == 0) { - 8: 480: this->m_runMode = STOPPED; - 8: 481: this->sequenceComplete(); - -: 482: } else { - 100: 483: this->performCmd_Step(); - -: 484: } - -: 485: } else { // manual step mode - 36: 486: this->commandComplete(opcode); - 36: 487: if (this->m_seqBuffer.getBuffLeft() == 0) { - 4: 488: this->m_runMode = STOPPED; - 4: 489: this->sequenceComplete(); - -: 490: } - -: 491: } - -: 492: } - 152: 493: } - -: 494: - 48: 495: void CmdSequencerComponentImpl::schedIn_handler(NATIVE_INT_TYPE portNum, - -: 496: NATIVE_UINT_TYPE order) { - -: 497: - 96: 498: Fw::Time currTime = this->getTime(); - -: 499: // check to see if a command time is pending - 48: 500: if (this->m_cmdTimer.isExpiredAt(currTime)) { - 20: 501: this->comCmdOut_out(0, m_cmdRecord.m_command, 0); - 20: 502: this->m_cmdTimer.clear(); - -: 503: // start command timeout timer - 20: 504: this->setCmdTimeout(currTime); - 28: 505: } else if (this->m_cmdTimeoutTimer.isExpiredAt(this->getTime())) { // check for command timeout - 4: 506: this->log_WARNING_HI_CS_SequenceTimeout(m_logFileName,this->m_executedCount); - -: 507: // If there is a command timeout, cancel the sequence - 4: 508: this->performCmd_Cancel(); - -: 509: } - 48: 510: } - -: 511: - 16: 512: void CmdSequencerComponentImpl::CS_Start_cmdHandler( - -: 513: FwOpcodeType opcode, U32 cmdSeq) { - -: 514: - -: 515: // make sure a sequence is loaded - 16: 516: if (this->m_seqBuffer.getBuffLength() == 0) { - 4: 517: this->log_WARNING_LO_CS_NoSequenceActive(); - 4: 518: this->cmdResponse_out(opcode, cmdSeq, Fw::COMMAND_EXECUTION_ERROR); - 4: 519: return; - -: 520: } - 12: 521: if (!this->requireRunMode(STOPPED)) { - 4: 522: this->cmdResponse_out(opcode, cmdSeq, Fw::COMMAND_EXECUTION_ERROR); - 4: 523: return; - -: 524: } - 8: 525: this->m_runMode = RUNNING; - 8: 526: this->performCmd_Step(); - 8: 527: this->log_ACTIVITY_HI_CS_CmdStarted(this->m_logFileName); - 8: 528: this->cmdResponse_out(opcode, cmdSeq, Fw::COMMAND_OK); - -: 529: } - -: 530: - 36: 531: void CmdSequencerComponentImpl::CS_Step_cmdHandler( - -: 532: FwOpcodeType opcode, U32 cmdSeq) { - 36: 533: if (this->requireRunMode(RUNNING)) { - 32: 534: this->performCmd_Step(); - -: 535: // check for special case where end of sequence entry was encountered - 32: 536: if (this->m_runMode != STOPPED) { - 28: 537: this->log_ACTIVITY_HI_CS_CmdStepped(this->m_logFileName,this->m_executedCount); - -: 538: } - 32: 539: this->cmdResponse_out(opcode, cmdSeq, Fw::COMMAND_OK); - -: 540: } else { - 4: 541: this->cmdResponse_out(opcode, cmdSeq, Fw::COMMAND_EXECUTION_ERROR); - -: 542: } - 36: 543: } - -: 544: - 8: 545: void CmdSequencerComponentImpl::CS_Auto_cmdHandler( - -: 546: FwOpcodeType opcode, U32 cmdSeq) { - 8: 547: if (this->requireRunMode(STOPPED)) { - 4: 548: this->m_stepMode = AUTO; - 4: 549: this->log_ACTIVITY_HI_CS_ModeSwitched(SEQ_AUTO_MODE); - 4: 550: this->cmdResponse_out(opcode, cmdSeq, Fw::COMMAND_OK); - -: 551: } else { - 4: 552: this->cmdResponse_out(opcode, cmdSeq, Fw::COMMAND_EXECUTION_ERROR); - -: 553: } - 8: 554: } - -: 555: - 12: 556: void CmdSequencerComponentImpl::CS_Manual_cmdHandler( - -: 557: FwOpcodeType opcode, U32 cmdSeq) { - 12: 558: if (this->requireRunMode(STOPPED)) { - 8: 559: this->m_stepMode = MANUAL; - 8: 560: this->log_ACTIVITY_HI_CS_ModeSwitched(SEQ_STEP_MODE); - 8: 561: this->cmdResponse_out(opcode, cmdSeq, Fw::COMMAND_OK); - -: 562: } else { - 4: 563: this->cmdResponse_out(opcode, cmdSeq, Fw::COMMAND_EXECUTION_ERROR); - -: 564: } - 12: 565: } - -: 566: - -: 567: // ---------------------------------------------------------------------- - -: 568: // Helper methods - -: 569: // ---------------------------------------------------------------------- - -: 570: - 268: 571: bool CmdSequencerComponentImpl::requireRunMode(RunMode mode) { - 268: 572: if (this->m_runMode == mode) { - 240: 573: return true; - -: 574: } else { - 28: 575: this->log_WARNING_HI_CS_InvalidMode(); - 28: 576: return false; - -: 577: } - -: 578: } - -: 579: - 4: 580: void CmdSequencerComponentImpl::commandError(const U32 number, - -: 581: const U32 opCode, const U32 error) { - 8: 582: Fw::LogStringArg fileStr(this->m_fileName); - 4: 583: this->log_WARNING_HI_CS_CommandError(fileStr,number, opCode, error); - 4: 584: this->error(); - 4: 585: } - -: 586: - 180: 587: void CmdSequencerComponentImpl::performCmd_Step(void) { - -: 588: - -: 589: // deserialize next record. The buffer was previously validated, - -: 590: // so a failure here should be asserted - -: 591: - 180: 592: Fw::SerializeStatus stat = this->m_cmdRecord.deserialize(this->m_seqBuffer); - 180: 593: FW_ASSERT(Fw::FW_SERIALIZE_OK == stat,stat); - -: 594: // set clock time base and context from value set when sequence was loaded - 180: 595: this->m_cmdRecord.m_timeTag.setTimeBase(this->m_timeBase); - 180: 596: this->m_cmdRecord.m_timeTag.setTimeContext(this->m_timeContext); - -: 597: - 360: 598: Fw::Time currentTime = this->getTime(); - 180: 599: switch (this->m_cmdRecord.m_descriptor) { - -: 600: case END_OF_SEQUENCE: - 20: 601: this->m_runMode = STOPPED; - 20: 602: this->sequenceComplete(); - 20: 603: break; - -: 604: case RELATIVE: - 156: 605: this->performCmd_Step_RELATIVE(currentTime); - 156: 606: break; - -: 607: case ABSOLUTE: - 4: 608: this->performCmd_Step_ABSOLUTE(currentTime); - 4: 609: break; - -: 610: default: - #####: 611: FW_ASSERT(0, m_cmdRecord.m_descriptor); - -: 612: } - 180: 613: } - -: 614: - 32: 615: void CmdSequencerComponentImpl::sequenceComplete(void) { - 32: 616: ++this->m_sequencesCompletedCount; - -: 617: // reset buffer - 32: 618: this->m_seqBuffer.resetSer(); - 64: 619: Fw::LogStringArg fileStr(this->m_fileName); - 32: 620: this->log_ACTIVITY_HI_CS_SequenceComplete(fileStr); - 32: 621: this->tlmWrite_CS_SequencesCompleted(this->m_sequencesCompletedCount); - 32: 622: this->m_executedCount = 0; - -: 623: // write sequence done port, if connected - 32: 624: if (this->isConnected_seqDone_OutputPort(0)) { - 32: 625: this->seqDone_out(0,0,0,Fw::COMMAND_OK); - -: 626: } - 32: 627: } - -: 628: - 144: 629: void CmdSequencerComponentImpl::commandComplete(const U32 opcode) { - 288: 630: Fw::LogStringArg fileStr(this->m_fileName); - 144: 631: this->log_ACTIVITY_LO_CS_CommandComplete(fileStr,this->m_executedCount, opcode); - 144: 632: ++this->m_executedCount; - 144: 633: ++this->m_totalExecutedCount; - 144: 634: this->tlmWrite_CS_CommandsExecuted(this->m_totalExecutedCount); - 144: 635: } - -: 636: - 156: 637: void CmdSequencerComponentImpl::performCmd_Step_RELATIVE( - -: 638: Fw::Time& currentTime) { - -: 639: - 156: 640: this->m_cmdRecord.m_timeTag.add(currentTime.getSeconds(),currentTime.getUSeconds()); - 156: 641: this->performCmd_Step_ABSOLUTE(currentTime); - 156: 642: } - -: 643: - 160: 644: void CmdSequencerComponentImpl::performCmd_Step_ABSOLUTE( - -: 645: Fw::Time& currentTime) { - -: 646: - 160: 647: if (currentTime >= this->m_cmdRecord.m_timeTag) { - 140: 648: this->comCmdOut_out(0, m_cmdRecord.m_command, 0); - 140: 649: this->setCmdTimeout(currentTime); - -: 650: } else { - 20: 651: this->m_cmdTimer.set(this->m_cmdRecord.m_timeTag); - -: 652: } - 160: 653: } - -: 654: - 80: 655: void CmdSequencerComponentImpl::preamble(void){ - -: 656: // make sure a buffer has been allocated - 80: 657: FW_ASSERT(this->m_seqBuffer.getBuffAddr()); - 80: 658: FW_ASSERT(this->m_seqBuffer.getBuffCapacity()); - 80: 659: } - -: 660: - #####: 661: Fw::SerializeStatus CmdSequencerComponentImpl::CmdRecord::serialize(Fw::SerializeBufferBase& buffer) const { - -: 662: - -: 663: // shouldn't ever be serialized - #####: 664: FW_ASSERT(0); - #####: 665: return Fw::FW_DESERIALIZE_TYPE_MISMATCH; - -: 666: } - -: 667: - 672: 668: Fw::SerializeStatus CmdSequencerComponentImpl::CmdRecord::deserialize(Fw::SerializeBufferBase& buffer) { - -: 669: - -: 670: U8 descEntry; - -: 671: - -: 672: // read the descriptor - 672: 673: Fw::SerializeStatus stat = buffer.deserialize(descEntry); - 672: 674: if (stat != Fw::FW_SERIALIZE_OK) { - #####: 675: return stat; - -: 676: } - -: 677: // check the descriptor value - 672: 678: switch (descEntry) { - -: 679: case ABSOLUTE...END_OF_SEQUENCE: // okay - 664: 680: break; - -: 681: default: - 8: 682: return Fw::FW_DESERIALIZE_FORMAT_ERROR; - -: 683: } - -: 684: // cast it - 664: 685: this->m_descriptor = static_cast(descEntry); - -: 686: // if the descriptor is END_OF_SEQUENCE, quit - 664: 687: if (END_OF_SEQUENCE == this->m_descriptor) { - 88: 688: return Fw::FW_SERIALIZE_OK; - -: 689: } - -: 690: // next is time field - -: 691: - -: 692: U32 seconds; - 576: 693: stat = buffer.deserialize(seconds); - 576: 694: if (stat != Fw::FW_SERIALIZE_OK) { - #####: 695: return stat; - -: 696: } - -: 697: - -: 698: U32 useconds; - -: 699: - 576: 700: stat = buffer.deserialize(useconds); - 576: 701: if (stat != Fw::FW_SERIALIZE_OK) { - 8: 702: return stat; - -: 703: } - -: 704: - -: 705: // set time value for record - 568: 706: this->m_timeTag.set(seconds,useconds); - -: 707: - -: 708: // read the command buffer record size - -: 709: U32 recordSize; - 568: 710: stat = buffer.deserialize(recordSize); - 568: 711: if (stat != Fw::FW_SERIALIZE_OK) { - 8: 712: return stat; - -: 713: } - -: 714: // validate the record size. It shouldn't be longer than the remaining buffer - -: 715: // or longer than destination ComBuffer - -: 716: - 560: 717: if ( - 1112: 718: (recordSize > buffer.getBuffLeft()) || - 552: 719: (recordSize > Fw::ComBuffer::SERIALIZED_SIZE - sizeof(FwPacketDescriptorType)) - -: 720: - -: 721: ) { - -: 722: - 8: 723: return Fw::FW_DESERIALIZE_SIZE_MISMATCH; - -: 724: } - -: 725: - -: 726: // next is command buffer - 552: 727: this->m_command.resetSer(); - -: 728: - 552: 729: stat = buffer.deserialize(this->m_command.getBuffAddr(),recordSize,true); - 552: 730: if (stat != Fw::FW_SERIALIZE_OK) { - #####: 731: return stat; - -: 732: } - -: 733: // set length of command buffer - 552: 734: FW_ASSERT(Fw::FW_SERIALIZE_OK == this->m_command.setBuffLen(recordSize)); - -: 735: - 552: 736: return Fw::FW_SERIALIZE_OK; - -: 737: } - -: 738: - 4: 739: void CmdSequencerComponentImpl::pingIn_handler( - -: 740: NATIVE_INT_TYPE portNum, /*!< The port number*/ - -: 741: U32 key /*!< Value to return to pinger*/ - -: 742: ) { - -: 743: // send ping response - 4: 744: this->pingOut_out(0,key); - 4: 745: } - -: 746: - -: 747: //! initialize CRC - 240: 748: void CmdSequencerComponentImpl::initCrc(U32 &crc) { - 240: 749: crc = 0xFFFFFFFF; - 240: 750: } - -: 751: - -: 752: //! update CRC - 376: 753: void CmdSequencerComponentImpl::updateCRC(U32 &crc, const BYTE* buffer, NATIVE_UINT_TYPE bufferSize) { - 376: 754: FW_ASSERT(buffer); - 19904: 755: for(NATIVE_UINT_TYPE index = 0; index < bufferSize; index++) { - 19528: 756: crc = update_crc_32(crc, buffer[index]); - -: 757: } - 376: 758: } - -: 759: - -: 760: //! finalize CRC - 220: 761: void CmdSequencerComponentImpl::finalizeCRC(U32 &crc) { - 220: 762: crc = ~crc; - 220: 763: } - -: 764: - 160: 765: void CmdSequencerComponentImpl::setCmdTimeout(const Fw::Time ¤tTime) { - -: 766: // start timeout timer if enabled and not in step mode - 160: 767: if ((this->m_timeout > 0) and (AUTO == this->m_stepMode)) { - 144: 768: Fw::Time expTime = currentTime; - 72: 769: expTime.add(this->m_timeout,0); - 72: 770: this->m_cmdTimeoutTimer.set(expTime); - -: 771: } - 160: 772: } - -: 773: - -: 774: - 12: 775:} - -: 776: diff --git a/Svc/CmdSequencer/test/ut/output/SvcCmdSequencer_gcov.txt b/Svc/CmdSequencer/test/ut/output/SvcCmdSequencer_gcov.txt deleted file mode 100755 index 96a637dc62..0000000000 --- a/Svc/CmdSequencer/test/ut/output/SvcCmdSequencer_gcov.txt +++ /dev/null @@ -1,9 +0,0 @@ -File '/home/tim/source/isf/Svc/CmdSequencer/CmdSequencerImpl.cpp' -Lines executed:96.11% of 386 -Creating 'CmdSequencerImpl.cpp.gcov' - -File '/home/tim/source/isf/Svc/CmdSequencer/CmdSequencerComponentAc.cpp' -Lines executed:93.35% of 1369 -Creating 'CmdSequencerComponentAc.cpp.gcov' - -Lines executed:94.04% of 1778 diff --git a/Svc/CmdSequencer/test/ut/output/test.txt b/Svc/CmdSequencer/test/ut/output/test.txt deleted file mode 100644 index db1d1bc6dc..0000000000 --- a/Svc/CmdSequencer/test/ut/output/test.txt +++ /dev/null @@ -1,350 +0,0 @@ -Compiling ut_CYGWIN unit test for SvcCmdSequencer -make[1]: Entering directory '/home/tim/source/isf/Svc/CmdSequencer' -make[1]: Nothing to be done for 'test_SvcCmdSequencertestut'. -make[1]: Leaving directory '/home/tim/source/isf/Svc/CmdSequencer' -Running unit test for SvcCmdSequencer -make[1]: Entering directory '/home/tim/source/isf/Svc/CmdSequencer' -Running test/ut/runtest_CYGWIN with output dir linux-cygwin-x86-ut-gnu-bin -test/ut/runtest_CYGWIN linux-cygwin-x86-ut-gnu-bin -Running /home/tim/source/isf/Svc/CmdSequencer/test/ut/linux-cygwin-x86-ut-gnu-bin/test_ut -[==========] Running 24 tests from 2 test cases. -[----------] Global test environment set-up. -[----------] 9 tests from Nominal -[ RUN ] Nominal.InitTest - -*************************************** -TESTCASE 103.1.1: Nominal Initialization -*************************************** -[ OK ] Nominal.InitTest (0 ms) -[ RUN ] Nominal.NominalImmediate - -*************************************** -TESTCASE 103.1.2: Nominal Immediate Commands -*************************************** - -*************************************** -(RQ) ISF-CMDS-001 -*************************************** - -*************************************** -(RQ) ISF-CMDS-003 -*************************************** -EVENT: (0) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_SequenceLoaded : Loaded sequence SeqF/NomImm.seq -EVENT: (19) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_SequenceValid : Sequence SeqF/NomImm.seq is valid. -EVENT: (0) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_SequenceLoaded : Loaded sequence SeqF/NomImm.seq -REC 0 -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 0 (opcode 0) complete -REC 1 -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 1 (opcode 1) complete -REC 2 -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 2 (opcode 2) complete -REC 3 -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 3 (opcode 3) complete -EVENT: (9) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_SequenceComplete : Sequence file SeqF/NomImm.seq complete -[ OK ] Nominal.NominalImmediate (2 ms) -[ RUN ] Nominal.NominalRelative - -*************************************** -TESTCASE 103.1.3: Nominal Relative Commands -*************************************** -EVENT: (0) (2:0,0) ACTIVITY_LO: (CmdSequencer) CS_SequenceLoaded : Loaded sequence SeqF/NomRel.seq -EVENT: (19) (2:0,0) ACTIVITY_HI: (CmdSequencer) CS_SequenceValid : Sequence SeqF/NomRel.seq is valid. -EVENT: (0) (2:0,0) ACTIVITY_LO: (CmdSequencer) CS_SequenceLoaded : Loaded sequence SeqF/NomRel.seq -EVENT: (8) (2:3,0) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomRel.seq: Command 0 (opcode 0) complete -EVENT: (8) (2:5,0) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomRel.seq: Command 1 (opcode 1) complete -EVENT: (8) (2:7,0) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomRel.seq: Command 2 (opcode 2) complete -EVENT: (9) (2:7,0) ACTIVITY_HI: (CmdSequencer) CS_SequenceComplete : Sequence file SeqF/NomRel.seq complete -[ OK ] Nominal.NominalRelative (1 ms) -[ RUN ] Nominal.NominalTimedRelative - -*************************************** -TESTCASE 103.1.4: Nominal Timed Relative Commands -*************************************** -EVENT: (0) (2:0,0) ACTIVITY_LO: (CmdSequencer) CS_SequenceLoaded : Loaded sequence SeqF/NomTimedRel.seq -EVENT: (19) (2:0,0) ACTIVITY_HI: (CmdSequencer) CS_SequenceValid : Sequence SeqF/NomTimedRel.seq is valid. -EVENT: (0) (2:0,0) ACTIVITY_LO: (CmdSequencer) CS_SequenceLoaded : Loaded sequence SeqF/NomTimedRel.seq -EVENT: (8) (2:3,0) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomTimedRel.seq: Command 0 (opcode 0) complete -EVENT: (8) (2:3,0) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomTimedRel.seq: Command 1 (opcode 2) complete -EVENT: (8) (2:5,0) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomTimedRel.seq: Command 2 (opcode 4) complete -EVENT: (8) (2:5,0) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomTimedRel.seq: Command 3 (opcode 6) complete -EVENT: (9) (2:5,0) ACTIVITY_HI: (CmdSequencer) CS_SequenceComplete : Sequence file SeqF/NomTimedRel.seq complete -[ OK ] Nominal.NominalTimedRelative (2 ms) -[ RUN ] Nominal.NominalImmediatePort - -*************************************** -TESTCASE 103.1.5: Nominal Immediate Port Sequence -*************************************** -EVENT: (0) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_SequenceLoaded : Loaded sequence SeqF/NomImm.seq -EVENT: (19) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_SequenceValid : Sequence SeqF/NomImm.seq is valid. -EVENT: (0) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_SequenceLoaded : Loaded sequence SeqF/NomImm.seq -EVENT: (15) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_PortSequenceStarted : Local request for sequence SeqF/NomImm.seq started. -REC 0 -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 0 (opcode 0) complete -REC 1 -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 1 (opcode 1) complete -REC 2 -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 2 (opcode 2) complete -REC 3 -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 3 (opcode 3) complete -EVENT: (9) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_SequenceComplete : Sequence file SeqF/NomImm.seq complete -[ OK ] Nominal.NominalImmediatePort (1 ms) -[ RUN ] Nominal.CancelCommand - -*************************************** -TESTCASE 103.1.6: Nominal Sequence Cancel -*************************************** - -*************************************** -(RQ) ISF-CMDS-005 -*************************************** -EVENT: (0) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_SequenceLoaded : Loaded sequence SeqF/NomImm.seq -EVENT: (19) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_SequenceValid : Sequence SeqF/NomImm.seq is valid. -EVENT: (0) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_SequenceLoaded : Loaded sequence SeqF/NomImm.seq -REC 0 -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 0 (opcode 0) complete -REC 1 -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 1 (opcode 1) complete -REC 2 -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 2 (opcode 2) complete -EVENT: (1) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_SequenceCanceled : Sequence file SeqF/NomImm.seq canceled -[ OK ] Nominal.CancelCommand (2 ms) -[ RUN ] Nominal.ManualImmediate - -*************************************** -TESTCASE 103.1.7: Nominal Manual Sequence Stepping -*************************************** -EVENT: (0) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_SequenceLoaded : Loaded sequence SeqF/NomImm.seq -EVENT: (19) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_SequenceValid : Sequence SeqF/NomImm.seq is valid. -EVENT: (17) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_ModeSwitched : Sequencer switched to 0 step mode -EVENT: (0) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_SequenceLoaded : Loaded sequence SeqF/NomImm.seq -EVENT: (22) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_CmdStarted : Sequence SeqF/NomImm.seq started -REC 0 -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 0 (opcode 0) complete -EVENT: (21) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_CmdStepped : Sequence SeqF/NomImm.seq command 1 stepped -REC 1 -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 1 (opcode 1) complete -EVENT: (21) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_CmdStepped : Sequence SeqF/NomImm.seq command 2 stepped -REC 2 -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 2 (opcode 2) complete -EVENT: (21) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_CmdStepped : Sequence SeqF/NomImm.seq command 3 stepped -REC 3 -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 3 (opcode 3) complete -EVENT: (9) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_SequenceComplete : Sequence file SeqF/NomImm.seq complete -EVENT: (11) (2:1,1) WARNING_HI: (CmdSequencer) CS_InvalidMode : Invalid mode -EVENT: (17) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_ModeSwitched : Sequencer switched to 1 step mode -[ OK ] Nominal.ManualImmediate (1 ms) -[ RUN ] Nominal.ManualImmediate2 - -*************************************** -TESTCASE 103.1.8: Nominal Manual Sequence Stepping - No end of sequence marker -*************************************** -EVENT: (0) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_SequenceLoaded : Loaded sequence SeqF/NomImm.seq -EVENT: (19) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_SequenceValid : Sequence SeqF/NomImm.seq is valid. -EVENT: (17) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_ModeSwitched : Sequencer switched to 0 step mode -EVENT: (0) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_SequenceLoaded : Loaded sequence SeqF/NomImm.seq -EVENT: (22) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_CmdStarted : Sequence SeqF/NomImm.seq started -REC 0 -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 0 (opcode 0) complete -EVENT: (21) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_CmdStepped : Sequence SeqF/NomImm.seq command 1 stepped -REC 1 -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 1 (opcode 1) complete -EVENT: (21) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_CmdStepped : Sequence SeqF/NomImm.seq command 2 stepped -REC 2 -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 2 (opcode 2) complete -EVENT: (21) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_CmdStepped : Sequence SeqF/NomImm.seq command 3 stepped -REC 3 -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 3 (opcode 3) complete -EVENT: (21) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_CmdStepped : Sequence SeqF/NomImm.seq command 4 stepped -REC 4 -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 4 (opcode 4) complete -EVENT: (9) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_SequenceComplete : Sequence file SeqF/NomImm.seq complete -[ OK ] Nominal.ManualImmediate2 (2 ms) -[ RUN ] Nominal.PingTest - -*************************************** -TESTCASE 103.1.9: Nominal ping test -*************************************** -[ OK ] Nominal.PingTest (0 ms) -[----------] 9 tests from Nominal (11 ms total) - -[----------] 15 tests from OffNominal -[ RUN ] OffNominal.MissingFile - -*************************************** -TESTCASE 103.2.1: Off-Nominal Missing File -*************************************** -EVENT: (6) (0:0,0) WARNING_HI: (CmdSequencer) CS_FileNotFound : Sequence file SeqF/bad_file_name.seq not found. -[ OK ] OffNominal.MissingFile (1 ms) -[ RUN ] OffNominal.BadFileCrc - -*************************************** -TESTCASE 103.2.2: Off-Nominal Bad File CRC -*************************************** - -*************************************** -(RQ) ISF-CMDS-002 -*************************************** -EVENT: (7) (2:0,0) WARNING_HI: (CmdSequencer) CS_FileCrcFailure : Sequence file SeqF/BadCrcFile.seq had invalid CRC. Stored 0x00000020, Computed 0x4D0AC4E8. -[ OK ] OffNominal.BadFileCrc (1 ms) -[ RUN ] OffNominal.EmptySequenceFile - -*************************************** -TESTCASE 103.2.3: Off-Nominal Empty Sequence File -*************************************** -EVENT: (3) (0:0,0) WARNING_HI: (CmdSequencer) CS_FileInvalid : Sequence file SeqF/empty.seq invalid. Stage: 1 Error: 0 -[ OK ] OffNominal.EmptySequenceFile (1 ms) -[ RUN ] OffNominal.InvalidRecord - -*************************************** -TESTCASE 103.2.4: Off-Nominal Invalid Records -*************************************** -EVENT: (3) (2:0,0) WARNING_HI: (CmdSequencer) CS_FileInvalid : Sequence file SeqF/invalid_record.seq invalid. Stage: 6 Error: 1 -EVENT: (3) (2:0,0) WARNING_HI: (CmdSequencer) CS_FileInvalid : Sequence file SeqF/invalid_record.seq invalid. Stage: 6 Error: 1 -EVENT: (3) (2:0,0) WARNING_HI: (CmdSequencer) CS_FileInvalid : Sequence file SeqF/invalid_record.seq invalid. Stage: 6 Error: 1 -[ OK ] OffNominal.InvalidRecord (1 ms) -[ RUN ] OffNominal.FileTooLarge - -*************************************** -TESTCASE 103.2.5: Off-Nominal File Too Large -*************************************** -EVENT: (5) (2:0,0) WARNING_HI: (CmdSequencer) CS_FileSizeError : Sequence file SeqF/too_large.seq too large. Size: 512 -[ OK ] OffNominal.FileTooLarge (1 ms) -[ RUN ] OffNominal.FailedCommand - -*************************************** -TESTCASE 103.2.6: Off-Nominal failed command -*************************************** - -*************************************** -(RQ) ISF-CMDS-004 -*************************************** -EVENT: (0) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_SequenceLoaded : Loaded sequence SeqF/NomImm.seq -EVENT: (19) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_SequenceValid : Sequence SeqF/NomImm.seq is valid. -EVENT: (0) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_SequenceLoaded : Loaded sequence SeqF/NomImm.seq -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 0 (opcode 0) complete -EVENT: (10) (2:1,1) WARNING_HI: (CmdSequencer) CS_CommandError : Sequence file SeqF/NomImm.seq: Command 1 (opcode 1) completed with error 4 -[ OK ] OffNominal.FailedCommand (2 ms) -[ RUN ] OffNominal.InvalidMode - -*************************************** -TESTCASE 103.2.7: Off-Nominal invalid modes -*************************************** -EVENT: (0) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_SequenceLoaded : Loaded sequence SeqF/NomImm.seq -EVENT: (19) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_SequenceValid : Sequence SeqF/NomImm.seq is valid. -EVENT: (0) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_SequenceLoaded : Loaded sequence SeqF/NomImm.seq -REC 0 -EVENT: (11) (2:1,1) WARNING_HI: (CmdSequencer) CS_InvalidMode : Invalid mode -EVENT: (11) (2:1,1) WARNING_HI: (CmdSequencer) CS_InvalidMode : Invalid mode -EVENT: (11) (2:1,1) WARNING_HI: (CmdSequencer) CS_InvalidMode : Invalid mode -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 0 (opcode 0) complete -REC 1 -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 1 (opcode 1) complete -REC 2 -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 2 (opcode 2) complete -REC 3 -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 3 (opcode 3) complete -EVENT: (9) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_SequenceComplete : Sequence file SeqF/NomImm.seq complete -[ OK ] OffNominal.InvalidMode (1 ms) -[ RUN ] OffNominal.NoSequenceActive - -*************************************** -TESTCASE 103.2.8: Off-Nominal no active sequence -*************************************** -EVENT: (18) (0:0,0) WARNING_LO: (CmdSequencer) CS_NoSequenceActive : No sequence active. -[ OK ] OffNominal.NoSequenceActive (0 ms) -[ RUN ] OffNominal.InvalidRecordEntries - -*************************************** -TESTCASE 103.2.9: Invalid Record entries -*************************************** -EVENT: (4) (2:1,1) WARNING_HI: (CmdSequencer) CS_RecordInvalid : Sequence file SeqF/BadRecord.seq: Record 0 invalid. Err: 4 -EVENT: (4) (2:1,1) WARNING_HI: (CmdSequencer) CS_RecordInvalid : Sequence file SeqF/BadRecord.seq: Record 0 invalid. Err: 4 -EVENT: (4) (2:1,1) WARNING_HI: (CmdSequencer) CS_RecordInvalid : Sequence file SeqF/BadRecord.seq: Record 0 invalid. Err: 5 -EVENT: (4) (2:1,1) WARNING_HI: (CmdSequencer) CS_RecordInvalid : Sequence file SeqF/BadRecord.seq: Record 0 invalid. Err: 5 -EVENT: (4) (2:1,1) WARNING_HI: (CmdSequencer) CS_RecordInvalid : Sequence file SeqF/BadRecord.seq: Record 0 invalid. Err: 5 -EVENT: (4) (2:1,1) WARNING_HI: (CmdSequencer) CS_RecordInvalid : Sequence file SeqF/BadRecord.seq: Record 0 invalid. Err: 5 -EVENT: (4) (2:1,1) WARNING_HI: (CmdSequencer) CS_RecordInvalid : Sequence file SeqF/BadRecord.seq: Record 0 invalid. Err: 5 -EVENT: (4) (2:1,1) WARNING_HI: (CmdSequencer) CS_RecordInvalid : Sequence file SeqF/BadRecord.seq: Record 0 invalid. Err: 5 -[ OK ] OffNominal.InvalidRecordEntries (5 ms) -[ RUN ] OffNominal.InvalidSequenceTime - -*************************************** -TESTCASE 103.2.10: Invalid sequence time -*************************************** -EVENT: (13) (2:1,1) WARNING_HI: (CmdSequencer) CS_TimeBaseMismatch : Sequence file SeqF/NomImm.seq: Current time base doesn't match sequence time: base: 2 seq: 1 -EVENT: (14) (2:1,1) WARNING_HI: (CmdSequencer) CS_TimeContextMismatch : Sequence file SeqF/NomImm.seq: Current time context doesn't match sequence context: base: 0 seq: 1 -[ OK ] OffNominal.InvalidSequenceTime (2 ms) -[ RUN ] OffNominal.UnexpectedCompletion - -*************************************** -TESTCASE 103.2.11: Unexpected completion after completed sequence -*************************************** -EVENT: (0) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_SequenceLoaded : Loaded sequence SeqF/NomImm.seq -EVENT: (19) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_SequenceValid : Sequence SeqF/NomImm.seq is valid. -EVENT: (0) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_SequenceLoaded : Loaded sequence SeqF/NomImm.seq -REC 0 -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 0 (opcode 0) complete -REC 1 -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 1 (opcode 1) complete -REC 2 -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 2 (opcode 2) complete -REC 3 -EVENT: (8) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_CommandComplete : Sequence file SeqF/NomImm.seq: Command 3 (opcode 3) complete -EVENT: (9) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_SequenceComplete : Sequence file SeqF/NomImm.seq complete -EVENT: (16) (2:1,1) WARNING_HI: (CmdSequencer) CS_UnexpectedCompletion : Command complete status received while no sequences active. Opcode: 16 -[ OK ] OffNominal.UnexpectedCompletion (2 ms) -[ RUN ] OffNominal.SequenceTimeout - -*************************************** -TESTCASE 103.2.12: Sequence timeout -*************************************** - -*************************************** -(RQ) ISF-CMDS-006 -*************************************** -EVENT: (0) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_SequenceLoaded : Loaded sequence SeqF/NomImm.seq -EVENT: (19) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_SequenceValid : Sequence SeqF/NomImm.seq is valid. -EVENT: (0) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_SequenceLoaded : Loaded sequence SeqF/NomImm.seq -EVENT: (20) (2:200,1) WARNING_HI: (CmdSequencer) CS_SequenceTimeout : Sequence SeqF/NomImm.seq timed out on command 0 -[ OK ] OffNominal.SequenceTimeout (1 ms) -[ RUN ] OffNominal.InvalidManualModes - -*************************************** -TESTCASE 103.2.13: Invalid Manual Modes -*************************************** -EVENT: (18) (2:1,1) WARNING_LO: (CmdSequencer) CS_NoSequenceActive : No sequence active. -EVENT: (0) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_SequenceLoaded : Loaded sequence SeqF/NomImm.seq -EVENT: (19) (2:1,1) ACTIVITY_HI: (CmdSequencer) CS_SequenceValid : Sequence SeqF/NomImm.seq is valid. -EVENT: (0) (2:1,1) ACTIVITY_LO: (CmdSequencer) CS_SequenceLoaded : Loaded sequence SeqF/NomImm.seq -EVENT: (11) (2:1,1) WARNING_HI: (CmdSequencer) CS_InvalidMode : Invalid mode -EVENT: (11) (2:1,1) WARNING_HI: (CmdSequencer) CS_InvalidMode : Invalid mode -EVENT: (11) (2:1,1) WARNING_HI: (CmdSequencer) CS_InvalidMode : Invalid mode -[ OK ] OffNominal.InvalidManualModes (2 ms) -[ RUN ] OffNominal.FileLoadErrors - -*************************************** -TESTCASE 103.2.14: File Load errors -*************************************** -EVENT: (6) (2:1,1) WARNING_HI: (CmdSequencer) CS_FileNotFound : Sequence file SeqF/NomImm.seq not found. -EVENT: (2) (2:1,1) WARNING_HI: (CmdSequencer) CS_FileReadError : Error reading sequence file SeqF/NomImm.seq -EVENT: (3) (2:1,1) WARNING_HI: (CmdSequencer) CS_FileInvalid : Sequence file SeqF/NomImm.seq invalid. Stage: 0 Error: 2 -EVENT: (3) (2:1,1) WARNING_HI: (CmdSequencer) CS_FileInvalid : Sequence file SeqF/NomImm.seq invalid. Stage: 7 Error: 2 -EVENT: (3) (2:1,1) WARNING_HI: (CmdSequencer) CS_FileInvalid : Sequence file SeqF/NomImm.seq invalid. Stage: 8 Error: 2 -[ OK ] OffNominal.FileLoadErrors (1 ms) -[ RUN ] OffNominal.ExtraData - -*************************************** -TESTCASE 103.2.15: Extra Data after records -*************************************** - -*************************************** -(RQ) ISF-CMDS-001 -*************************************** -EVENT: (12) (2:1,1) WARNING_HI: (CmdSequencer) CS_RecordMismatch : Sequence file SeqF/NomImm.seq header records mismatch: 5 in header, found 8 extra bytes. -[ OK ] OffNominal.ExtraData (1 ms) -[----------] 15 tests from OffNominal (22 ms total) - -[----------] Global test environment tear-down -[==========] 24 tests from 2 test cases ran. (33 ms total) -[ PASSED ] 24 tests. -make[1]: Leaving directory '/home/tim/source/isf/Svc/CmdSequencer' diff --git a/Svc/Health/docs/sdd.md b/Svc/Health/docs/sdd.md index 6654f03644..dd6b299ad9 100644 --- a/Svc/Health/docs/sdd.md +++ b/Svc/Health/docs/sdd.md @@ -147,11 +147,9 @@ This test is similar to `6.1.8`, but it includes a nominal running of the SchedI This set of test cases verifies the remaining off-nominal error cases. Each test case is simulated and validated individually. -## 6.2 Unit Test Output -[Unit Test Output](../test/ut/ut_output.txt) +## 6.2 Unit Test Coverage -## 6.3 Unit Test Coverage -[Coverage Output](../test/ut/SvcHealth_gcov.txt) +To see unit test coverage run fprime-util check --coverage ## 7. Change Log diff --git a/Svc/Health/test/ut/output/HealthComponentAc.cpp.gcov b/Svc/Health/test/ut/output/HealthComponentAc.cpp.gcov deleted file mode 100644 index 19965fd931..0000000000 --- a/Svc/Health/test/ut/output/HealthComponentAc.cpp.gcov +++ /dev/null @@ -1,2413 +0,0 @@ - -: 0:Source:/home/tim/source/isf/Svc/Health/HealthComponentAc.cpp - -: 0:Programs:2 - -: 1:// ====================================================================== - -: 2:// \title HealthComponentAc.hpp - -: 3:// \author Auto-generated - -: 4:// \brief cpp file for Health component base class - -: 5:// - -: 6:// \copyright - -: 7:// Copyright 2009-2015, by the California Institute of Technology. - -: 8:// ALL RIGHTS RESERVED. United States Government Sponsorship - -: 9:// acknowledged. - -: 11:// - -: 18:// ====================================================================== - -: 19: - -: 20:#include - -: 21:#include - -: 22:#include - -: 23:#include - -: 24:#if FW_ENABLE_TEXT_LOGGING - -: 25:#include - -: 26:#endif - -: 27: - -: 28: - -: 29:namespace Svc { - -: 30: - -: 31: // ---------------------------------------------------------------------- - -: 32: // Anonymous namespace to prevent name collisions - -: 33: // ---------------------------------------------------------------------- - -: 34: - -: 35: namespace { - -: 36: - -: 37: typedef enum { - -: 38: HEALTH_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT, - -: 39: PINGRETURN_PING, - -: 40: CMD_HLTH_ENABLE, - -: 41: CMD_HLTH_PING_ENABLE, - -: 42: CMD_HLTH_CHNG_PING - -: 43: } MsgTypeEnum; - -: 44: - -: 45: // Get the max size by doing a union of the input port serialization sizes. - -: 46: - -: 47: typedef union { - -: 48: BYTE port1[Svc::InputPingPort::SERIALIZED_SIZE]; - -: 49: BYTE cmdPort[Fw::InputCmdPort::SERIALIZED_SIZE]; - -: 50: } BuffUnion; - -: 51: - -: 52: // Define a message buffer class large enough to handle all the - -: 53: // asynchronous inputs to the component - -: 54: - 2014: 55: class ComponentIpcSerializableBuffer : - -: 56: public Fw::SerializeBufferBase - -: 57: { - -: 58: - -: 59: public: - -: 60: - -: 61: enum { - -: 62: // Max. message size = size of data + message id + port - -: 63: SERIALIZATION_SIZE = - -: 64: sizeof(BuffUnion) + - -: 65: sizeof(NATIVE_INT_TYPE) + - -: 66: sizeof(NATIVE_INT_TYPE) - -: 67: }; - -: 68: - 2134: 69: NATIVE_UINT_TYPE getBuffCapacity(void) const { - 2134: 70: return sizeof(m_buff); - -: 71: } - -: 72: - 11431: 73: U8* getBuffAddr(void) { - 11431: 74: return m_buff; - -: 75: } - -: 76: - 341: 77: const U8* getBuffAddr(void) const { - 341: 78: return m_buff; - -: 79: } - -: 80: - -: 81: private: - -: 82: // Should be the max of all the input ports serialized sizes... - -: 83: U8 m_buff[SERIALIZATION_SIZE]; - -: 84: - -: 85: }; - -: 86: - -: 87: } - -: 88: - -: 89: // ---------------------------------------------------------------------- - -: 90: // Getters for numbers of input ports - -: 91: // ---------------------------------------------------------------------- - -: 92: - 100: 93: Svc::InputPingPort *HealthComponentBase :: - -: 94: get_PingReturn_InputPort(NATIVE_INT_TYPE portNum) - -: 95: { - 100: 96: FW_ASSERT(portNum < this->getNum_PingReturn_InputPorts(),static_cast(portNum)); - 100: 97: return &this->m_PingReturn_InputPort[portNum]; - -: 98: } - -: 99: - 10: 100: Svc::InputSchedPort *HealthComponentBase :: - -: 101: get_Run_InputPort(NATIVE_INT_TYPE portNum) - -: 102: { - 10: 103: FW_ASSERT(portNum < this->getNum_Run_InputPorts(),static_cast(portNum)); - 10: 104: return &this->m_Run_InputPort[portNum]; - -: 105: } - -: 106: - 10: 107: Fw::InputCmdPort *HealthComponentBase :: - -: 108: get_CmdDisp_InputPort(NATIVE_INT_TYPE portNum) - -: 109: { - 10: 110: FW_ASSERT(portNum < this->getNum_CmdDisp_InputPorts(),static_cast(portNum)); - 10: 111: return &this->m_CmdDisp_InputPort[portNum]; - -: 112: } - -: 113: - -: 114: // ---------------------------------------------------------------------- - -: 115: // Typed connectors for output ports - -: 116: // ---------------------------------------------------------------------- - -: 117: - 100: 118: void HealthComponentBase :: - -: 119: set_PingSend_OutputPort( - -: 120: NATIVE_INT_TYPE portNum, - -: 121: Svc::InputPingPort* port - -: 122: ) - -: 123: { - 100: 124: FW_ASSERT(portNum < this->getNum_PingSend_OutputPorts(),static_cast(portNum)); - 100: 125: this->m_PingSend_OutputPort[portNum].addCallPort(port); - 100: 126: } - -: 127: - 10: 128: void HealthComponentBase :: - -: 129: set_WdogStroke_OutputPort( - -: 130: NATIVE_INT_TYPE portNum, - -: 131: Svc::InputWatchDogPort* port - -: 132: ) - -: 133: { - 10: 134: FW_ASSERT(portNum < this->getNum_WdogStroke_OutputPorts(),static_cast(portNum)); - 10: 135: this->m_WdogStroke_OutputPort[portNum].addCallPort(port); - 10: 136: } - -: 137: - 10: 138: void HealthComponentBase :: - -: 139: set_CmdStatus_OutputPort( - -: 140: NATIVE_INT_TYPE portNum, - -: 141: Fw::InputCmdResponsePort* port - -: 142: ) - -: 143: { - 10: 144: FW_ASSERT(portNum < this->getNum_CmdStatus_OutputPorts(),static_cast(portNum)); - 10: 145: this->m_CmdStatus_OutputPort[portNum].addCallPort(port); - 10: 146: } - -: 147: - 10: 148: void HealthComponentBase :: - -: 149: set_CmdReg_OutputPort( - -: 150: NATIVE_INT_TYPE portNum, - -: 151: Fw::InputCmdRegPort* port - -: 152: ) - -: 153: { - 10: 154: FW_ASSERT(portNum < this->getNum_CmdReg_OutputPorts(),static_cast(portNum)); - 10: 155: this->m_CmdReg_OutputPort[portNum].addCallPort(port); - 10: 156: } - -: 157: - 10: 158: void HealthComponentBase :: - -: 159: set_Tlm_OutputPort( - -: 160: NATIVE_INT_TYPE portNum, - -: 161: Fw::InputTlmPort* port - -: 162: ) - -: 163: { - 10: 164: FW_ASSERT(portNum < this->getNum_Tlm_OutputPorts(),static_cast(portNum)); - 10: 165: this->m_Tlm_OutputPort[portNum].addCallPort(port); - 10: 166: } - -: 167: - 10: 168: void HealthComponentBase :: - -: 169: set_Time_OutputPort( - -: 170: NATIVE_INT_TYPE portNum, - -: 171: Fw::InputTimePort* port - -: 172: ) - -: 173: { - 10: 174: FW_ASSERT(portNum < this->getNum_Time_OutputPorts(),static_cast(portNum)); - 10: 175: this->m_Time_OutputPort[portNum].addCallPort(port); - 10: 176: } - -: 177: - 10: 178: void HealthComponentBase :: - -: 179: set_Log_OutputPort( - -: 180: NATIVE_INT_TYPE portNum, - -: 181: Fw::InputLogPort* port - -: 182: ) - -: 183: { - 10: 184: FW_ASSERT(portNum < this->getNum_Log_OutputPorts(),static_cast(portNum)); - 10: 185: this->m_Log_OutputPort[portNum].addCallPort(port); - 10: 186: } - -: 187: - -: 188:#if FW_ENABLE_TEXT_LOGGING == 1 - 10: 189: void HealthComponentBase :: - -: 190: set_LogText_OutputPort( - -: 191: NATIVE_INT_TYPE portNum, - -: 192: Fw::InputLogTextPort* port - -: 193: ) - -: 194: { - 10: 195: FW_ASSERT(portNum < this->getNum_LogText_OutputPorts(),static_cast(portNum)); - 10: 196: this->m_LogText_OutputPort[portNum].addCallPort(port); - 10: 197: } - -: 198:#endif - -: 199: - -: 200: // ---------------------------------------------------------------------- - -: 201: // Serialization connectors for output ports - -: 202: // ---------------------------------------------------------------------- - -: 203: - -: 204:#if FW_PORT_SERIALIZATION - -: 205: - #####: 206: void HealthComponentBase :: - -: 207: set_PingSend_OutputPort( - -: 208: NATIVE_INT_TYPE portNum, - -: 209: Fw::InputSerializePort *port - -: 210: ) - -: 211: { - #####: 212: FW_ASSERT(portNum < this->getNum_PingSend_OutputPorts(),static_cast(portNum)); - #####: 213: return this->m_PingSend_OutputPort[portNum].registerSerialPort(port); - -: 214: } - -: 215: - #####: 216: void HealthComponentBase :: - -: 217: set_WdogStroke_OutputPort( - -: 218: NATIVE_INT_TYPE portNum, - -: 219: Fw::InputSerializePort *port - -: 220: ) - -: 221: { - #####: 222: FW_ASSERT(portNum < this->getNum_WdogStroke_OutputPorts(),static_cast(portNum)); - #####: 223: return this->m_WdogStroke_OutputPort[portNum].registerSerialPort(port); - -: 224: } - -: 225: - #####: 226: void HealthComponentBase :: - -: 227: set_CmdStatus_OutputPort( - -: 228: NATIVE_INT_TYPE portNum, - -: 229: Fw::InputSerializePort *port - -: 230: ) - -: 231: { - #####: 232: FW_ASSERT(portNum < this->getNum_CmdStatus_OutputPorts(),static_cast(portNum)); - #####: 233: return this->m_CmdStatus_OutputPort[portNum].registerSerialPort(port); - -: 234: } - -: 235: - #####: 236: void HealthComponentBase :: - -: 237: set_CmdReg_OutputPort( - -: 238: NATIVE_INT_TYPE portNum, - -: 239: Fw::InputSerializePort *port - -: 240: ) - -: 241: { - #####: 242: FW_ASSERT(portNum < this->getNum_CmdReg_OutputPorts(),static_cast(portNum)); - #####: 243: return this->m_CmdReg_OutputPort[portNum].registerSerialPort(port); - -: 244: } - -: 245: - #####: 246: void HealthComponentBase :: - -: 247: set_Tlm_OutputPort( - -: 248: NATIVE_INT_TYPE portNum, - -: 249: Fw::InputSerializePort *port - -: 250: ) - -: 251: { - #####: 252: FW_ASSERT(portNum < this->getNum_Tlm_OutputPorts(),static_cast(portNum)); - #####: 253: return this->m_Tlm_OutputPort[portNum].registerSerialPort(port); - -: 254: } - -: 255: - #####: 256: void HealthComponentBase :: - -: 257: set_Time_OutputPort( - -: 258: NATIVE_INT_TYPE portNum, - -: 259: Fw::InputSerializePort *port - -: 260: ) - -: 261: { - #####: 262: FW_ASSERT(portNum < this->getNum_Time_OutputPorts(),static_cast(portNum)); - #####: 263: return this->m_Time_OutputPort[portNum].registerSerialPort(port); - -: 264: } - -: 265: - #####: 266: void HealthComponentBase :: - -: 267: set_Log_OutputPort( - -: 268: NATIVE_INT_TYPE portNum, - -: 269: Fw::InputSerializePort *port - -: 270: ) - -: 271: { - #####: 272: FW_ASSERT(portNum < this->getNum_Log_OutputPorts(),static_cast(portNum)); - #####: 273: return this->m_Log_OutputPort[portNum].registerSerialPort(port); - -: 274: } - -: 275: - -: 276:#if FW_ENABLE_TEXT_LOGGING == 1 - #####: 277: void HealthComponentBase :: - -: 278: set_LogText_OutputPort( - -: 279: NATIVE_INT_TYPE portNum, - -: 280: Fw::InputSerializePort *port - -: 281: ) - -: 282: { - #####: 283: FW_ASSERT(portNum < this->getNum_LogText_OutputPorts(),static_cast(portNum)); - #####: 284: return this->m_LogText_OutputPort[portNum].registerSerialPort(port); - -: 285: } - -: 286:#endif - -: 287: - -: 288:#endif - -: 289: - -: 290: // ---------------------------------------------------------------------- - -: 291: // Command registration - -: 292: // ---------------------------------------------------------------------- - -: 293: - #####: 294: void HealthComponentBase :: - -: 295: regCommands(void) - -: 296: { - #####: 297: FW_ASSERT(this->m_CmdReg_OutputPort[0].isConnected()); - #####: 298: this->m_CmdReg_OutputPort[0].invoke( - -: 299: this->getIdBase() + OPCODE_HLTH_ENABLE - #####: 300: ); - #####: 301: this->m_CmdReg_OutputPort[0].invoke( - #####: 302: this->getIdBase() + OPCODE_HLTH_PING_ENABLE - #####: 303: ); - #####: 304: this->m_CmdReg_OutputPort[0].invoke( - #####: 305: this->getIdBase() + OPCODE_HLTH_CHNG_PING - #####: 306: ); - #####: 307: } - -: 308: - -: 309: // ---------------------------------------------------------------------- - -: 310: // Component construction, initialization, and destruction - -: 311: // ---------------------------------------------------------------------- - -: 312: - 10: 313: HealthComponentBase :: - -: 314:#if FW_OBJECT_NAMES == 1 - -: 315: HealthComponentBase(const char* compName) : - 10: 316: Fw::QueuedComponentBase(compName) - -: 317:#else - -: 318: HealthComponentBase() : - -: 319: Fw::QueuedComponentBase() - -: 320:#endif - -: 321: { - -: 322: - -: 323: - -: 324: - -: 325: - 10: 326: } - -: 327: - 10: 328: void HealthComponentBase :: - -: 329: init( - -: 330: NATIVE_INT_TYPE queueDepth, - -: 331: NATIVE_INT_TYPE instance - -: 332: ) - -: 333: { - -: 334: - -: 335: // Initialize base class - 10: 336: Fw::QueuedComponentBase::init(instance); - -: 337: - -: 338: // Connect input port PingReturn - 210: 339: for ( - 10: 340: NATIVE_INT_TYPE port = 0; - 110: 341: port < this->getNum_PingReturn_InputPorts(); - -: 342: port++ - -: 343: ) { - -: 344: - 100: 345: this->m_PingReturn_InputPort[port].init(); - 100: 346: this->m_PingReturn_InputPort[port].addCallComp( - -: 347: this, - -: 348: m_p_PingReturn_in - 100: 349: ); - 100: 350: this->m_PingReturn_InputPort[port].setPortNum(port); - -: 351: - -: 352:#if FW_OBJECT_NAMES == 1 - -: 353: char portName[80]; - 100: 354: (void) snprintf( - -: 355: portName, - -: 356: sizeof(portName), - -: 357: "%s_PingReturn_InputPort[%d]", - -: 358: this->m_objName, - -: 359: port - 100: 360: ); - 100: 361: this->m_PingReturn_InputPort[port].setObjName(portName); - -: 362:#endif - -: 363: - -: 364: } - -: 365: - -: 366: // Connect input port Run - 30: 367: for ( - 10: 368: NATIVE_INT_TYPE port = 0; - 20: 369: port < this->getNum_Run_InputPorts(); - -: 370: port++ - -: 371: ) { - -: 372: - 10: 373: this->m_Run_InputPort[port].init(); - 10: 374: this->m_Run_InputPort[port].addCallComp( - -: 375: this, - -: 376: m_p_Run_in - 10: 377: ); - 10: 378: this->m_Run_InputPort[port].setPortNum(port); - -: 379: - -: 380:#if FW_OBJECT_NAMES == 1 - -: 381: char portName[80]; - 10: 382: (void) snprintf( - -: 383: portName, - -: 384: sizeof(portName), - -: 385: "%s_Run_InputPort[%d]", - -: 386: this->m_objName, - -: 387: port - 10: 388: ); - 10: 389: this->m_Run_InputPort[port].setObjName(portName); - -: 390:#endif - -: 391: - -: 392: } - -: 393: - -: 394: // Connect input port CmdDisp - 30: 395: for ( - 10: 396: NATIVE_INT_TYPE port = 0; - 20: 397: port < this->getNum_CmdDisp_InputPorts(); - -: 398: port++ - -: 399: ) { - -: 400: - 10: 401: this->m_CmdDisp_InputPort[port].init(); - 10: 402: this->m_CmdDisp_InputPort[port].addCallComp( - -: 403: this, - -: 404: m_p_CmdDisp_in - 10: 405: ); - 10: 406: this->m_CmdDisp_InputPort[port].setPortNum(port); - -: 407: - -: 408:#if FW_OBJECT_NAMES == 1 - -: 409: char portName[80]; - 10: 410: (void) snprintf( - -: 411: portName, - -: 412: sizeof(portName), - -: 413: "%s_CmdDisp_InputPort[%d]", - -: 414: this->m_objName, - -: 415: port - 10: 416: ); - 10: 417: this->m_CmdDisp_InputPort[port].setObjName(portName); - -: 418:#endif - -: 419: - -: 420: } - -: 421: - -: 422: // Initialize output port PingSend - 210: 423: for ( - 10: 424: NATIVE_INT_TYPE port = 0; - 110: 425: port < this->getNum_PingSend_OutputPorts(); - -: 426: port++ - -: 427: ) { - 100: 428: this->m_PingSend_OutputPort[port].init(); - -: 429: - -: 430:#if FW_OBJECT_NAMES == 1 - -: 431: char portName[80]; - 100: 432: (void) snprintf( - -: 433: portName, - -: 434: sizeof(portName), - -: 435: "%s_PingSend_OutputPort[%d]", - -: 436: this->m_objName, - -: 437: port - 100: 438: ); - 100: 439: this->m_PingSend_OutputPort[port].setObjName(portName); - -: 440:#endif - -: 441: - -: 442: } - -: 443: - -: 444: // Initialize output port WdogStroke - 30: 445: for ( - 10: 446: NATIVE_INT_TYPE port = 0; - 20: 447: port < this->getNum_WdogStroke_OutputPorts(); - -: 448: port++ - -: 449: ) { - 10: 450: this->m_WdogStroke_OutputPort[port].init(); - -: 451: - -: 452:#if FW_OBJECT_NAMES == 1 - -: 453: char portName[80]; - 10: 454: (void) snprintf( - -: 455: portName, - -: 456: sizeof(portName), - -: 457: "%s_WdogStroke_OutputPort[%d]", - -: 458: this->m_objName, - -: 459: port - 10: 460: ); - 10: 461: this->m_WdogStroke_OutputPort[port].setObjName(portName); - -: 462:#endif - -: 463: - -: 464: } - -: 465: - -: 466: // Initialize output port CmdStatus - 30: 467: for ( - 10: 468: NATIVE_INT_TYPE port = 0; - 20: 469: port < this->getNum_CmdStatus_OutputPorts(); - -: 470: port++ - -: 471: ) { - 10: 472: this->m_CmdStatus_OutputPort[port].init(); - -: 473: - -: 474:#if FW_OBJECT_NAMES == 1 - -: 475: char portName[80]; - 10: 476: (void) snprintf( - -: 477: portName, - -: 478: sizeof(portName), - -: 479: "%s_CmdStatus_OutputPort[%d]", - -: 480: this->m_objName, - -: 481: port - 10: 482: ); - 10: 483: this->m_CmdStatus_OutputPort[port].setObjName(portName); - -: 484:#endif - -: 485: - -: 486: } - -: 487: - -: 488: // Initialize output port CmdReg - 30: 489: for ( - 10: 490: NATIVE_INT_TYPE port = 0; - 20: 491: port < this->getNum_CmdReg_OutputPorts(); - -: 492: port++ - -: 493: ) { - 10: 494: this->m_CmdReg_OutputPort[port].init(); - -: 495: - -: 496:#if FW_OBJECT_NAMES == 1 - -: 497: char portName[80]; - 10: 498: (void) snprintf( - -: 499: portName, - -: 500: sizeof(portName), - -: 501: "%s_CmdReg_OutputPort[%d]", - -: 502: this->m_objName, - -: 503: port - 10: 504: ); - 10: 505: this->m_CmdReg_OutputPort[port].setObjName(portName); - -: 506:#endif - -: 507: - -: 508: } - -: 509: - -: 510: // Initialize output port Tlm - 30: 511: for ( - 10: 512: NATIVE_INT_TYPE port = 0; - 20: 513: port < this->getNum_Tlm_OutputPorts(); - -: 514: port++ - -: 515: ) { - 10: 516: this->m_Tlm_OutputPort[port].init(); - -: 517: - -: 518:#if FW_OBJECT_NAMES == 1 - -: 519: char portName[80]; - 10: 520: (void) snprintf( - -: 521: portName, - -: 522: sizeof(portName), - -: 523: "%s_Tlm_OutputPort[%d]", - -: 524: this->m_objName, - -: 525: port - 10: 526: ); - 10: 527: this->m_Tlm_OutputPort[port].setObjName(portName); - -: 528:#endif - -: 529: - -: 530: } - -: 531: - -: 532: // Initialize output port Time - 30: 533: for ( - 10: 534: NATIVE_INT_TYPE port = 0; - 20: 535: port < this->getNum_Time_OutputPorts(); - -: 536: port++ - -: 537: ) { - 10: 538: this->m_Time_OutputPort[port].init(); - -: 539: - -: 540:#if FW_OBJECT_NAMES == 1 - -: 541: char portName[80]; - 10: 542: (void) snprintf( - -: 543: portName, - -: 544: sizeof(portName), - -: 545: "%s_Time_OutputPort[%d]", - -: 546: this->m_objName, - -: 547: port - 10: 548: ); - 10: 549: this->m_Time_OutputPort[port].setObjName(portName); - -: 550:#endif - -: 551: - -: 552: } - -: 553: - -: 554: // Initialize output port Log - 30: 555: for ( - 10: 556: NATIVE_INT_TYPE port = 0; - 20: 557: port < this->getNum_Log_OutputPorts(); - -: 558: port++ - -: 559: ) { - 10: 560: this->m_Log_OutputPort[port].init(); - -: 561: - -: 562:#if FW_OBJECT_NAMES == 1 - -: 563: char portName[80]; - 10: 564: (void) snprintf( - -: 565: portName, - -: 566: sizeof(portName), - -: 567: "%s_Log_OutputPort[%d]", - -: 568: this->m_objName, - -: 569: port - 10: 570: ); - 10: 571: this->m_Log_OutputPort[port].setObjName(portName); - -: 572:#endif - -: 573: - -: 574: } - -: 575: - -: 576: // Initialize output port LogText - -: 577:#if FW_ENABLE_TEXT_LOGGING == 1 - 30: 578: for ( - 10: 579: NATIVE_INT_TYPE port = 0; - 20: 580: port < this->getNum_LogText_OutputPorts(); - -: 581: port++ - -: 582: ) { - 10: 583: this->m_LogText_OutputPort[port].init(); - -: 584: - -: 585:#if FW_OBJECT_NAMES == 1 - -: 586: char portName[80]; - 10: 587: (void) snprintf( - -: 588: portName, - -: 589: sizeof(portName), - -: 590: "%s_LogText_OutputPort[%d]", - -: 591: this->m_objName, - -: 592: port - 10: 593: ); - 10: 594: this->m_LogText_OutputPort[port].setObjName(portName); - -: 595:#endif - -: 596: - -: 597: } - -: 598:#endif - -: 599: - -: 600: Os::Queue::QueueStatus qStat = - 10: 601: this->createQueue( - -: 602: queueDepth, - -: 603: ComponentIpcSerializableBuffer::SERIALIZATION_SIZE - 10: 604: ); - -: 605: FW_ASSERT( - -: 606: Os::Queue::QUEUE_OK == qStat, - -: 607: static_cast(qStat) - 10: 608: ); - -: 609: - 10: 610: } - -: 611: - 10: 612: HealthComponentBase:: - 10: 613: ~HealthComponentBase() { - -: 614: - 10: 615: } - -: 616: - -: 617: // ---------------------------------------------------------------------- - -: 618: // Invocation functions for output ports - -: 619: // ---------------------------------------------------------------------- - -: 620: - 421: 621: void HealthComponentBase :: - -: 622: PingSend_out( - -: 623: NATIVE_INT_TYPE portNum, - -: 624: U32 key - -: 625: ) - -: 626: { - 421: 627: FW_ASSERT(portNum < this->getNum_PingSend_OutputPorts(),static_cast(portNum)); - 421: 628: this->m_PingSend_OutputPort[portNum].invoke(key); - 421: 629: } - -: 630: - 302: 631: void HealthComponentBase :: - -: 632: WdogStroke_out( - -: 633: NATIVE_INT_TYPE portNum, - -: 634: U32 code - -: 635: ) - -: 636: { - 302: 637: FW_ASSERT(portNum < this->getNum_WdogStroke_OutputPorts(),static_cast(portNum)); - 302: 638: this->m_WdogStroke_OutputPort[portNum].invoke(code); - 302: 639: } - -: 640: - -: 641: // ---------------------------------------------------------------------- - -: 642: // Getters for numbers of ports - -: 643: // ---------------------------------------------------------------------- - -: 644: - 741: 645: NATIVE_INT_TYPE HealthComponentBase :: - -: 646: getNum_PingSend_OutputPorts(void) - -: 647: { - 741: 648: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 649: this->m_PingSend_OutputPort - -: 650: ); - -: 651: } - -: 652: - 620: 653: NATIVE_INT_TYPE HealthComponentBase :: - -: 654: getNum_PingReturn_InputPorts(void) - -: 655: { - 620: 656: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 657: this->m_PingReturn_InputPort - -: 658: ); - -: 659: } - -: 660: - 332: 661: NATIVE_INT_TYPE HealthComponentBase :: - -: 662: getNum_Run_InputPorts(void) - -: 663: { - 332: 664: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 665: this->m_Run_InputPort - -: 666: ); - -: 667: } - -: 668: - 634: 669: NATIVE_INT_TYPE HealthComponentBase :: - -: 670: getNum_WdogStroke_OutputPorts(void) - -: 671: { - 634: 672: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 673: this->m_WdogStroke_OutputPort - -: 674: ); - -: 675: } - -: 676: - 30: 677: NATIVE_INT_TYPE HealthComponentBase :: - -: 678: getNum_CmdDisp_InputPorts(void) - -: 679: { - 30: 680: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 681: this->m_CmdDisp_InputPort - -: 682: ); - -: 683: } - -: 684: - 30: 685: NATIVE_INT_TYPE HealthComponentBase :: - -: 686: getNum_CmdStatus_OutputPorts(void) - -: 687: { - 30: 688: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 689: this->m_CmdStatus_OutputPort - -: 690: ); - -: 691: } - -: 692: - 30: 693: NATIVE_INT_TYPE HealthComponentBase :: - -: 694: getNum_CmdReg_OutputPorts(void) - -: 695: { - 30: 696: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 697: this->m_CmdReg_OutputPort - -: 698: ); - -: 699: } - -: 700: - 30: 701: NATIVE_INT_TYPE HealthComponentBase :: - -: 702: getNum_Tlm_OutputPorts(void) - -: 703: { - 30: 704: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 705: this->m_Tlm_OutputPort - -: 706: ); - -: 707: } - -: 708: - 30: 709: NATIVE_INT_TYPE HealthComponentBase :: - -: 710: getNum_Time_OutputPorts(void) - -: 711: { - 30: 712: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 713: this->m_Time_OutputPort - -: 714: ); - -: 715: } - -: 716: - 30: 717: NATIVE_INT_TYPE HealthComponentBase :: - -: 718: getNum_Log_OutputPorts(void) - -: 719: { - 30: 720: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 721: this->m_Log_OutputPort - -: 722: ); - -: 723: } - -: 724: - -: 725:#if FW_ENABLE_TEXT_LOGGING == 1 - 30: 726: NATIVE_INT_TYPE HealthComponentBase :: - -: 727: getNum_LogText_OutputPorts(void) - -: 728: { - 30: 729: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 730: this->m_LogText_OutputPort - -: 731: ); - -: 732: } - -: 733:#endif - -: 734: - -: 735: // ---------------------------------------------------------------------- - -: 736: // Port connection status queries - -: 737: // ---------------------------------------------------------------------- - -: 738: - #####: 739: bool HealthComponentBase :: - -: 740: isConnected_PingSend_OutputPort(NATIVE_INT_TYPE portNum) - -: 741: { - #####: 742: FW_ASSERT( - -: 743: portNum < this->getNum_PingSend_OutputPorts(), - -: 744: static_cast(portNum) - #####: 745: ); - #####: 746: return this->m_PingSend_OutputPort[portNum].isConnected(); - -: 747: } - -: 748: - 302: 749: bool HealthComponentBase :: - -: 750: isConnected_WdogStroke_OutputPort(NATIVE_INT_TYPE portNum) - -: 751: { - 302: 752: FW_ASSERT( - -: 753: portNum < this->getNum_WdogStroke_OutputPorts(), - -: 754: static_cast(portNum) - 302: 755: ); - 302: 756: return this->m_WdogStroke_OutputPort[portNum].isConnected(); - -: 757: } - -: 758: - #####: 759: bool HealthComponentBase :: - -: 760: isConnected_CmdStatus_OutputPort(NATIVE_INT_TYPE portNum) - -: 761: { - #####: 762: FW_ASSERT( - -: 763: portNum < this->getNum_CmdStatus_OutputPorts(), - -: 764: static_cast(portNum) - #####: 765: ); - #####: 766: return this->m_CmdStatus_OutputPort[portNum].isConnected(); - -: 767: } - -: 768: - #####: 769: bool HealthComponentBase :: - -: 770: isConnected_CmdReg_OutputPort(NATIVE_INT_TYPE portNum) - -: 771: { - #####: 772: FW_ASSERT( - -: 773: portNum < this->getNum_CmdReg_OutputPorts(), - -: 774: static_cast(portNum) - #####: 775: ); - #####: 776: return this->m_CmdReg_OutputPort[portNum].isConnected(); - -: 777: } - -: 778: - #####: 779: bool HealthComponentBase :: - -: 780: isConnected_Tlm_OutputPort(NATIVE_INT_TYPE portNum) - -: 781: { - #####: 782: FW_ASSERT( - -: 783: portNum < this->getNum_Tlm_OutputPorts(), - -: 784: static_cast(portNum) - #####: 785: ); - #####: 786: return this->m_Tlm_OutputPort[portNum].isConnected(); - -: 787: } - -: 788: - #####: 789: bool HealthComponentBase :: - -: 790: isConnected_Time_OutputPort(NATIVE_INT_TYPE portNum) - -: 791: { - #####: 792: FW_ASSERT( - -: 793: portNum < this->getNum_Time_OutputPorts(), - -: 794: static_cast(portNum) - #####: 795: ); - #####: 796: return this->m_Time_OutputPort[portNum].isConnected(); - -: 797: } - -: 798: - #####: 799: bool HealthComponentBase :: - -: 800: isConnected_Log_OutputPort(NATIVE_INT_TYPE portNum) - -: 801: { - #####: 802: FW_ASSERT( - -: 803: portNum < this->getNum_Log_OutputPorts(), - -: 804: static_cast(portNum) - #####: 805: ); - #####: 806: return this->m_Log_OutputPort[portNum].isConnected(); - -: 807: } - -: 808: - -: 809:#if FW_ENABLE_TEXT_LOGGING == 1 - #####: 810: bool HealthComponentBase :: - -: 811: isConnected_LogText_OutputPort(NATIVE_INT_TYPE portNum) - -: 812: { - #####: 813: FW_ASSERT( - -: 814: portNum < this->getNum_LogText_OutputPorts(), - -: 815: static_cast(portNum) - #####: 816: ); - #####: 817: return this->m_LogText_OutputPort[portNum].isConnected(); - -: 818: } - -: 819:#endif - -: 820: - -: 821: // ---------------------------------------------------------------------- - -: 822: // Calls for messages received on command input ports - -: 823: // ---------------------------------------------------------------------- - -: 824: - 41: 825: void HealthComponentBase :: - -: 826: m_p_CmdDisp_in( - -: 827: Fw::PassiveComponentBase* callComp, - -: 828: NATIVE_INT_TYPE portNum, - -: 829: FwOpcodeType opCode, - -: 830: U32 cmdSeq, - -: 831: Fw::CmdArgBuffer &args - -: 832: ) - -: 833: { - -: 834: - -: 835: // Select base class function based on opcode - 41: 836: FW_ASSERT(callComp); - -: 837: HealthComponentBase* compPtr = - 41: 838: (HealthComponentBase*) callComp; - -: 839: - 41: 840: const U32 idBase = callComp->getIdBase(); - 41: 841: FW_ASSERT(opCode >= idBase, opCode, idBase); - 41: 842: switch (opCode - idBase) { - -: 843: - -: 844: case OPCODE_HLTH_ENABLE: /*!< A command to enable or disable health checks */ - -: 845: compPtr->HLTH_ENABLE_cmdHandlerBase( - -: 846: opCode, - -: 847: cmdSeq, - -: 848: args - 5: 849: ); - 5: 850: break; - -: 851: - -: 852: case OPCODE_HLTH_PING_ENABLE: /*!< Ignore a particular ping entry */ - -: 853: compPtr->HLTH_PING_ENABLE_cmdHandlerBase( - -: 854: opCode, - -: 855: cmdSeq, - -: 856: args - 23: 857: ); - 23: 858: break; - -: 859: - -: 860: case OPCODE_HLTH_CHNG_PING: /*!< Change ping value */ - -: 861: compPtr->HLTH_CHNG_PING_cmdHandlerBase( - -: 862: opCode, - -: 863: cmdSeq, - -: 864: args - 13: 865: ); - 13: 866: break; - -: 867: - -: 868: default: { - -: 869: compPtr->cmdResponse_out( - -: 870: opCode,cmdSeq, - -: 871: Fw::COMMAND_INVALID_OPCODE - #####: 872: ); - #####: 873: break; - -: 874: } - -: 875: - -: 876: } - -: 877: - 41: 878: } - -: 879: - 41: 880: void HealthComponentBase :: - -: 881: cmdResponse_out( - -: 882: FwOpcodeType opCode, - -: 883: U32 cmdSeq, - -: 884: Fw::CommandResponse response - -: 885: ) - -: 886: { - 41: 887: FW_ASSERT(this->m_CmdStatus_OutputPort[0].isConnected()); - 41: 888: this->m_CmdStatus_OutputPort[0].invoke(opCode,cmdSeq,response); - 41: 889: } - -: 890: - -: 891: // ---------------------------------------------------------------------- - -: 892: // Base class command functions - -: 893: // ---------------------------------------------------------------------- - -: 894: - 5: 895: void HealthComponentBase :: - -: 896: HLTH_ENABLE_cmdHandlerBase( - -: 897: FwOpcodeType opCode, - -: 898: U32 cmdSeq, - -: 899: Fw::CmdArgBuffer &args - -: 900: ) - -: 901: { - -: 902: - -: 903: // Call pre-message hook - 5: 904: this->HLTH_ENABLE_preMsgHook(opCode,cmdSeq); - -: 905: - -: 906: // Defer deserializing arguments to the message dispatcher - -: 907: // to avoid deserializing and reserializing just for IPC - 10: 908: ComponentIpcSerializableBuffer msg; - 5: 909: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 910: - -: 911: // Serialize for IPC - 5: 912: _status = msg.serialize((NATIVE_INT_TYPE)CMD_HLTH_ENABLE); - -: 913: FW_ASSERT ( - -: 914: _status == Fw::FW_SERIALIZE_OK, - -: 915: static_cast(_status) - 5: 916: ); - -: 917: - -: 918: // Fake port number to make message dequeue work - 5: 919: NATIVE_INT_TYPE port = 0; - 5: 920: _status = msg.serialize(port); - -: 921: FW_ASSERT ( - -: 922: _status == Fw::FW_SERIALIZE_OK, - -: 923: static_cast(_status) - 5: 924: ); - -: 925: - 5: 926: _status = msg.serialize(opCode); - -: 927: FW_ASSERT ( - -: 928: _status == Fw::FW_SERIALIZE_OK, - -: 929: static_cast(_status) - 5: 930: ); - -: 931: - 5: 932: _status = msg.serialize(cmdSeq); - -: 933: FW_ASSERT ( - -: 934: _status == Fw::FW_SERIALIZE_OK, - -: 935: static_cast(_status) - 5: 936: ); - -: 937: - 5: 938: _status = msg.serialize(args); - -: 939: FW_ASSERT ( - -: 940: _status == Fw::FW_SERIALIZE_OK, - -: 941: static_cast(_status) - 5: 942: ); - -: 943: - -: 944: // send message - -: 945: Os::Queue::QueueBlocking _block = - 5: 946: Os::Queue::QUEUE_NONBLOCKING; - -: 947: Os::Queue::QueueStatus qStatus = - 5: 948: this->m_queue.send(msg, 0,_block); - -: 949: FW_ASSERT( - -: 950: qStatus == Os::Queue::QUEUE_OK, - -: 951: static_cast(qStatus) - 5: 952: ); - -: 953: - 5: 954: } - -: 955: - 5: 956: void HealthComponentBase:: - -: 957: HLTH_ENABLE_preMsgHook( - -: 958: FwOpcodeType opCode, - -: 959: U32 cmdSeq - -: 960: ) - -: 961: { - -: 962: // Defaults to no-op; can be overridden - 5: 963: } - -: 964: - 23: 965: void HealthComponentBase :: - -: 966: HLTH_PING_ENABLE_cmdHandlerBase( - -: 967: FwOpcodeType opCode, - -: 968: U32 cmdSeq, - -: 969: Fw::CmdArgBuffer &args - -: 970: ) - -: 971: { - -: 972: - -: 973: // Call pre-message hook - 23: 974: this->HLTH_PING_ENABLE_preMsgHook(opCode,cmdSeq); - -: 975: - -: 976: // Defer deserializing arguments to the message dispatcher - -: 977: // to avoid deserializing and reserializing just for IPC - 46: 978: ComponentIpcSerializableBuffer msg; - 23: 979: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 980: - -: 981: // Serialize for IPC - 23: 982: _status = msg.serialize((NATIVE_INT_TYPE)CMD_HLTH_PING_ENABLE); - -: 983: FW_ASSERT ( - -: 984: _status == Fw::FW_SERIALIZE_OK, - -: 985: static_cast(_status) - 23: 986: ); - -: 987: - -: 988: // Fake port number to make message dequeue work - 23: 989: NATIVE_INT_TYPE port = 0; - 23: 990: _status = msg.serialize(port); - -: 991: FW_ASSERT ( - -: 992: _status == Fw::FW_SERIALIZE_OK, - -: 993: static_cast(_status) - 23: 994: ); - -: 995: - 23: 996: _status = msg.serialize(opCode); - -: 997: FW_ASSERT ( - -: 998: _status == Fw::FW_SERIALIZE_OK, - -: 999: static_cast(_status) - 23: 1000: ); - -: 1001: - 23: 1002: _status = msg.serialize(cmdSeq); - -: 1003: FW_ASSERT ( - -: 1004: _status == Fw::FW_SERIALIZE_OK, - -: 1005: static_cast(_status) - 23: 1006: ); - -: 1007: - 23: 1008: _status = msg.serialize(args); - -: 1009: FW_ASSERT ( - -: 1010: _status == Fw::FW_SERIALIZE_OK, - -: 1011: static_cast(_status) - 23: 1012: ); - -: 1013: - -: 1014: // send message - -: 1015: Os::Queue::QueueBlocking _block = - 23: 1016: Os::Queue::QUEUE_NONBLOCKING; - -: 1017: Os::Queue::QueueStatus qStatus = - 23: 1018: this->m_queue.send(msg, 0,_block); - -: 1019: FW_ASSERT( - -: 1020: qStatus == Os::Queue::QUEUE_OK, - -: 1021: static_cast(qStatus) - 23: 1022: ); - -: 1023: - 23: 1024: } - -: 1025: - 23: 1026: void HealthComponentBase:: - -: 1027: HLTH_PING_ENABLE_preMsgHook( - -: 1028: FwOpcodeType opCode, - -: 1029: U32 cmdSeq - -: 1030: ) - -: 1031: { - -: 1032: // Defaults to no-op; can be overridden - 23: 1033: } - -: 1034: - 13: 1035: void HealthComponentBase :: - -: 1036: HLTH_CHNG_PING_cmdHandlerBase( - -: 1037: FwOpcodeType opCode, - -: 1038: U32 cmdSeq, - -: 1039: Fw::CmdArgBuffer &args - -: 1040: ) - -: 1041: { - -: 1042: - -: 1043: // Call pre-message hook - 13: 1044: this->HLTH_CHNG_PING_preMsgHook(opCode,cmdSeq); - -: 1045: - -: 1046: // Defer deserializing arguments to the message dispatcher - -: 1047: // to avoid deserializing and reserializing just for IPC - 26: 1048: ComponentIpcSerializableBuffer msg; - 13: 1049: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 1050: - -: 1051: // Serialize for IPC - 13: 1052: _status = msg.serialize((NATIVE_INT_TYPE)CMD_HLTH_CHNG_PING); - -: 1053: FW_ASSERT ( - -: 1054: _status == Fw::FW_SERIALIZE_OK, - -: 1055: static_cast(_status) - 13: 1056: ); - -: 1057: - -: 1058: // Fake port number to make message dequeue work - 13: 1059: NATIVE_INT_TYPE port = 0; - 13: 1060: _status = msg.serialize(port); - -: 1061: FW_ASSERT ( - -: 1062: _status == Fw::FW_SERIALIZE_OK, - -: 1063: static_cast(_status) - 13: 1064: ); - -: 1065: - 13: 1066: _status = msg.serialize(opCode); - -: 1067: FW_ASSERT ( - -: 1068: _status == Fw::FW_SERIALIZE_OK, - -: 1069: static_cast(_status) - 13: 1070: ); - -: 1071: - 13: 1072: _status = msg.serialize(cmdSeq); - -: 1073: FW_ASSERT ( - -: 1074: _status == Fw::FW_SERIALIZE_OK, - -: 1075: static_cast(_status) - 13: 1076: ); - -: 1077: - 13: 1078: _status = msg.serialize(args); - -: 1079: FW_ASSERT ( - -: 1080: _status == Fw::FW_SERIALIZE_OK, - -: 1081: static_cast(_status) - 13: 1082: ); - -: 1083: - -: 1084: // send message - -: 1085: Os::Queue::QueueBlocking _block = - 13: 1086: Os::Queue::QUEUE_NONBLOCKING; - -: 1087: Os::Queue::QueueStatus qStatus = - 13: 1088: this->m_queue.send(msg, 0,_block); - -: 1089: FW_ASSERT( - -: 1090: qStatus == Os::Queue::QUEUE_OK, - -: 1091: static_cast(qStatus) - 13: 1092: ); - -: 1093: - 13: 1094: } - -: 1095: - 13: 1096: void HealthComponentBase:: - -: 1097: HLTH_CHNG_PING_preMsgHook( - -: 1098: FwOpcodeType opCode, - -: 1099: U32 cmdSeq - -: 1100: ) - -: 1101: { - -: 1102: // Defaults to no-op; can be overridden - 13: 1103: } - -: 1104: - -: 1105: // ---------------------------------------------------------------------- - -: 1106: // Telemetry write functions - -: 1107: // ---------------------------------------------------------------------- - -: 1108: - 21: 1109: void HealthComponentBase :: - -: 1110: tlmWrite_PingLateWarnings(U32 arg) - -: 1111: { - -: 1112: - 21: 1113: if (this->m_Tlm_OutputPort[0].isConnected()) { - 42: 1114: Fw::Time _tlmTime; - 21: 1115: if (this->m_Time_OutputPort[0].isConnected()) { - 21: 1116: this->m_Time_OutputPort[0].invoke( _tlmTime); - -: 1117: } - 42: 1118: Fw::TlmBuffer _tlmBuff; - 21: 1119: Fw::SerializeStatus _stat = _tlmBuff.serialize(arg); - -: 1120: FW_ASSERT( - -: 1121: _stat == Fw::FW_SERIALIZE_OK, - -: 1122: static_cast(_stat) - 21: 1123: ); - -: 1124: - -: 1125: FwChanIdType _id; - -: 1126: - 21: 1127: _id = this->getIdBase() + CHANNELID_PINGLATEWARNINGS; - -: 1128: - 21: 1129: this->m_Tlm_OutputPort[0].invoke( - -: 1130: _id, - -: 1131: _tlmTime, - -: 1132: _tlmBuff - 21: 1133: ); - -: 1134: } - -: 1135: - 21: 1136: } - -: 1137: - -: 1138: // ---------------------------------------------------------------------- - -: 1139: // Time - -: 1140: // ---------------------------------------------------------------------- - -: 1141: - #####: 1142: Fw::Time HealthComponentBase :: - -: 1143: getTime(void) - -: 1144: { - #####: 1145: if (this->m_Time_OutputPort[0].isConnected()) { - #####: 1146: Fw::Time _time; - #####: 1147: this->m_Time_OutputPort[0].invoke(_time); - #####: 1148: return _time; - -: 1149: } else { - #####: 1150: return Fw::Time(TB_NONE,0,0); - -: 1151: } - -: 1152: } - -: 1153: - -: 1154: // ---------------------------------------------------------------------- - -: 1155: // Event handling functions - -: 1156: // ---------------------------------------------------------------------- - -: 1157: - 21: 1158: void HealthComponentBase :: - -: 1159: log_WARNING_HI_HLTH_PING_WARN( - -: 1160: Fw::LogStringArg& entry - -: 1161: ) - -: 1162: { - -: 1163: - -: 1164: - -: 1165: // Get the time - 42: 1166: Fw::Time _logTime; - 21: 1167: if (this->m_Time_OutputPort[0].isConnected()) { - 21: 1168: this->m_Time_OutputPort[0].invoke( _logTime); - -: 1169: } - -: 1170: - 21: 1171: FwEventIdType _id = static_cast(0); - -: 1172: - 21: 1173: _id = this->getIdBase() + EVENTID_HLTH_PING_WARN; - -: 1174: - -: 1175: // Emit the event on the log port - 21: 1176: if (this->m_Log_OutputPort[0].isConnected()) { - -: 1177: - 42: 1178: Fw::LogBuffer _logBuff; - 21: 1179: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 1180: - -: 1181:#if FW_AMPCS_COMPATIBLE - -: 1182: // Serialize the number of arguments - -: 1183: _status = _logBuff.serialize(static_cast(1)); - -: 1184: FW_ASSERT( - -: 1185: _status == Fw::FW_SERIALIZE_OK, - -: 1186: static_cast(_status) - -: 1187: ); - -: 1188:#endif - -: 1189: - 21: 1190: entry.setMaxSerialize(40); - 21: 1191: _status = _logBuff.serialize(entry); - -: 1192: FW_ASSERT( - -: 1193: _status == Fw::FW_SERIALIZE_OK, - -: 1194: static_cast(_status) - 21: 1195: ); - -: 1196: - -: 1197: - 21: 1198: this->m_Log_OutputPort[0].invoke( - -: 1199: _id, - -: 1200: _logTime,Fw::LOG_WARNING_HI, - -: 1201: _logBuff - 21: 1202: ); - -: 1203: - -: 1204: } - -: 1205: - -: 1206: // Emit the event on the text log port - -: 1207:#if FW_ENABLE_TEXT_LOGGING - 21: 1208: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 1209: - -: 1210:#if FW_OBJECT_NAMES == 1 - -: 1211: const char* _formatString = - 21: 1212: "(%s) %s: Ping entry %s late warning"; - -: 1213:#else - -: 1214: const char* _formatString = - -: 1215: "%s: Ping entry %s late warning"; - -: 1216:#endif - -: 1217: - -: 1218: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 1219: - 21: 1220: (void) snprintf( - -: 1221: _textBuffer, - -: 1222: FW_LOG_TEXT_BUFFER_SIZE, - -: 1223: _formatString, - -: 1224:#if FW_OBJECT_NAMES == 1 - -: 1225: this->m_objName, - -: 1226:#endif - -: 1227: "HLTH_PING_WARN " - 21: 1228: , entry.toChar() - 21: 1229: ); - -: 1230: - -: 1231: // Null terminate - 21: 1232: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 42: 1233: Fw::TextLogString _logString = _textBuffer; - 21: 1234: this->m_LogText_OutputPort[0].invoke( - -: 1235: _id, - -: 1236: _logTime,Fw::TEXT_LOG_WARNING_HI, - -: 1237: _logString - 21: 1238: ); - -: 1239: - -: 1240: } - -: 1241:#endif - -: 1242: - 21: 1243: } - -: 1244: - -: 1245: - 20: 1246: void HealthComponentBase :: - -: 1247: log_FATAL_HLTH_PING_LATE( - -: 1248: Fw::LogStringArg& entry - -: 1249: ) - -: 1250: { - -: 1251: - -: 1252: - -: 1253: // Get the time - 40: 1254: Fw::Time _logTime; - 20: 1255: if (this->m_Time_OutputPort[0].isConnected()) { - 20: 1256: this->m_Time_OutputPort[0].invoke( _logTime); - -: 1257: } - -: 1258: - 20: 1259: FwEventIdType _id = static_cast(0); - -: 1260: - 20: 1261: _id = this->getIdBase() + EVENTID_HLTH_PING_LATE; - -: 1262: - -: 1263: // Emit the event on the log port - 20: 1264: if (this->m_Log_OutputPort[0].isConnected()) { - -: 1265: - 40: 1266: Fw::LogBuffer _logBuff; - 20: 1267: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 1268: - -: 1269:#if FW_AMPCS_COMPATIBLE - -: 1270: // Serialize the number of arguments - -: 1271: _status = _logBuff.serialize(static_cast(1)); - -: 1272: FW_ASSERT( - -: 1273: _status == Fw::FW_SERIALIZE_OK, - -: 1274: static_cast(_status) - -: 1275: ); - -: 1276:#endif - -: 1277: - 20: 1278: entry.setMaxSerialize(40); - 20: 1279: _status = _logBuff.serialize(entry); - -: 1280: FW_ASSERT( - -: 1281: _status == Fw::FW_SERIALIZE_OK, - -: 1282: static_cast(_status) - 20: 1283: ); - -: 1284: - -: 1285: - 20: 1286: this->m_Log_OutputPort[0].invoke( - -: 1287: _id, - -: 1288: _logTime,Fw::LOG_FATAL, - -: 1289: _logBuff - 20: 1290: ); - -: 1291: - -: 1292: } - -: 1293: - -: 1294: // Emit the event on the text log port - -: 1295:#if FW_ENABLE_TEXT_LOGGING - 20: 1296: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 1297: - -: 1298:#if FW_OBJECT_NAMES == 1 - -: 1299: const char* _formatString = - 20: 1300: "(%s) %s: Ping entry %s did not respond"; - -: 1301:#else - -: 1302: const char* _formatString = - -: 1303: "%s: Ping entry %s did not respond"; - -: 1304:#endif - -: 1305: - -: 1306: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 1307: - 20: 1308: (void) snprintf( - -: 1309: _textBuffer, - -: 1310: FW_LOG_TEXT_BUFFER_SIZE, - -: 1311: _formatString, - -: 1312:#if FW_OBJECT_NAMES == 1 - -: 1313: this->m_objName, - -: 1314:#endif - -: 1315: "HLTH_PING_LATE " - 20: 1316: , entry.toChar() - 20: 1317: ); - -: 1318: - -: 1319: // Null terminate - 20: 1320: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 40: 1321: Fw::TextLogString _logString = _textBuffer; - 20: 1322: this->m_LogText_OutputPort[0].invoke( - -: 1323: _id, - -: 1324: _logTime,Fw::TEXT_LOG_FATAL, - -: 1325: _logString - 20: 1326: ); - -: 1327: - -: 1328: } - -: 1329:#endif - -: 1330: - 20: 1331: } - -: 1332: - -: 1333: - 10: 1334: void HealthComponentBase :: - -: 1335: log_FATAL_HLTH_PING_WRONG_KEY( - -: 1336: Fw::LogStringArg& entry, U32 badKey - -: 1337: ) - -: 1338: { - -: 1339: - -: 1340: - -: 1341: // Get the time - 20: 1342: Fw::Time _logTime; - 10: 1343: if (this->m_Time_OutputPort[0].isConnected()) { - 10: 1344: this->m_Time_OutputPort[0].invoke( _logTime); - -: 1345: } - -: 1346: - 10: 1347: FwEventIdType _id = static_cast(0); - -: 1348: - 10: 1349: _id = this->getIdBase() + EVENTID_HLTH_PING_WRONG_KEY; - -: 1350: - -: 1351: // Emit the event on the log port - 10: 1352: if (this->m_Log_OutputPort[0].isConnected()) { - -: 1353: - 20: 1354: Fw::LogBuffer _logBuff; - 10: 1355: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 1356: - -: 1357:#if FW_AMPCS_COMPATIBLE - -: 1358: // Serialize the number of arguments - -: 1359: _status = _logBuff.serialize(static_cast(2)); - -: 1360: FW_ASSERT( - -: 1361: _status == Fw::FW_SERIALIZE_OK, - -: 1362: static_cast(_status) - -: 1363: ); - -: 1364:#endif - -: 1365: - 10: 1366: entry.setMaxSerialize(40); - 10: 1367: _status = _logBuff.serialize(entry); - -: 1368: FW_ASSERT( - -: 1369: _status == Fw::FW_SERIALIZE_OK, - -: 1370: static_cast(_status) - 10: 1371: ); - -: 1372: - -: 1373:#if FW_AMPCS_COMPATIBLE - -: 1374: // Serialize the argument size - -: 1375: _status = _logBuff.serialize( - -: 1376: static_cast(sizeof(badKey)) - -: 1377: ); - -: 1378: FW_ASSERT( - -: 1379: _status == Fw::FW_SERIALIZE_OK, - -: 1380: static_cast(_status) - -: 1381: ); - -: 1382:#endif - -: 1383: - 10: 1384: _status = _logBuff.serialize(badKey); - -: 1385: FW_ASSERT( - -: 1386: _status == Fw::FW_SERIALIZE_OK, - -: 1387: static_cast(_status) - 10: 1388: ); - -: 1389: - -: 1390: - 10: 1391: this->m_Log_OutputPort[0].invoke( - -: 1392: _id, - -: 1393: _logTime,Fw::LOG_FATAL, - -: 1394: _logBuff - 10: 1395: ); - -: 1396: - -: 1397: } - -: 1398: - -: 1399: // Emit the event on the text log port - -: 1400:#if FW_ENABLE_TEXT_LOGGING - 10: 1401: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 1402: - -: 1403:#if FW_OBJECT_NAMES == 1 - -: 1404: const char* _formatString = - 10: 1405: "(%s) %s: Ping entry %s responded with wrong key 0x%08X"; - -: 1406:#else - -: 1407: const char* _formatString = - -: 1408: "%s: Ping entry %s responded with wrong key 0x%08X"; - -: 1409:#endif - -: 1410: - -: 1411: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 1412: - 10: 1413: (void) snprintf( - -: 1414: _textBuffer, - -: 1415: FW_LOG_TEXT_BUFFER_SIZE, - -: 1416: _formatString, - -: 1417:#if FW_OBJECT_NAMES == 1 - -: 1418: this->m_objName, - -: 1419:#endif - -: 1420: "HLTH_PING_WRONG_KEY " - 10: 1421: , entry.toChar() - -: 1422: , badKey - 10: 1423: ); - -: 1424: - -: 1425: // Null terminate - 10: 1426: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 20: 1427: Fw::TextLogString _logString = _textBuffer; - 10: 1428: this->m_LogText_OutputPort[0].invoke( - -: 1429: _id, - -: 1430: _logTime,Fw::TEXT_LOG_FATAL, - -: 1431: _logString - 10: 1432: ); - -: 1433: - -: 1434: } - -: 1435:#endif - -: 1436: - 10: 1437: } - -: 1438: - -: 1439: - 5: 1440: void HealthComponentBase :: - -: 1441: log_ACTIVITY_HI_HLTH_CHECK_ENABLE( - -: 1442: HealthIsEnabled enabled - -: 1443: ) - -: 1444: { - -: 1445: - -: 1446: - -: 1447: // Get the time - 10: 1448: Fw::Time _logTime; - 5: 1449: if (this->m_Time_OutputPort[0].isConnected()) { - 5: 1450: this->m_Time_OutputPort[0].invoke( _logTime); - -: 1451: } - -: 1452: - 5: 1453: FwEventIdType _id = static_cast(0); - -: 1454: - 5: 1455: _id = this->getIdBase() + EVENTID_HLTH_CHECK_ENABLE; - -: 1456: - -: 1457: // Emit the event on the log port - 5: 1458: if (this->m_Log_OutputPort[0].isConnected()) { - -: 1459: - 10: 1460: Fw::LogBuffer _logBuff; - 5: 1461: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 1462: - -: 1463:#if FW_AMPCS_COMPATIBLE - -: 1464: // Serialize the number of arguments - -: 1465: _status = _logBuff.serialize(static_cast(1)); - -: 1466: FW_ASSERT( - -: 1467: _status == Fw::FW_SERIALIZE_OK, - -: 1468: static_cast(_status) - -: 1469: ); - -: 1470:#endif - -: 1471: - -: 1472:#if FW_AMPCS_COMPATIBLE - -: 1473: // Serialize the argument size - -: 1474: _status = _logBuff.serialize(static_cast(sizeof(FwEnumStoreType))); - -: 1475: FW_ASSERT( - -: 1476: _status == Fw::FW_SERIALIZE_OK, - -: 1477: static_cast(_status) - -: 1478: ); - -: 1479:#endif - -: 1480: - 5: 1481: _status = _logBuff.serialize( - -: 1482: static_cast(enabled) - 5: 1483: ); - -: 1484: FW_ASSERT( - -: 1485: _status == Fw::FW_SERIALIZE_OK, - -: 1486: static_cast(_status) - 5: 1487: ); - -: 1488: - -: 1489: - 5: 1490: this->m_Log_OutputPort[0].invoke( - -: 1491: _id, - -: 1492: _logTime,Fw::LOG_ACTIVITY_HI, - -: 1493: _logBuff - 5: 1494: ); - -: 1495: - -: 1496: } - -: 1497: - -: 1498: // Emit the event on the text log port - -: 1499:#if FW_ENABLE_TEXT_LOGGING - 5: 1500: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 1501: - -: 1502:#if FW_OBJECT_NAMES == 1 - -: 1503: const char* _formatString = - 5: 1504: "(%s) %s: Health checking set to %d"; - -: 1505:#else - -: 1506: const char* _formatString = - -: 1507: "%s: Health checking set to %d"; - -: 1508:#endif - -: 1509: - -: 1510: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 1511: - 5: 1512: (void) snprintf( - -: 1513: _textBuffer, - -: 1514: FW_LOG_TEXT_BUFFER_SIZE, - -: 1515: _formatString, - -: 1516:#if FW_OBJECT_NAMES == 1 - -: 1517: this->m_objName, - -: 1518:#endif - -: 1519: "HLTH_CHECK_ENABLE " - -: 1520: , enabled - 5: 1521: ); - -: 1522: - -: 1523: // Null terminate - 5: 1524: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 10: 1525: Fw::TextLogString _logString = _textBuffer; - 5: 1526: this->m_LogText_OutputPort[0].invoke( - -: 1527: _id, - -: 1528: _logTime,Fw::TEXT_LOG_ACTIVITY_HI, - -: 1529: _logString - 5: 1530: ); - -: 1531: - -: 1532: } - -: 1533:#endif - -: 1534: - 5: 1535: } - -: 1536: - -: 1537: - 21: 1538: void HealthComponentBase :: - -: 1539: log_ACTIVITY_HI_HLTH_CHECK_PING( - -: 1540: HealthPingIsEnabled enabled, Fw::LogStringArg& entry - -: 1541: ) - -: 1542: { - -: 1543: - -: 1544: - -: 1545: // Get the time - 42: 1546: Fw::Time _logTime; - 21: 1547: if (this->m_Time_OutputPort[0].isConnected()) { - 21: 1548: this->m_Time_OutputPort[0].invoke( _logTime); - -: 1549: } - -: 1550: - 21: 1551: FwEventIdType _id = static_cast(0); - -: 1552: - 21: 1553: _id = this->getIdBase() + EVENTID_HLTH_CHECK_PING; - -: 1554: - -: 1555: // Emit the event on the log port - 21: 1556: if (this->m_Log_OutputPort[0].isConnected()) { - -: 1557: - 42: 1558: Fw::LogBuffer _logBuff; - 21: 1559: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 1560: - -: 1561:#if FW_AMPCS_COMPATIBLE - -: 1562: // Serialize the number of arguments - -: 1563: _status = _logBuff.serialize(static_cast(2)); - -: 1564: FW_ASSERT( - -: 1565: _status == Fw::FW_SERIALIZE_OK, - -: 1566: static_cast(_status) - -: 1567: ); - -: 1568:#endif - -: 1569: - -: 1570:#if FW_AMPCS_COMPATIBLE - -: 1571: // Serialize the argument size - -: 1572: _status = _logBuff.serialize(static_cast(sizeof(FwEnumStoreType))); - -: 1573: FW_ASSERT( - -: 1574: _status == Fw::FW_SERIALIZE_OK, - -: 1575: static_cast(_status) - -: 1576: ); - -: 1577:#endif - -: 1578: - 21: 1579: _status = _logBuff.serialize( - -: 1580: static_cast(enabled) - 21: 1581: ); - -: 1582: FW_ASSERT( - -: 1583: _status == Fw::FW_SERIALIZE_OK, - -: 1584: static_cast(_status) - 21: 1585: ); - -: 1586: - 21: 1587: entry.setMaxSerialize(40); - 21: 1588: _status = _logBuff.serialize(entry); - -: 1589: FW_ASSERT( - -: 1590: _status == Fw::FW_SERIALIZE_OK, - -: 1591: static_cast(_status) - 21: 1592: ); - -: 1593: - -: 1594: - 21: 1595: this->m_Log_OutputPort[0].invoke( - -: 1596: _id, - -: 1597: _logTime,Fw::LOG_ACTIVITY_HI, - -: 1598: _logBuff - 21: 1599: ); - -: 1600: - -: 1601: } - -: 1602: - -: 1603: // Emit the event on the text log port - -: 1604:#if FW_ENABLE_TEXT_LOGGING - 21: 1605: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 1606: - -: 1607:#if FW_OBJECT_NAMES == 1 - -: 1608: const char* _formatString = - 21: 1609: "(%s) %s: Health checking set to %d for %s"; - -: 1610:#else - -: 1611: const char* _formatString = - -: 1612: "%s: Health checking set to %d for %s"; - -: 1613:#endif - -: 1614: - -: 1615: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 1616: - 21: 1617: (void) snprintf( - -: 1618: _textBuffer, - -: 1619: FW_LOG_TEXT_BUFFER_SIZE, - -: 1620: _formatString, - -: 1621:#if FW_OBJECT_NAMES == 1 - -: 1622: this->m_objName, - -: 1623:#endif - -: 1624: "HLTH_CHECK_PING " - -: 1625: , enabled - 21: 1626: , entry.toChar() - 21: 1627: ); - -: 1628: - -: 1629: // Null terminate - 21: 1630: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 42: 1631: Fw::TextLogString _logString = _textBuffer; - 21: 1632: this->m_LogText_OutputPort[0].invoke( - -: 1633: _id, - -: 1634: _logTime,Fw::TEXT_LOG_ACTIVITY_HI, - -: 1635: _logString - 21: 1636: ); - -: 1637: - -: 1638: } - -: 1639:#endif - -: 1640: - 21: 1641: } - -: 1642: - -: 1643: - 2: 1644: void HealthComponentBase :: - -: 1645: log_WARNING_LO_HLTH_CHECK_LOOKUP_ERROR( - -: 1646: Fw::LogStringArg& entry - -: 1647: ) - -: 1648: { - -: 1649: - -: 1650: - -: 1651: // Get the time - 4: 1652: Fw::Time _logTime; - 2: 1653: if (this->m_Time_OutputPort[0].isConnected()) { - 2: 1654: this->m_Time_OutputPort[0].invoke( _logTime); - -: 1655: } - -: 1656: - 2: 1657: FwEventIdType _id = static_cast(0); - -: 1658: - 2: 1659: _id = this->getIdBase() + EVENTID_HLTH_CHECK_LOOKUP_ERROR; - -: 1660: - -: 1661: // Emit the event on the log port - 2: 1662: if (this->m_Log_OutputPort[0].isConnected()) { - -: 1663: - 4: 1664: Fw::LogBuffer _logBuff; - 2: 1665: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 1666: - -: 1667:#if FW_AMPCS_COMPATIBLE - -: 1668: // Serialize the number of arguments - -: 1669: _status = _logBuff.serialize(static_cast(1)); - -: 1670: FW_ASSERT( - -: 1671: _status == Fw::FW_SERIALIZE_OK, - -: 1672: static_cast(_status) - -: 1673: ); - -: 1674:#endif - -: 1675: - 2: 1676: entry.setMaxSerialize(40); - 2: 1677: _status = _logBuff.serialize(entry); - -: 1678: FW_ASSERT( - -: 1679: _status == Fw::FW_SERIALIZE_OK, - -: 1680: static_cast(_status) - 2: 1681: ); - -: 1682: - -: 1683: - 2: 1684: this->m_Log_OutputPort[0].invoke( - -: 1685: _id, - -: 1686: _logTime,Fw::LOG_WARNING_LO, - -: 1687: _logBuff - 2: 1688: ); - -: 1689: - -: 1690: } - -: 1691: - -: 1692: // Emit the event on the text log port - -: 1693:#if FW_ENABLE_TEXT_LOGGING - 2: 1694: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 1695: - -: 1696:#if FW_OBJECT_NAMES == 1 - -: 1697: const char* _formatString = - 2: 1698: "(%s) %s: Couldn't find entry %s"; - -: 1699:#else - -: 1700: const char* _formatString = - -: 1701: "%s: Couldn't find entry %s"; - -: 1702:#endif - -: 1703: - -: 1704: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 1705: - 2: 1706: (void) snprintf( - -: 1707: _textBuffer, - -: 1708: FW_LOG_TEXT_BUFFER_SIZE, - -: 1709: _formatString, - -: 1710:#if FW_OBJECT_NAMES == 1 - -: 1711: this->m_objName, - -: 1712:#endif - -: 1713: "HLTH_CHECK_LOOKUP_ERROR " - 2: 1714: , entry.toChar() - 2: 1715: ); - -: 1716: - -: 1717: // Null terminate - 2: 1718: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 4: 1719: Fw::TextLogString _logString = _textBuffer; - 2: 1720: this->m_LogText_OutputPort[0].invoke( - -: 1721: _id, - -: 1722: _logTime,Fw::TEXT_LOG_WARNING_LO, - -: 1723: _logString - 2: 1724: ); - -: 1725: - -: 1726: } - -: 1727:#endif - -: 1728: - 2: 1729: } - -: 1730: - -: 1731: - 11: 1732: void HealthComponentBase :: - -: 1733: log_ACTIVITY_HI_HLTH_PING_UPDATED( - -: 1734: Fw::LogStringArg& entry, U32 warn, U32 fatal - -: 1735: ) - -: 1736: { - -: 1737: - -: 1738: - -: 1739: // Get the time - 22: 1740: Fw::Time _logTime; - 11: 1741: if (this->m_Time_OutputPort[0].isConnected()) { - 11: 1742: this->m_Time_OutputPort[0].invoke( _logTime); - -: 1743: } - -: 1744: - 11: 1745: FwEventIdType _id = static_cast(0); - -: 1746: - 11: 1747: _id = this->getIdBase() + EVENTID_HLTH_PING_UPDATED; - -: 1748: - -: 1749: // Emit the event on the log port - 11: 1750: if (this->m_Log_OutputPort[0].isConnected()) { - -: 1751: - 22: 1752: Fw::LogBuffer _logBuff; - 11: 1753: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 1754: - -: 1755:#if FW_AMPCS_COMPATIBLE - -: 1756: // Serialize the number of arguments - -: 1757: _status = _logBuff.serialize(static_cast(3)); - -: 1758: FW_ASSERT( - -: 1759: _status == Fw::FW_SERIALIZE_OK, - -: 1760: static_cast(_status) - -: 1761: ); - -: 1762:#endif - -: 1763: - 11: 1764: entry.setMaxSerialize(40); - 11: 1765: _status = _logBuff.serialize(entry); - -: 1766: FW_ASSERT( - -: 1767: _status == Fw::FW_SERIALIZE_OK, - -: 1768: static_cast(_status) - 11: 1769: ); - -: 1770: - -: 1771:#if FW_AMPCS_COMPATIBLE - -: 1772: // Serialize the argument size - -: 1773: _status = _logBuff.serialize( - -: 1774: static_cast(sizeof(warn)) - -: 1775: ); - -: 1776: FW_ASSERT( - -: 1777: _status == Fw::FW_SERIALIZE_OK, - -: 1778: static_cast(_status) - -: 1779: ); - -: 1780:#endif - -: 1781: - 11: 1782: _status = _logBuff.serialize(warn); - -: 1783: FW_ASSERT( - -: 1784: _status == Fw::FW_SERIALIZE_OK, - -: 1785: static_cast(_status) - 11: 1786: ); - -: 1787: - -: 1788:#if FW_AMPCS_COMPATIBLE - -: 1789: // Serialize the argument size - -: 1790: _status = _logBuff.serialize( - -: 1791: static_cast(sizeof(fatal)) - -: 1792: ); - -: 1793: FW_ASSERT( - -: 1794: _status == Fw::FW_SERIALIZE_OK, - -: 1795: static_cast(_status) - -: 1796: ); - -: 1797:#endif - -: 1798: - 11: 1799: _status = _logBuff.serialize(fatal); - -: 1800: FW_ASSERT( - -: 1801: _status == Fw::FW_SERIALIZE_OK, - -: 1802: static_cast(_status) - 11: 1803: ); - -: 1804: - -: 1805: - 11: 1806: this->m_Log_OutputPort[0].invoke( - -: 1807: _id, - -: 1808: _logTime,Fw::LOG_ACTIVITY_HI, - -: 1809: _logBuff - 11: 1810: ); - -: 1811: - -: 1812: } - -: 1813: - -: 1814: // Emit the event on the text log port - -: 1815:#if FW_ENABLE_TEXT_LOGGING - 11: 1816: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 1817: - -: 1818:#if FW_OBJECT_NAMES == 1 - -: 1819: const char* _formatString = - 11: 1820: "(%s) %s: Health ping for %s changed to WARN %d FATAL %d"; - -: 1821:#else - -: 1822: const char* _formatString = - -: 1823: "%s: Health ping for %s changed to WARN %d FATAL %d"; - -: 1824:#endif - -: 1825: - -: 1826: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 1827: - 11: 1828: (void) snprintf( - -: 1829: _textBuffer, - -: 1830: FW_LOG_TEXT_BUFFER_SIZE, - -: 1831: _formatString, - -: 1832:#if FW_OBJECT_NAMES == 1 - -: 1833: this->m_objName, - -: 1834:#endif - -: 1835: "HLTH_PING_UPDATED " - 11: 1836: , entry.toChar() - -: 1837: , warn - -: 1838: , fatal - 11: 1839: ); - -: 1840: - -: 1841: // Null terminate - 11: 1842: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 22: 1843: Fw::TextLogString _logString = _textBuffer; - 11: 1844: this->m_LogText_OutputPort[0].invoke( - -: 1845: _id, - -: 1846: _logTime,Fw::TEXT_LOG_ACTIVITY_HI, - -: 1847: _logString - 11: 1848: ); - -: 1849: - -: 1850: } - -: 1851:#endif - -: 1852: - 11: 1853: } - -: 1854: - -: 1855: - 1: 1856: void HealthComponentBase :: - -: 1857: log_WARNING_HI_HLTH_PING_INVALID_VALUES( - -: 1858: Fw::LogStringArg& entry, U32 warn, U32 fatal - -: 1859: ) - -: 1860: { - -: 1861: - -: 1862: - -: 1863: // Get the time - 2: 1864: Fw::Time _logTime; - 1: 1865: if (this->m_Time_OutputPort[0].isConnected()) { - 1: 1866: this->m_Time_OutputPort[0].invoke( _logTime); - -: 1867: } - -: 1868: - 1: 1869: FwEventIdType _id = static_cast(0); - -: 1870: - 1: 1871: _id = this->getIdBase() + EVENTID_HLTH_PING_INVALID_VALUES; - -: 1872: - -: 1873: // Emit the event on the log port - 1: 1874: if (this->m_Log_OutputPort[0].isConnected()) { - -: 1875: - 2: 1876: Fw::LogBuffer _logBuff; - 1: 1877: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 1878: - -: 1879:#if FW_AMPCS_COMPATIBLE - -: 1880: // Serialize the number of arguments - -: 1881: _status = _logBuff.serialize(static_cast(3)); - -: 1882: FW_ASSERT( - -: 1883: _status == Fw::FW_SERIALIZE_OK, - -: 1884: static_cast(_status) - -: 1885: ); - -: 1886:#endif - -: 1887: - 1: 1888: entry.setMaxSerialize(40); - 1: 1889: _status = _logBuff.serialize(entry); - -: 1890: FW_ASSERT( - -: 1891: _status == Fw::FW_SERIALIZE_OK, - -: 1892: static_cast(_status) - 1: 1893: ); - -: 1894: - -: 1895:#if FW_AMPCS_COMPATIBLE - -: 1896: // Serialize the argument size - -: 1897: _status = _logBuff.serialize( - -: 1898: static_cast(sizeof(warn)) - -: 1899: ); - -: 1900: FW_ASSERT( - -: 1901: _status == Fw::FW_SERIALIZE_OK, - -: 1902: static_cast(_status) - -: 1903: ); - -: 1904:#endif - -: 1905: - 1: 1906: _status = _logBuff.serialize(warn); - -: 1907: FW_ASSERT( - -: 1908: _status == Fw::FW_SERIALIZE_OK, - -: 1909: static_cast(_status) - 1: 1910: ); - -: 1911: - -: 1912:#if FW_AMPCS_COMPATIBLE - -: 1913: // Serialize the argument size - -: 1914: _status = _logBuff.serialize( - -: 1915: static_cast(sizeof(fatal)) - -: 1916: ); - -: 1917: FW_ASSERT( - -: 1918: _status == Fw::FW_SERIALIZE_OK, - -: 1919: static_cast(_status) - -: 1920: ); - -: 1921:#endif - -: 1922: - 1: 1923: _status = _logBuff.serialize(fatal); - -: 1924: FW_ASSERT( - -: 1925: _status == Fw::FW_SERIALIZE_OK, - -: 1926: static_cast(_status) - 1: 1927: ); - -: 1928: - -: 1929: - 1: 1930: this->m_Log_OutputPort[0].invoke( - -: 1931: _id, - -: 1932: _logTime,Fw::LOG_WARNING_HI, - -: 1933: _logBuff - 1: 1934: ); - -: 1935: - -: 1936: } - -: 1937: - -: 1938: // Emit the event on the text log port - -: 1939:#if FW_ENABLE_TEXT_LOGGING - 1: 1940: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 1941: - -: 1942:#if FW_OBJECT_NAMES == 1 - -: 1943: const char* _formatString = - 1: 1944: "(%s) %s: Health ping for %s invalid values: WARN %d FATAL %d"; - -: 1945:#else - -: 1946: const char* _formatString = - -: 1947: "%s: Health ping for %s invalid values: WARN %d FATAL %d"; - -: 1948:#endif - -: 1949: - -: 1950: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 1951: - 1: 1952: (void) snprintf( - -: 1953: _textBuffer, - -: 1954: FW_LOG_TEXT_BUFFER_SIZE, - -: 1955: _formatString, - -: 1956:#if FW_OBJECT_NAMES == 1 - -: 1957: this->m_objName, - -: 1958:#endif - -: 1959: "HLTH_PING_INVALID_VALUES " - 1: 1960: , entry.toChar() - -: 1961: , warn - -: 1962: , fatal - 1: 1963: ); - -: 1964: - -: 1965: // Null terminate - 1: 1966: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 2: 1967: Fw::TextLogString _logString = _textBuffer; - 1: 1968: this->m_LogText_OutputPort[0].invoke( - -: 1969: _id, - -: 1970: _logTime,Fw::TEXT_LOG_WARNING_HI, - -: 1971: _logString - 1: 1972: ); - -: 1973: - -: 1974: } - -: 1975:#endif - -: 1976: - 1: 1977: } - -: 1978: - -: 1979: - -: 1980: // ---------------------------------------------------------------------- - -: 1981: // Calls for invocations received on typed input ports - -: 1982: // ---------------------------------------------------------------------- - -: 1983: - 300: 1984: void HealthComponentBase :: - -: 1985: m_p_PingReturn_in( - -: 1986: Fw::PassiveComponentBase* callComp, - -: 1987: NATIVE_INT_TYPE portNum, - -: 1988: U32 key - -: 1989: ) - -: 1990: { - 300: 1991: FW_ASSERT(callComp); - -: 1992: HealthComponentBase* compPtr = - 300: 1993: (HealthComponentBase*) callComp; - 300: 1994: compPtr->PingReturn_handlerBase(portNum, key); - 300: 1995: } - -: 1996: - 302: 1997: void HealthComponentBase :: - -: 1998: m_p_Run_in( - -: 1999: Fw::PassiveComponentBase* callComp, - -: 2000: NATIVE_INT_TYPE portNum, - -: 2001: NATIVE_UINT_TYPE context - -: 2002: ) - -: 2003: { - 302: 2004: FW_ASSERT(callComp); - -: 2005: HealthComponentBase* compPtr = - 302: 2006: (HealthComponentBase*) callComp; - 302: 2007: compPtr->Run_handlerBase(portNum, context); - 302: 2008: } - -: 2009: - -: 2010: // ---------------------------------------------------------------------- - -: 2011: // Port handler base-class functions for typed input ports - -: 2012: // ---------------------------------------------------------------------- - -: 2013: - 300: 2014: void HealthComponentBase :: - -: 2015: PingReturn_handlerBase( - -: 2016: NATIVE_INT_TYPE portNum, - -: 2017: U32 key - -: 2018: ) - -: 2019: { - -: 2020: - -: 2021: // Make sure port number is valid - 300: 2022: FW_ASSERT(portNum < this->getNum_PingReturn_InputPorts(),static_cast(portNum)); - -: 2023: - -: 2024: // Call pre-message hook - -: 2025: PingReturn_preMsgHook( - -: 2026: portNum, - -: 2027: key - 300: 2028: ); - -: 2029: - 600: 2030: ComponentIpcSerializableBuffer msg; - 300: 2031: Fw::SerializeStatus _status = Fw::FW_SERIALIZE_OK; - -: 2032: - -: 2033: _status = msg.serialize( - -: 2034: static_cast(PINGRETURN_PING) - 300: 2035: ); - -: 2036: FW_ASSERT ( - -: 2037: _status == Fw::FW_SERIALIZE_OK, - -: 2038: static_cast(_status) - 300: 2039: ); - -: 2040: - 300: 2041: _status = msg.serialize(portNum); - -: 2042: FW_ASSERT ( - -: 2043: _status == Fw::FW_SERIALIZE_OK, - -: 2044: static_cast(_status) - 300: 2045: ); - -: 2046: - -: 2047: // Serialize argument key - 300: 2048: _status = msg.serialize(key); - -: 2049: FW_ASSERT( - -: 2050: _status == Fw::FW_SERIALIZE_OK, - -: 2051: static_cast(_status) - 300: 2052: ); - -: 2053: - -: 2054: - -: 2055: // send message - -: 2056: Os::Queue::QueueBlocking _block = - 300: 2057: Os::Queue::QUEUE_NONBLOCKING; - -: 2058: Os::Queue::QueueStatus qStatus = - 300: 2059: this->m_queue.send(msg, 0,_block); - -: 2060: FW_ASSERT( - -: 2061: qStatus == Os::Queue::QUEUE_OK, - -: 2062: static_cast(qStatus) - 300: 2063: ); - -: 2064: - 300: 2065: } - -: 2066: - 302: 2067: void HealthComponentBase :: - -: 2068: Run_handlerBase( - -: 2069: NATIVE_INT_TYPE portNum, - -: 2070: NATIVE_UINT_TYPE context - -: 2071: ) - -: 2072: { - -: 2073: - -: 2074: // Make sure port number is valid - 302: 2075: FW_ASSERT(portNum < this->getNum_Run_InputPorts(),static_cast(portNum)); - -: 2076: - -: 2077: // Down call to pure virtual handler method implemented in Impl class - 302: 2078: this->Run_handler(portNum, context); - -: 2079: - 302: 2080: } - -: 2081: - -: 2082: // ---------------------------------------------------------------------- - -: 2083: // Pre-message hooks for async input ports - -: 2084: // ---------------------------------------------------------------------- - -: 2085: - 300: 2086: void HealthComponentBase :: - -: 2087: PingReturn_preMsgHook( - -: 2088: NATIVE_INT_TYPE portNum, - -: 2089: U32 key - -: 2090: ) - -: 2091: { - -: 2092: // Default: no-op - 300: 2093: } - -: 2094: - -: 2095: // ---------------------------------------------------------------------- - -: 2096: // Message dispatch method for active and queued components. Called - -: 2097: // by active component thread or implementation code for queued components - -: 2098: // ---------------------------------------------------------------------- - -: 2099: - 666: 2100: Fw::QueuedComponentBase::MsgDispatchStatus HealthComponentBase :: - -: 2101: doDispatch(void) - -: 2102: { - 1332: 2103: ComponentIpcSerializableBuffer msg; - -: 2104: NATIVE_INT_TYPE priority; - -: 2105: - 666: 2106: Os::Queue::QueueStatus msgStatus = this->m_queue.receive(msg,priority,Os::Queue::QUEUE_NONBLOCKING); - 666: 2107: if (Os::Queue::QUEUE_NO_MORE_MSGS == msgStatus) { - 344: 2108: return Fw::QueuedComponentBase::MSG_DISPATCH_EMPTY; - -: 2109: } else { - -: 2110: FW_ASSERT( - -: 2111: msgStatus == Os::Queue::QUEUE_OK, - -: 2112: static_cast(msgStatus) - 322: 2113: ); - -: 2114: } - -: 2115: - -: 2116: // Reset to beginning of buffer - 322: 2117: msg.resetDeser(); - -: 2118: - -: 2119: NATIVE_INT_TYPE desMsg; - 322: 2120: Fw::SerializeStatus deserStatus = msg.deserialize(desMsg); - -: 2121: FW_ASSERT( - -: 2122: deserStatus == Fw::FW_SERIALIZE_OK, - -: 2123: static_cast(deserStatus) - 322: 2124: ); - -: 2125: - 322: 2126: MsgTypeEnum msgType = static_cast(desMsg); - -: 2127: - 322: 2128: if (msgType == HEALTH_COMPONENT_EXIT) { - #####: 2129: return MSG_DISPATCH_EXIT; - -: 2130: } - -: 2131: - -: 2132: NATIVE_INT_TYPE portNum; - 322: 2133: deserStatus = msg.deserialize(portNum); - -: 2134: FW_ASSERT( - -: 2135: deserStatus == Fw::FW_SERIALIZE_OK, - -: 2136: static_cast(deserStatus) - 322: 2137: ); - -: 2138: - 322: 2139: switch (msgType) { - -: 2140: - -: 2141: // Handle async input port PingReturn - -: 2142: case PINGRETURN_PING: { - -: 2143: - -: 2144: // Deserialize argument key - -: 2145: U32 key; - 281: 2146: deserStatus = msg.deserialize(key); - -: 2147: FW_ASSERT( - -: 2148: deserStatus == Fw::FW_SERIALIZE_OK, - -: 2149: static_cast(deserStatus) - 281: 2150: ); - -: 2151: - -: 2152: // Call handler function - -: 2153: this->PingReturn_handler( - -: 2154: portNum, - -: 2155: key - 281: 2156: ); - -: 2157: - 281: 2158: break; - -: 2159: - -: 2160: } - -: 2161: - -: 2162: // Handle command HLTH_ENABLE - -: 2163: case CMD_HLTH_ENABLE: { - -: 2164: // Deserialize opcode - -: 2165: FwOpcodeType opCode; - 5: 2166: deserStatus = msg.deserialize(opCode); - -: 2167: FW_ASSERT ( - -: 2168: deserStatus == Fw::FW_SERIALIZE_OK, - -: 2169: static_cast(deserStatus) - 5: 2170: ); - -: 2171: - -: 2172: // Deserialize command sequence - -: 2173: U32 cmdSeq; - 5: 2174: deserStatus = msg.deserialize(cmdSeq); - -: 2175: FW_ASSERT ( - -: 2176: deserStatus == Fw::FW_SERIALIZE_OK, - -: 2177: static_cast(deserStatus) - 5: 2178: ); - -: 2179: - -: 2180: // Deserialize command argument buffer - 10: 2181: Fw::CmdArgBuffer args; - 5: 2182: deserStatus = msg.deserialize(args); - -: 2183: FW_ASSERT ( - -: 2184: deserStatus == Fw::FW_SERIALIZE_OK, - -: 2185: static_cast(deserStatus) - 5: 2186: ); - -: 2187: - -: 2188: // Reset buffer - 5: 2189: args.resetDeser(); - -: 2190: - -: 2191: // Deserialize argument enable - -: 2192: HealthEnabled enable; - -: 2193: FwEnumStoreType enableInt; - 5: 2194: deserStatus = args.deserialize(enableInt); - 5: 2195: enable = (HealthEnabled)enableInt; - 5: 2196: if (deserStatus != Fw::FW_SERIALIZE_OK) { - #####: 2197: if (this->m_CmdStatus_OutputPort[0].isConnected()) { - -: 2198: this->cmdResponse_out( - -: 2199: opCode, - -: 2200: cmdSeq, - -: 2201: Fw::COMMAND_FORMAT_ERROR - #####: 2202: ); - -: 2203: } - -: 2204: // Don't crash the task if bad arguments were passed from the ground - #####: 2205: break; - -: 2206: } - -: 2207: - -: 2208: // Make sure there was no data left over. - -: 2209: // That means the argument buffer size was incorrect. - -: 2210:#if FW_CMD_CHECK_RESIDUAL - 5: 2211: if (args.getBuffLeft() != 0) { - #####: 2212: if (this->m_CmdStatus_OutputPort[0].isConnected()) { - #####: 2213: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_FORMAT_ERROR); - -: 2214: } - -: 2215: // Don't crash the task if bad arguments were passed from the ground - #####: 2216: break; - -: 2217: } - -: 2218:#endif - -: 2219: // Call handler function - -: 2220: this->HLTH_ENABLE_cmdHandler( - -: 2221: opCode, - -: 2222: cmdSeq, - -: 2223: enable - 5: 2224: ); - -: 2225: - 5: 2226: break; - -: 2227: - -: 2228: } - -: 2229: - -: 2230: // Handle command HLTH_PING_ENABLE - -: 2231: case CMD_HLTH_PING_ENABLE: { - -: 2232: // Deserialize opcode - -: 2233: FwOpcodeType opCode; - 23: 2234: deserStatus = msg.deserialize(opCode); - -: 2235: FW_ASSERT ( - -: 2236: deserStatus == Fw::FW_SERIALIZE_OK, - -: 2237: static_cast(deserStatus) - 23: 2238: ); - -: 2239: - -: 2240: // Deserialize command sequence - -: 2241: U32 cmdSeq; - 23: 2242: deserStatus = msg.deserialize(cmdSeq); - -: 2243: FW_ASSERT ( - -: 2244: deserStatus == Fw::FW_SERIALIZE_OK, - -: 2245: static_cast(deserStatus) - 23: 2246: ); - -: 2247: - -: 2248: // Deserialize command argument buffer - 46: 2249: Fw::CmdArgBuffer args; - 23: 2250: deserStatus = msg.deserialize(args); - -: 2251: FW_ASSERT ( - -: 2252: deserStatus == Fw::FW_SERIALIZE_OK, - -: 2253: static_cast(deserStatus) - 23: 2254: ); - -: 2255: - -: 2256: // Reset buffer - 23: 2257: args.resetDeser(); - -: 2258: - -: 2259: // Deserialize argument entry - 46: 2260: Fw::CmdStringArg entry; - 23: 2261: deserStatus = args.deserialize(entry); - 23: 2262: if (deserStatus != Fw::FW_SERIALIZE_OK) { - #####: 2263: if (this->m_CmdStatus_OutputPort[0].isConnected()) { - -: 2264: this->cmdResponse_out( - -: 2265: opCode, - -: 2266: cmdSeq, - -: 2267: Fw::COMMAND_FORMAT_ERROR - #####: 2268: ); - -: 2269: } - -: 2270: // Don't crash the task if bad arguments were passed from the ground - #####: 2271: break; - -: 2272: } - -: 2273: - -: 2274: // Deserialize argument enable - -: 2275: PingEnabled enable; - -: 2276: FwEnumStoreType enableInt; - 23: 2277: deserStatus = args.deserialize(enableInt); - 23: 2278: enable = (PingEnabled)enableInt; - 23: 2279: if (deserStatus != Fw::FW_SERIALIZE_OK) { - #####: 2280: if (this->m_CmdStatus_OutputPort[0].isConnected()) { - -: 2281: this->cmdResponse_out( - -: 2282: opCode, - -: 2283: cmdSeq, - -: 2284: Fw::COMMAND_FORMAT_ERROR - #####: 2285: ); - -: 2286: } - -: 2287: // Don't crash the task if bad arguments were passed from the ground - #####: 2288: break; - -: 2289: } - -: 2290: - -: 2291: // Make sure there was no data left over. - -: 2292: // That means the argument buffer size was incorrect. - -: 2293:#if FW_CMD_CHECK_RESIDUAL - 23: 2294: if (args.getBuffLeft() != 0) { - #####: 2295: if (this->m_CmdStatus_OutputPort[0].isConnected()) { - #####: 2296: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_FORMAT_ERROR); - -: 2297: } - -: 2298: // Don't crash the task if bad arguments were passed from the ground - #####: 2299: break; - -: 2300: } - -: 2301:#endif - -: 2302: // Call handler function - -: 2303: this->HLTH_PING_ENABLE_cmdHandler( - -: 2304: opCode, - -: 2305: cmdSeq, - -: 2306: entry, enable - 23: 2307: ); - -: 2308: - 23: 2309: break; - -: 2310: - -: 2311: } - -: 2312: - -: 2313: // Handle command HLTH_CHNG_PING - -: 2314: case CMD_HLTH_CHNG_PING: { - -: 2315: // Deserialize opcode - -: 2316: FwOpcodeType opCode; - 13: 2317: deserStatus = msg.deserialize(opCode); - -: 2318: FW_ASSERT ( - -: 2319: deserStatus == Fw::FW_SERIALIZE_OK, - -: 2320: static_cast(deserStatus) - 13: 2321: ); - -: 2322: - -: 2323: // Deserialize command sequence - -: 2324: U32 cmdSeq; - 13: 2325: deserStatus = msg.deserialize(cmdSeq); - -: 2326: FW_ASSERT ( - -: 2327: deserStatus == Fw::FW_SERIALIZE_OK, - -: 2328: static_cast(deserStatus) - 13: 2329: ); - -: 2330: - -: 2331: // Deserialize command argument buffer - 26: 2332: Fw::CmdArgBuffer args; - 13: 2333: deserStatus = msg.deserialize(args); - -: 2334: FW_ASSERT ( - -: 2335: deserStatus == Fw::FW_SERIALIZE_OK, - -: 2336: static_cast(deserStatus) - 13: 2337: ); - -: 2338: - -: 2339: // Reset buffer - 13: 2340: args.resetDeser(); - -: 2341: - -: 2342: // Deserialize argument entry - 26: 2343: Fw::CmdStringArg entry; - 13: 2344: deserStatus = args.deserialize(entry); - 13: 2345: if (deserStatus != Fw::FW_SERIALIZE_OK) { - #####: 2346: if (this->m_CmdStatus_OutputPort[0].isConnected()) { - -: 2347: this->cmdResponse_out( - -: 2348: opCode, - -: 2349: cmdSeq, - -: 2350: Fw::COMMAND_FORMAT_ERROR - #####: 2351: ); - -: 2352: } - -: 2353: // Don't crash the task if bad arguments were passed from the ground - #####: 2354: break; - -: 2355: } - -: 2356: - -: 2357: // Deserialize argument warningValue - -: 2358: U32 warningValue; - 13: 2359: deserStatus = args.deserialize(warningValue); - 13: 2360: if (deserStatus != Fw::FW_SERIALIZE_OK) { - #####: 2361: if (this->m_CmdStatus_OutputPort[0].isConnected()) { - -: 2362: this->cmdResponse_out( - -: 2363: opCode, - -: 2364: cmdSeq, - -: 2365: Fw::COMMAND_FORMAT_ERROR - #####: 2366: ); - -: 2367: } - -: 2368: // Don't crash the task if bad arguments were passed from the ground - #####: 2369: break; - -: 2370: } - -: 2371: - -: 2372: // Deserialize argument fatalValue - -: 2373: U32 fatalValue; - 13: 2374: deserStatus = args.deserialize(fatalValue); - 13: 2375: if (deserStatus != Fw::FW_SERIALIZE_OK) { - #####: 2376: if (this->m_CmdStatus_OutputPort[0].isConnected()) { - -: 2377: this->cmdResponse_out( - -: 2378: opCode, - -: 2379: cmdSeq, - -: 2380: Fw::COMMAND_FORMAT_ERROR - #####: 2381: ); - -: 2382: } - -: 2383: // Don't crash the task if bad arguments were passed from the ground - #####: 2384: break; - -: 2385: } - -: 2386: - -: 2387: // Make sure there was no data left over. - -: 2388: // That means the argument buffer size was incorrect. - -: 2389:#if FW_CMD_CHECK_RESIDUAL - 13: 2390: if (args.getBuffLeft() != 0) { - #####: 2391: if (this->m_CmdStatus_OutputPort[0].isConnected()) { - #####: 2392: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_FORMAT_ERROR); - -: 2393: } - -: 2394: // Don't crash the task if bad arguments were passed from the ground - #####: 2395: break; - -: 2396: } - -: 2397:#endif - -: 2398: // Call handler function - -: 2399: this->HLTH_CHNG_PING_cmdHandler( - -: 2400: opCode, - -: 2401: cmdSeq, - -: 2402: entry, warningValue, fatalValue - 13: 2403: ); - -: 2404: - 13: 2405: break; - -: 2406: - -: 2407: } - -: 2408: - -: 2409: default: - #####: 2410: return MSG_DISPATCH_ERROR; - -: 2411: - -: 2412: } - -: 2413: - 322: 2414: return MSG_DISPATCH_OK; - -: 2415: - -: 2416: } - -: 2417: - 3: 2418:} // end namespace Svc diff --git a/Svc/Health/test/ut/output/HealthComponentImpl.cpp.gcov b/Svc/Health/test/ut/output/HealthComponentImpl.cpp.gcov deleted file mode 100644 index 7e022eb6b4..0000000000 --- a/Svc/Health/test/ut/output/HealthComponentImpl.cpp.gcov +++ /dev/null @@ -1,233 +0,0 @@ - -: 0:Source:/home/tim/source/isf/Svc/Health/HealthComponentImpl.cpp - -: 0:Programs:2 - -: 1:// ====================================================================== - -: 2:// \title Health.hpp - -: 3:// \author Tim - -: 4:// \brief hpp file for Health component implementation class - -: 5:// - -: 6:// \copyright - -: 7:// Copyright 2009-2015, by the California Institute of Technology. - -: 8:// ALL RIGHTS RESERVED. United States Government Sponsorship - -: 9:// acknowledged. - -: 11:// - -: 18:// ====================================================================== - -: 19: - -: 20:#include - -: 21:#include "Fw/Types/BasicTypes.hpp" - -: 22:#include - -: 23:#include - -: 24:#include - -: 25: - -: 26:namespace Svc { - -: 27: - -: 28: // ---------------------------------------------------------------------- - -: 29: // Construction, initialization, and destruction - -: 30: // ---------------------------------------------------------------------- - -: 31: - 10: 32: HealthImpl::HealthImpl( - -: 33:#if FW_OBJECT_NAMES == 1 - -: 34: const char * const compName - -: 35:#endif - -: 36: ) : - -: 37:#if FW_OBJECT_NAMES == 1 - -: 38: HealthComponentBase(compName), - -: 39:#endif - -: 40: m_numPingEntries(0), - -: 41: m_key(0), - -: 42: m_watchDogCode(0), - -: 43: m_warnings(0), - -: 44: m_enabled(HLTH_CHK_ENABLED), - 10: 45: queue_depth(0) { - -: 46: // clear tracker by disabling pings - 110: 47: for (NATIVE_UINT_TYPE entry = 0; - 110: 48: entry < FW_NUM_ARRAY_ELEMENTS(this->m_pingTrackerEntries); - -: 49: entry++) { - 100: 50: this->m_pingTrackerEntries[entry].enabled = HLTH_PING_DISABLED; - -: 51: } - 10: 52: } - -: 53: - 10: 54: void HealthImpl::init(const NATIVE_INT_TYPE queueDepth, const NATIVE_INT_TYPE instance) { - 10: 55: HealthComponentBase::init(queueDepth, instance); - 10: 56: this->queue_depth = queueDepth; - -: 57: - 10: 58: } - -: 59: - 10: 60: void HealthImpl::setPingEntries(PingEntry* pingEntries, NATIVE_INT_TYPE numPingEntries, U32 watchDogCode) { - -: 61: - 10: 62: FW_ASSERT(pingEntries); - -: 63: // make sure not asking for more pings than ports - 10: 64: FW_ASSERT(numPingEntries <= NUM_PINGSEND_OUTPUT_PORTS); - -: 65: - 10: 66: this->m_numPingEntries = numPingEntries; - 10: 67: this->m_watchDogCode = watchDogCode; - -: 68: - -: 69: // copy entries to private data - 110: 70: for (NATIVE_INT_TYPE entry = 0; entry < numPingEntries; entry++) { - 100: 71: FW_ASSERT(pingEntries[entry].warnCycles <= pingEntries[entry].fatalCycles, pingEntries[entry].warnCycles, pingEntries[entry].fatalCycles); - 100: 72: this->m_pingTrackerEntries[entry].entry = pingEntries[entry]; - 100: 73: this->m_pingTrackerEntries[entry].cycleCount = 0; - 100: 74: this->m_pingTrackerEntries[entry].enabled = HLTH_PING_ENABLED; - 100: 75: this->m_pingTrackerEntries[entry].key = 0; - -: 76: } - 10: 77: } - -: 78: - 10: 79: HealthImpl::~HealthImpl(void) { - -: 80: - 10: 81: } - -: 82: - -: 83: // ---------------------------------------------------------------------- - -: 84: // Handler implementations for user-defined typed input ports - -: 85: // ---------------------------------------------------------------------- - -: 86: - 281: 87: void HealthImpl::PingReturn_handler(const NATIVE_INT_TYPE portNum, U32 key) { - -: 88: // verify the key value - 281: 89: if (key != this->m_pingTrackerEntries[portNum].key) { - 20: 90: Fw::LogStringArg _arg = this->m_pingTrackerEntries[portNum].entry.entryName; - 10: 91: this->log_FATAL_HLTH_PING_WRONG_KEY(_arg,key); - -: 92: } else { - -: 93: // reset the counter and clear the key - 271: 94: this->m_pingTrackerEntries[portNum].cycleCount = 0; - 271: 95: this->m_pingTrackerEntries[portNum].key = 0; - -: 96: } - -: 97: - 281: 98: } - -: 99: - 302: 100: void HealthImpl::Run_handler(const NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context) { - -: 101: //dispatch messages - 563: 102: for (NATIVE_UINT_TYPE i = 0; i < this->queue_depth; i++) { - 563: 103: MsgDispatchStatus stat = this->doDispatch(); - 563: 104: if (MSG_DISPATCH_EMPTY == stat) { - 302: 105: break; - -: 106: } - 261: 107: FW_ASSERT(MSG_DISPATCH_OK == stat); - -: 108: } - -: 109: - 302: 110: if (this->m_enabled) { - -: 111: // cycle through ping table, pinging ports that are not awaiting a reply - -: 112: // for ports that are awaiting a reply, decrement their counters - -: 113: // and check for violations - -: 114: - 2222: 115: for (NATIVE_UINT_TYPE entry = 0; entry < this->m_numPingEntries; entry++) { - 2020: 116: if (HLTH_PING_ENABLED == this->m_pingTrackerEntries[entry].enabled) { - -: 117: // If clear entry - 1920: 118: if (0 == this->m_pingTrackerEntries[entry].cycleCount) { - -: 119: // start a ping - 421: 120: this->m_pingTrackerEntries[entry].key = this->m_key; - -: 121: // send ping - 421: 122: this->PingSend_out(entry, this->m_pingTrackerEntries[entry].key); - -: 123: // increment key - 421: 124: this->m_key++; - -: 125: // increment cycles for the entry - 421: 126: this->m_pingTrackerEntries[entry].cycleCount++; - -: 127: } else { - -: 128: // check to see if it is at warning threshold and decrement cycle count - 2998: 129: if (this->m_pingTrackerEntries[entry].cycleCount++ == - 1499: 130: this->m_pingTrackerEntries[entry].entry.warnCycles) { - 42: 131: Fw::LogStringArg _arg = this->m_pingTrackerEntries[entry].entry.entryName; - 21: 132: this->log_WARNING_HI_HLTH_PING_WARN(_arg); - 21: 133: this->tlmWrite_PingLateWarnings(++this->m_warnings); - -: 134: } else { - -: 135: // check for FATAL timeout value - 2956: 136: if (this->m_pingTrackerEntries[entry].entry.fatalCycles == - 1478: 137: this->m_pingTrackerEntries[entry].cycleCount) { - 40: 138: Fw::LogStringArg _arg = this->m_pingTrackerEntries[entry].entry.entryName; - 20: 139: this->log_FATAL_HLTH_PING_LATE(_arg); - -: 140: } - -: 141: } // if at warning or fatal threshold - -: 142: } // if clear entry - -: 143: } // if entry has ping enabled - -: 144: } // for each entry - -: 145: - -: 146: // do other specialized platform checks (e.g. VxWorks suspended tasks) - 202: 147: this->doOtherChecks(); - -: 148: - -: 149: } // If health checking is enabled - -: 150: - -: 151: // stroke watchdog. - 302: 152: if (this->isConnected_WdogStroke_OutputPort(0)) { - 302: 153: this->WdogStroke_out(0,this->m_watchDogCode); - -: 154: } - 302: 155: } - -: 156: - -: 157: // ---------------------------------------------------------------------- - -: 158: // Command handler implementations - -: 159: // ---------------------------------------------------------------------- - -: 160: - 5: 161: void HealthImpl::HLTH_ENABLE_cmdHandler(const FwOpcodeType opCode, U32 cmdSeq, HealthEnabled enable) { - 5: 162: this->m_enabled = enable; - 5: 163: HealthIsEnabled isEnabled = HEALTH_CHECK_DISABLED; - 5: 164: if (enable) { - 2: 165: isEnabled = HEALTH_CHECK_ENABLED; - -: 166: } - 5: 167: this->log_ACTIVITY_HI_HLTH_CHECK_ENABLE(isEnabled); - 5: 168: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_OK); - 5: 169: } - -: 170: - -: 171: - 23: 172: void HealthImpl::HLTH_PING_ENABLE_cmdHandler(const FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg& entry, PingEnabled enable) { - -: 173: // check to see if entry is in range - 23: 174: NATIVE_INT_TYPE entryIndex = this->findEntry(entry); - -: 175: - 23: 176: if (-1 == entryIndex) { - 1: 177: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_VALIDATION_ERROR); - 3: 178: return; - -: 179: } - -: 180: - -: 181: // check enable value - 22: 182: if (enable != HealthImpl::HLTH_PING_DISABLED && enable != HealthImpl::HLTH_PING_ENABLED) { - 1: 183: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_VALIDATION_ERROR); - 1: 184: return; - -: 185: } - -: 186: - 21: 187: this->m_pingTrackerEntries[entryIndex].enabled = enable; - 21: 188: HealthPingIsEnabled isEnabled = HEALTH_PING_DISABLED; - 21: 189: if (enable) { - 10: 190: isEnabled = HEALTH_PING_ENABLED; - -: 191: } - 42: 192: Fw::LogStringArg arg; - 21: 193: arg = entry; - 21: 194: this->log_ACTIVITY_HI_HLTH_CHECK_PING(isEnabled,arg); - 21: 195: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_OK); - -: 196: } - -: 197: - 13: 198: void HealthImpl::HLTH_CHNG_PING_cmdHandler(const FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg& entry, U32 warningValue, U32 fatalValue) { - -: 199: // check to see if entry is in range - 13: 200: NATIVE_INT_TYPE entryIndex = this->findEntry(entry); - 13: 201: if (-1 == entryIndex) { - 1: 202: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_VALIDATION_ERROR); - 3: 203: return; - -: 204: } - -: 205: - -: 206: //check to see if warningValue less than or equal to fatalValue - 12: 207: if (warningValue > fatalValue) { - 2: 208: Fw::LogStringArg arg; - 1: 209: arg = entry; - 1: 210: this->log_WARNING_HI_HLTH_PING_INVALID_VALUES(arg,warningValue,fatalValue); - 1: 211: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_VALIDATION_ERROR); - 1: 212: return; - -: 213: } - -: 214: - 11: 215: this->m_pingTrackerEntries[entryIndex].entry.warnCycles = warningValue; - 11: 216: this->m_pingTrackerEntries[entryIndex].entry.fatalCycles = fatalValue; - 22: 217: Fw::LogStringArg arg = entry; - 11: 218: this->log_ACTIVITY_HI_HLTH_PING_UPDATED(arg,warningValue,fatalValue); - 11: 219: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_OK); - -: 220: } - -: 221: - 36: 222: NATIVE_INT_TYPE HealthImpl::findEntry(Fw::CmdStringArg entry) { - -: 223: - -: 224: // walk through entries - 191: 225: for (NATIVE_UINT_TYPE tableEntry = 0; tableEntry < NUM_PINGSEND_OUTPUT_PORTS; tableEntry++) { - 189: 226: if (entry == this->m_pingTrackerEntries[tableEntry].entry.entryName) { - 34: 227: return tableEntry; - -: 228: } - -: 229: } - 4: 230: Fw::LogStringArg arg = entry; - 2: 231: this->log_WARNING_LO_HLTH_CHECK_LOOKUP_ERROR(arg); - -: 232: - 2: 233: return -1; - -: 234: } - -: 235: - -: 236: - -: 237: - 3: 238:} // end namespace Svc diff --git a/Svc/Health/test/ut/output/HealthComponentImpl.hpp.gcov b/Svc/Health/test/ut/output/HealthComponentImpl.hpp.gcov deleted file mode 100644 index 808b6d842e..0000000000 --- a/Svc/Health/test/ut/output/HealthComponentImpl.hpp.gcov +++ /dev/null @@ -1,165 +0,0 @@ - -: 0:Source:/home/tim/source/isf/Svc/Health/HealthComponentImpl.hpp - -: 0:Programs:2 - -: 1:// ====================================================================== - -: 2:// \title Health.hpp - -: 3:// \author Tim, J.Perez - -: 4:// \brief hpp file for Health component implementation class - -: 5:// - -: 6:// \copyright - -: 7:// Copyright 2009-2015, by the California Institute of Technology. - -: 8:// ALL RIGHTS RESERVED. United States Government Sponsorship - -: 9:// acknowledged. - -: 11:// - -: 18:// ====================================================================== - -: 19: - -: 20:#ifndef Health_HPP - -: 21:#define Health_HPP - -: 22: - -: 23:#include - -: 24:#include - -: 25: - -: 26:namespace Svc { - -: 27: - -: 28: //! \class HealthImpl - -: 29: //! \brief Health component implementation class - -: 30: //! - -: 31: //! The health component iterates through each entry - -: 32: //! in its table and checks its status. If an ping entry - -: 33: //! tracker is enabled, it will ping its corresponding port - -: 34: //! with a provided key. If a ping return is outstanding, - -: 35: //! a counter is decremented, and its value is checked - -: 36: //! against warning and fault thresholds. A watchdog is - -: 37: //! always stroked in the run handler. - -: 38: - -: 39: class HealthImpl: public HealthComponentBase { - -: 40: - -: 41: public: - -: 42: //! \brief struct for ping entry - -: 43: //! - -: 44: //! struct for ping entry thresholds. - -: 45: //! Countdown is via calls to the run() - -: 46: //! port. If no response by warnCycles, - -: 47: //! an EVR will be generated and telemetry - -: 48: //! count will be updated. If no response - -: 49: //! by fatalCycles, component will send FATAL - -: 50: //! event. A descriptive name is stored in entryName - -: 51: //! for events. - 100: 52: struct PingEntry { - -: 53: NATIVE_UINT_TYPE warnCycles; //!< number of cycles before WARNING - -: 54: NATIVE_UINT_TYPE fatalCycles; //!< number of cycles before FATAL - -: 55: Fw::EightyCharString entryName; //!< the name of the entry - -: 56: }; - -: 57: - -: 58: //! \brief HealthImpl constructor - -: 59: //! - -: 60: //! The constructor for Health - -: 61: //! - -: 62: //! \param compName component name - -: 63: HealthImpl( - -: 64:#if FW_OBJECT_NAMES == 1 - -: 65: const char * const compName //!< The component name - -: 66:#endif - -: 67: ); - -: 68: - -: 69: //! \brief HealthImpl initialization function - -: 70: //! - -: 71: //! Initializes the autocoded base class, ping table, and data members - -: 72: //! - -: 73: //! \param queueDepth Depth of queue - -: 74: //! \param instance The instance number - -: 75: void init(const NATIVE_INT_TYPE queueDepth, const NATIVE_INT_TYPE instance); - -: 76: - -: 77: //! \brief Set ping entry tables - -: 78: //! - -: 79: //! Provides a table of ping entries - -: 80: //! - -: 81: //! \param pingEntries Pointer to provided ping table entries - -: 82: //! \param numPingEntries Number of ping entries in table - -: 83: //! \param watchDogCode Value that is sent to watchdog - -: 84: void setPingEntries(PingEntry* pingEntries, NATIVE_INT_TYPE numPingEntries, U32 watchDogCode); - -: 85: - -: 86: //! \brief Component destructor - -: 87: //! - -: 88: //! The destructor for HealthImpl is empty - -: 89: ~HealthImpl(void); - -: 90: - -: 91: PROTECTED: - -: 92: - -: 93: //! \brief additional checks function - -: 94: //! - -: 95: //! Does additional checks based on the platform - -: 96: virtual void doOtherChecks(void); - -: 97: - -: 98: PRIVATE: - -: 99: - -: 100: //! \brief ping return handler - -: 101: //! - -: 102: //! Handler implementation for pingReturn - -: 103: //! - -: 104: //! \param portNum Port number - -: 105: //! \param key Key value - -: 106: void PingReturn_handler(const NATIVE_INT_TYPE portNum, U32 key); - -: 107: - -: 108: //! \brief run handler - -: 109: //! - -: 110: //! Handler implementation for run - -: 111: //! - -: 112: //! \param portNum Port number - -: 113: //! \param context Port Context - -: 114: void Run_handler(const NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context); - -: 115: - -: 116: //! \brief HLTH_ENABLE handler - -: 117: //! - -: 118: //! Implementation for HLTH_ENABLE command handler - -: 119: //! - -: 120: //! \param opCode Command opcode - -: 121: //! \param cmdSeq Command sequence - -: 122: //! \param enable Enum for enabling/disabling tracker - -: 123: void HLTH_ENABLE_cmdHandler(const FwOpcodeType opCode, U32 cmdSeq, HealthEnabled enable); - -: 124: - -: 125: //! \brief HLTH_PING_ENABLE handler - -: 126: //! - -: 127: //! Handler for command HLTH_PING_ENABLE - -: 128: //! - -: 129: //! \param opCode Command opcode - -: 130: //! \param cmdSeq Command sequence - -: 131: //! \param entry Ping entry number - -: 132: //! \param enable Enum for enabling/disabling tracker - -: 133: void HLTH_PING_ENABLE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg& entry, PingEnabled enable); - -: 134: - -: 135: //! \brief HLTH_CHNG_PING handler - -: 136: //! - -: 137: //! Implementation for HLTH_CHNG_PING command handler - -: 138: //! - -: 139: //! \param opCode Command opcode - -: 140: //! \param cmdSeq Command sequence - -: 141: //! \param entry Ping entry number - -: 142: //! \param warningValue Warning threshold value - -: 143: //! \param fatalValue Fatal threshold value - -: 144: void HLTH_CHNG_PING_cmdHandler(const FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg& entry, U32 warningValue, U32 fatalValue); - -: 145: - -: 146: //! \brief ping tracker struct - -: 147: //! - -: 148: //! Array for storing ping table entries - 200: 149: struct PingTracker { - -: 150: PingEntry entry; //!< entry passed by user - -: 151: U32 cycleCount; //!< current cycle count - -: 152: U32 key; //!< key passed to ping - -: 153: PingEnabled enabled; //!< if current ping result is checked - -: 154: } m_pingTrackerEntries[NUM_PINGSEND_OUTPUT_PORTS]; - -: 155: - -: 156: NATIVE_INT_TYPE findEntry(Fw::CmdStringArg entry); - -: 157: - -: 158: //! Private member data - -: 159: U32 m_numPingEntries; //!< stores number of entries passed to constructor - -: 160: U32 m_key; //!< current key value. Just increments for each ping entry. - -: 161: U32 m_watchDogCode; //!< stores code used for watchdog stroking - -: 162: U32 m_warnings; //!< number of slip warnings issued - -: 163: HealthEnabled m_enabled; //!< if the pinger is enabled - -: 164: U32 queue_depth; //!< queue depth passed by user - -: 165: - -: 166: }; - -: 167: - -: 168:} // end namespace Svc - -: 169: - -: 170:#endif diff --git a/Svc/Health/test/ut/output/SvcHealth_gcov.txt b/Svc/Health/test/ut/output/SvcHealth_gcov.txt deleted file mode 100644 index 97f5f946ae..0000000000 --- a/Svc/Health/test/ut/output/SvcHealth_gcov.txt +++ /dev/null @@ -1,33 +0,0 @@ -File '/home/tim/source/isf/Svc/Health/HealthComponentImpl.cpp' -Lines executed:100.00% of 106 -Creating 'HealthComponentImpl.cpp.gcov' - -File '/usr/lib/gcc/i686-pc-cygwin/5.4.0/include/c++/iostream' -Lines executed:100.00% of 1 -Creating 'iostream.gcov' - -File '/home/tim/source/isf/Fw/Log/LogString.hpp' -Lines executed:0.00% of 1 -Creating 'LogString.hpp.gcov' - -File '/home/tim/source/isf/Fw/Cmd/CmdString.hpp' -Lines executed:100.00% of 1 -Creating 'CmdString.hpp.gcov' - -File '/home/tim/source/isf/Fw/Types/StringType.hpp' -Lines executed:0.00% of 1 -Creating 'StringType.hpp.gcov' - -File '/home/tim/source/isf/Fw/Types/Serializable.hpp' -Lines executed:0.00% of 1 -Creating 'Serializable.hpp.gcov' - -File '/home/tim/source/isf/Svc/Health/HealthComponentImpl.hpp' -Lines executed:100.00% of 2 -Creating 'HealthComponentImpl.hpp.gcov' - -File '/home/tim/source/isf/Svc/Health/HealthComponentAc.cpp' -Lines executed:85.21% of 676 -Creating 'HealthComponentAc.cpp.gcov' - -Lines executed:86.95% of 789 diff --git a/Svc/Health/test/ut/output/test.txt b/Svc/Health/test/ut/output/test.txt deleted file mode 100644 index 04e28c0d28..0000000000 --- a/Svc/Health/test/ut/output/test.txt +++ /dev/null @@ -1,240 +0,0 @@ -Running unit test for SvcHealth -make[1]: Entering directory '/home/tim/source/isf/Svc/Health' -Running test/ut/runtest_CYGWIN with output dir linux-cygwin-x86-ut-gnu-bin -test/ut/runtest_CYGWIN linux-cygwin-x86-ut-gnu-bin -Running /home/tim/source/isf/Svc/Health/test/ut/linux-cygwin-x86-ut-gnu-bin/test_ut -[==========] Running 10 tests from 1 test case. -[----------] Global test environment set-up. -[----------] 10 tests from Test -[ RUN ] Test.NominalTlm - -*************************************** -TESTCASE 900.1.1: Nominal Telemetry -*************************************** - -*************************************** -(RQ) ISF-HTH-001 -*************************************** - -*************************************** -The Svc::Health component shall ping each output port specified in the provided table. -*************************************** -[ OK ] Test.NominalTlm (1 ms) -[ RUN ] Test.WarningTlm - -*************************************** -TESTCASE 900.1.2: Warning Telemetry -*************************************** - -*************************************** -(RQ) ISF-HTH-002 -*************************************** - -*************************************** -The Svc::Health component shall track the timeout cycles for each component. -*************************************** -[ OK ] Test.WarningTlm (0 ms) -[ RUN ] Test.FaultTlm - -*************************************** -TESTCASE 900.1.3: Fault Telemetry -*************************************** - -*************************************** -(RQ) ISF-HTH-003 -*************************************** - -*************************************** -The Svc::Health component shall issue a FATAL event if a component fails to return a ping by the specified timeout. -*************************************** -EVENT: (0) (0:0,0) WARNING_HI: (Health) HLTH_PING_WARN : Ping entry task0 late warning -EVENT: (0) (0:0,0) WARNING_HI: (Health) HLTH_PING_WARN : Ping entry task1 late warning -EVENT: (0) (0:0,0) WARNING_HI: (Health) HLTH_PING_WARN : Ping entry task2 late warning -EVENT: (0) (0:0,0) WARNING_HI: (Health) HLTH_PING_WARN : Ping entry task3 late warning -EVENT: (0) (0:0,0) WARNING_HI: (Health) HLTH_PING_WARN : Ping entry task4 late warning -EVENT: (0) (0:0,0) WARNING_HI: (Health) HLTH_PING_WARN : Ping entry task5 late warning -EVENT: (0) (0:0,0) WARNING_HI: (Health) HLTH_PING_WARN : Ping entry task6 late warning -EVENT: (0) (0:0,0) WARNING_HI: (Health) HLTH_PING_WARN : Ping entry task7 late warning -EVENT: (0) (0:0,0) WARNING_HI: (Health) HLTH_PING_WARN : Ping entry task8 late warning -EVENT: (0) (0:0,0) WARNING_HI: (Health) HLTH_PING_WARN : Ping entry task9 late warning -EVENT: (1) (0:0,0) FATAL: (Health) HLTH_PING_LATE : Ping entry task0 did not respond -EVENT: (1) (0:0,0) FATAL: (Health) HLTH_PING_LATE : Ping entry task1 did not respond -EVENT: (1) (0:0,0) FATAL: (Health) HLTH_PING_LATE : Ping entry task2 did not respond -EVENT: (1) (0:0,0) FATAL: (Health) HLTH_PING_LATE : Ping entry task3 did not respond -EVENT: (1) (0:0,0) FATAL: (Health) HLTH_PING_LATE : Ping entry task4 did not respond -EVENT: (1) (0:0,0) FATAL: (Health) HLTH_PING_LATE : Ping entry task5 did not respond -EVENT: (1) (0:0,0) FATAL: (Health) HLTH_PING_LATE : Ping entry task6 did not respond -EVENT: (1) (0:0,0) FATAL: (Health) HLTH_PING_LATE : Ping entry task7 did not respond -EVENT: (1) (0:0,0) FATAL: (Health) HLTH_PING_LATE : Ping entry task8 did not respond -EVENT: (1) (0:0,0) FATAL: (Health) HLTH_PING_LATE : Ping entry task9 did not respond -[ OK ] Test.FaultTlm (1 ms) -[ RUN ] Test.DisableAllMonitoring - -*************************************** -TESTCASE 900.1.4: Enable/Disable all monitoring -*************************************** - -*************************************** -(RQ) ISF-HTH-004 -*************************************** - -*************************************** -The Svc::Health component shall have a command to enable or disable all monitoring. -*************************************** -EVENT: (0) (0:0,0) WARNING_HI: (Health) HLTH_PING_WARN : Ping entry task0 late warning -EVENT: (0) (0:0,0) WARNING_HI: (Health) HLTH_PING_WARN : Ping entry task1 late warning -EVENT: (0) (0:0,0) WARNING_HI: (Health) HLTH_PING_WARN : Ping entry task2 late warning -EVENT: (0) (0:0,0) WARNING_HI: (Health) HLTH_PING_WARN : Ping entry task3 late warning -EVENT: (0) (0:0,0) WARNING_HI: (Health) HLTH_PING_WARN : Ping entry task4 late warning -EVENT: (0) (0:0,0) WARNING_HI: (Health) HLTH_PING_WARN : Ping entry task5 late warning -EVENT: (0) (0:0,0) WARNING_HI: (Health) HLTH_PING_WARN : Ping entry task6 late warning -EVENT: (0) (0:0,0) WARNING_HI: (Health) HLTH_PING_WARN : Ping entry task7 late warning -EVENT: (0) (0:0,0) WARNING_HI: (Health) HLTH_PING_WARN : Ping entry task8 late warning -EVENT: (0) (0:0,0) WARNING_HI: (Health) HLTH_PING_WARN : Ping entry task9 late warning -EVENT: (3) (0:0,0) ACTIVITY_HI: (Health) HLTH_CHECK_ENABLE : Health checking set to 0 -EVENT: (3) (0:0,0) ACTIVITY_HI: (Health) HLTH_CHECK_ENABLE : Health checking set to 1 -EVENT: (1) (0:0,0) FATAL: (Health) HLTH_PING_LATE : Ping entry task0 did not respond -EVENT: (1) (0:0,0) FATAL: (Health) HLTH_PING_LATE : Ping entry task1 did not respond -EVENT: (1) (0:0,0) FATAL: (Health) HLTH_PING_LATE : Ping entry task2 did not respond -EVENT: (1) (0:0,0) FATAL: (Health) HLTH_PING_LATE : Ping entry task3 did not respond -EVENT: (1) (0:0,0) FATAL: (Health) HLTH_PING_LATE : Ping entry task4 did not respond -EVENT: (1) (0:0,0) FATAL: (Health) HLTH_PING_LATE : Ping entry task5 did not respond -EVENT: (1) (0:0,0) FATAL: (Health) HLTH_PING_LATE : Ping entry task6 did not respond -EVENT: (1) (0:0,0) FATAL: (Health) HLTH_PING_LATE : Ping entry task7 did not respond -EVENT: (1) (0:0,0) FATAL: (Health) HLTH_PING_LATE : Ping entry task8 did not respond -EVENT: (1) (0:0,0) FATAL: (Health) HLTH_PING_LATE : Ping entry task9 did not respond -[ OK ] Test.DisableAllMonitoring (0 ms) -[ RUN ] Test.DisableOneMonitoring - -*************************************** -TESTCASE 900.1.5: Enable/Disable individual monitors -*************************************** - -*************************************** -(RQ) ISF-HTH-005 -*************************************** - -*************************************** -The Svc::Health component shall have a command to enable or disable monitoring for a particular port. -*************************************** -EVENT: (4) (0:0,0) ACTIVITY_HI: (Health) HLTH_CHECK_PING : Health checking set to 0 for task0 -EVENT: (4) (0:0,0) ACTIVITY_HI: (Health) HLTH_CHECK_PING : Health checking set to 1 for task0 -EVENT: (4) (0:0,0) ACTIVITY_HI: (Health) HLTH_CHECK_PING : Health checking set to 0 for task1 -EVENT: (4) (0:0,0) ACTIVITY_HI: (Health) HLTH_CHECK_PING : Health checking set to 1 for task1 -EVENT: (4) (0:0,0) ACTIVITY_HI: (Health) HLTH_CHECK_PING : Health checking set to 0 for task2 -EVENT: (4) (0:0,0) ACTIVITY_HI: (Health) HLTH_CHECK_PING : Health checking set to 1 for task2 -EVENT: (4) (0:0,0) ACTIVITY_HI: (Health) HLTH_CHECK_PING : Health checking set to 0 for task3 -EVENT: (4) (0:0,0) ACTIVITY_HI: (Health) HLTH_CHECK_PING : Health checking set to 1 for task3 -EVENT: (4) (0:0,0) ACTIVITY_HI: (Health) HLTH_CHECK_PING : Health checking set to 0 for task4 -EVENT: (4) (0:0,0) ACTIVITY_HI: (Health) HLTH_CHECK_PING : Health checking set to 1 for task4 -EVENT: (4) (0:0,0) ACTIVITY_HI: (Health) HLTH_CHECK_PING : Health checking set to 0 for task5 -EVENT: (4) (0:0,0) ACTIVITY_HI: (Health) HLTH_CHECK_PING : Health checking set to 1 for task5 -EVENT: (4) (0:0,0) ACTIVITY_HI: (Health) HLTH_CHECK_PING : Health checking set to 0 for task6 -EVENT: (4) (0:0,0) ACTIVITY_HI: (Health) HLTH_CHECK_PING : Health checking set to 1 for task6 -EVENT: (4) (0:0,0) ACTIVITY_HI: (Health) HLTH_CHECK_PING : Health checking set to 0 for task7 -EVENT: (4) (0:0,0) ACTIVITY_HI: (Health) HLTH_CHECK_PING : Health checking set to 1 for task7 -EVENT: (4) (0:0,0) ACTIVITY_HI: (Health) HLTH_CHECK_PING : Health checking set to 0 for task8 -EVENT: (4) (0:0,0) ACTIVITY_HI: (Health) HLTH_CHECK_PING : Health checking set to 1 for task8 -EVENT: (4) (0:0,0) ACTIVITY_HI: (Health) HLTH_CHECK_PING : Health checking set to 0 for task9 -EVENT: (4) (0:0,0) ACTIVITY_HI: (Health) HLTH_CHECK_PING : Health checking set to 1 for task9 -[ OK ] Test.DisableOneMonitoring (1 ms) -[ RUN ] Test.UpdatePingTimeout - -*************************************** -TESTCASE 900.1.6: Update ping timeouts -*************************************** - -*************************************** -(RQ) ISF-HTH-006 -*************************************** - -*************************************** -The Svc::Health component shall have a command to update ping timeout values for a port -*************************************** -EVENT: (6) (0:0,0) ACTIVITY_HI: (Health) HLTH_PING_UPDATED : Health ping for task0 changed to WARN 40 FATAL 50 -EVENT: (6) (0:0,0) ACTIVITY_HI: (Health) HLTH_PING_UPDATED : Health ping for task1 changed to WARN 41 FATAL 51 -EVENT: (6) (0:0,0) ACTIVITY_HI: (Health) HLTH_PING_UPDATED : Health ping for task2 changed to WARN 42 FATAL 52 -EVENT: (6) (0:0,0) ACTIVITY_HI: (Health) HLTH_PING_UPDATED : Health ping for task3 changed to WARN 43 FATAL 53 -EVENT: (6) (0:0,0) ACTIVITY_HI: (Health) HLTH_PING_UPDATED : Health ping for task4 changed to WARN 44 FATAL 54 -EVENT: (6) (0:0,0) ACTIVITY_HI: (Health) HLTH_PING_UPDATED : Health ping for task5 changed to WARN 45 FATAL 55 -EVENT: (6) (0:0,0) ACTIVITY_HI: (Health) HLTH_PING_UPDATED : Health ping for task6 changed to WARN 46 FATAL 56 -EVENT: (6) (0:0,0) ACTIVITY_HI: (Health) HLTH_PING_UPDATED : Health ping for task7 changed to WARN 47 FATAL 57 -EVENT: (6) (0:0,0) ACTIVITY_HI: (Health) HLTH_PING_UPDATED : Health ping for task8 changed to WARN 48 FATAL 58 -EVENT: (6) (0:0,0) ACTIVITY_HI: (Health) HLTH_PING_UPDATED : Health ping for task9 changed to WARN 49 FATAL 59 -[ OK ] Test.UpdatePingTimeout (1 ms) -[ RUN ] Test.WatchdogCheck - -*************************************** -TESTCASE 900.1.7: Watchdog check -*************************************** - -*************************************** -(RQ) ISF-HTH-007 -*************************************** - -*************************************** -The Svc::Health component shall stroke a watchdog port while all ping replies are within their limit and health checks pass -*************************************** -[ OK ] Test.WatchdogCheck (0 ms) -[ RUN ] Test.NominalCmd - -*************************************** -TESTCASE 900.1.8: Nominal Command -*************************************** - -*************************************** -Process command during quiescent (no telemetry readout) period. -*************************************** -EVENT: (3) (0:0,0) ACTIVITY_HI: (Health) HLTH_CHECK_ENABLE : Health checking set to 0 -EVENT: (3) (0:0,0) ACTIVITY_HI: (Health) HLTH_CHECK_ENABLE : Health checking set to 1 -EVENT: (4) (0:0,0) ACTIVITY_HI: (Health) HLTH_CHECK_PING : Health checking set to 0 for task0 -EVENT: (6) (0:0,0) ACTIVITY_HI: (Health) HLTH_PING_UPDATED : Health ping for task0 changed to WARN 9 FATAL 99 -[ OK ] Test.NominalCmd (0 ms) -[ RUN ] Test.Nominal2CmdsDuringTlm - -*************************************** -TESTCASE 900.1.9: Nominal 2 commands called during telemetry readouts. -*************************************** - -*************************************** -Process commands during busy (telemetry readout) period. -*************************************** -EVENT: (3) (0:0,0) ACTIVITY_HI: (Health) HLTH_CHECK_ENABLE : Health checking set to 0 -[ OK ] Test.Nominal2CmdsDuringTlm (1 ms) -[ RUN ] Test.Miscellaneous - -*************************************** -TESTCASE 900.1.10: Miscellaneous remaining tests. -*************************************** - -*************************************** -Case 1: Ping port anomalies. -*************************************** -EVENT: (2) (0:0,0) FATAL: (Health) HLTH_PING_WRONG_KEY : Ping entry task0 responded with wrong key 0x00000032 -EVENT: (2) (0:0,0) FATAL: (Health) HLTH_PING_WRONG_KEY : Ping entry task1 responded with wrong key 0x00000032 -EVENT: (2) (0:0,0) FATAL: (Health) HLTH_PING_WRONG_KEY : Ping entry task2 responded with wrong key 0x00000032 -EVENT: (2) (0:0,0) FATAL: (Health) HLTH_PING_WRONG_KEY : Ping entry task3 responded with wrong key 0x00000032 -EVENT: (2) (0:0,0) FATAL: (Health) HLTH_PING_WRONG_KEY : Ping entry task4 responded with wrong key 0x00000032 -EVENT: (2) (0:0,0) FATAL: (Health) HLTH_PING_WRONG_KEY : Ping entry task5 responded with wrong key 0x00000032 -EVENT: (2) (0:0,0) FATAL: (Health) HLTH_PING_WRONG_KEY : Ping entry task6 responded with wrong key 0x00000032 -EVENT: (2) (0:0,0) FATAL: (Health) HLTH_PING_WRONG_KEY : Ping entry task7 responded with wrong key 0x00000032 -EVENT: (2) (0:0,0) FATAL: (Health) HLTH_PING_WRONG_KEY : Ping entry task8 responded with wrong key 0x00000032 -EVENT: (2) (0:0,0) FATAL: (Health) HLTH_PING_WRONG_KEY : Ping entry task9 responded with wrong key 0x00000032 - -*************************************** -Case 2: Command input anomalies. -*************************************** -EVENT: (5) (0:0,0) WARNING_LO: (Health) HLTH_CHECK_LOOKUP_ERROR : Couldn't find entry notask -EVENT: (7) (0:0,0) WARNING_HI: (Health) HLTH_PING_INVALID_VALUES : Health ping for task0 invalid values: WARN 10 FATAL 9 -EVENT: (5) (0:0,0) WARNING_LO: (Health) HLTH_CHECK_LOOKUP_ERROR : Couldn't find entry sometask - -*************************************** -Case 3: All ping ports except one respond to ping requests. -*************************************** -EVENT: (0) (0:0,0) WARNING_HI: (Health) HLTH_PING_WARN : Ping entry task9 late warning -[ OK ] Test.Miscellaneous (2 ms) -[----------] 10 tests from Test (7 ms total) - -[----------] Global test environment tear-down -[==========] 10 tests from 1 test case ran. (7 ms total) -[ PASSED ] 10 tests. diff --git a/Svc/PolyDb/docs/sdd.md b/Svc/PolyDb/docs/sdd.md index a94df0229a..1ed26f0e3f 100644 --- a/Svc/PolyDb/docs/sdd.md +++ b/Svc/PolyDb/docs/sdd.md @@ -71,13 +71,7 @@ Unit Test Checklist | [Link](Checklist_Unit_Test.xlsx) ## 5. Unit Testing -[Unit Test Output](../test/ut/output/test.txt) - -[Coverage Summary](../test/ut/output/SvcPolyDb_gcov.txt) - -[PolyDbImpl.cpp Coverage](../test/ut/output/PolyDbImpl.cpp.gcov) - -[PolyDbComponentAc.cpp Coverage](../test/ut/output/PolyDbComponentAc.cpp.gcov) +To see unit test coverage run fprime-util check --coverage ## 6. Change Log diff --git a/Svc/PolyDb/test/ut/output/PolyDbComponentAc.cpp.gcov b/Svc/PolyDb/test/ut/output/PolyDbComponentAc.cpp.gcov deleted file mode 100644 index 9c36b24196..0000000000 --- a/Svc/PolyDb/test/ut/output/PolyDbComponentAc.cpp.gcov +++ /dev/null @@ -1,141 +0,0 @@ - -: 0:Source:/home/tcanham/source/isf/Svc/PolyDb/PolyDbComponentAc.cpp - -: 0:Programs:6 - -: 1:#include - -: 2:#include - -: 3:#include - -: 4:#include - -: 5: - -: 6:#if FW_ENABLE_TEXT_LOGGING - -: 7:#include - -: 8:#endif - -: 9:// Namespace code - -: 10:namespace Svc { - -: 11: - -: 12:// public methods - -: 13: - 3: 14: Svc::InputPolyPort *PolyDbComponentBase::get_getValue_InputPort(NATIVE_INT_TYPE portNum) { - 3: 15: FW_ASSERT(portNum < this->getNum_getValue_InputPorts()); - 3: 16: return &this->m_getValue_InputPort[portNum]; - -: 17: } - -: 18: - 3: 19: Svc::InputPolyPort *PolyDbComponentBase::get_setValue_InputPort(NATIVE_INT_TYPE portNum) { - 3: 20: FW_ASSERT(portNum < this->getNum_setValue_InputPorts()); - 3: 21: return &this->m_setValue_InputPort[portNum]; - -: 22: } - -: 23:#if FW_PORT_SERIALIZATION - -: 24:#endif - -: 25: - -: 26: - -: 27: - -: 28:// protected methods - -: 29:#if FW_OBJECT_NAMES == 1 - 3: 30: PolyDbComponentBase::PolyDbComponentBase(const char* compName) : Fw::PassiveComponentBase(compName) { - -: 31:#else - -: 32: PolyDbComponentBase::PolyDbComponentBase() : Fw::PassiveComponentBase() { - -: 33:#endif - 3: 34:} - -: 35: - -: 36: - 3: 37: void PolyDbComponentBase::init(NATIVE_INT_TYPE instance) { - -: 38: - -: 39: - -: 40: // initialize base class - 3: 41: Fw::PassiveComponentBase::init(instance); - -: 42: // Input ports attached to component here with external component interfaces - 6: 43: for (NATIVE_INT_TYPE port = 0; port < this->getNum_getValue_InputPorts(); port++) { - 3: 44: this->m_getValue_InputPort[port].init(); - -: 45: - 3: 46: this->m_getValue_InputPort[port].addCallComp(this, m_p_getValue_in); - -: 47: - 3: 48: this->m_getValue_InputPort[port].setPortNum(port); - -: 49:#if FW_OBJECT_NAMES == 1 - -: 50: char portName[80]; - 3: 51: (void)snprintf(portName, sizeof(portName), "%s_getValue_InputPort[%d]", this->m_objName, port); - 3: 52: this->m_getValue_InputPort[port].setObjName(portName); - -: 53:#endif - -: 54: } - 6: 55: for (NATIVE_INT_TYPE port = 0; port < this->getNum_setValue_InputPorts(); port++) { - 3: 56: this->m_setValue_InputPort[port].init(); - -: 57: - 3: 58: this->m_setValue_InputPort[port].addCallComp(this, m_p_setValue_in); - -: 59: - 3: 60: this->m_setValue_InputPort[port].setPortNum(port); - -: 61:#if FW_OBJECT_NAMES == 1 - -: 62: char portName[80]; - 3: 63: (void)snprintf(portName, sizeof(portName), "%s_setValue_InputPort[%d]", this->m_objName, port); - 3: 64: this->m_setValue_InputPort[port].setObjName(portName); - -: 65:#endif - -: 66: } - -: 67: - -: 68: // Set output ports - -: 69: - -: 70: - 3: 71: } - -: 72: - 3: 73: PolyDbComponentBase::~PolyDbComponentBase() { - 3: 74: } - -: 75: - -: 76: // Up-calls, calls for output ports - 134: 77: NATIVE_INT_TYPE PolyDbComponentBase::getNum_getValue_InputPorts(void) { - 134: 78: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS(this->m_getValue_InputPort); - -: 79: } - 134: 80: NATIVE_INT_TYPE PolyDbComponentBase::getNum_setValue_InputPorts(void) { - 134: 81: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS(this->m_setValue_InputPort); - -: 82: } - -: 83: - -: 84: - -: 85: // lock mutex for guarded ports - 250: 86: void PolyDbComponentBase::lock(void) { - 250: 87: this->m_guardedPortMutex.lock(); - 250: 88: } - -: 89: - -: 90: // unlock mutex for guarded ports - 250: 91: void PolyDbComponentBase::unLock(void) { - 250: 92: this->m_guardedPortMutex.unLock(); - 250: 93: } - -: 94:// private methods - -: 95: - -: 96: // call for incoming port getValue - 125: 97: void PolyDbComponentBase::m_p_getValue_in(Fw::PassiveComponentBase* callComp, NATIVE_INT_TYPE portNum, U32 entry, MeasurementStatus &status, Fw::Time &time, Fw::PolyType &val) { - 125: 98: FW_ASSERT(callComp); - 125: 99: PolyDbComponentBase* compPtr = (PolyDbComponentBase*)callComp; - 125: 100: compPtr->getValue_handlerBase(portNum, entry, status, time, val); - 125: 101: } - -: 102: - 125: 103: void PolyDbComponentBase::getValue_handlerBase(NATIVE_INT_TYPE portNum, U32 entry, MeasurementStatus &status, Fw::Time &time, Fw::PolyType &val) { - -: 104: - -: 105: // make sure port number is valid - 125: 106: FW_ASSERT(portNum < this->getNum_getValue_InputPorts()); - -: 107: - -: 108: // Lock guard mutex before calling - 125: 109: this->lock(); - -: 110: // Down call to pure virtual handler method implemented in Impl class - 125: 111: this->getValue_handler(portNum, entry, status, time, val); - -: 112: - -: 113: // Unlock guard mutex - 125: 114: this->unLock(); - 125: 115: } - -: 116: - -: 117: // call for incoming port setValue - 125: 118: void PolyDbComponentBase::m_p_setValue_in(Fw::PassiveComponentBase* callComp, NATIVE_INT_TYPE portNum, U32 entry, MeasurementStatus &status, Fw::Time &time, Fw::PolyType &val) { - 125: 119: FW_ASSERT(callComp); - 125: 120: PolyDbComponentBase* compPtr = (PolyDbComponentBase*)callComp; - 125: 121: compPtr->setValue_handlerBase(portNum, entry, status, time, val); - 125: 122: } - -: 123: - 125: 124: void PolyDbComponentBase::setValue_handlerBase(NATIVE_INT_TYPE portNum, U32 entry, MeasurementStatus &status, Fw::Time &time, Fw::PolyType &val) { - -: 125: - -: 126: // make sure port number is valid - 125: 127: FW_ASSERT(portNum < this->getNum_setValue_InputPorts()); - -: 128: - -: 129: // Lock guard mutex before calling - 125: 130: this->lock(); - -: 131: // Down call to pure virtual handler method implemented in Impl class - 125: 132: this->setValue_handler(portNum, entry, status, time, val); - -: 133: - -: 134: // Unlock guard mutex - 125: 135: this->unLock(); - 125: 136: } - -: 137: - -: 138:} - -: 139: diff --git a/Svc/PolyDb/test/ut/output/PolyDbImpl.hpp.gcov b/Svc/PolyDb/test/ut/output/PolyDbImpl.hpp.gcov deleted file mode 100644 index a3303f7af0..0000000000 --- a/Svc/PolyDb/test/ut/output/PolyDbImpl.hpp.gcov +++ /dev/null @@ -1,42 +0,0 @@ - -: 0:Source:/home/tcanham/source/isf/Svc/PolyDb/PolyDbImpl.hpp - -: 0:Programs:6 - -: 1:/* - -: 2: * PolyDbImpl.hpp - -: 3: * - -: 4: * Created on: February 19, 2015 - -: 5: * Author: Timothy Canham - -: 6: */ - -: 7: - -: 8:#ifndef POLYDBIMPL_HPP_ - -: 9:#define POLYDBIMPL_HPP_ - -: 10: - -: 11:#include - -: 12:#include - -: 13:#include - -: 14: - -: 15:namespace Svc { - -: 16: class PolyDbImpl : public PolyDbComponentBase { - -: 17: public: - -: 18: - -: 19:#if FW_OBJECT_NAMES == 1 - -: 20: PolyDbImpl(const char* name); - -: 21:#else - -: 22: PolyDbImpl(); - -: 23:#endif - -: 24: void init(void); - -: 25: virtual ~PolyDbImpl(); - -: 26: protected: - -: 27: private: - -: 28: void getValue_handler(NATIVE_INT_TYPE portNum, U32 entry, MeasurementStatus &status, Fw::Time &time, Fw::PolyType &val); - -: 29: void setValue_handler(NATIVE_INT_TYPE portNum, U32 entry, MeasurementStatus &status, Fw::Time &time, Fw::PolyType &val); - -: 30: - 150: 31: struct t_dbStruct { - -: 32: MeasurementStatus status; - -: 33: Fw::PolyType val; - -: 34: Fw::Time time; - -: 35: } m_db[POLYDB_NUM_DB_ENTRIES]; - -: 36: - -: 37: }; - -: 38:} - -: 39: - -: 40:#endif /* POLYDBIMPL_HPP_ */ diff --git a/Svc/PolyDb/test/ut/output/SvcPolyDb_gcov.txt b/Svc/PolyDb/test/ut/output/SvcPolyDb_gcov.txt deleted file mode 100644 index 3693c3472c..0000000000 --- a/Svc/PolyDb/test/ut/output/SvcPolyDb_gcov.txt +++ /dev/null @@ -1,13 +0,0 @@ -File '/home/tcanham/source/isf/Svc/PolyDb/PolyDbImpl.cpp' -Lines executed:100.00% of 21 -Creating 'PolyDbImpl.cpp.gcov' - -File '/home/tcanham/source/isf/Svc/PolyDb/PolyDbImpl.hpp' -Lines executed:100.00% of 1 -Creating 'PolyDbImpl.hpp.gcov' - -File '/home/tcanham/source/isf/Svc/PolyDb/PolyDbComponentAc.cpp' -Lines executed:100.00% of 57 -Creating 'PolyDbComponentAc.cpp.gcov' - -Lines executed:100.00% of 79 diff --git a/Svc/PolyDb/test/ut/output/test.txt b/Svc/PolyDb/test/ut/output/test.txt deleted file mode 100644 index 1dac5c9ff7..0000000000 --- a/Svc/PolyDb/test/ut/output/test.txt +++ /dev/null @@ -1,49 +0,0 @@ -07:10:40 **** Build of configuration Default for project Svc **** -make ut run_ut -Compiling ut_CYGWIN unit test for SvcPolyDb -make[1]: Entering directory '/home/tcanham/source/isf/Svc/PolyDb' -make[1]: Nothing to be done for 'test_SvcPolyDbtestut'. -make[1]: Leaving directory '/home/tcanham/source/isf/Svc/PolyDb' -Running unit test for SvcPolyDb -make[1]: Entering directory '/home/tcanham/source/isf/Svc/PolyDb' -Running test/ut/runtest_CYGWIN with output dir linux-cygwin-x86-ut-gnu-bin -test/ut/runtest_CYGWIN linux-cygwin-x86-ut-gnu-bin -Running /home/tcanham/source/isf/Svc/PolyDb/test/ut/linux-cygwin-x86-ut-gnu-bin/test_ut -[==========] Running 1 test from 1 test case. -[----------] Global test environment set-up. -[----------] 1 test from CmdDispTestNominal -[ RUN ] CmdDispTestNominal.NominalReadWrite - -*************************************** -TESTCASE 104.1.1: PolyDb Nominal Read/Write Test -*************************************** - -*************************************** -Read and write values to the database while varying the measurement statuses. -*************************************** - -*************************************** -(RQ) ISF-PDB-001 -*************************************** - -*************************************** -(RQ) ISF-PDB-003 -*************************************** - -*************************************** -(RQ) ISF-PDB-002 -*************************************** - -*************************************** -(RQ) ISF-PDB-004 -*************************************** -[ OK ] CmdDispTestNominal.NominalReadWrite (0 ms) -[----------] 1 test from CmdDispTestNominal (1 ms total) - -[----------] Global test environment tear-down -[==========] 1 test from 1 test case ran. (1 ms total) -[ PASSED ] 1 test. -make[1]: Leaving directory '/home/tcanham/source/isf/Svc/PolyDb' - -07:10:42 Build Finished (took 2s.492ms) - diff --git a/Svc/PrmDb/docs/sdd.md b/Svc/PrmDb/docs/sdd.md index 47594ee428..2d88a53c21 100644 --- a/Svc/PrmDb/docs/sdd.md +++ b/Svc/PrmDb/docs/sdd.md @@ -94,13 +94,7 @@ TBD ## 6. Unit Testing -[Unit Test Output](../test/ut/output/test.txt) - -[Coverage Output - `PrmDbImpl.cpp`](../test/ut/output/PrmDbImpl.cpp.gcov) - -[Coverage Output - `PrmDbComponentAc.cpp`](../test/ut/output/PrmDbComponentAc.cpp.gcov) - -[Report](../test/ut/output/SvcPrmDb_gcov.txt) +To see unit test coverage run fprime-util check --coverage ## 7. Change Log diff --git a/Svc/PrmDb/test/ut/output/PrmDbComponentAc.cpp.gcov b/Svc/PrmDb/test/ut/output/PrmDbComponentAc.cpp.gcov deleted file mode 100644 index 2cf09d6aac..0000000000 --- a/Svc/PrmDb/test/ut/output/PrmDbComponentAc.cpp.gcov +++ /dev/null @@ -1,1854 +0,0 @@ - -: 0:Source:/home/tcanham/source/isf/Svc/PrmDb/PrmDbComponentAc.cpp - -: 0:Programs:13 - -: 1:// ====================================================================== - -: 2:// \title PrmDbComponentAc.hpp - -: 3:// \author Auto-generated - -: 4:// \brief cpp file for PrmDb component base class - -: 5:// - -: 6:// \copyright - -: 7:// Copyright 2009-2015, by the California Institute of Technology. - -: 8:// ALL RIGHTS RESERVED. United States Government Sponsorship - -: 9:// acknowledged. - -: 11:// - -: 18:// ====================================================================== - -: 19: - -: 20:#include - -: 21:#include - -: 22:#include - -: 23:#include - -: 24:#if FW_ENABLE_TEXT_LOGGING - -: 25:#include - -: 26:#endif - -: 27: - -: 28: - -: 29:namespace Svc { - -: 30: - -: 31: // ---------------------------------------------------------------------- - -: 32: // Anonymous namespace to prevent name collisions - -: 33: // ---------------------------------------------------------------------- - -: 34: - -: 35: namespace { - -: 36: - -: 37: typedef enum { - -: 38: PRMDB_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT, - -: 39: SETPRM_PRMSET, - -: 40: CMD_PRM_SAVE_FILE - -: 41: } MsgTypeEnum; - -: 42: - -: 43: // Get the max size by doing a union of the input port serialization sizes. - -: 44: - -: 45: typedef union { - -: 46: BYTE port1[Fw::InputPrmSetPort::SERIALIZED_SIZE]; - -: 47: BYTE cmdPort[Fw::InputCmdPort::SERIALIZED_SIZE]; - -: 48: } BuffUnion; - -: 49: - -: 50: // Define a message buffer class large enough to handle all the - -: 51: // asynchronous inputs to the component - -: 52: - 2448: 53: class ComponentIpcSerializableBuffer : - -: 54: public Fw::SerializeBufferBase - -: 55: { - -: 56: - -: 57: public: - -: 58: - -: 59: enum { - -: 60: // Max. message size = size of data + message id + port - -: 61: SERIALIZATION_SIZE = - -: 62: sizeof(BuffUnion) + - -: 63: sizeof(NATIVE_INT_TYPE) + - -: 64: sizeof(NATIVE_INT_TYPE) - -: 65: }; - -: 66: - 4404: 67: NATIVE_UINT_TYPE getBuffCapacity(void) const { - 4404: 68: return sizeof(m_buff); - -: 69: } - -: 70: - 26292: 71: U8* getBuffAddr(void) { - 26292: 72: return m_buff; - -: 73: } - -: 74: - 612: 75: const U8* getBuffAddr(void) const { - 612: 76: return m_buff; - -: 77: } - -: 78: - -: 79: private: - -: 80: // Should be the max of all the input ports serialized sizes... - -: 81: U8 m_buff[SERIALIZATION_SIZE]; - -: 82: - -: 83: }; - -: 84: - -: 85: } - -: 86: - -: 87: // ---------------------------------------------------------------------- - -: 88: // Getters for numbers of input ports - -: 89: // ---------------------------------------------------------------------- - -: 90: - 72: 91: Fw::InputPrmGetPort *PrmDbComponentBase :: - -: 92: get_getPrm_InputPort(NATIVE_INT_TYPE portNum) - -: 93: { - 72: 94: FW_ASSERT(portNum < this->getNum_getPrm_InputPorts()); - 72: 95: return &this->m_getPrm_InputPort[portNum]; - -: 96: } - -: 97: - 72: 98: Fw::InputPrmSetPort *PrmDbComponentBase :: - -: 99: get_setPrm_InputPort(NATIVE_INT_TYPE portNum) - -: 100: { - 72: 101: FW_ASSERT(portNum < this->getNum_setPrm_InputPorts()); - 72: 102: return &this->m_setPrm_InputPort[portNum]; - -: 103: } - -: 104: - 72: 105: Fw::InputCmdPort *PrmDbComponentBase :: - -: 106: get_CmdDisp_InputPort(NATIVE_INT_TYPE portNum) - -: 107: { - 72: 108: FW_ASSERT(portNum < this->getNum_CmdDisp_InputPorts()); - 72: 109: return &this->m_CmdDisp_InputPort[portNum]; - -: 110: } - -: 111: - -: 112: // ---------------------------------------------------------------------- - -: 113: // Typed connectors for output ports - -: 114: // ---------------------------------------------------------------------- - -: 115: - 72: 116: void PrmDbComponentBase :: - -: 117: set_CmdStatus_OutputPort( - -: 118: NATIVE_INT_TYPE portNum, - -: 119: Fw::InputCmdResponsePort* port - -: 120: ) - -: 121: { - 72: 122: FW_ASSERT(portNum < this->getNum_CmdStatus_OutputPorts()); - 72: 123: this->m_CmdStatus_OutputPort[portNum].addCallPort(port); - 72: 124: } - -: 125: - #####: 126: void PrmDbComponentBase :: - -: 127: set_CmdReg_OutputPort( - -: 128: NATIVE_INT_TYPE portNum, - -: 129: Fw::InputCmdRegPort* port - -: 130: ) - -: 131: { - #####: 132: FW_ASSERT(portNum < this->getNum_CmdReg_OutputPorts()); - #####: 133: this->m_CmdReg_OutputPort[portNum].addCallPort(port); - #####: 134: } - -: 135: - 72: 136: void PrmDbComponentBase :: - -: 137: set_Time_OutputPort( - -: 138: NATIVE_INT_TYPE portNum, - -: 139: Fw::InputTimePort* port - -: 140: ) - -: 141: { - 72: 142: FW_ASSERT(portNum < this->getNum_Time_OutputPorts()); - 72: 143: this->m_Time_OutputPort[portNum].addCallPort(port); - 72: 144: } - -: 145: - 72: 146: void PrmDbComponentBase :: - -: 147: set_Log_OutputPort( - -: 148: NATIVE_INT_TYPE portNum, - -: 149: Fw::InputLogPort* port - -: 150: ) - -: 151: { - 72: 152: FW_ASSERT(portNum < this->getNum_Log_OutputPorts()); - 72: 153: this->m_Log_OutputPort[portNum].addCallPort(port); - 72: 154: } - -: 155: - -: 156:#if FW_ENABLE_TEXT_LOGGING == 1 - 72: 157: void PrmDbComponentBase :: - -: 158: set_LogText_OutputPort( - -: 159: NATIVE_INT_TYPE portNum, - -: 160: Fw::InputLogTextPort* port - -: 161: ) - -: 162: { - 72: 163: FW_ASSERT(portNum < this->getNum_LogText_OutputPorts()); - 72: 164: this->m_LogText_OutputPort[portNum].addCallPort(port); - 72: 165: } - -: 166:#endif - -: 167: - -: 168: // ---------------------------------------------------------------------- - -: 169: // Serialization connectors for output ports - -: 170: // ---------------------------------------------------------------------- - -: 171: - -: 172:#if FW_PORT_SERIALIZATION - -: 173: - #####: 174: void PrmDbComponentBase :: - -: 175: set_CmdStatus_OutputPort( - -: 176: NATIVE_INT_TYPE portNum, - -: 177: Fw::InputSerializePort *port - -: 178: ) - -: 179: { - #####: 180: FW_ASSERT(portNum < this->getNum_CmdStatus_OutputPorts()); - #####: 181: return this->m_CmdStatus_OutputPort[portNum].registerSerialPort(port); - -: 182: } - -: 183: - #####: 184: void PrmDbComponentBase :: - -: 185: set_CmdReg_OutputPort( - -: 186: NATIVE_INT_TYPE portNum, - -: 187: Fw::InputSerializePort *port - -: 188: ) - -: 189: { - #####: 190: FW_ASSERT(portNum < this->getNum_CmdReg_OutputPorts()); - #####: 191: return this->m_CmdReg_OutputPort[portNum].registerSerialPort(port); - -: 192: } - -: 193: - #####: 194: void PrmDbComponentBase :: - -: 195: set_Time_OutputPort( - -: 196: NATIVE_INT_TYPE portNum, - -: 197: Fw::InputSerializePort *port - -: 198: ) - -: 199: { - #####: 200: FW_ASSERT(portNum < this->getNum_Time_OutputPorts()); - #####: 201: return this->m_Time_OutputPort[portNum].registerSerialPort(port); - -: 202: } - -: 203: - #####: 204: void PrmDbComponentBase :: - -: 205: set_Log_OutputPort( - -: 206: NATIVE_INT_TYPE portNum, - -: 207: Fw::InputSerializePort *port - -: 208: ) - -: 209: { - #####: 210: FW_ASSERT(portNum < this->getNum_Log_OutputPorts()); - #####: 211: return this->m_Log_OutputPort[portNum].registerSerialPort(port); - -: 212: } - -: 213: - -: 214:#if FW_ENABLE_TEXT_LOGGING == 1 - #####: 215: void PrmDbComponentBase :: - -: 216: set_LogText_OutputPort( - -: 217: NATIVE_INT_TYPE portNum, - -: 218: Fw::InputSerializePort *port - -: 219: ) - -: 220: { - #####: 221: FW_ASSERT(portNum < this->getNum_LogText_OutputPorts()); - #####: 222: return this->m_LogText_OutputPort[portNum].registerSerialPort(port); - -: 223: } - -: 224:#endif - -: 225: - -: 226:#endif - -: 227: - -: 228: // ---------------------------------------------------------------------- - -: 229: // Command registration - -: 230: // ---------------------------------------------------------------------- - -: 231: - #####: 232: void PrmDbComponentBase :: - -: 233: regCommands(void) - -: 234: { - #####: 235: FW_ASSERT(this->m_CmdReg_OutputPort[0].isConnected()); - #####: 236: this->m_CmdReg_OutputPort[0].invoke(OPCODE_PRM_SAVE_FILE); - #####: 237: } - -: 238: - -: 239: // ---------------------------------------------------------------------- - -: 240: // Component construction, initialization, and destruction - -: 241: // ---------------------------------------------------------------------- - -: 242: - 72: 243: PrmDbComponentBase :: - -: 244:#if FW_OBJECT_NAMES == 1 - -: 245: PrmDbComponentBase(const char* compName) : - 72: 246: Fw::ActiveComponentBase(compName) - -: 247:#else - -: 248: PrmDbComponentBase() : - -: 249: Fw::ActiveComponentBase() - -: 250:#endif - -: 251: { - -: 252: - 72: 253: } - -: 254: - 72: 255: void PrmDbComponentBase :: - -: 256: init( - -: 257: NATIVE_INT_TYPE queueDepth, - -: 258: NATIVE_INT_TYPE instance - -: 259: ) - -: 260: { - -: 261: - -: 262: // Initialize base class - 72: 263: Fw::ActiveComponentBase::init(instance); - -: 264: - -: 265: // Connect input port getPrm - 288: 266: for ( - 72: 267: NATIVE_INT_TYPE port = 0; - 144: 268: port < this->getNum_getPrm_InputPorts(); - -: 269: port++ - -: 270: ) { - -: 271: - 72: 272: this->m_getPrm_InputPort[port].init(); - -: 273: this->m_getPrm_InputPort[port].addCallComp( - -: 274: this, - -: 275: m_p_getPrm_in - 72: 276: ); - 72: 277: this->m_getPrm_InputPort[port].setPortNum(port); - -: 278: - -: 279:#if FW_OBJECT_NAMES == 1 - -: 280: char portName[80]; - -: 281: (void) snprintf( - -: 282: portName, - -: 283: sizeof(portName), - -: 284: "%s_getPrm_InputPort[%d]", - -: 285: this->m_objName, - -: 286: port - 72: 287: ); - 72: 288: this->m_getPrm_InputPort[port].setObjName(portName); - -: 289:#endif - -: 290: - -: 291: } - -: 292: - -: 293: // Connect input port setPrm - 288: 294: for ( - 72: 295: NATIVE_INT_TYPE port = 0; - 144: 296: port < this->getNum_setPrm_InputPorts(); - -: 297: port++ - -: 298: ) { - -: 299: - 72: 300: this->m_setPrm_InputPort[port].init(); - -: 301: this->m_setPrm_InputPort[port].addCallComp( - -: 302: this, - -: 303: m_p_setPrm_in - 72: 304: ); - 72: 305: this->m_setPrm_InputPort[port].setPortNum(port); - -: 306: - -: 307:#if FW_OBJECT_NAMES == 1 - -: 308: char portName[80]; - -: 309: (void) snprintf( - -: 310: portName, - -: 311: sizeof(portName), - -: 312: "%s_setPrm_InputPort[%d]", - -: 313: this->m_objName, - -: 314: port - 72: 315: ); - 72: 316: this->m_setPrm_InputPort[port].setObjName(portName); - -: 317:#endif - -: 318: - -: 319: } - -: 320: - -: 321: // Connect input port CmdDisp - 288: 322: for ( - 72: 323: NATIVE_INT_TYPE port = 0; - 144: 324: port < this->getNum_CmdDisp_InputPorts(); - -: 325: port++ - -: 326: ) { - -: 327: - 72: 328: this->m_CmdDisp_InputPort[port].init(); - -: 329: this->m_CmdDisp_InputPort[port].addCallComp( - -: 330: this, - -: 331: m_p_CmdDisp_in - 72: 332: ); - 72: 333: this->m_CmdDisp_InputPort[port].setPortNum(port); - -: 334: - -: 335:#if FW_OBJECT_NAMES == 1 - -: 336: char portName[80]; - -: 337: (void) snprintf( - -: 338: portName, - -: 339: sizeof(portName), - -: 340: "%s_CmdDisp_InputPort[%d]", - -: 341: this->m_objName, - -: 342: port - 72: 343: ); - 72: 344: this->m_CmdDisp_InputPort[port].setObjName(portName); - -: 345:#endif - -: 346: - -: 347: } - -: 348: - -: 349: // Initialize output port CmdStatus - 288: 350: for ( - 72: 351: NATIVE_INT_TYPE port = 0; - 144: 352: port < this->getNum_CmdStatus_OutputPorts(); - -: 353: port++ - -: 354: ) { - 72: 355: this->m_CmdStatus_OutputPort[port].init(); - -: 356: - -: 357:#if FW_OBJECT_NAMES == 1 - -: 358: char portName[80]; - -: 359: (void) snprintf( - -: 360: portName, - -: 361: sizeof(portName), - -: 362: "%s_CmdStatus_OutputPort[%d]", - -: 363: this->m_objName, - -: 364: port - 72: 365: ); - 72: 366: this->m_CmdStatus_OutputPort[port].setObjName(portName); - -: 367:#endif - -: 368: - -: 369: } - -: 370: - -: 371: // Initialize output port CmdReg - 288: 372: for ( - 72: 373: NATIVE_INT_TYPE port = 0; - 144: 374: port < this->getNum_CmdReg_OutputPorts(); - -: 375: port++ - -: 376: ) { - 72: 377: this->m_CmdReg_OutputPort[port].init(); - -: 378: - -: 379:#if FW_OBJECT_NAMES == 1 - -: 380: char portName[80]; - -: 381: (void) snprintf( - -: 382: portName, - -: 383: sizeof(portName), - -: 384: "%s_CmdReg_OutputPort[%d]", - -: 385: this->m_objName, - -: 386: port - 72: 387: ); - 72: 388: this->m_CmdReg_OutputPort[port].setObjName(portName); - -: 389:#endif - -: 390: - -: 391: } - -: 392: - -: 393: // Initialize output port Time - 288: 394: for ( - 72: 395: NATIVE_INT_TYPE port = 0; - 144: 396: port < this->getNum_Time_OutputPorts(); - -: 397: port++ - -: 398: ) { - 72: 399: this->m_Time_OutputPort[port].init(); - -: 400: - -: 401:#if FW_OBJECT_NAMES == 1 - -: 402: char portName[80]; - -: 403: (void) snprintf( - -: 404: portName, - -: 405: sizeof(portName), - -: 406: "%s_Time_OutputPort[%d]", - -: 407: this->m_objName, - -: 408: port - 72: 409: ); - 72: 410: this->m_Time_OutputPort[port].setObjName(portName); - -: 411:#endif - -: 412: - -: 413: } - -: 414: - -: 415: // Initialize output port Log - 288: 416: for ( - 72: 417: NATIVE_INT_TYPE port = 0; - 144: 418: port < this->getNum_Log_OutputPorts(); - -: 419: port++ - -: 420: ) { - 72: 421: this->m_Log_OutputPort[port].init(); - -: 422: - -: 423:#if FW_OBJECT_NAMES == 1 - -: 424: char portName[80]; - -: 425: (void) snprintf( - -: 426: portName, - -: 427: sizeof(portName), - -: 428: "%s_Log_OutputPort[%d]", - -: 429: this->m_objName, - -: 430: port - 72: 431: ); - 72: 432: this->m_Log_OutputPort[port].setObjName(portName); - -: 433:#endif - -: 434: - -: 435: } - -: 436: - -: 437: // Initialize output port LogText - -: 438:#if FW_ENABLE_TEXT_LOGGING == 1 - 288: 439: for ( - 72: 440: NATIVE_INT_TYPE port = 0; - 144: 441: port < this->getNum_LogText_OutputPorts(); - -: 442: port++ - -: 443: ) { - 72: 444: this->m_LogText_OutputPort[port].init(); - -: 445: - -: 446:#if FW_OBJECT_NAMES == 1 - -: 447: char portName[80]; - -: 448: (void) snprintf( - -: 449: portName, - -: 450: sizeof(portName), - -: 451: "%s_LogText_OutputPort[%d]", - -: 452: this->m_objName, - -: 453: port - 72: 454: ); - 72: 455: this->m_LogText_OutputPort[port].setObjName(portName); - -: 456:#endif - -: 457: - -: 458: } - -: 459:#endif - -: 460: - -: 461: Os::Queue::QueueStatus qStat = - -: 462: this->createQueue( - -: 463: queueDepth, - -: 464: ComponentIpcSerializableBuffer::SERIALIZATION_SIZE - 72: 465: ); - 72: 466: FW_ASSERT( - -: 467: Os::Queue::QUEUE_OK == qStat, - -: 468: static_cast(qStat) - 144: 469: ); - -: 470: - 72: 471: } - -: 472: - 72: 473: PrmDbComponentBase:: - 72: 474: ~PrmDbComponentBase() { - -: 475: - 72: 476: } - -: 477: - -: 478: // ---------------------------------------------------------------------- - -: 479: // Invocation functions for output ports - -: 480: // ---------------------------------------------------------------------- - -: 481: - -: 482: // ---------------------------------------------------------------------- - -: 483: // Getters for numbers of ports - -: 484: // ---------------------------------------------------------------------- - -: 485: - 372: 486: NATIVE_INT_TYPE PrmDbComponentBase :: - -: 487: getNum_getPrm_InputPorts(void) - -: 488: { - 372: 489: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 490: this->m_getPrm_InputPort - -: 491: ); - -: 492: } - -: 493: - 708: 494: NATIVE_INT_TYPE PrmDbComponentBase :: - -: 495: getNum_setPrm_InputPorts(void) - -: 496: { - 708: 497: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 498: this->m_setPrm_InputPort - -: 499: ); - -: 500: } - -: 501: - 216: 502: NATIVE_INT_TYPE PrmDbComponentBase :: - -: 503: getNum_CmdDisp_InputPorts(void) - -: 504: { - 216: 505: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 506: this->m_CmdDisp_InputPort - -: 507: ); - -: 508: } - -: 509: - 216: 510: NATIVE_INT_TYPE PrmDbComponentBase :: - -: 511: getNum_CmdStatus_OutputPorts(void) - -: 512: { - 216: 513: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 514: this->m_CmdStatus_OutputPort - -: 515: ); - -: 516: } - -: 517: - 144: 518: NATIVE_INT_TYPE PrmDbComponentBase :: - -: 519: getNum_CmdReg_OutputPorts(void) - -: 520: { - 144: 521: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 522: this->m_CmdReg_OutputPort - -: 523: ); - -: 524: } - -: 525: - 216: 526: NATIVE_INT_TYPE PrmDbComponentBase :: - -: 527: getNum_Time_OutputPorts(void) - -: 528: { - 216: 529: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 530: this->m_Time_OutputPort - -: 531: ); - -: 532: } - -: 533: - 216: 534: NATIVE_INT_TYPE PrmDbComponentBase :: - -: 535: getNum_Log_OutputPorts(void) - -: 536: { - 216: 537: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 538: this->m_Log_OutputPort - -: 539: ); - -: 540: } - -: 541: - -: 542:#if FW_ENABLE_TEXT_LOGGING == 1 - 216: 543: NATIVE_INT_TYPE PrmDbComponentBase :: - -: 544: getNum_LogText_OutputPorts(void) - -: 545: { - 216: 546: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 547: this->m_LogText_OutputPort - -: 548: ); - -: 549: } - -: 550:#endif - -: 551: - -: 552: // ---------------------------------------------------------------------- - -: 553: // Port connection status queries - -: 554: // ---------------------------------------------------------------------- - -: 555: - #####: 556: bool PrmDbComponentBase :: - -: 557: isConnected_CmdStatus_OutputPort(NATIVE_INT_TYPE portNum) - -: 558: { - #####: 559: FW_ASSERT( - -: 560: portNum < this->getNum_CmdStatus_OutputPorts(), - -: 561: portNum - #####: 562: ); - #####: 563: return this->m_CmdStatus_OutputPort[portNum].isConnected(); - -: 564: } - -: 565: - #####: 566: bool PrmDbComponentBase :: - -: 567: isConnected_CmdReg_OutputPort(NATIVE_INT_TYPE portNum) - -: 568: { - #####: 569: FW_ASSERT( - -: 570: portNum < this->getNum_CmdReg_OutputPorts(), - -: 571: portNum - #####: 572: ); - #####: 573: return this->m_CmdReg_OutputPort[portNum].isConnected(); - -: 574: } - -: 575: - #####: 576: bool PrmDbComponentBase :: - -: 577: isConnected_Time_OutputPort(NATIVE_INT_TYPE portNum) - -: 578: { - #####: 579: FW_ASSERT( - -: 580: portNum < this->getNum_Time_OutputPorts(), - -: 581: portNum - #####: 582: ); - #####: 583: return this->m_Time_OutputPort[portNum].isConnected(); - -: 584: } - -: 585: - #####: 586: bool PrmDbComponentBase :: - -: 587: isConnected_Log_OutputPort(NATIVE_INT_TYPE portNum) - -: 588: { - #####: 589: FW_ASSERT( - -: 590: portNum < this->getNum_Log_OutputPorts(), - -: 591: portNum - #####: 592: ); - #####: 593: return this->m_Log_OutputPort[portNum].isConnected(); - -: 594: } - -: 595: - -: 596:#if FW_ENABLE_TEXT_LOGGING == 1 - #####: 597: bool PrmDbComponentBase :: - -: 598: isConnected_LogText_OutputPort(NATIVE_INT_TYPE portNum) - -: 599: { - #####: 600: FW_ASSERT( - -: 601: portNum < this->getNum_LogText_OutputPorts(), - -: 602: portNum - #####: 603: ); - #####: 604: return this->m_LogText_OutputPort[portNum].isConnected(); - -: 605: } - -: 606:#endif - -: 607: - -: 608: // ---------------------------------------------------------------------- - -: 609: // Calls for messages received on typed input ports - -: 610: // ---------------------------------------------------------------------- - -: 611: - 120: 612: void PrmDbComponentBase :: - -: 613: m_p_CmdDisp_in( - -: 614: Fw::PassiveComponentBase* callComp, - -: 615: NATIVE_INT_TYPE portNum, - -: 616: FwOpcodeType opCode, - -: 617: U32 cmdSeq, - -: 618: Fw::CmdArgBuffer &args - -: 619: ) - -: 620: { - -: 621: - -: 622: // Select base class function based on opcode - 120: 623: FW_ASSERT(callComp); - -: 624: PrmDbComponentBase* compPtr = - 120: 625: (PrmDbComponentBase*) callComp; - -: 626: - 120: 627: switch (opCode) { - -: 628: - -: 629: case OPCODE_PRM_SAVE_FILE: - -: 630: compPtr->PRM_SAVE_FILE_cmdHandlerBase( - -: 631: opCode, - -: 632: cmdSeq, - -: 633: args - 120: 634: ); - 120: 635: break; - -: 636: - -: 637: default: { - -: 638: compPtr->cmdResponse_out( - -: 639: opCode,cmdSeq, - -: 640: Fw::COMMAND_INVALID_OPCODE - #####: 641: ); - #####: 642: break; - -: 643: } - -: 644: - -: 645: } - -: 646: - 120: 647: } - -: 648: - 120: 649: void PrmDbComponentBase :: - -: 650: cmdResponse_out( - -: 651: FwOpcodeType opCode, - -: 652: U32 cmdSeq, - -: 653: Fw::CommandResponse response - -: 654: ) - -: 655: { - 120: 656: FW_ASSERT(this->m_CmdStatus_OutputPort[0].isConnected()); - 120: 657: this->m_CmdStatus_OutputPort[0].invoke(opCode,cmdSeq,response); - 120: 658: } - -: 659: - -: 660: // ---------------------------------------------------------------------- - -: 661: // Base class command functions - -: 662: // ---------------------------------------------------------------------- - -: 663: - 120: 664: void PrmDbComponentBase :: - -: 665: PRM_SAVE_FILE_cmdHandlerBase( - -: 666: FwOpcodeType opCode, - -: 667: U32 cmdSeq, - -: 668: Fw::CmdArgBuffer &args - -: 669: ) - -: 670: { - -: 671: - -: 672: // Call pre-message hook - 120: 673: this->PRM_SAVE_FILE_preMsgHook(opCode,cmdSeq); - -: 674: - -: 675: // Defer deserializing arguments to the message dispatcher - -: 676: // to avoid deserializing and reserializing just for IPC - 120: 677: ComponentIpcSerializableBuffer msg; - -: 678: Fw::SerializeStatus _status; - -: 679: - -: 680: // Serialize for IPC - 120: 681: _status = msg.serialize((NATIVE_INT_TYPE)CMD_PRM_SAVE_FILE); - 120: 682: FW_ASSERT ( - -: 683: _status == Fw::FW_SERIALIZE_OK, - -: 684: static_cast(_status) - 240: 685: ); - -: 686: - -: 687: // Fake port number to make message dequeue work - 120: 688: NATIVE_INT_TYPE port = 0; - 120: 689: _status = msg.serialize(port); - 120: 690: FW_ASSERT ( - -: 691: _status == Fw::FW_SERIALIZE_OK, - -: 692: static_cast(_status) - 240: 693: ); - -: 694: - 120: 695: _status = msg.serialize(opCode); - 120: 696: FW_ASSERT ( - -: 697: _status == Fw::FW_SERIALIZE_OK, - -: 698: static_cast(_status) - 240: 699: ); - -: 700: - 120: 701: _status = msg.serialize(cmdSeq); - 120: 702: FW_ASSERT ( - -: 703: _status == Fw::FW_SERIALIZE_OK, - -: 704: static_cast(_status) - 240: 705: ); - -: 706: - 120: 707: _status = msg.serialize(args); - 120: 708: FW_ASSERT ( - -: 709: _status == Fw::FW_SERIALIZE_OK, - -: 710: static_cast(_status) - 240: 711: ); - -: 712: - 120: 713: Os::Queue::QueueStatus qStatus = this->m_queue.send(msg,0); - -: 714: - 120: 715: FW_ASSERT( - -: 716: qStatus == Os::Queue::QUEUE_OK, - -: 717: static_cast(qStatus) - 360: 718: ); - -: 719: - 120: 720: } - -: 721: - 120: 722: void PrmDbComponentBase:: - -: 723: PRM_SAVE_FILE_preMsgHook( - -: 724: FwOpcodeType opCode, - -: 725: U32 cmdSeq - -: 726: ) - -: 727: { - -: 728: // Defaults to no-op; can be overridden - 120: 729: } - -: 730: - -: 731: // ---------------------------------------------------------------------- - -: 732: // Time - -: 733: // ---------------------------------------------------------------------- - -: 734: - #####: 735: Fw::Time PrmDbComponentBase :: - -: 736: getTime(void) - -: 737: { - #####: 738: if (this->m_Time_OutputPort[0].isConnected()) { - #####: 739: return this->m_Time_OutputPort[0].invoke(); - -: 740: } else { - #####: 741: return Fw::Time(TB_NONE,0,0); - -: 742: } - -: 743: } - -: 744: - -: 745: // ---------------------------------------------------------------------- - -: 746: // Event handling functions - -: 747: // ---------------------------------------------------------------------- - -: 748: - 12: 749: void PrmDbComponentBase :: - -: 750: log_WARNING_LO_PrmIdNotFound( - -: 751: U32 Id - -: 752: ) - -: 753: { - -: 754: - -: 755: // Get the time - 12: 756: Fw::Time _logTime; - 12: 757: if (this->m_Time_OutputPort[0].isConnected()) { - 12: 758: _logTime = this->m_Time_OutputPort[0].invoke(); - -: 759: } - -: 760: - 12: 761: FwEventIdType _id = static_cast(0); - -: 762: - 12: 763: _id = EVENTID_PRMIDNOTFOUND; - -: 764: - -: 765: // Emit the event on the log port - 12: 766: if (this->m_Log_OutputPort[0].isConnected()) { - -: 767: - 12: 768: Fw::LogBuffer _logBuff; - -: 769: Fw::SerializeStatus _status; - -: 770: - -: 771:#if FW_AMPCS_COMPATIBLE - -: 772: // Serialize the number of arguments - -: 773: _status = _logBuff.serialize(static_cast(1)); - -: 774: FW_ASSERT( - -: 775: _status == Fw::FW_SERIALIZE_OK, - -: 776: static_cast(_status) - -: 777: ); - -: 778:#endif - -: 779: - -: 780:#if FW_AMPCS_COMPATIBLE - -: 781: // Serialize the argument size - -: 782: _status = _logBuff.serialize( - -: 783: static_cast(sizeof(Id)) - -: 784: ); - -: 785: FW_ASSERT( - -: 786: _status == Fw::FW_SERIALIZE_OK, - -: 787: static_cast(_status) - -: 788: ); - -: 789:#endif - -: 790: - 12: 791: _status = _logBuff.serialize(Id); - 12: 792: FW_ASSERT( - -: 793: _status == Fw::FW_SERIALIZE_OK, - -: 794: static_cast(_status) - 24: 795: ); - -: 796: - -: 797: - -: 798: this->m_Log_OutputPort[0].invoke( - -: 799: _id, - -: 800: _logTime,Fw::LOG_WARNING_LO, - -: 801: _logBuff - 12: 802: ); - -: 803: - -: 804: } - -: 805: - -: 806: // Emit the event on the text log port - -: 807:#if FW_ENABLE_TEXT_LOGGING - 12: 808: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 809: - -: 810:#if FW_OBJECT_NAMES == 1 - -: 811: const char* _formatString = - 12: 812: "(%s) %s: Parameter ID 0x%08X not found"; - -: 813:#else - -: 814: const char* _formatString = - -: 815: "%s: Parameter ID 0x%08X not found"; - -: 816:#endif - -: 817: - -: 818: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 819: - -: 820: (void) snprintf( - -: 821: _textBuffer, - -: 822: FW_LOG_TEXT_BUFFER_SIZE, - -: 823: _formatString, - -: 824:#if FW_OBJECT_NAMES == 1 - -: 825: this->m_objName, - -: 826:#endif - -: 827: "PrmIdNotFound " - -: 828: , Id - 12: 829: ); - -: 830: - -: 831: // Null terminate - 12: 832: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 12: 833: Fw::TextLogString _logString = _textBuffer; - -: 834: this->m_LogText_OutputPort[0].invoke( - -: 835: _id, - -: 836: _logTime,Fw::TEXT_LOG_WARNING_LO, - -: 837: _logString - 12: 838: ); - -: 839: - 12: 840: } - -: 841:#endif - -: 842: - 12: 843: } - -: 844: - 60: 845: void PrmDbComponentBase :: - -: 846: log_ACTIVITY_HI_PrmIdUpdated( - -: 847: U32 Id - -: 848: ) - -: 849: { - -: 850: - -: 851: // Get the time - 60: 852: Fw::Time _logTime; - 60: 853: if (this->m_Time_OutputPort[0].isConnected()) { - 60: 854: _logTime = this->m_Time_OutputPort[0].invoke(); - -: 855: } - -: 856: - 60: 857: FwEventIdType _id = static_cast(0); - -: 858: - 60: 859: _id = EVENTID_PRMIDUPDATED; - -: 860: - -: 861: // Emit the event on the log port - 60: 862: if (this->m_Log_OutputPort[0].isConnected()) { - -: 863: - 60: 864: Fw::LogBuffer _logBuff; - -: 865: Fw::SerializeStatus _status; - -: 866: - -: 867:#if FW_AMPCS_COMPATIBLE - -: 868: // Serialize the number of arguments - -: 869: _status = _logBuff.serialize(static_cast(1)); - -: 870: FW_ASSERT( - -: 871: _status == Fw::FW_SERIALIZE_OK, - -: 872: static_cast(_status) - -: 873: ); - -: 874:#endif - -: 875: - -: 876:#if FW_AMPCS_COMPATIBLE - -: 877: // Serialize the argument size - -: 878: _status = _logBuff.serialize( - -: 879: static_cast(sizeof(Id)) - -: 880: ); - -: 881: FW_ASSERT( - -: 882: _status == Fw::FW_SERIALIZE_OK, - -: 883: static_cast(_status) - -: 884: ); - -: 885:#endif - -: 886: - 60: 887: _status = _logBuff.serialize(Id); - 60: 888: FW_ASSERT( - -: 889: _status == Fw::FW_SERIALIZE_OK, - -: 890: static_cast(_status) - 120: 891: ); - -: 892: - -: 893: - -: 894: this->m_Log_OutputPort[0].invoke( - -: 895: _id, - -: 896: _logTime,Fw::LOG_ACTIVITY_HI, - -: 897: _logBuff - 60: 898: ); - -: 899: - -: 900: } - -: 901: - -: 902: // Emit the event on the text log port - -: 903:#if FW_ENABLE_TEXT_LOGGING - 60: 904: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 905: - -: 906:#if FW_OBJECT_NAMES == 1 - -: 907: const char* _formatString = - 60: 908: "(%s) %s: Parameter ID 0x%08X updated"; - -: 909:#else - -: 910: const char* _formatString = - -: 911: "%s: Parameter ID 0x%08X updated"; - -: 912:#endif - -: 913: - -: 914: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 915: - -: 916: (void) snprintf( - -: 917: _textBuffer, - -: 918: FW_LOG_TEXT_BUFFER_SIZE, - -: 919: _formatString, - -: 920:#if FW_OBJECT_NAMES == 1 - -: 921: this->m_objName, - -: 922:#endif - -: 923: "PrmIdUpdated " - -: 924: , Id - 60: 925: ); - -: 926: - -: 927: // Null terminate - 60: 928: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 60: 929: Fw::TextLogString _logString = _textBuffer; - -: 930: this->m_LogText_OutputPort[0].invoke( - -: 931: _id, - -: 932: _logTime,Fw::TEXT_LOG_ACTIVITY_HI, - -: 933: _logString - 60: 934: ); - -: 935: - 60: 936: } - -: 937:#endif - -: 938: - 60: 939: } - -: 940: - 12: 941: void PrmDbComponentBase :: - -: 942: log_FATAL_PrmDbFull( - -: 943: U32 Id - -: 944: ) - -: 945: { - -: 946: - -: 947: // Get the time - 12: 948: Fw::Time _logTime; - 12: 949: if (this->m_Time_OutputPort[0].isConnected()) { - 12: 950: _logTime = this->m_Time_OutputPort[0].invoke(); - -: 951: } - -: 952: - 12: 953: FwEventIdType _id = static_cast(0); - -: 954: - 12: 955: _id = EVENTID_PRMDBFULL; - -: 956: - -: 957: // Emit the event on the log port - 12: 958: if (this->m_Log_OutputPort[0].isConnected()) { - -: 959: - 12: 960: Fw::LogBuffer _logBuff; - -: 961: Fw::SerializeStatus _status; - -: 962: - -: 963:#if FW_AMPCS_COMPATIBLE - -: 964: // Serialize the number of arguments - -: 965: _status = _logBuff.serialize(static_cast(1)); - -: 966: FW_ASSERT( - -: 967: _status == Fw::FW_SERIALIZE_OK, - -: 968: static_cast(_status) - -: 969: ); - -: 970:#endif - -: 971: - -: 972:#if FW_AMPCS_COMPATIBLE - -: 973: // Serialize the argument size - -: 974: _status = _logBuff.serialize( - -: 975: static_cast(sizeof(Id)) - -: 976: ); - -: 977: FW_ASSERT( - -: 978: _status == Fw::FW_SERIALIZE_OK, - -: 979: static_cast(_status) - -: 980: ); - -: 981:#endif - -: 982: - 12: 983: _status = _logBuff.serialize(Id); - 12: 984: FW_ASSERT( - -: 985: _status == Fw::FW_SERIALIZE_OK, - -: 986: static_cast(_status) - 24: 987: ); - -: 988: - -: 989: - -: 990: this->m_Log_OutputPort[0].invoke( - -: 991: _id, - -: 992: _logTime,Fw::LOG_FATAL, - -: 993: _logBuff - 12: 994: ); - -: 995: - -: 996: } - -: 997: - -: 998: // Emit the event on the text log port - -: 999:#if FW_ENABLE_TEXT_LOGGING - 12: 1000: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 1001: - -: 1002:#if FW_OBJECT_NAMES == 1 - -: 1003: const char* _formatString = - 12: 1004: "(%s) %s: Parameter DB full when adding ID 0x%08X"; - -: 1005:#else - -: 1006: const char* _formatString = - -: 1007: "%s: Parameter DB full when adding ID 0x%08X"; - -: 1008:#endif - -: 1009: - -: 1010: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 1011: - -: 1012: (void) snprintf( - -: 1013: _textBuffer, - -: 1014: FW_LOG_TEXT_BUFFER_SIZE, - -: 1015: _formatString, - -: 1016:#if FW_OBJECT_NAMES == 1 - -: 1017: this->m_objName, - -: 1018:#endif - -: 1019: "PrmDbFull " - -: 1020: , Id - 12: 1021: ); - -: 1022: - -: 1023: // Null terminate - 12: 1024: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 12: 1025: Fw::TextLogString _logString = _textBuffer; - -: 1026: this->m_LogText_OutputPort[0].invoke( - -: 1027: _id, - -: 1028: _logTime,Fw::TEXT_LOG_FATAL, - -: 1029: _logString - 12: 1030: ); - -: 1031: - 12: 1032: } - -: 1033:#endif - -: 1034: - 12: 1035: } - -: 1036: - 420: 1037: void PrmDbComponentBase :: - -: 1038: log_ACTIVITY_HI_PrmIdAdded( - -: 1039: U32 Id - -: 1040: ) - -: 1041: { - -: 1042: - -: 1043: // Get the time - 420: 1044: Fw::Time _logTime; - 420: 1045: if (this->m_Time_OutputPort[0].isConnected()) { - 420: 1046: _logTime = this->m_Time_OutputPort[0].invoke(); - -: 1047: } - -: 1048: - 420: 1049: FwEventIdType _id = static_cast(0); - -: 1050: - 420: 1051: _id = EVENTID_PRMIDADDED; - -: 1052: - -: 1053: // Emit the event on the log port - 420: 1054: if (this->m_Log_OutputPort[0].isConnected()) { - -: 1055: - 420: 1056: Fw::LogBuffer _logBuff; - -: 1057: Fw::SerializeStatus _status; - -: 1058: - -: 1059:#if FW_AMPCS_COMPATIBLE - -: 1060: // Serialize the number of arguments - -: 1061: _status = _logBuff.serialize(static_cast(1)); - -: 1062: FW_ASSERT( - -: 1063: _status == Fw::FW_SERIALIZE_OK, - -: 1064: static_cast(_status) - -: 1065: ); - -: 1066:#endif - -: 1067: - -: 1068:#if FW_AMPCS_COMPATIBLE - -: 1069: // Serialize the argument size - -: 1070: _status = _logBuff.serialize( - -: 1071: static_cast(sizeof(Id)) - -: 1072: ); - -: 1073: FW_ASSERT( - -: 1074: _status == Fw::FW_SERIALIZE_OK, - -: 1075: static_cast(_status) - -: 1076: ); - -: 1077:#endif - -: 1078: - 420: 1079: _status = _logBuff.serialize(Id); - 420: 1080: FW_ASSERT( - -: 1081: _status == Fw::FW_SERIALIZE_OK, - -: 1082: static_cast(_status) - 840: 1083: ); - -: 1084: - -: 1085: - -: 1086: this->m_Log_OutputPort[0].invoke( - -: 1087: _id, - -: 1088: _logTime,Fw::LOG_ACTIVITY_HI, - -: 1089: _logBuff - 420: 1090: ); - -: 1091: - -: 1092: } - -: 1093: - -: 1094: // Emit the event on the text log port - -: 1095:#if FW_ENABLE_TEXT_LOGGING - 420: 1096: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 1097: - -: 1098:#if FW_OBJECT_NAMES == 1 - -: 1099: const char* _formatString = - 420: 1100: "(%s) %s: Parameter ID 0x%08X added"; - -: 1101:#else - -: 1102: const char* _formatString = - -: 1103: "%s: Parameter ID 0x%08X added"; - -: 1104:#endif - -: 1105: - -: 1106: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 1107: - -: 1108: (void) snprintf( - -: 1109: _textBuffer, - -: 1110: FW_LOG_TEXT_BUFFER_SIZE, - -: 1111: _formatString, - -: 1112:#if FW_OBJECT_NAMES == 1 - -: 1113: this->m_objName, - -: 1114:#endif - -: 1115: "PrmIdAdded " - -: 1116: , Id - 420: 1117: ); - -: 1118: - -: 1119: // Null terminate - 420: 1120: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 420: 1121: Fw::TextLogString _logString = _textBuffer; - -: 1122: this->m_LogText_OutputPort[0].invoke( - -: 1123: _id, - -: 1124: _logTime,Fw::TEXT_LOG_ACTIVITY_HI, - -: 1125: _logString - 420: 1126: ); - -: 1127: - 420: 1128: } - -: 1129:#endif - -: 1130: - 420: 1131: } - -: 1132: - 108: 1133: void PrmDbComponentBase :: - -: 1134: log_WARNING_HI_PrmFileWriteError( - -: 1135: LogWriteError stage, I32 record, I32 error - -: 1136: ) - -: 1137: { - -: 1138: - -: 1139: // Get the time - 108: 1140: Fw::Time _logTime; - 108: 1141: if (this->m_Time_OutputPort[0].isConnected()) { - 108: 1142: _logTime = this->m_Time_OutputPort[0].invoke(); - -: 1143: } - -: 1144: - 108: 1145: FwEventIdType _id = static_cast(0); - -: 1146: - 108: 1147: _id = EVENTID_PRMFILEWRITEERROR; - -: 1148: - -: 1149: // Emit the event on the log port - 108: 1150: if (this->m_Log_OutputPort[0].isConnected()) { - -: 1151: - 108: 1152: Fw::LogBuffer _logBuff; - -: 1153: Fw::SerializeStatus _status; - -: 1154: - -: 1155:#if FW_AMPCS_COMPATIBLE - -: 1156: // Serialize the number of arguments - -: 1157: _status = _logBuff.serialize(static_cast(3)); - -: 1158: FW_ASSERT( - -: 1159: _status == Fw::FW_SERIALIZE_OK, - -: 1160: static_cast(_status) - -: 1161: ); - -: 1162:#endif - -: 1163: - -: 1164:#if FW_AMPCS_COMPATIBLE - -: 1165: // Serialize the argument size - -: 1166: _status = _logBuff.serialize(static_cast(sizeof(FwEnumStoreType))); - -: 1167: FW_ASSERT( - -: 1168: _status == Fw::FW_SERIALIZE_OK, - -: 1169: static_cast(_status) - -: 1170: ); - -: 1171:#endif - -: 1172: - -: 1173: _status = _logBuff.serialize( - -: 1174: static_cast(stage) - 108: 1175: ); - 108: 1176: FW_ASSERT( - -: 1177: _status == Fw::FW_SERIALIZE_OK, - -: 1178: static_cast(_status) - 216: 1179: ); - -: 1180: - -: 1181:#if FW_AMPCS_COMPATIBLE - -: 1182: // Serialize the argument size - -: 1183: _status = _logBuff.serialize( - -: 1184: static_cast(sizeof(record)) - -: 1185: ); - -: 1186: FW_ASSERT( - -: 1187: _status == Fw::FW_SERIALIZE_OK, - -: 1188: static_cast(_status) - -: 1189: ); - -: 1190:#endif - -: 1191: - 108: 1192: _status = _logBuff.serialize(record); - 108: 1193: FW_ASSERT( - -: 1194: _status == Fw::FW_SERIALIZE_OK, - -: 1195: static_cast(_status) - 216: 1196: ); - -: 1197: - -: 1198:#if FW_AMPCS_COMPATIBLE - -: 1199: // Serialize the argument size - -: 1200: _status = _logBuff.serialize( - -: 1201: static_cast(sizeof(error)) - -: 1202: ); - -: 1203: FW_ASSERT( - -: 1204: _status == Fw::FW_SERIALIZE_OK, - -: 1205: static_cast(_status) - -: 1206: ); - -: 1207:#endif - -: 1208: - 108: 1209: _status = _logBuff.serialize(error); - 108: 1210: FW_ASSERT( - -: 1211: _status == Fw::FW_SERIALIZE_OK, - -: 1212: static_cast(_status) - 216: 1213: ); - -: 1214: - -: 1215: - -: 1216: this->m_Log_OutputPort[0].invoke( - -: 1217: _id, - -: 1218: _logTime,Fw::LOG_WARNING_HI, - -: 1219: _logBuff - 108: 1220: ); - -: 1221: - -: 1222: } - -: 1223: - -: 1224: // Emit the event on the text log port - -: 1225:#if FW_ENABLE_TEXT_LOGGING - 108: 1226: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 1227: - -: 1228:#if FW_OBJECT_NAMES == 1 - -: 1229: const char* _formatString = - 108: 1230: "(%s) %s: Parameter write failed in stage %d with error %d"; - -: 1231:#else - -: 1232: const char* _formatString = - -: 1233: "%s: Parameter write failed in stage %d with error %d"; - -: 1234:#endif - -: 1235: - -: 1236: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 1237: - -: 1238: (void) snprintf( - -: 1239: _textBuffer, - -: 1240: FW_LOG_TEXT_BUFFER_SIZE, - -: 1241: _formatString, - -: 1242:#if FW_OBJECT_NAMES == 1 - -: 1243: this->m_objName, - -: 1244:#endif - -: 1245: "PrmFileWriteError " - -: 1246: , stage - -: 1247: , record - -: 1248: , error - 108: 1249: ); - -: 1250: - -: 1251: // Null terminate - 108: 1252: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 108: 1253: Fw::TextLogString _logString = _textBuffer; - -: 1254: this->m_LogText_OutputPort[0].invoke( - -: 1255: _id, - -: 1256: _logTime,Fw::TEXT_LOG_WARNING_HI, - -: 1257: _logString - 108: 1258: ); - -: 1259: - 108: 1260: } - -: 1261:#endif - -: 1262: - 108: 1263: } - -: 1264: - 12: 1265: void PrmDbComponentBase :: - -: 1266: log_ACTIVITY_HI_PrmFileSaveComplete( - -: 1267: U32 records - -: 1268: ) - -: 1269: { - -: 1270: - -: 1271: // Get the time - 12: 1272: Fw::Time _logTime; - 12: 1273: if (this->m_Time_OutputPort[0].isConnected()) { - 12: 1274: _logTime = this->m_Time_OutputPort[0].invoke(); - -: 1275: } - -: 1276: - 12: 1277: FwEventIdType _id = static_cast(0); - -: 1278: - 12: 1279: _id = EVENTID_PRMFILESAVECOMPLETE; - -: 1280: - -: 1281: // Emit the event on the log port - 12: 1282: if (this->m_Log_OutputPort[0].isConnected()) { - -: 1283: - 12: 1284: Fw::LogBuffer _logBuff; - -: 1285: Fw::SerializeStatus _status; - -: 1286: - -: 1287:#if FW_AMPCS_COMPATIBLE - -: 1288: // Serialize the number of arguments - -: 1289: _status = _logBuff.serialize(static_cast(1)); - -: 1290: FW_ASSERT( - -: 1291: _status == Fw::FW_SERIALIZE_OK, - -: 1292: static_cast(_status) - -: 1293: ); - -: 1294:#endif - -: 1295: - -: 1296:#if FW_AMPCS_COMPATIBLE - -: 1297: // Serialize the argument size - -: 1298: _status = _logBuff.serialize( - -: 1299: static_cast(sizeof(records)) - -: 1300: ); - -: 1301: FW_ASSERT( - -: 1302: _status == Fw::FW_SERIALIZE_OK, - -: 1303: static_cast(_status) - -: 1304: ); - -: 1305:#endif - -: 1306: - 12: 1307: _status = _logBuff.serialize(records); - 12: 1308: FW_ASSERT( - -: 1309: _status == Fw::FW_SERIALIZE_OK, - -: 1310: static_cast(_status) - 24: 1311: ); - -: 1312: - -: 1313: - -: 1314: this->m_Log_OutputPort[0].invoke( - -: 1315: _id, - -: 1316: _logTime,Fw::LOG_ACTIVITY_HI, - -: 1317: _logBuff - 12: 1318: ); - -: 1319: - -: 1320: } - -: 1321: - -: 1322: // Emit the event on the text log port - -: 1323:#if FW_ENABLE_TEXT_LOGGING - 12: 1324: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 1325: - -: 1326:#if FW_OBJECT_NAMES == 1 - -: 1327: const char* _formatString = - 12: 1328: "(%s) %s: Parameter file save completed. Wrote %d records."; - -: 1329:#else - -: 1330: const char* _formatString = - -: 1331: "%s: Parameter file save completed. Wrote %d records."; - -: 1332:#endif - -: 1333: - -: 1334: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 1335: - -: 1336: (void) snprintf( - -: 1337: _textBuffer, - -: 1338: FW_LOG_TEXT_BUFFER_SIZE, - -: 1339: _formatString, - -: 1340:#if FW_OBJECT_NAMES == 1 - -: 1341: this->m_objName, - -: 1342:#endif - -: 1343: "PrmFileSaveComplete " - -: 1344: , records - 12: 1345: ); - -: 1346: - -: 1347: // Null terminate - 12: 1348: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 12: 1349: Fw::TextLogString _logString = _textBuffer; - -: 1350: this->m_LogText_OutputPort[0].invoke( - -: 1351: _id, - -: 1352: _logTime,Fw::TEXT_LOG_ACTIVITY_HI, - -: 1353: _logString - 12: 1354: ); - -: 1355: - 12: 1356: } - -: 1357:#endif - -: 1358: - 12: 1359: } - -: 1360: - 132: 1361: void PrmDbComponentBase :: - -: 1362: log_WARNING_HI_PrmFileReadError( - -: 1363: LogReadError stage, I32 record, I32 error - -: 1364: ) - -: 1365: { - -: 1366: - -: 1367: // Get the time - 132: 1368: Fw::Time _logTime; - 132: 1369: if (this->m_Time_OutputPort[0].isConnected()) { - 132: 1370: _logTime = this->m_Time_OutputPort[0].invoke(); - -: 1371: } - -: 1372: - 132: 1373: FwEventIdType _id = static_cast(0); - -: 1374: - 132: 1375: _id = EVENTID_PRMFILEREADERROR; - -: 1376: - -: 1377: // Emit the event on the log port - 132: 1378: if (this->m_Log_OutputPort[0].isConnected()) { - -: 1379: - 132: 1380: Fw::LogBuffer _logBuff; - -: 1381: Fw::SerializeStatus _status; - -: 1382: - -: 1383:#if FW_AMPCS_COMPATIBLE - -: 1384: // Serialize the number of arguments - -: 1385: _status = _logBuff.serialize(static_cast(3)); - -: 1386: FW_ASSERT( - -: 1387: _status == Fw::FW_SERIALIZE_OK, - -: 1388: static_cast(_status) - -: 1389: ); - -: 1390:#endif - -: 1391: - -: 1392:#if FW_AMPCS_COMPATIBLE - -: 1393: // Serialize the argument size - -: 1394: _status = _logBuff.serialize(static_cast(sizeof(FwEnumStoreType))); - -: 1395: FW_ASSERT( - -: 1396: _status == Fw::FW_SERIALIZE_OK, - -: 1397: static_cast(_status) - -: 1398: ); - -: 1399:#endif - -: 1400: - -: 1401: _status = _logBuff.serialize( - -: 1402: static_cast(stage) - 132: 1403: ); - 132: 1404: FW_ASSERT( - -: 1405: _status == Fw::FW_SERIALIZE_OK, - -: 1406: static_cast(_status) - 264: 1407: ); - -: 1408: - -: 1409:#if FW_AMPCS_COMPATIBLE - -: 1410: // Serialize the argument size - -: 1411: _status = _logBuff.serialize( - -: 1412: static_cast(sizeof(record)) - -: 1413: ); - -: 1414: FW_ASSERT( - -: 1415: _status == Fw::FW_SERIALIZE_OK, - -: 1416: static_cast(_status) - -: 1417: ); - -: 1418:#endif - -: 1419: - 132: 1420: _status = _logBuff.serialize(record); - 132: 1421: FW_ASSERT( - -: 1422: _status == Fw::FW_SERIALIZE_OK, - -: 1423: static_cast(_status) - 264: 1424: ); - -: 1425: - -: 1426:#if FW_AMPCS_COMPATIBLE - -: 1427: // Serialize the argument size - -: 1428: _status = _logBuff.serialize( - -: 1429: static_cast(sizeof(error)) - -: 1430: ); - -: 1431: FW_ASSERT( - -: 1432: _status == Fw::FW_SERIALIZE_OK, - -: 1433: static_cast(_status) - -: 1434: ); - -: 1435:#endif - -: 1436: - 132: 1437: _status = _logBuff.serialize(error); - 132: 1438: FW_ASSERT( - -: 1439: _status == Fw::FW_SERIALIZE_OK, - -: 1440: static_cast(_status) - 264: 1441: ); - -: 1442: - -: 1443: - -: 1444: this->m_Log_OutputPort[0].invoke( - -: 1445: _id, - -: 1446: _logTime,Fw::LOG_WARNING_HI, - -: 1447: _logBuff - 132: 1448: ); - -: 1449: - -: 1450: } - -: 1451: - -: 1452: // Emit the event on the text log port - -: 1453:#if FW_ENABLE_TEXT_LOGGING - 132: 1454: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 1455: - -: 1456:#if FW_OBJECT_NAMES == 1 - -: 1457: const char* _formatString = - 132: 1458: "(%s) %s: Parameter file read failed in stage %d with error %d"; - -: 1459:#else - -: 1460: const char* _formatString = - -: 1461: "%s: Parameter file read failed in stage %d with error %d"; - -: 1462:#endif - -: 1463: - -: 1464: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 1465: - -: 1466: (void) snprintf( - -: 1467: _textBuffer, - -: 1468: FW_LOG_TEXT_BUFFER_SIZE, - -: 1469: _formatString, - -: 1470:#if FW_OBJECT_NAMES == 1 - -: 1471: this->m_objName, - -: 1472:#endif - -: 1473: "PrmFileReadError " - -: 1474: , stage - -: 1475: , record - -: 1476: , error - 132: 1477: ); - -: 1478: - -: 1479: // Null terminate - 132: 1480: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 132: 1481: Fw::TextLogString _logString = _textBuffer; - -: 1482: this->m_LogText_OutputPort[0].invoke( - -: 1483: _id, - -: 1484: _logTime,Fw::TEXT_LOG_WARNING_HI, - -: 1485: _logString - 132: 1486: ); - -: 1487: - 132: 1488: } - -: 1489:#endif - -: 1490: - 132: 1491: } - -: 1492: - 12: 1493: void PrmDbComponentBase :: - -: 1494: log_ACTIVITY_HI_PrmFileLoadComplete( - -: 1495: U32 records - -: 1496: ) - -: 1497: { - -: 1498: - -: 1499: // Get the time - 12: 1500: Fw::Time _logTime; - 12: 1501: if (this->m_Time_OutputPort[0].isConnected()) { - 12: 1502: _logTime = this->m_Time_OutputPort[0].invoke(); - -: 1503: } - -: 1504: - 12: 1505: FwEventIdType _id = static_cast(0); - -: 1506: - 12: 1507: _id = EVENTID_PRMFILELOADCOMPLETE; - -: 1508: - -: 1509: // Emit the event on the log port - 12: 1510: if (this->m_Log_OutputPort[0].isConnected()) { - -: 1511: - 12: 1512: Fw::LogBuffer _logBuff; - -: 1513: Fw::SerializeStatus _status; - -: 1514: - -: 1515:#if FW_AMPCS_COMPATIBLE - -: 1516: // Serialize the number of arguments - -: 1517: _status = _logBuff.serialize(static_cast(1)); - -: 1518: FW_ASSERT( - -: 1519: _status == Fw::FW_SERIALIZE_OK, - -: 1520: static_cast(_status) - -: 1521: ); - -: 1522:#endif - -: 1523: - -: 1524:#if FW_AMPCS_COMPATIBLE - -: 1525: // Serialize the argument size - -: 1526: _status = _logBuff.serialize( - -: 1527: static_cast(sizeof(records)) - -: 1528: ); - -: 1529: FW_ASSERT( - -: 1530: _status == Fw::FW_SERIALIZE_OK, - -: 1531: static_cast(_status) - -: 1532: ); - -: 1533:#endif - -: 1534: - 12: 1535: _status = _logBuff.serialize(records); - 12: 1536: FW_ASSERT( - -: 1537: _status == Fw::FW_SERIALIZE_OK, - -: 1538: static_cast(_status) - 24: 1539: ); - -: 1540: - -: 1541: - -: 1542: this->m_Log_OutputPort[0].invoke( - -: 1543: _id, - -: 1544: _logTime,Fw::LOG_ACTIVITY_HI, - -: 1545: _logBuff - 12: 1546: ); - -: 1547: - -: 1548: } - -: 1549: - -: 1550: // Emit the event on the text log port - -: 1551:#if FW_ENABLE_TEXT_LOGGING - 12: 1552: if (this->m_LogText_OutputPort[0].isConnected()) { - -: 1553: - -: 1554:#if FW_OBJECT_NAMES == 1 - -: 1555: const char* _formatString = - 12: 1556: "(%s) %s: Parameter file load completed. Read %d records."; - -: 1557:#else - -: 1558: const char* _formatString = - -: 1559: "%s: Parameter file load completed. Read %d records."; - -: 1560:#endif - -: 1561: - -: 1562: char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE]; - -: 1563: - -: 1564: (void) snprintf( - -: 1565: _textBuffer, - -: 1566: FW_LOG_TEXT_BUFFER_SIZE, - -: 1567: _formatString, - -: 1568:#if FW_OBJECT_NAMES == 1 - -: 1569: this->m_objName, - -: 1570:#endif - -: 1571: "PrmFileLoadComplete " - -: 1572: , records - 12: 1573: ); - -: 1574: - -: 1575: // Null terminate - 12: 1576: _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0; - 12: 1577: Fw::TextLogString _logString = _textBuffer; - -: 1578: this->m_LogText_OutputPort[0].invoke( - -: 1579: _id, - -: 1580: _logTime,Fw::TEXT_LOG_ACTIVITY_HI, - -: 1581: _logString - 12: 1582: ); - -: 1583: - 12: 1584: } - -: 1585:#endif - -: 1586: - 12: 1587: } - -: 1588: - -: 1589: // ---------------------------------------------------------------------- - -: 1590: // Mutex functions for guarded ports - -: 1591: // ---------------------------------------------------------------------- - -: 1592: - 756: 1593: void PrmDbComponentBase :: - -: 1594: lock(void) - -: 1595: { - 756: 1596: this->m_guardedPortMutex.lock(); - 756: 1597: } - -: 1598: - 756: 1599: void PrmDbComponentBase :: - -: 1600: unLock(void) - -: 1601: { - 756: 1602: this->m_guardedPortMutex.unLock(); - 756: 1603: } - -: 1604: - -: 1605: // ---------------------------------------------------------------------- - -: 1606: // Calls for messages received on typed input ports - -: 1607: // ---------------------------------------------------------------------- - -: 1608: - 156: 1609: Fw::ParamValid PrmDbComponentBase :: - -: 1610: m_p_getPrm_in( - -: 1611: Fw::PassiveComponentBase* callComp, - -: 1612: NATIVE_INT_TYPE portNum, - -: 1613: FwPrmIdType id, Fw::ParamBuffer &val - -: 1614: ) - -: 1615: { - 156: 1616: FW_ASSERT(callComp); - -: 1617: PrmDbComponentBase* compPtr = - 156: 1618: (PrmDbComponentBase*) callComp; - 156: 1619: return compPtr->getPrm_handlerBase(portNum, id, val); - -: 1620: } - -: 1621: - 492: 1622: void PrmDbComponentBase :: - -: 1623: m_p_setPrm_in( - -: 1624: Fw::PassiveComponentBase* callComp, - -: 1625: NATIVE_INT_TYPE portNum, - -: 1626: FwPrmIdType id, Fw::ParamBuffer &val - -: 1627: ) - -: 1628: { - 492: 1629: FW_ASSERT(callComp); - -: 1630: PrmDbComponentBase* compPtr = - 492: 1631: (PrmDbComponentBase*) callComp; - 492: 1632: compPtr->setPrm_handlerBase(portNum, id, val); - 492: 1633: } - -: 1634: - -: 1635: // ---------------------------------------------------------------------- - -: 1636: // Port handler base-class functions for typed input ports - -: 1637: // ---------------------------------------------------------------------- - -: 1638: - 156: 1639: Fw::ParamValid PrmDbComponentBase :: - -: 1640: getPrm_handlerBase( - -: 1641: NATIVE_INT_TYPE portNum, - -: 1642: FwPrmIdType id, Fw::ParamBuffer &val - -: 1643: ) - -: 1644: { - -: 1645: - -: 1646: // Make sure port number is valid - 156: 1647: FW_ASSERT(portNum < this->getNum_getPrm_InputPorts()); - -: 1648: Fw::ParamValid retVal; - -: 1649: - -: 1650: // Lock guard mutex before calling - 156: 1651: this->lock(); - -: 1652: - -: 1653: // Down call to pure virtual handler method implemented in Impl class - 156: 1654: retVal = this->getPrm_handler(portNum, id, val); - -: 1655: - -: 1656: // Unlock guard mutex - 156: 1657: this->unLock(); - -: 1658: - 156: 1659: return retVal; - -: 1660: - -: 1661: } - -: 1662: - 492: 1663: void PrmDbComponentBase :: - -: 1664: setPrm_handlerBase( - -: 1665: NATIVE_INT_TYPE portNum, - -: 1666: FwPrmIdType id, Fw::ParamBuffer &val - -: 1667: ) - -: 1668: { - -: 1669: - -: 1670: // Make sure port number is valid - 492: 1671: FW_ASSERT(portNum < this->getNum_setPrm_InputPorts()); - -: 1672: - -: 1673: // Call pre-message hook - -: 1674: setPrm_preMsgHook( - -: 1675: portNum, - -: 1676: id, val - 492: 1677: ); - -: 1678: - 492: 1679: ComponentIpcSerializableBuffer msg; - -: 1680: Fw::SerializeStatus _status; - -: 1681: - -: 1682: _status = msg.serialize( - -: 1683: static_cast(SETPRM_PRMSET) - 492: 1684: ); - 492: 1685: FW_ASSERT ( - -: 1686: _status == Fw::FW_SERIALIZE_OK, - -: 1687: static_cast(_status) - 984: 1688: ); - -: 1689: - 492: 1690: _status = msg.serialize(portNum); - 492: 1691: FW_ASSERT ( - -: 1692: _status == Fw::FW_SERIALIZE_OK, - -: 1693: static_cast(_status) - 984: 1694: ); - -: 1695: - -: 1696: // Serialize argument id - 492: 1697: _status = msg.serialize(id); - 492: 1698: FW_ASSERT( - -: 1699: _status == Fw::FW_SERIALIZE_OK, - -: 1700: static_cast(_status) - 984: 1701: ); - -: 1702: - -: 1703: // Serialize argument val - 492: 1704: _status = msg.serialize(val); - 492: 1705: FW_ASSERT( - -: 1706: _status == Fw::FW_SERIALIZE_OK, - -: 1707: static_cast(_status) - 984: 1708: ); - -: 1709: - -: 1710: Os::Queue::QueueStatus qStatus = - 492: 1711: this->m_queue.send(msg, 0); - 492: 1712: FW_ASSERT( - -: 1713: qStatus == Os::Queue::QUEUE_OK, - -: 1714: static_cast(qStatus) - 1476: 1715: ); - 492: 1716: } - -: 1717: - -: 1718: // ---------------------------------------------------------------------- - -: 1719: // Pre-message hooks for async input ports - -: 1720: // ---------------------------------------------------------------------- - -: 1721: - 492: 1722: void PrmDbComponentBase :: - -: 1723: setPrm_preMsgHook( - -: 1724: NATIVE_INT_TYPE portNum, - -: 1725: FwPrmIdType id, Fw::ParamBuffer &val - -: 1726: ) - -: 1727: { - -: 1728: // Default: no-op - 492: 1729: } - -: 1730: - -: 1731: // ---------------------------------------------------------------------- - -: 1732: // Message dispatch method for active and queued components. Called - -: 1733: // by active component thread or implementation code for queued components - -: 1734: // ---------------------------------------------------------------------- - -: 1735: - 612: 1736: Fw::QueuedComponentBase::MsgDispatchStatus PrmDbComponentBase :: - -: 1737: doDispatch(void) - -: 1738: { - -: 1739: - 612: 1740: ComponentIpcSerializableBuffer msg; - -: 1741: NATIVE_INT_TYPE priority; - -: 1742: - 612: 1743: Os::Queue::QueueStatus msgStatus = this->m_queue.receive(msg,priority); - 612: 1744: FW_ASSERT( - -: 1745: msgStatus == Os::Queue::QUEUE_OK, - -: 1746: static_cast(msgStatus) - 1224: 1747: ); - -: 1748: - -: 1749: // Reset to beginning of buffer - 612: 1750: msg.resetDeser(); - -: 1751: - -: 1752: NATIVE_INT_TYPE desMsg; - 612: 1753: Fw::SerializeStatus deserStatus = msg.deserialize(desMsg); - 612: 1754: FW_ASSERT( - -: 1755: deserStatus == Fw::FW_SERIALIZE_OK, - -: 1756: static_cast(deserStatus) - 1224: 1757: ); - -: 1758: - 612: 1759: MsgTypeEnum msgType = static_cast(desMsg); - -: 1760: - 612: 1761: if (msgType == PRMDB_COMPONENT_EXIT) { - #####: 1762: return MSG_DISPATCH_EXIT; - -: 1763: } - -: 1764: - -: 1765: NATIVE_INT_TYPE portNum; - 612: 1766: deserStatus = msg.deserialize(portNum); - 612: 1767: FW_ASSERT( - -: 1768: deserStatus == Fw::FW_SERIALIZE_OK, - -: 1769: static_cast(deserStatus) - 1224: 1770: ); - -: 1771: - 612: 1772: switch (msgType) { - -: 1773: - -: 1774: // Handle async input port setPrm - -: 1775: case SETPRM_PRMSET: { - -: 1776: - -: 1777: // Deserialize argument id - -: 1778: FwPrmIdType id; - 492: 1779: deserStatus = msg.deserialize(id); - 492: 1780: FW_ASSERT( - -: 1781: deserStatus == Fw::FW_SERIALIZE_OK, - -: 1782: static_cast(deserStatus) - 984: 1783: ); - -: 1784: - -: 1785: // Deserialize argument val - 492: 1786: Fw::ParamBuffer val; - 492: 1787: deserStatus = msg.deserialize(val); - 492: 1788: FW_ASSERT( - -: 1789: deserStatus == Fw::FW_SERIALIZE_OK, - -: 1790: static_cast(deserStatus) - 984: 1791: ); - -: 1792: - -: 1793: // Call handler function - -: 1794: this->setPrm_handler( - -: 1795: portNum, - -: 1796: id, val - 492: 1797: ); - -: 1798: - 492: 1799: break; - -: 1800: - -: 1801: } - -: 1802: - -: 1803: // Handle command PRM_SAVE_FILE - -: 1804: case CMD_PRM_SAVE_FILE: { - -: 1805: // Deserialize opcode - -: 1806: FwOpcodeType opCode; - 120: 1807: deserStatus = msg.deserialize(opCode); - 120: 1808: FW_ASSERT ( - -: 1809: deserStatus == Fw::FW_SERIALIZE_OK, - -: 1810: static_cast(deserStatus) - 240: 1811: ); - -: 1812: - -: 1813: // Deserialize command sequence - -: 1814: U32 cmdSeq; - 120: 1815: deserStatus = msg.deserialize(cmdSeq); - 120: 1816: FW_ASSERT ( - -: 1817: deserStatus == Fw::FW_SERIALIZE_OK, - -: 1818: static_cast(deserStatus) - 240: 1819: ); - -: 1820: - -: 1821: // Deserialize command argument buffer - 120: 1822: Fw::CmdArgBuffer args; - 120: 1823: deserStatus = msg.deserialize(args); - 120: 1824: FW_ASSERT ( - -: 1825: deserStatus == Fw::FW_SERIALIZE_OK, - -: 1826: static_cast(deserStatus) - 240: 1827: ); - -: 1828: - -: 1829: // Reset buffer - 120: 1830: args.resetDeser(); - -: 1831: - -: 1832: // Make sure there was no data left over. - -: 1833: // That means the argument buffer size was incorrect. - 120: 1834: if (args.getBuffLeft() != 0) { - #####: 1835: if (this->m_CmdStatus_OutputPort[0].isConnected()) { - #####: 1836: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_FORMAT_ERROR); - -: 1837: } - -: 1838: // Don't crash the task if bad arguments were passed from the ground - #####: 1839: break; - -: 1840: } - -: 1841: - -: 1842: // Call handler function - 120: 1843: this->PRM_SAVE_FILE_cmdHandler(opCode, cmdSeq); - -: 1844: - 120: 1845: break; - -: 1846: - -: 1847: } - -: 1848: - -: 1849: default: - #####: 1850: return MSG_DISPATCH_ERROR; - -: 1851: - -: 1852: } - -: 1853: - 612: 1854: return MSG_DISPATCH_OK; - -: 1855: - -: 1856: } - -: 1857: - -: 1858:} - -: 1859: diff --git a/Svc/PrmDb/test/ut/output/PrmDbImpl.cpp.gcov b/Svc/PrmDb/test/ut/output/PrmDbImpl.cpp.gcov deleted file mode 100644 index 78a733e779..0000000000 --- a/Svc/PrmDb/test/ut/output/PrmDbImpl.cpp.gcov +++ /dev/null @@ -1,370 +0,0 @@ - -: 0:Source:/home/tcanham/source/isf/Svc/PrmDb/PrmDbImpl.cpp - -: 0:Programs:13 - -: 1:/* - -: 2: * PrmDbImpl.cpp - -: 3: * - -: 4: * Created on: March 9, 2015 - -: 5: * Author: Timothy Canham - -: 6: */ - -: 7: - -: 8:#include - -: 9:#include - -: 10:#include - -: 11: - -: 12:#include - -: 13: - -: 14:#include - -: 15:#include - -: 16: - -: 17:namespace Svc { - -: 18: - -: 19: // anonymous namespace for buffer declaration - -: 20: namespace { - 42: 21: class WorkingBuffer : public Fw::SerializeBufferBase { - -: 22: public: - -: 23: - 25: 24: NATIVE_UINT_TYPE getBuffCapacity(void) const { - 25: 25: return sizeof(m_buff); - -: 26: } - -: 27: - 154: 28: U8* getBuffAddr(void) { - 154: 29: return m_buff; - -: 30: } - -: 31: - #####: 32: const U8* getBuffAddr(void) const { - #####: 33: return m_buff; - -: 34: } - -: 35: - -: 36: private: - -: 37: // Set to max of parameter buffer + id - -: 38: U8 m_buff[FW_PARAM_BUFFER_MAX_SIZE + sizeof(FwPrmIdType)]; - -: 39: }; - -: 40: } - -: 41: - -: 42: - -: 43:#if FW_OBJECT_NAMES == 1 - 6: 44: PrmDbImpl::PrmDbImpl(const char* name, const char* file) : PrmDbComponentBase(name) { - -: 45:#else - -: 46: PrmDbImpl::PrmDbImpl(const char* file) { - -: 47:#endif - 6: 48: this->clearDb(); - 6: 49: this->m_fileName = file; - 6: 50: } - -: 51: - 6: 52: void PrmDbImpl::init(NATIVE_INT_TYPE queueDepth, NATIVE_INT_TYPE instance) { - 6: 53: PrmDbComponentBase::init(queueDepth,instance); - 6: 54: } - -: 55: - 23: 56: void PrmDbImpl::clearDb(void) { - 598: 57: for (I32 entry = 0; entry < PRMDB_NUM_DB_ENTRIES; entry++) { - 575: 58: this->m_db[entry].used = false; - 575: 59: this->m_db[entry].id = 0; - -: 60: } - 23: 61: } - -: 62: - -: 63: // If ports are no longer guarded, these accesses need to be protected from each other - -: 64: // If there are a lot of accesses, perhaps an interrupt lock could be used instead of guarded ports - -: 65: - 13: 66: Fw::ParamValid PrmDbImpl::getPrm_handler(NATIVE_INT_TYPE portNum, FwPrmIdType id, Fw::ParamBuffer &val) { - -: 67: // search for entry - 13: 68: Fw::ParamValid stat = Fw::PARAM_INVALID; - -: 69: - 39: 70: for (I32 entry = 0; entry < PRMDB_NUM_DB_ENTRIES; entry++) { - 38: 71: if (this->m_db[entry].used) { - 15: 72: if (this->m_db[entry].id == id) { - 12: 73: val = this->m_db[entry].val; - 12: 74: stat = Fw::PARAM_VALID; - 12: 75: break; - -: 76: } - -: 77: } - -: 78: } - -: 79: - -: 80: // if unable to find parameter, send error message - 13: 81: if (Fw::PARAM_INVALID == stat) { - 1: 82: this->log_WARNING_LO_PrmIdNotFound(id); - -: 83: } - -: 84: - 13: 85: return stat; - -: 86: } - -: 87: - 41: 88: void PrmDbImpl::setPrm_handler(NATIVE_INT_TYPE portNum, FwPrmIdType id, Fw::ParamBuffer &val) { - -: 89: - 41: 90: this->lock(); - -: 91: - -: 92: // search for existing entry - -: 93: - 41: 94: bool existingEntry = false; - 41: 95: bool noSlots = true; - -: 96: - 941: 97: for (NATIVE_INT_TYPE entry = 0; entry < PRMDB_NUM_DB_ENTRIES; entry++) { - 905: 98: if ((this->m_db[entry].used) && (id == this->m_db[entry].id)) { - 5: 99: this->m_db[entry].val = val; - 5: 100: existingEntry = true; - 5: 101: break; - -: 102: } - -: 103: } - -: 104: - -: 105: // if there is no existing entry, add one - 41: 106: if (!existingEntry) { - 366: 107: for (I32 entry = 0; entry < PRMDB_NUM_DB_ENTRIES; entry++) { - 365: 108: if (!(this->m_db[entry].used)) { - 35: 109: this->m_db[entry].val = val; - 35: 110: this->m_db[entry].id = id; - 35: 111: this->m_db[entry].used = true; - 35: 112: noSlots = false; - 35: 113: break; - -: 114: } - -: 115: } - -: 116: } - -: 117: - 41: 118: this->unLock(); - -: 119: - 41: 120: if (existingEntry) { - 5: 121: this->log_ACTIVITY_HI_PrmIdUpdated(id); - 36: 122: } else if (noSlots) { - 1: 123: this->log_FATAL_PrmDbFull(id); - -: 124: } else { - 35: 125: this->log_ACTIVITY_HI_PrmIdAdded(id); - -: 126: } - -: 127: - 41: 128: } - -: 129: - 10: 130: void PrmDbImpl::PRM_SAVE_FILE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) { - -: 131: - 10: 132: Os::File paramFile; - 11: 133: WorkingBuffer buff; - -: 134: - 10: 135: Os::File::Status stat = paramFile.open(this->m_fileName.toChar(),Os::File::OPEN_WRITE); - 10: 136: if (stat != Os::File::OP_OK) { - 1: 137: this->log_WARNING_HI_PrmFileWriteError(PRM_WRITE_OPEN,0,stat); - 1: 138: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_EXECUTION_ERROR); - 1: 139: return; - -: 140: } - -: 141: - 9: 142: this->lock(); - -: 143: - -: 144: // Traverse the parameter list, saving each entry - -: 145: - 9: 146: U32 numRecords = 0; - -: 147: - 34: 148: for (NATIVE_UINT_TYPE entry = 0; entry < FW_NUM_ARRAY_ELEMENTS(this->m_db); entry++) { - 33: 149: if (this->m_db[entry].used) { - -: 150: // write delimiter - -: 151: static const U8 delim = PRMDB_ENTRY_DELIMITER; - 10: 152: NATIVE_INT_TYPE writeSize = sizeof(delim); - 10: 153: stat = paramFile.write(&delim,writeSize,true); - 10: 154: if (stat != Os::File::OP_OK) { - 1: 155: this->unLock(); - 1: 156: this->log_WARNING_HI_PrmFileWriteError(PRM_WRITE_DELIMITER,numRecords,stat); - 1: 157: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_EXECUTION_ERROR); - 9: 158: return; - -: 159: } - 9: 160: if (writeSize != sizeof(delim)) { - 1: 161: this->unLock(); - 1: 162: this->log_WARNING_HI_PrmFileWriteError(PRM_WRITE_DELIMITER_SIZE,numRecords,writeSize); - 1: 163: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_EXECUTION_ERROR); - 1: 164: return; - -: 165: } - -: 166: // serialize record size = id field + data - 8: 167: U32 recordSize = sizeof(FwPrmIdType) + this->m_db[entry].val.getBuffLength(); - -: 168: - -: 169: // reset buffer - 8: 170: buff.resetSer(); - 8: 171: Fw::SerializeStatus serStat = buff.serialize(recordSize); - -: 172: // should always work - 8: 173: FW_ASSERT(Fw::FW_SERIALIZE_OK == serStat,(NATIVE_INT_TYPE)serStat); - -: 174: - -: 175: // write record size - 8: 176: writeSize = buff.getBuffLength(); - 8: 177: stat = paramFile.write(buff.getBuffAddr(),writeSize,true); - 8: 178: if (stat != Os::File::OP_OK) { - 1: 179: this->unLock(); - 1: 180: this->log_WARNING_HI_PrmFileWriteError(PRM_WRITE_RECORD_SIZE,numRecords,stat); - 1: 181: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_EXECUTION_ERROR); - 1: 182: return; - -: 183: } - 7: 184: if (writeSize != sizeof(writeSize)) { - 1: 185: this->unLock(); - 1: 186: this->log_WARNING_HI_PrmFileWriteError(PRM_WRITE_RECORD_SIZE_SIZE,numRecords,writeSize); - 1: 187: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_EXECUTION_ERROR); - 1: 188: return; - -: 189: } - -: 190: - -: 191: // reset buffer - 6: 192: buff.resetSer(); - -: 193: - -: 194: // serialize parameter id - -: 195: - 6: 196: serStat = buff.serialize(this->m_db[entry].id); - -: 197: // should always work - 6: 198: FW_ASSERT(Fw::FW_SERIALIZE_OK == serStat,(NATIVE_INT_TYPE)serStat); - -: 199: - -: 200: // write parameter ID - 6: 201: writeSize = buff.getBuffLength(); - 6: 202: stat = paramFile.write(buff.getBuffAddr(),writeSize,true); - 6: 203: if (stat != Os::File::OP_OK) { - 1: 204: this->unLock(); - 1: 205: this->log_WARNING_HI_PrmFileWriteError(PRM_WRITE_PARAMETER_ID,numRecords,stat); - 1: 206: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_EXECUTION_ERROR); - 1: 207: return; - -: 208: } - 5: 209: if (writeSize != (NATIVE_INT_TYPE)buff.getBuffLength()) { - 1: 210: this->unLock(); - 1: 211: this->log_WARNING_HI_PrmFileWriteError(PRM_WRITE_PARAMETER_ID_SIZE,numRecords,writeSize); - 1: 212: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_EXECUTION_ERROR); - 1: 213: return; - -: 214: } - -: 215: - -: 216: // write serialized parameter value - -: 217: - 4: 218: writeSize = this->m_db[entry].val.getBuffLength(); - 4: 219: stat = paramFile.write(this->m_db[entry].val.getBuffAddr(),writeSize,true); - 4: 220: if (stat != Os::File::OP_OK) { - 1: 221: this->unLock(); - 1: 222: this->log_WARNING_HI_PrmFileWriteError(PRM_WRITE_PARAMETER_VALUE,numRecords,stat); - 1: 223: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_EXECUTION_ERROR); - 1: 224: return; - -: 225: } - 3: 226: if (writeSize != (NATIVE_INT_TYPE)this->m_db[entry].val.getBuffLength()) { - 1: 227: this->unLock(); - 1: 228: this->log_WARNING_HI_PrmFileWriteError(PRM_WRITE_PARAMETER_VALUE_SIZE,numRecords,writeSize); - 1: 229: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_EXECUTION_ERROR); - 1: 230: return; - -: 231: } - 2: 232: numRecords++; - -: 233: } // end if record in use - -: 234: } // end for each record - -: 235: - 1: 236: this->unLock(); - 1: 237: this->log_ACTIVITY_HI_PrmFileSaveComplete(numRecords); - 2: 238: this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_OK); - -: 239: - -: 240: } - -: 241: - 6: 242: PrmDbImpl::~PrmDbImpl() { - 6: 243: } - -: 244: - 12: 245: void PrmDbImpl::readParamFile(void) { - -: 246: // load file. FIXME: Put more robust file checking, such as a CRC. - 12: 247: Os::File paramFile; - -: 248: - 12: 249: Os::File::Status stat = paramFile.open(this->m_fileName.toChar(),Os::File::OPEN_READ); - 12: 250: if (stat != Os::File::OP_OK) { - 1: 251: this->log_WARNING_HI_PrmFileReadError(PRM_READ_OPEN,0,stat); - 1: 252: return; - -: 253: } - -: 254: - 12: 255: WorkingBuffer buff; - -: 256: - 11: 257: U32 recordNum = 0; - -: 258: - 11: 259: this->clearDb(); - -: 260: - 26: 261: for (NATIVE_INT_TYPE entry = 0; entry < PRMDB_NUM_DB_ENTRIES; entry++) { - -: 262: - -: 263: U8 delimiter; - 13: 264: NATIVE_INT_TYPE readSize = sizeof(delimiter); - -: 265: - -: 266: // read delimiter - 13: 267: Os::File::Status fStat = paramFile.read(&delimiter,readSize,true); - -: 268: - -: 269: // check for end of file (read size 0) - 13: 270: if (0 == readSize) { - 1: 271: break; - -: 272: } - -: 273: - 12: 274: if (fStat != Os::File::OP_OK) { - 1: 275: this->log_WARNING_HI_PrmFileReadError(PRM_READ_DELIMITER,recordNum,fStat); - 11: 276: return; - -: 277: } - -: 278: - 11: 279: if (sizeof(delimiter) != readSize) { - 1: 280: this->log_WARNING_HI_PrmFileReadError(PRM_READ_DELIMITER_SIZE,recordNum,readSize); - 1: 281: return; - -: 282: } - -: 283: - 10: 284: if (PRMDB_ENTRY_DELIMITER != delimiter) { - 1: 285: this->log_WARNING_HI_PrmFileReadError(PRM_READ_DELIMITER_VALUE,recordNum,delimiter); - 1: 286: return; - -: 287: } - -: 288: - -: 289: U32 recordSize; - -: 290: // read record size - 9: 291: readSize = sizeof(recordSize); - -: 292: - 9: 293: fStat = paramFile.read(buff.getBuffAddr(),readSize,true); - 9: 294: if (fStat != Os::File::OP_OK) { - 1: 295: this->log_WARNING_HI_PrmFileReadError(PRM_READ_RECORD_SIZE,recordNum,fStat); - 1: 296: return; - -: 297: } - 8: 298: if (sizeof(recordSize) != readSize) { - 1: 299: this->log_WARNING_HI_PrmFileReadError(PRM_READ_RECORD_SIZE_SIZE,recordNum,readSize); - 1: 300: return; - -: 301: } - -: 302: // set serialized size to read size - 7: 303: Fw::SerializeStatus desStat = buff.setBuffLen(readSize); - -: 304: // should never fail - 7: 305: FW_ASSERT(Fw::FW_SERIALIZE_OK == desStat,(NATIVE_INT_TYPE)desStat); - -: 306: // reset deserialization - 7: 307: buff.resetDeser(); - -: 308: // deserialize, since record size is serialized in file - 7: 309: FW_ASSERT(Fw::FW_SERIALIZE_OK == buff.deserialize(recordSize)); - -: 310: - -: 311: // sanity check value. It can't be larger than the maximum parameter buffer size + id - -: 312: // or smaller than the record id - 7: 313: if ((recordSize > FW_PARAM_BUFFER_MAX_SIZE + sizeof(U32)) or (recordSize < sizeof(U32))) { - 1: 314: this->log_WARNING_HI_PrmFileReadError(PRM_READ_RECORD_SIZE_VALUE,recordNum,recordSize); - 1: 315: return; - -: 316: } - -: 317: - -: 318: // read the parameter ID - 6: 319: FwPrmIdType parameterId = 0; - 6: 320: readSize = sizeof(FwPrmIdType); - -: 321: - 6: 322: fStat = paramFile.read(buff.getBuffAddr(),readSize,true); - 6: 323: if (fStat != Os::File::OP_OK) { - 1: 324: this->log_WARNING_HI_PrmFileReadError(PRM_READ_PARAMETER_ID,recordNum,fStat); - 1: 325: return; - -: 326: } - 5: 327: if (sizeof(parameterId) != static_cast(readSize)) { - 1: 328: this->log_WARNING_HI_PrmFileReadError(PRM_READ_PARAMETER_ID_SIZE,recordNum,readSize); - 1: 329: return; - -: 330: } - -: 331: - -: 332: // set serialized size to read parameter ID - 4: 333: desStat = buff.setBuffLen(readSize); - -: 334: // should never fail - 4: 335: FW_ASSERT(Fw::FW_SERIALIZE_OK == desStat,(NATIVE_INT_TYPE)desStat); - -: 336: // reset deserialization - 4: 337: buff.resetDeser(); - -: 338: // deserialize, since parameter ID is serialized in file - 4: 339: FW_ASSERT(Fw::FW_SERIALIZE_OK == buff.deserialize(parameterId)); - -: 340: - -: 341: // copy parameter - 4: 342: this->m_db[entry].used = true; - 4: 343: this->m_db[entry].id = parameterId; - 4: 344: readSize = recordSize-sizeof(parameterId); - -: 345: - 4: 346: fStat = paramFile.read(this->m_db[entry].val.getBuffAddr(),readSize); - -: 347: - 4: 348: if (fStat != Os::File::OP_OK) { - 1: 349: this->log_WARNING_HI_PrmFileReadError(PRM_READ_PARAMETER_VALUE,recordNum,fStat); - 1: 350: return; - -: 351: } - 3: 352: if (static_cast(readSize) != recordSize-sizeof(parameterId)) { - 1: 353: this->log_WARNING_HI_PrmFileReadError(PRM_READ_PARAMETER_VALUE_SIZE,recordNum,readSize); - 1: 354: return; - -: 355: } - -: 356: - -: 357: // set serialized size to read size - 2: 358: desStat = this->m_db[entry].val.setBuffLen(readSize); - -: 359: // should never fail - 2: 360: FW_ASSERT(Fw::FW_SERIALIZE_OK == desStat,(NATIVE_INT_TYPE)desStat); - 2: 361: recordNum++; - -: 362: - -: 363: } - -: 364: - 2: 365: this->log_ACTIVITY_HI_PrmFileLoadComplete(recordNum); - -: 366: } - -: 367: - -: 368:} diff --git a/Svc/PrmDb/test/ut/output/SvcPrmDb_gcov.txt b/Svc/PrmDb/test/ut/output/SvcPrmDb_gcov.txt deleted file mode 100644 index 715bbfe3e4..0000000000 --- a/Svc/PrmDb/test/ut/output/SvcPrmDb_gcov.txt +++ /dev/null @@ -1,17 +0,0 @@ -File '/home/tcanham/source/isf/Svc/PrmDb/PrmDbImpl.cpp' -Lines executed:98.96% of 192 -Creating 'PrmDbImpl.cpp.gcov' - -File '/home/tcanham/source/isf/Fw/Types/EightyCharString.hpp' -Lines executed:100.00% of 1 -Creating 'EightyCharString.hpp.gcov' - -File '/home/tcanham/source/isf/Svc/PrmDb/PrmDbImpl.hpp' -Lines executed:100.00% of 1 -Creating 'PrmDbImpl.hpp.gcov' - -File '/home/tcanham/source/isf/Svc/PrmDb/PrmDbComponentAc.cpp' -Lines executed:88.21% of 458 -Creating 'PrmDbComponentAc.cpp.gcov' - -Lines executed:91.41% of 652 diff --git a/Svc/PrmDb/test/ut/output/test.txt b/Svc/PrmDb/test/ut/output/test.txt deleted file mode 100644 index f90407ff81..0000000000 --- a/Svc/PrmDb/test/ut/output/test.txt +++ /dev/null @@ -1,91 +0,0 @@ -Running test/ut/runtest_CYGWIN with output dir linux-cygwin-x86-ut-gnu-bin -test/ut/runtest_CYGWIN linux-cygwin-x86-ut-gnu-bin -Running /home/tcanham/source/isf/Svc/PrmDb/test/ut/linux-cygwin-x86-ut-gnu-bin/test_ut -[==========] Running 6 tests from 1 test case. -[----------] Global test environment set-up. -[----------] 6 tests from ParameterDbTest -[ RUN ] ParameterDbTest.NominalPopulateTest - -*************************************** -TESTCASE 105.1.1: Nominal populate test -*************************************** - -*************************************** -Write values to the parameter database and verify that they were written correctly -*************************************** - -*************************************** -(RQ) ISF-PDB-003 -*************************************** - -*************************************** -(RQ) ISF-PDB-002 -*************************************** -[ OK ] ParameterDbTest.NominalPopulateTest (4 ms) -[ RUN ] ParameterDbTest.NominalFileSaveTest - -*************************************** -TESTCASE 105.1.2: Nominal file save test -*************************************** - -*************************************** -Write values to the parameter database and save them to a file. -*************************************** - -*************************************** -(RQ) ISF-PDB-004 -*************************************** -[ OK ] ParameterDbTest.NominalFileSaveTest (3 ms) -[ RUN ] ParameterDbTest.NominalFileLoadTest - -*************************************** -TESTCASE 105.1.3: Nominal file load test -*************************************** - -*************************************** -Read values from the created file and verify they are correct. -*************************************** - -*************************************** -(RQ) ISF-PDB-001 -*************************************** -[ OK ] ParameterDbTest.NominalFileLoadTest (4 ms) -[ RUN ] ParameterDbTest.PrmMissingExtraParamsTest - -*************************************** -TESTCASE 105.2.1: Missing and too many parameters test -*************************************** - -*************************************** -Attempt to read a non-existent parameter and write too many parameters -*************************************** -[ OK ] ParameterDbTest.PrmMissingExtraParamsTest (3 ms) -[ RUN ] ParameterDbTest.PrmFileReadError - -*************************************** -TESTCASE 105.2.2: File read errors -*************************************** - -*************************************** -Induce errors at various stages of reading the file -*************************************** -[ OK ] ParameterDbTest.PrmFileReadError (4 ms) -[ RUN ] ParameterDbTest.PrmFileWriteError - -*************************************** -TESTCASE 105.2.3: File write errors -*************************************** - -*************************************** -Induce errors at various stages of writing the file -*************************************** -[ OK ] ParameterDbTest.PrmFileWriteError (11 ms) -[----------] 6 tests from ParameterDbTest (29 ms total) - -[----------] Global test environment tear-down -[==========] 6 tests from 1 test case ran. (29 ms total) -[ PASSED ] 6 tests. -make[1]: Leaving directory '/home/tcanham/source/isf/Svc/PrmDb' - -12:24:11 Build Finished (took 6s.295ms) - diff --git a/Svc/RateGroupDriver/docs/sdd.md b/Svc/RateGroupDriver/docs/sdd.md index 888364a5af..368475afba 100644 --- a/Svc/RateGroupDriver/docs/sdd.md +++ b/Svc/RateGroupDriver/docs/sdd.md @@ -87,9 +87,7 @@ Unit Test Checklist | [Link](Checklist_Unit_Test.xlsx) ## 6. Unit Testing -[Unit Test Output](../test/ut/output/test.txt) - -[Coverage Output - `RateGroupDriverImpl.cpp`](../test/ut/output/RateGroupDriverImpl.cpp.gcov) +To see unit test coverage run fprime-util check --coverage ## 7. Change Log diff --git a/Svc/RateGroupDriver/test/ut/output/RateGroupDriverComponentAc.cpp.gcov b/Svc/RateGroupDriver/test/ut/output/RateGroupDriverComponentAc.cpp.gcov deleted file mode 100644 index de63b94de1..0000000000 --- a/Svc/RateGroupDriver/test/ut/output/RateGroupDriverComponentAc.cpp.gcov +++ /dev/null @@ -1,116 +0,0 @@ - -: 0:Source:/home/tcanham/source/isf/Svc/RateGroupDriver/RateGroupDriverComponentAc.cpp - -: 0:Programs:4 - -: 1:#include - -: 2:#include - -: 3:#include - -: 4:#include - -: 5: - -: 6:#if FW_ENABLE_TEXT_LOGGING - -: 7:#include - -: 8:#endif - -: 9:// Namespace code - -: 10:namespace Svc { - -: 11: - -: 12:// public methods - -: 13: - 2: 14: Svc::InputCyclePort *RateGroupDriverComponentBase::get_CycleIn_InputPort(NATIVE_INT_TYPE portNum) { - 2: 15: FW_ASSERT(portNum < this->getNum_CycleIn_InputPorts()); - 2: 16: return &this->m_CycleIn_InputPort[portNum]; - -: 17: } - 6: 18: void RateGroupDriverComponentBase::set_CycleOut_OutputPort(NATIVE_INT_TYPE portNum, Svc::InputCyclePort* port) { - 6: 19: FW_ASSERT(portNum < this->getNum_CycleOut_OutputPorts()); - 6: 20: this->m_CycleOut_OutputPort[portNum].addCallPort(port); - 6: 21: } - -: 22: - -: 23:#if FW_PORT_SERIALIZATION - -: 24: - #####: 25: void RateGroupDriverComponentBase::set_CycleOut_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputSerializePort *port) { - #####: 26: FW_ASSERT(portNum < this->getNum_CycleOut_OutputPorts()); - #####: 27: return this->m_CycleOut_OutputPort[portNum].registerSerialPort(port); - -: 28: } - -: 29:#endif - -: 30: - -: 31: - -: 32: - -: 33:// protected methods - -: 34:#if FW_OBJECT_NAMES == 1 - 2: 35: RateGroupDriverComponentBase::RateGroupDriverComponentBase(const char* compName) : Fw::PassiveComponentBase(compName) { - -: 36:#else - -: 37: RateGroupDriverComponentBase::RateGroupDriverComponentBase() : Fw::PassiveComponentBase() { - -: 38:#endif - 2: 39:} - -: 40: - -: 41: - 2: 42: void RateGroupDriverComponentBase::init(NATIVE_INT_TYPE instance) { - -: 43: - -: 44: - -: 45: // initialize base class - 2: 46: Fw::PassiveComponentBase::init(instance); - -: 47: // Input ports attached to component here with external component interfaces - 4: 48: for (NATIVE_INT_TYPE port = 0; port < this->getNum_CycleIn_InputPorts(); port++) { - 2: 49: this->m_CycleIn_InputPort[port].init(); - -: 50: - 2: 51: this->m_CycleIn_InputPort[port].addCallComp(this, m_p_CycleIn_in); - -: 52: - 2: 53: this->m_CycleIn_InputPort[port].setPortNum(port); - -: 54:#if FW_OBJECT_NAMES == 1 - -: 55: char portName[80]; - 2: 56: (void)snprintf(portName, sizeof(portName), "%s_CycleIn_InputPort[%d]", this->m_objName, port); - 2: 57: this->m_CycleIn_InputPort[port].setObjName(portName); - -: 58:#endif - -: 59: } - -: 60: - -: 61: // Set output ports - 8: 62: for (NATIVE_INT_TYPE port = 0; port < this->getNum_CycleOut_OutputPorts(); port++) { - 6: 63: this->m_CycleOut_OutputPort[port].init(); - -: 64:#if FW_OBJECT_NAMES == 1 - -: 65: char portName[80]; - 6: 66: (void)snprintf(portName, sizeof(portName), "%s_CycleOut_OutputPort[%d]", this->m_objName, port); - 6: 67: this->m_CycleOut_OutputPort[port].setObjName(portName); - -: 68:#endif - -: 69: } - -: 70: - -: 71: - -: 72: - 2: 73: } - -: 74: - 2: 75: RateGroupDriverComponentBase::~RateGroupDriverComponentBase() { - 2: 76: } - -: 77: - -: 78: // Up-calls, calls for output ports - -: 79: - 220: 80: void RateGroupDriverComponentBase::CycleOut_out(NATIVE_INT_TYPE portNum, Svc::TimerVal cycle_start) { - 220: 81: FW_ASSERT(portNum < this->getNum_CycleOut_OutputPorts()); - 220: 82: m_CycleOut_OutputPort[portNum].invoke(cycle_start); - 220: 83: } - 126: 84: NATIVE_INT_TYPE RateGroupDriverComponentBase::getNum_CycleIn_InputPorts(void) { - 126: 85: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS(this->m_CycleIn_InputPort); - -: 86: } - 596: 87: NATIVE_INT_TYPE RateGroupDriverComponentBase::getNum_CycleOut_OutputPorts(void) { - 596: 88: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS(this->m_CycleOut_OutputPort); - -: 89: } - 360: 90: bool RateGroupDriverComponentBase::isConnected_CycleOut_OutputPort(NATIVE_INT_TYPE portNum) { - 360: 91: FW_ASSERT(portNum < this->getNum_CycleOut_OutputPorts(),portNum); - 360: 92: return this->m_CycleOut_OutputPort[portNum].isConnected(); - -: 93: } - -: 94: - -: 95:// private methods - -: 96: - -: 97: // call for incoming port CycleIn - 120: 98: void RateGroupDriverComponentBase::m_p_CycleIn_in(Fw::PassiveComponentBase* callComp, NATIVE_INT_TYPE portNum, Svc::TimerVal cycle_start) { - 120: 99: FW_ASSERT(callComp); - 120: 100: RateGroupDriverComponentBase* compPtr = (RateGroupDriverComponentBase*)callComp; - 120: 101: compPtr->CycleIn_handlerBase(portNum, cycle_start); - 120: 102: } - -: 103: - 120: 104: void RateGroupDriverComponentBase::CycleIn_handlerBase(NATIVE_INT_TYPE portNum, Svc::TimerVal cycle_start) { - -: 105: - -: 106: // make sure port number is valid - 120: 107: FW_ASSERT(portNum < this->getNum_CycleIn_InputPorts()); - -: 108: // Down call to pure virtual handler method implemented in Impl class - 120: 109: this->CycleIn_handler(portNum, cycle_start); - 120: 110: } - -: 111: - -: 112: - -: 113:} - -: 114: diff --git a/Svc/RateGroupDriver/test/ut/output/RateGroupDriverImpl.cpp.gcov b/Svc/RateGroupDriver/test/ut/output/RateGroupDriverImpl.cpp.gcov deleted file mode 100644 index 3e1cb0d035..0000000000 --- a/Svc/RateGroupDriver/test/ut/output/RateGroupDriverImpl.cpp.gcov +++ /dev/null @@ -1,71 +0,0 @@ - -: 0:Source:/home/tcanham/source/isf/Svc/RateGroupDriver/RateGroupDriverImpl.cpp - -: 0:Programs:4 - -: 1:#include - -: 2:#include - -: 3:#include - -: 4:#include - -: 5:#include - -: 6: - -: 7:namespace Svc { - -: 8: - -: 9:#if FW_OBJECT_NAMES == 1 - 2: 10: RateGroupDriverImpl::RateGroupDriverImpl(const char* compName, I32 dividers[], I32 numDividers) : - -: 11: RateGroupDriverComponentBase(compName), - -: 12:#else - -: 13: RateGroupDriverImpl::RateGroupDriverImpl(I32 dividers[], I32 numDividers) : - -: 14:#endif - 2: 15: m_ticks(0),m_rollover(1) - -: 16: { - -: 17: - -: 18: // double check arguments - 2: 19: FW_ASSERT(dividers); - 4: 20: FW_ASSERT(numDividers <= static_cast(FW_NUM_ARRAY_ELEMENTS(this->m_dividers)), - -: 21: numDividers, - 4: 22: static_cast(FW_NUM_ARRAY_ELEMENTS(this->m_dividers))); - -: 23: // verify port/table size matches - 4: 24: FW_ASSERT(FW_NUM_ARRAY_ELEMENTS(this->m_dividers) == this->getNum_CycleOut_OutputPorts(), - -: 25: static_cast(FW_NUM_ARRAY_ELEMENTS(this->m_dividers)), - 4: 26: this->getNum_CycleOut_OutputPorts()); - -: 27: // clear table - 2: 28: ::memset(this->m_dividers,0,sizeof(this->m_dividers)); - 8: 29: for (NATIVE_INT_TYPE entry = 0; entry < numDividers; entry++) { - 6: 30: this->m_dividers[entry] = dividers[entry]; - -: 31: // rollover value should be product of all dividers to make sure integer rollover doesn't jump cycles - -: 32: // only use non-zero dividers - 6: 33: if (dividers[entry] != 0) { - 6: 34: this->m_rollover *= dividers[entry]; - -: 35: } - -: 36: } - -: 37: - 2: 38: } - -: 39: - 2: 40: RateGroupDriverImpl::~RateGroupDriverImpl(void) { - -: 41: - 2: 42: } - -: 43: - 2: 44: void RateGroupDriverImpl::init(void) { - 2: 45: RateGroupDriverComponentBase::init(); - 2: 46: } - -: 47: - 120: 48: void RateGroupDriverImpl::CycleIn_handler(NATIVE_INT_TYPE portNum, Svc::TimerVal cycle_start) { - -: 49: - -: 50: // Loop through each divider. For a given port, the port will be called when the divider value - -: 51: // divides evenly into the number of ticks. For example, if the divider value for a port is 4, - -: 52: // it would be called every fourth invocation of the CycleIn port. - 480: 53: for (NATIVE_INT_TYPE entry = 0; entry < static_cast(FW_NUM_ARRAY_ELEMENTS(this->m_dividers)); entry++) { - 360: 54: if (this->m_dividers[entry] != 0) { - 360: 55: if (this->isConnected_CycleOut_OutputPort(entry)) { - 360: 56: if ((this->m_ticks % this->m_dividers[entry]) == 0) { - 220: 57: this->CycleOut_out(entry,cycle_start); - -: 58: } - -: 59: } - -: 60: } - -: 61: } - -: 62: - -: 63: // rollover the tick value when the tick count reaches the rollover value - -: 64: // the rollover value is the product of all the dividers. See comment in constructor. - 120: 65: this->m_ticks = (this->m_ticks + 1) % this->m_rollover; - -: 66: - 120: 67: } - -: 68: - -: 69:} diff --git a/Svc/RateGroupDriver/test/ut/output/SvcRateGroupDriver_gcov.txt b/Svc/RateGroupDriver/test/ut/output/SvcRateGroupDriver_gcov.txt deleted file mode 100644 index a4b8f9d1d6..0000000000 --- a/Svc/RateGroupDriver/test/ut/output/SvcRateGroupDriver_gcov.txt +++ /dev/null @@ -1,13 +0,0 @@ -File '/home/tcanham/source/isf/Svc/RateGroupDriver/RateGroupDriverImpl.cpp' -Lines executed:100.00% of 26 -Creating 'RateGroupDriverImpl.cpp.gcov' - -File '/home/tcanham/source/isf/Svc/Cycle/TimerVal.hpp' -Lines executed:0.00% of 1 -Creating 'TimerVal.hpp.gcov' - -File '/home/tcanham/source/isf/Svc/RateGroupDriver/RateGroupDriverComponentAc.cpp' -Lines executed:93.62% of 47 -Creating 'RateGroupDriverComponentAc.cpp.gcov' - -Lines executed:94.59% of 74 diff --git a/Svc/RateGroupDriver/test/ut/output/test.txt b/Svc/RateGroupDriver/test/ut/output/test.txt deleted file mode 100644 index 407285fd54..0000000000 --- a/Svc/RateGroupDriver/test/ut/output/test.txt +++ /dev/null @@ -1,31 +0,0 @@ -Running test/ut/runtest_CYGWIN with output dir linux-cygwin-x86-ut-gnu-bin -test/ut/runtest_CYGWIN linux-cygwin-x86-ut-gnu-bin -Running /home/tcanham/source/isf/Svc/RateGroupDriver/test/ut/linux-cygwin-x86-ut-gnu-bin/test_ut -[==========] Running 1 test from 1 test case. -[----------] Global test environment set-up. -[----------] 1 test from RateGroupDriverTest -[ RUN ] RateGroupDriverTest.NominalSchedule - -*************************************** -TESTCASE 106.1.1: Nominal Execution -*************************************** - -*************************************** -Call the port with enough ticks that the internal rollover value will roll over. -Verify that the output ports are being called correctly. - -*************************************** - -*************************************** -(RQ) ISF-RGD-001 -*************************************** -[ OK ] RateGroupDriverTest.NominalSchedule (0 ms) -[----------] 1 test from RateGroupDriverTest (0 ms total) - -[----------] Global test environment tear-down -[==========] 1 test from 1 test case ran. (1 ms total) -[ PASSED ] 1 test. -make[1]: Leaving directory '/home/tcanham/source/isf/Svc/RateGroupDriver' - -14:16:26 Build Finished (took 9s.806ms) - diff --git a/Svc/TlmChan/docs/sdd.md b/Svc/TlmChan/docs/sdd.md index a1960fe535..15dcd92b11 100644 --- a/Svc/TlmChan/docs/sdd.md +++ b/Svc/TlmChan/docs/sdd.md @@ -85,14 +85,7 @@ Unit Test Checklist | [Link](Checklist_Unit_Test.xlsx) ## 6. Unit Testing -File | Contents ----- | -------- -Unit Test Output | [Link](../test/ut/output/test.txt) -Coverage - TlmChanImpl.cpp | [Link](../test/ut/output/TlmChanImpl.cpp.gcov) -Coverage - TlmChanImplGet.cpp | [Link](../test/ut/output/TlmChanImplGet.cpp.gcov) -Coverage - TlmChanImplRecv.cpp | [Link](../test/ut/output/TlmChanImplRecv.cpp.gcov) -Coverage - TlmChanImplTask.cpp | [Link](../test/ut/output/TlmChanImplTask.cpp.gcov) -Coverage - TlmChanComponentAc.cpp | [Link](../test/ut/output/TlmChanComponentAc.cpp.gcov) +To see unit test coverage run fprime-util check --coverage ## 7. Change Log diff --git a/Svc/TlmChan/test/ut/output/SvcTlmChan_gcov.txt b/Svc/TlmChan/test/ut/output/SvcTlmChan_gcov.txt deleted file mode 100644 index 87075610ec..0000000000 --- a/Svc/TlmChan/test/ut/output/SvcTlmChan_gcov.txt +++ /dev/null @@ -1,25 +0,0 @@ -File '/home/tim/source/isf/Svc/TlmChan/TlmChanImpl.cpp' -Lines executed:100.00% of 24 -Creating 'TlmChanImpl.cpp.gcov' - -File '/home/tim/source/isf/Svc/TlmChan/TlmChanImpl.hpp' -Lines executed:100.00% of 2 -Creating 'TlmChanImpl.hpp.gcov' - -File '/home/tim/source/isf/Svc/TlmChan/TlmChanImplRecv.cpp' -Lines executed:100.00% of 28 -Creating 'TlmChanImplRecv.cpp.gcov' - -File '/home/tim/source/isf/Svc/TlmChan/TlmChanImplGet.cpp' -Lines executed:100.00% of 14 -Creating 'TlmChanImplGet.cpp.gcov' - -File '/home/tim/source/isf/Svc/TlmChan/TlmChanImplTask.cpp' -Lines executed:100.00% of 19 -Creating 'TlmChanImplTask.cpp.gcov' - -File '/home/tim/source/isf/Svc/TlmChan/TlmChanComponentAc.cpp' -Lines executed:96.60% of 147 -Creating 'TlmChanComponentAc.cpp.gcov' - -Lines executed:97.86% of 234 diff --git a/Svc/TlmChan/test/ut/output/TlmChanComponentAc.cpp.gcov b/Svc/TlmChan/test/ut/output/TlmChanComponentAc.cpp.gcov deleted file mode 100644 index bd4f28c2a1..0000000000 --- a/Svc/TlmChan/test/ut/output/TlmChanComponentAc.cpp.gcov +++ /dev/null @@ -1,589 +0,0 @@ - -: 0:Source:/home/tim/source/isf/Svc/TlmChan/TlmChanComponentAc.cpp - -: 0:Programs:5 - -: 1:// ====================================================================== - -: 2:// \title TlmChanComponentAc.hpp - -: 3:// \author Auto-generated - -: 4:// \brief cpp file for TlmChan component base class - -: 5:// - -: 6:// \copyright - -: 7:// Copyright 2009-2015, by the California Institute of Technology. - -: 8:// ALL RIGHTS RESERVED. United States Government Sponsorship - -: 9:// acknowledged. - -: 11:// - -: 18:// ====================================================================== - -: 19: - -: 20:#include - -: 21:#include - -: 22:#include - -: 23:#include - -: 24:#if FW_ENABLE_TEXT_LOGGING - -: 25:#include - -: 26:#endif - -: 27: - -: 28: - -: 29:namespace Svc { - -: 30: - -: 31: // ---------------------------------------------------------------------- - -: 32: // Anonymous namespace to prevent name collisions - -: 33: // ---------------------------------------------------------------------- - -: 34: - -: 35: namespace { - -: 36: - -: 37: typedef enum { - -: 38: TLMCHAN_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT, - -: 39: RUN_SCHED - -: 40: } MsgTypeEnum; - -: 41: - -: 42: // Get the max size by doing a union of the input port serialization sizes. - -: 43: - -: 44: typedef union { - -: 45: BYTE port1[Svc::InputSchedPort::SERIALIZED_SIZE]; - -: 46: } BuffUnion; - -: 47: - -: 48: // Define a message buffer class large enough to handle all the - -: 49: // asynchronous inputs to the component - -: 50: - 12: 51: class ComponentIpcSerializableBuffer : - -: 52: public Fw::SerializeBufferBase - -: 53: { - -: 54: - -: 55: public: - -: 56: - -: 57: enum { - -: 58: // Max. message size = size of data + message id + port - -: 59: SERIALIZATION_SIZE = - -: 60: sizeof(BuffUnion) + - -: 61: sizeof(NATIVE_INT_TYPE) + - -: 62: sizeof(NATIVE_INT_TYPE) - -: 63: }; - -: 64: - 15: 65: NATIVE_UINT_TYPE getBuffCapacity(void) const { - 15: 66: return sizeof(m_buff); - -: 67: } - -: 68: - 93: 69: U8* getBuffAddr(void) { - 93: 70: return m_buff; - -: 71: } - -: 72: - 3: 73: const U8* getBuffAddr(void) const { - 3: 74: return m_buff; - -: 75: } - -: 76: - -: 77: private: - -: 78: // Should be the max of all the input ports serialized sizes... - -: 79: U8 m_buff[SERIALIZATION_SIZE]; - -: 80: - -: 81: }; - -: 82: - -: 83: } - -: 84: - -: 85: // ---------------------------------------------------------------------- - -: 86: // Getters for numbers of input ports - -: 87: // ---------------------------------------------------------------------- - -: 88: - 4: 89: Fw::InputTlmPort *TlmChanComponentBase :: - -: 90: get_TlmRecv_InputPort(NATIVE_INT_TYPE portNum) - -: 91: { - 4: 92: FW_ASSERT(portNum < this->getNum_TlmRecv_InputPorts(),static_cast(portNum)); - 4: 93: return &this->m_TlmRecv_InputPort[portNum]; - -: 94: } - -: 95: - 4: 96: Fw::InputTlmPort *TlmChanComponentBase :: - -: 97: get_TlmGet_InputPort(NATIVE_INT_TYPE portNum) - -: 98: { - 4: 99: FW_ASSERT(portNum < this->getNum_TlmGet_InputPorts(),static_cast(portNum)); - 4: 100: return &this->m_TlmGet_InputPort[portNum]; - -: 101: } - -: 102: - 4: 103: Svc::InputSchedPort *TlmChanComponentBase :: - -: 104: get_Run_InputPort(NATIVE_INT_TYPE portNum) - -: 105: { - 4: 106: FW_ASSERT(portNum < this->getNum_Run_InputPorts(),static_cast(portNum)); - 4: 107: return &this->m_Run_InputPort[portNum]; - -: 108: } - -: 109: - -: 110: // ---------------------------------------------------------------------- - -: 111: // Typed connectors for output ports - -: 112: // ---------------------------------------------------------------------- - -: 113: - 4: 114: void TlmChanComponentBase :: - -: 115: set_PktSend_OutputPort( - -: 116: NATIVE_INT_TYPE portNum, - -: 117: Fw::InputComPort* port - -: 118: ) - -: 119: { - 4: 120: FW_ASSERT(portNum < this->getNum_PktSend_OutputPorts(),static_cast(portNum)); - 4: 121: this->m_PktSend_OutputPort[portNum].addCallPort(port); - 4: 122: } - -: 123: - -: 124: // ---------------------------------------------------------------------- - -: 125: // Serialization connectors for output ports - -: 126: // ---------------------------------------------------------------------- - -: 127: - -: 128:#if FW_PORT_SERIALIZATION - -: 129: - #####: 130: void TlmChanComponentBase :: - -: 131: set_PktSend_OutputPort( - -: 132: NATIVE_INT_TYPE portNum, - -: 133: Fw::InputSerializePort *port - -: 134: ) - -: 135: { - #####: 136: FW_ASSERT(portNum < this->getNum_PktSend_OutputPorts(),static_cast(portNum)); - #####: 137: return this->m_PktSend_OutputPort[portNum].registerSerialPort(port); - -: 138: } - -: 139: - -: 140:#endif - -: 141: - -: 142: // ---------------------------------------------------------------------- - -: 143: // Component construction, initialization, and destruction - -: 144: // ---------------------------------------------------------------------- - -: 145: - 4: 146: TlmChanComponentBase :: - -: 147:#if FW_OBJECT_NAMES == 1 - -: 148: TlmChanComponentBase(const char* compName) : - 4: 149: Fw::ActiveComponentBase(compName) - -: 150:#else - -: 151: TlmChanComponentBase() : - -: 152: Fw::ActiveComponentBase() - -: 153:#endif - -: 154: { - -: 155: - 4: 156: } - -: 157: - 4: 158: void TlmChanComponentBase :: - -: 159: init( - -: 160: NATIVE_INT_TYPE queueDepth, - -: 161: NATIVE_INT_TYPE instance - -: 162: ) - -: 163: { - -: 164: - -: 165: // Initialize base class - 4: 166: Fw::ActiveComponentBase::init(instance); - -: 167: - -: 168: // Connect input port TlmRecv - 16: 169: for ( - 4: 170: NATIVE_INT_TYPE port = 0; - 8: 171: port < this->getNum_TlmRecv_InputPorts(); - -: 172: port++ - -: 173: ) { - -: 174: - 4: 175: this->m_TlmRecv_InputPort[port].init(); - -: 176: this->m_TlmRecv_InputPort[port].addCallComp( - -: 177: this, - -: 178: m_p_TlmRecv_in - 4: 179: ); - 4: 180: this->m_TlmRecv_InputPort[port].setPortNum(port); - -: 181: - -: 182:#if FW_OBJECT_NAMES == 1 - -: 183: char portName[80]; - -: 184: (void) snprintf( - -: 185: portName, - -: 186: sizeof(portName), - -: 187: "%s_TlmRecv_InputPort[%d]", - -: 188: this->m_objName, - -: 189: port - 4: 190: ); - 4: 191: this->m_TlmRecv_InputPort[port].setObjName(portName); - -: 192:#endif - -: 193: - -: 194: } - -: 195: - -: 196: // Connect input port TlmGet - 16: 197: for ( - 4: 198: NATIVE_INT_TYPE port = 0; - 8: 199: port < this->getNum_TlmGet_InputPorts(); - -: 200: port++ - -: 201: ) { - -: 202: - 4: 203: this->m_TlmGet_InputPort[port].init(); - -: 204: this->m_TlmGet_InputPort[port].addCallComp( - -: 205: this, - -: 206: m_p_TlmGet_in - 4: 207: ); - 4: 208: this->m_TlmGet_InputPort[port].setPortNum(port); - -: 209: - -: 210:#if FW_OBJECT_NAMES == 1 - -: 211: char portName[80]; - -: 212: (void) snprintf( - -: 213: portName, - -: 214: sizeof(portName), - -: 215: "%s_TlmGet_InputPort[%d]", - -: 216: this->m_objName, - -: 217: port - 4: 218: ); - 4: 219: this->m_TlmGet_InputPort[port].setObjName(portName); - -: 220:#endif - -: 221: - -: 222: } - -: 223: - -: 224: // Connect input port Run - 16: 225: for ( - 4: 226: NATIVE_INT_TYPE port = 0; - 8: 227: port < this->getNum_Run_InputPorts(); - -: 228: port++ - -: 229: ) { - -: 230: - 4: 231: this->m_Run_InputPort[port].init(); - -: 232: this->m_Run_InputPort[port].addCallComp( - -: 233: this, - -: 234: m_p_Run_in - 4: 235: ); - 4: 236: this->m_Run_InputPort[port].setPortNum(port); - -: 237: - -: 238:#if FW_OBJECT_NAMES == 1 - -: 239: char portName[80]; - -: 240: (void) snprintf( - -: 241: portName, - -: 242: sizeof(portName), - -: 243: "%s_Run_InputPort[%d]", - -: 244: this->m_objName, - -: 245: port - 4: 246: ); - 4: 247: this->m_Run_InputPort[port].setObjName(portName); - -: 248:#endif - -: 249: - -: 250: } - -: 251: - -: 252: // Initialize output port PktSend - 16: 253: for ( - 4: 254: NATIVE_INT_TYPE port = 0; - 8: 255: port < this->getNum_PktSend_OutputPorts(); - -: 256: port++ - -: 257: ) { - 4: 258: this->m_PktSend_OutputPort[port].init(); - -: 259: - -: 260:#if FW_OBJECT_NAMES == 1 - -: 261: char portName[80]; - -: 262: (void) snprintf( - -: 263: portName, - -: 264: sizeof(portName), - -: 265: "%s_PktSend_OutputPort[%d]", - -: 266: this->m_objName, - -: 267: port - 4: 268: ); - 4: 269: this->m_PktSend_OutputPort[port].setObjName(portName); - -: 270:#endif - -: 271: - -: 272: } - -: 273: - -: 274: Os::Queue::QueueStatus qStat = - -: 275: this->createQueue( - -: 276: queueDepth, - -: 277: ComponentIpcSerializableBuffer::SERIALIZATION_SIZE - 4: 278: ); - -: 279: FW_ASSERT( - -: 280: Os::Queue::QUEUE_OK == qStat, - -: 281: static_cast(qStat) - 4: 282: ); - -: 283: - 4: 284: } - -: 285: - 4: 286: TlmChanComponentBase:: - 4: 287: ~TlmChanComponentBase() { - -: 288: - 4: 289: } - -: 290: - -: 291: // ---------------------------------------------------------------------- - -: 292: // Invocation functions for output ports - -: 293: // ---------------------------------------------------------------------- - -: 294: - 23: 295: void TlmChanComponentBase :: - -: 296: PktSend_out( - -: 297: NATIVE_INT_TYPE portNum, - -: 298: Fw::ComBuffer &data, U32 context - -: 299: ) - -: 300: { - 23: 301: FW_ASSERT(portNum < this->getNum_PktSend_OutputPorts(),static_cast(portNum)); - 23: 302: m_PktSend_OutputPort[portNum].invoke(data, context); - 23: 303: } - -: 304: - -: 305: // ---------------------------------------------------------------------- - -: 306: // Getters for numbers of ports - -: 307: // ---------------------------------------------------------------------- - -: 308: - 86: 309: NATIVE_INT_TYPE TlmChanComponentBase :: - -: 310: getNum_TlmRecv_InputPorts(void) - -: 311: { - 86: 312: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 313: this->m_TlmRecv_InputPort - -: 314: ); - -: 315: } - -: 316: - 87: 317: NATIVE_INT_TYPE TlmChanComponentBase :: - -: 318: getNum_TlmGet_InputPorts(void) - -: 319: { - 87: 320: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 321: this->m_TlmGet_InputPort - -: 322: ); - -: 323: } - -: 324: - 15: 325: NATIVE_INT_TYPE TlmChanComponentBase :: - -: 326: getNum_Run_InputPorts(void) - -: 327: { - 15: 328: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 329: this->m_Run_InputPort - -: 330: ); - -: 331: } - -: 332: - 38: 333: NATIVE_INT_TYPE TlmChanComponentBase :: - -: 334: getNum_PktSend_OutputPorts(void) - -: 335: { - 38: 336: return (NATIVE_INT_TYPE) FW_NUM_ARRAY_ELEMENTS( - -: 337: this->m_PktSend_OutputPort - -: 338: ); - -: 339: } - -: 340: - -: 341: // ---------------------------------------------------------------------- - -: 342: // Port connection status queries - -: 343: // ---------------------------------------------------------------------- - -: 344: - 3: 345: bool TlmChanComponentBase :: - -: 346: isConnected_PktSend_OutputPort(NATIVE_INT_TYPE portNum) - -: 347: { - 3: 348: FW_ASSERT( - -: 349: portNum < this->getNum_PktSend_OutputPorts(), - -: 350: static_cast(portNum) - 3: 351: ); - 3: 352: return this->m_PktSend_OutputPort[portNum].isConnected(); - -: 353: } - -: 354: - -: 355: // ---------------------------------------------------------------------- - -: 356: // Mutex functions for guarded ports - -: 357: // ---------------------------------------------------------------------- - -: 358: - 152: 359: void TlmChanComponentBase :: - -: 360: lock(void) - -: 361: { - 152: 362: this->m_guardedPortMutex.lock(); - 152: 363: } - -: 364: - 152: 365: void TlmChanComponentBase :: - -: 366: unLock(void) - -: 367: { - 152: 368: this->m_guardedPortMutex.unLock(); - 152: 369: } - -: 370: - -: 371: // ---------------------------------------------------------------------- - -: 372: // Calls for messages received on typed input ports - -: 373: // ---------------------------------------------------------------------- - -: 374: - 74: 375: void TlmChanComponentBase :: - -: 376: m_p_TlmRecv_in( - -: 377: Fw::PassiveComponentBase* callComp, - -: 378: NATIVE_INT_TYPE portNum, - -: 379: FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val - -: 380: ) - -: 381: { - 74: 382: FW_ASSERT(callComp); - -: 383: TlmChanComponentBase* compPtr = - 74: 384: (TlmChanComponentBase*) callComp; - 74: 385: compPtr->TlmRecv_handlerBase(portNum, id, timeTag, val); - 74: 386: } - -: 387: - 75: 388: void TlmChanComponentBase :: - -: 389: m_p_TlmGet_in( - -: 390: Fw::PassiveComponentBase* callComp, - -: 391: NATIVE_INT_TYPE portNum, - -: 392: FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val - -: 393: ) - -: 394: { - 75: 395: FW_ASSERT(callComp); - -: 396: TlmChanComponentBase* compPtr = - 75: 397: (TlmChanComponentBase*) callComp; - 75: 398: compPtr->TlmGet_handlerBase(portNum, id, timeTag, val); - 75: 399: } - -: 400: - 3: 401: void TlmChanComponentBase :: - -: 402: m_p_Run_in( - -: 403: Fw::PassiveComponentBase* callComp, - -: 404: NATIVE_INT_TYPE portNum, - -: 405: NATIVE_UINT_TYPE context - -: 406: ) - -: 407: { - 3: 408: FW_ASSERT(callComp); - -: 409: TlmChanComponentBase* compPtr = - 3: 410: (TlmChanComponentBase*) callComp; - 3: 411: compPtr->Run_handlerBase(portNum, context); - 3: 412: } - -: 413: - -: 414: // ---------------------------------------------------------------------- - -: 415: // Port handler base-class functions for typed input ports - -: 416: // ---------------------------------------------------------------------- - -: 417: - 74: 418: void TlmChanComponentBase :: - -: 419: TlmRecv_handlerBase( - -: 420: NATIVE_INT_TYPE portNum, - -: 421: FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val - -: 422: ) - -: 423: { - -: 424: - -: 425: // Make sure port number is valid - 74: 426: FW_ASSERT(portNum < this->getNum_TlmRecv_InputPorts(),static_cast(portNum)); - -: 427: - -: 428: // Lock guard mutex before calling - 74: 429: this->lock(); - -: 430: - -: 431: // Down call to pure virtual handler method implemented in Impl class - 74: 432: this->TlmRecv_handler(portNum, id, timeTag, val); - -: 433: - -: 434: // Unlock guard mutex - 74: 435: this->unLock(); - -: 436: - 74: 437: } - -: 438: - 75: 439: void TlmChanComponentBase :: - -: 440: TlmGet_handlerBase( - -: 441: NATIVE_INT_TYPE portNum, - -: 442: FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val - -: 443: ) - -: 444: { - -: 445: - -: 446: // Make sure port number is valid - 75: 447: FW_ASSERT(portNum < this->getNum_TlmGet_InputPorts(),static_cast(portNum)); - -: 448: - -: 449: // Lock guard mutex before calling - 75: 450: this->lock(); - -: 451: - -: 452: // Down call to pure virtual handler method implemented in Impl class - 75: 453: this->TlmGet_handler(portNum, id, timeTag, val); - -: 454: - -: 455: // Unlock guard mutex - 75: 456: this->unLock(); - -: 457: - 75: 458: } - -: 459: - 3: 460: void TlmChanComponentBase :: - -: 461: Run_handlerBase( - -: 462: NATIVE_INT_TYPE portNum, - -: 463: NATIVE_UINT_TYPE context - -: 464: ) - -: 465: { - -: 466: - -: 467: // Make sure port number is valid - 3: 468: FW_ASSERT(portNum < this->getNum_Run_InputPorts(),static_cast(portNum)); - -: 469: - -: 470: // Call pre-message hook - -: 471: Run_preMsgHook( - -: 472: portNum, - -: 473: context - 3: 474: ); - -: 475: - 3: 476: ComponentIpcSerializableBuffer msg; - -: 477: Fw::SerializeStatus _status; - -: 478: - -: 479: _status = msg.serialize( - -: 480: static_cast(RUN_SCHED) - 3: 481: ); - -: 482: FW_ASSERT ( - -: 483: _status == Fw::FW_SERIALIZE_OK, - -: 484: static_cast(_status) - 3: 485: ); - -: 486: - 3: 487: _status = msg.serialize(portNum); - -: 488: FW_ASSERT ( - -: 489: _status == Fw::FW_SERIALIZE_OK, - -: 490: static_cast(_status) - 3: 491: ); - -: 492: - -: 493: // Serialize argument context - 3: 494: _status = msg.serialize(context); - -: 495: FW_ASSERT( - -: 496: _status == Fw::FW_SERIALIZE_OK, - -: 497: static_cast(_status) - 3: 498: ); - -: 499: - -: 500: Os::Queue::QueueStatus qStatus = - 3: 501: this->m_queue.send(msg, 0); - -: 502: FW_ASSERT( - -: 503: qStatus == Os::Queue::QUEUE_OK, - -: 504: static_cast(qStatus) - 3: 505: ); - 3: 506: } - -: 507: - -: 508: // ---------------------------------------------------------------------- - -: 509: // Pre-message hooks for async input ports - -: 510: // ---------------------------------------------------------------------- - -: 511: - 3: 512: void TlmChanComponentBase :: - -: 513: Run_preMsgHook( - -: 514: NATIVE_INT_TYPE portNum, - -: 515: NATIVE_UINT_TYPE context - -: 516: ) - -: 517: { - -: 518: // Default: no-op - 3: 519: } - -: 520: - -: 521: // ---------------------------------------------------------------------- - -: 522: // Message dispatch method for active and queued components. Called - -: 523: // by active component thread or implementation code for queued components - -: 524: // ---------------------------------------------------------------------- - -: 525: - 3: 526: Fw::QueuedComponentBase::MsgDispatchStatus TlmChanComponentBase :: - -: 527: doDispatch(void) - -: 528: { - -: 529: - 3: 530: ComponentIpcSerializableBuffer msg; - -: 531: NATIVE_INT_TYPE priority; - -: 532: - 3: 533: Os::Queue::QueueStatus msgStatus = this->m_queue.receive(msg,priority); - -: 534: FW_ASSERT( - -: 535: msgStatus == Os::Queue::QUEUE_OK, - -: 536: static_cast(msgStatus) - 3: 537: ); - -: 538: - -: 539: // Reset to beginning of buffer - 3: 540: msg.resetDeser(); - -: 541: - -: 542: NATIVE_INT_TYPE desMsg; - 3: 543: Fw::SerializeStatus deserStatus = msg.deserialize(desMsg); - -: 544: FW_ASSERT( - -: 545: deserStatus == Fw::FW_SERIALIZE_OK, - -: 546: static_cast(deserStatus) - 3: 547: ); - -: 548: - 3: 549: MsgTypeEnum msgType = static_cast(desMsg); - -: 550: - 3: 551: if (msgType == TLMCHAN_COMPONENT_EXIT) { - #####: 552: return MSG_DISPATCH_EXIT; - -: 553: } - -: 554: - -: 555: NATIVE_INT_TYPE portNum; - 3: 556: deserStatus = msg.deserialize(portNum); - -: 557: FW_ASSERT( - -: 558: deserStatus == Fw::FW_SERIALIZE_OK, - -: 559: static_cast(deserStatus) - 3: 560: ); - -: 561: - 3: 562: switch (msgType) { - -: 563: - -: 564: // Handle async input port Run - -: 565: case RUN_SCHED: { - -: 566: - -: 567: // Deserialize argument context - -: 568: NATIVE_UINT_TYPE context; - 3: 569: deserStatus = msg.deserialize(context); - -: 570: FW_ASSERT( - -: 571: deserStatus == Fw::FW_SERIALIZE_OK, - -: 572: static_cast(deserStatus) - 3: 573: ); - -: 574: - -: 575: // Call handler function - -: 576: this->Run_handler( - -: 577: portNum, - -: 578: context - 3: 579: ); - -: 580: - 3: 581: break; - -: 582: - -: 583: } - -: 584: - -: 585: default: - #####: 586: return MSG_DISPATCH_ERROR; - -: 587: - -: 588: } - -: 589: - 6: 590: return MSG_DISPATCH_OK; - -: 591: - -: 592: } - -: 593: - -: 594:} // end namespace Svc diff --git a/Svc/TlmChan/test/ut/output/TlmChanImpl.cpp.gcov b/Svc/TlmChan/test/ut/output/TlmChanImpl.cpp.gcov deleted file mode 100644 index 0de692db27..0000000000 --- a/Svc/TlmChan/test/ut/output/TlmChanImpl.cpp.gcov +++ /dev/null @@ -1,66 +0,0 @@ - -: 0:Source:/home/tim/source/isf/Svc/TlmChan/TlmChanImpl.cpp - -: 0:Programs:5 - -: 1:/** - -: 2: * \file - -: 3: * \author T. Canham - -: 4: * \brief Implementation file for channelized telemetry storage component - -: 5: * - -: 6: * \copyright - -: 7: * Copyright 2009-2015, by the California Institute of Technology. - -: 8: * ALL RIGHTS RESERVED. United States Government Sponsorship - -: 9: * acknowledged. - -: 11: *

- -: 18: */ - -: 19:#include - -: 20:#include - -: 21:#include - -: 22:#include - -: 23:#include - -: 24: - -: 25:#include - -: 26: - -: 27:namespace Svc { - -: 28: - -: 29:#if FW_OBJECT_NAMES == 1 - 4: 30: TlmChanImpl::TlmChanImpl(const char* name) : TlmChanComponentBase(name) - -: 31:#else - -: 32: TlmChanImpl::TlmChanImpl() - -: 33:#endif - -: 34: { - -: 35: // clear data - 4: 36: this->m_activeBuffer = 0; - -: 37: // clear slot pointers - 64: 38: for (NATIVE_UINT_TYPE entry = 0; entry < TLMCHAN_NUM_TLM_HASH_SLOTS; entry++) { - 60: 39: this->m_tlmEntries[0].slots[entry] = 0; - 60: 40: this->m_tlmEntries[1].slots[entry] = 0; - -: 41: } - -: 42: // clear buckets - 204: 43: for (NATIVE_UINT_TYPE entry = 0; entry < TLMCHAN_HASH_BUCKETS; entry++) { - 200: 44: this->m_tlmEntries[0].buckets[entry].used = false; - 200: 45: this->m_tlmEntries[0].buckets[entry].bucketNo = entry; - 200: 46: this->m_tlmEntries[0].buckets[entry].next = 0; - 200: 47: this->m_tlmEntries[0].buckets[entry].id = 0; - 200: 48: this->m_tlmEntries[1].buckets[entry].used = false; - 200: 49: this->m_tlmEntries[1].buckets[entry].bucketNo = entry; - 200: 50: this->m_tlmEntries[1].buckets[entry].next = 0; - 200: 51: this->m_tlmEntries[1].buckets[entry].id = 0; - -: 52: } - -: 53: // clear free index - 4: 54: this->m_tlmEntries[0].free = 0; - 4: 55: this->m_tlmEntries[1].free = 0; - -: 56: - -: 57: - 4: 58: } - -: 59: - 4: 60: TlmChanImpl::~TlmChanImpl() { - 4: 61: } - -: 62: - 4: 63: void TlmChanImpl::init(NATIVE_INT_TYPE queueDepth) { - 4: 64: TlmChanComponentBase::init(queueDepth); - 4: 65: } - -: 66: - 149: 67: NATIVE_UINT_TYPE TlmChanImpl::doHash(FwChanIdType id) { - 149: 68: return (id % TLMCHAN_HASH_MOD_VALUE)%TLMCHAN_NUM_TLM_HASH_SLOTS; - -: 69: } - -: 70: - -: 71:} diff --git a/Svc/TlmChan/test/ut/output/TlmChanImpl.hpp.gcov b/Svc/TlmChan/test/ut/output/TlmChanImpl.hpp.gcov deleted file mode 100644 index d8189a3823..0000000000 --- a/Svc/TlmChan/test/ut/output/TlmChanImpl.hpp.gcov +++ /dev/null @@ -1,73 +0,0 @@ - -: 0:Source:/home/tim/source/isf/Svc/TlmChan/TlmChanImpl.hpp - -: 0:Programs:5 - -: 1:/** - -: 2: * \file - -: 3: * \author T. Canham - -: 4: * \brief Component that stores telemetry channel values - -: 5: * - -: 6: * \copyright - -: 7: * Copyright 2009-2015, by the California Institute of Technology. - -: 8: * ALL RIGHTS RESERVED. United States Government Sponsorship - -: 9: * acknowledged. - -: 11: *

- -: 18: */ - -: 19: - -: 20:#ifndef TELEMCHANIMPL_HPP_ - -: 21:#define TELEMCHANIMPL_HPP_ - -: 22: - -: 23:#include - -: 24:#include - -: 25:#include - -: 26:#include - -: 27: - -: 28:namespace Svc { - -: 29: - -: 30: class TlmChanImpl: public TlmChanComponentBase { - -: 31: public: - -: 32: friend class TlmChanImplTester; - -: 33: #if FW_OBJECT_NAMES == 1 - -: 34: TlmChanImpl(const char* compName); - -: 35: #else - -: 36: TlmChanImpl(); - -: 37: #endif - -: 38: virtual ~TlmChanImpl(); - -: 39: void init(NATIVE_INT_TYPE queueDepth); - -: 40: PROTECTED: - -: 41: - -: 42: // can be overridden for alternate algorithms - -: 43: virtual NATIVE_UINT_TYPE doHash(FwChanIdType id); - -: 44: - -: 45: PRIVATE: - -: 46: - -: 47: // Port functions - -: 48: void TlmRecv_handler(NATIVE_INT_TYPE portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val); - -: 49: void TlmGet_handler(NATIVE_INT_TYPE portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val); - -: 50: void Run_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context); - -: 51: - 800: 52: typedef struct tlmEntry { - -: 53: FwChanIdType id; //!< telemetry id stored in slot - -: 54: bool updated; //!< set whenever a value has been written. Used to skip if writing out values for downlinking - -: 55: Fw::Time lastUpdate; //!< last updated time - -: 56: Fw::TlmBuffer buffer; //!< buffer to store serialized telemetry - -: 57: tlmEntry* next; //!< pointer to next bucket in table - -: 58: bool used; //!< if entry has been used - -: 59: NATIVE_UINT_TYPE bucketNo; //!< for testing - -: 60: } TlmEntry; - -: 61: - 16: 62: struct TlmSet { - -: 63: TlmEntry* slots[TLMCHAN_NUM_TLM_HASH_SLOTS]; //!< set of hash slots in hash table - -: 64: TlmEntry buckets[TLMCHAN_HASH_BUCKETS]; //!< set of buckets used in hash table - -: 65: NATIVE_INT_TYPE free; //!< next free bucket - -: 66: } m_tlmEntries[2]; - -: 67: - -: 68: U32 m_activeBuffer; // !< which buffer is active for storing telemetry - -: 69: - -: 70: // work variables - -: 71: Fw::ComBuffer m_comBuffer; - -: 72: Fw::TlmPacket m_tlmPacket; - -: 73: - -: 74: }; - -: 75: - -: 76:} - -: 77: - -: 78:#endif /* TELEMCHANIMPL_HPP_ */ diff --git a/Svc/TlmChan/test/ut/output/TlmChanImplGet.cpp.gcov b/Svc/TlmChan/test/ut/output/TlmChanImplGet.cpp.gcov deleted file mode 100644 index b58a9bdc31..0000000000 --- a/Svc/TlmChan/test/ut/output/TlmChanImplGet.cpp.gcov +++ /dev/null @@ -1,47 +0,0 @@ - -: 0:Source:/home/tim/source/isf/Svc/TlmChan/TlmChanImplGet.cpp - -: 0:Programs:5 - -: 1:/* - -: 2: * TelemChanImpl.cpp - -: 3: * - -: 4: * Created on: Mar 28, 2014 - -: 5: * Author: tcanham - -: 6: */ - -: 7: - -: 8:#include - -: 9:#include - -: 10:#include - -: 11:#include - -: 12: - -: 13:#include - -: 14: - -: 15:namespace Svc { - -: 16: - 75: 17: void TlmChanImpl::TlmGet_handler(NATIVE_INT_TYPE portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) { - -: 18: - -: 19: // Compute index for entry - -: 20: - 75: 21: NATIVE_UINT_TYPE index = this->doHash(id); - -: 22: - -: 23: // Search to see if channel has been stored - 75: 24: TlmEntry *entryToUse = this->m_tlmEntries[this->m_activeBuffer].slots[index]; - 141: 25: for (NATIVE_UINT_TYPE bucket = 0; bucket < TLMCHAN_HASH_BUCKETS; bucket++) { - 141: 26: if (entryToUse) { // If bucket exists, check id - 140: 27: if (entryToUse->id == id) { - 74: 28: break; - -: 29: } else { // otherwise go to next bucket - 66: 30: entryToUse = entryToUse->next; - -: 31: } - -: 32: } else { // no buckets left to search - 1: 33: break; - -: 34: } - -: 35: } - -: 36: - 75: 37: if (entryToUse) { - 74: 38: val = entryToUse->buffer; - 74: 39: timeTag = entryToUse->lastUpdate; - -: 40: } else { // requested entry may not be written yet; empty buffer - 1: 41: val.resetSer(); - -: 42: } - -: 43: - 75: 44: } - -: 45:} diff --git a/Svc/TlmChan/test/ut/output/TlmChanImplRecv.cpp.gcov b/Svc/TlmChan/test/ut/output/TlmChanImplRecv.cpp.gcov deleted file mode 100644 index e26b5579be..0000000000 --- a/Svc/TlmChan/test/ut/output/TlmChanImplRecv.cpp.gcov +++ /dev/null @@ -1,67 +0,0 @@ - -: 0:Source:/home/tim/source/isf/Svc/TlmChan/TlmChanImplRecv.cpp - -: 0:Programs:5 - -: 1:/* - -: 2: * TelemChanImpl.cpp - -: 3: * - -: 4: * Created on: Mar 28, 2014 - -: 5: * Author: tcanham - -: 6: */ - -: 7: - -: 8:#include - -: 9:#include - -: 10:#include - -: 11:#include - -: 12: - -: 13:#include - -: 14: - -: 15:namespace Svc { - -: 16: - 74: 17: void TlmChanImpl::TlmRecv_handler(NATIVE_INT_TYPE portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) { - -: 18: - -: 19: // Compute index for entry - -: 20: - 74: 21: NATIVE_UINT_TYPE index = this->doHash(id); - 74: 22: TlmEntry* entryToUse = 0; - 74: 23: TlmEntry* prevEntry = 0; - -: 24: - -: 25: // Search to see if channel has already been stored or a bucket needs to be added - 74: 26: if (this->m_tlmEntries[this->m_activeBuffer].slots[index]) { - 42: 27: entryToUse = this->m_tlmEntries[this->m_activeBuffer].slots[index]; - 108: 28: for (NATIVE_UINT_TYPE bucket = 0; bucket < TLMCHAN_HASH_BUCKETS; bucket++) { - 108: 29: if (entryToUse) { - 67: 30: if (entryToUse->id == id) { // found the matching entry - 1: 31: break; - -: 32: } else { // try next entry - 66: 33: prevEntry = entryToUse; - 66: 34: entryToUse = entryToUse->next; - -: 35: } - -: 36: } else { - -: 37: // Make sure that we haven't run out of buckets - 41: 38: FW_ASSERT(this->m_tlmEntries[this->m_activeBuffer].free < TLMCHAN_HASH_BUCKETS); - -: 39: // add new bucket from free list - 41: 40: entryToUse = &this->m_tlmEntries[this->m_activeBuffer].buckets[this->m_tlmEntries[this->m_activeBuffer].free++]; - 41: 41: prevEntry->next = entryToUse; - -: 42: // clear next pointer - 41: 43: entryToUse->next = 0; - 41: 44: break; - -: 45: } - -: 46: } - -: 47: } else { - -: 48: // Make sure that we haven't run out of buckets - 32: 49: FW_ASSERT(this->m_tlmEntries[this->m_activeBuffer].free < TLMCHAN_HASH_BUCKETS); - -: 50: // create new entry at slot head - 32: 51: this->m_tlmEntries[this->m_activeBuffer].slots[index] = &this->m_tlmEntries[this->m_activeBuffer].buckets[this->m_tlmEntries[this->m_activeBuffer].free++]; - 32: 52: entryToUse = this->m_tlmEntries[this->m_activeBuffer].slots[index]; - 32: 53: entryToUse->next = 0; - -: 54: } - -: 55: - -: 56: // copy into entry - 74: 57: FW_ASSERT(entryToUse); - 74: 58: entryToUse->used = true; - 74: 59: entryToUse->id = id; - 74: 60: entryToUse->updated = true; - 74: 61: entryToUse->lastUpdate = timeTag; - 74: 62: entryToUse->buffer = val; - -: 63: - 74: 64: } - -: 65:} diff --git a/Svc/TlmChan/test/ut/output/TlmChanImplTask.cpp.gcov b/Svc/TlmChan/test/ut/output/TlmChanImplTask.cpp.gcov deleted file mode 100644 index 41120f8152..0000000000 --- a/Svc/TlmChan/test/ut/output/TlmChanImplTask.cpp.gcov +++ /dev/null @@ -1,59 +0,0 @@ - -: 0:Source:/home/tim/source/isf/Svc/TlmChan/TlmChanImplTask.cpp - -: 0:Programs:5 - -: 1:/** - -: 2: * \file - -: 3: * \author T. Canham - -: 4: * \brief Implementation for telemetry channel component thread. - -: 5: * - -: 6: * \copyright - -: 7: * Copyright 2009-2015, by the California Institute of Technology. - -: 8: * ALL RIGHTS RESERVED. United States Government Sponsorship - -: 9: * acknowledged. - -: 11: *

- -: 18: */ - -: 19: - -: 20:#include - -: 21:#include - -: 22:#include - -: 23:#include - -: 24:#include - -: 25:#include - -: 26: - -: 27:#include - -: 28: - -: 29:namespace Svc { - -: 30: - 3: 31: void TlmChanImpl::Run_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context) { - -: 32: // Only write packets if connected - 3: 33: if (not this->isConnected_PktSend_OutputPort(0)) { - 3: 34: return; - -: 35: } - -: 36: - -: 37: // lock mutex long enough to modify active telemetry buffer - -: 38: // so the data can be read without worrying about updates - 3: 39: this->lock(); - 3: 40: this->m_activeBuffer = 1 - this->m_activeBuffer; - -: 41: // set activeBuffer to not updated - 153: 42: for (U32 entry = 0; entry < TLMCHAN_HASH_BUCKETS; entry++) { - 150: 43: this->m_tlmEntries[this->m_activeBuffer].buckets[entry].updated = false; - -: 44: } - 3: 45: this->unLock(); - -: 46: - -: 47: // go through each entry and send a packet if it has been updated - -: 48: - 153: 49: for (U32 entry = 0; entry < TLMCHAN_HASH_BUCKETS; entry++) { - 150: 50: TlmEntry* p_entry = &this->m_tlmEntries[1-this->m_activeBuffer].buckets[entry]; - 150: 51: if ((p_entry->updated) && (p_entry->used)) { - 23: 52: this->m_tlmPacket.setId(p_entry->id); - 23: 53: this->m_tlmPacket.setTimeTag(p_entry->lastUpdate); - 23: 54: this->m_tlmPacket.setTlmBuffer(p_entry->buffer); - 23: 55: this->m_comBuffer.resetSer(); - 23: 56: Fw::SerializeStatus stat = this->m_tlmPacket.serialize(this->m_comBuffer); - 23: 57: FW_ASSERT(Fw::FW_SERIALIZE_OK == stat,static_cast(stat)); - 23: 58: p_entry->updated = false; - 23: 59: this->PktSend_out(0,this->m_comBuffer,0); - -: 60: } - -: 61: } - -: 62: } - -: 63: - -: 64:} diff --git a/Svc/TlmChan/test/ut/output/test.txt b/Svc/TlmChan/test/ut/output/test.txt deleted file mode 100644 index 87dd998550..0000000000 --- a/Svc/TlmChan/test/ut/output/test.txt +++ /dev/null @@ -1,104 +0,0 @@ -Running test/ut/runtest_CYGWIN with output dir linux-cygwin-x86-ut-gnu-bin -test/ut/runtest_CYGWIN linux-cygwin-x86-ut-gnu-bin -Running /home/tcanham/source/isf/Svc/TlmChan/test/ut/linux-cygwin-x86-ut-gnu-bin/test_ut -[==========] Running 4 tests from 1 test case. -[----------] Global test environment set-up. -[----------] 4 tests from TlmChanTest -[ RUN ] TlmChanTest.NominalChannelTest - -*************************************** -TESTCASE 107.1.1: Nominal channelized telemetry -*************************************** - -*************************************** -Write a single channel and verify it is read back and pushed correctly. -*************************************** - -*************************************** -(RQ) ISF-TLC-001 -*************************************** - -*************************************** -(RQ) ISF-TLC-002 -*************************************** - -*************************************** -(RQ) ISF-TLC-004 -*************************************** - -*************************************** -(RQ) ISF-TLC-003 -*************************************** -[ OK ] TlmChanTest.NominalChannelTest (4 ms) -[ RUN ] TlmChanTest.MultiChannelTest - -*************************************** -TESTCASE 107.1.2: Nominal Multi-channel channelized telemetry -*************************************** - -*************************************** -Write multiple channels and verify they are read back and pushed correctly. -*************************************** -Slot: 0 -Entry Ptr: 0x28a1a4 id: 0x00000300 bucket: 10 next: 0x28a4b4 -Entry Ptr: 0x28a4b4 id: 0x00000102 bucket: 17 next: 0x0 -Slot: 1 -Entry Ptr: 0x28a214 id: 0x00000301 bucket: 11 next: 0x28a524 -Entry Ptr: 0x28a524 id: 0x00000103 bucket: 18 next: 0x0 -Slot: 2 -Entry Ptr: 0x28a594 id: 0x00000104 bucket: 19 next: 0x0 -Slot: 3 -Entry Ptr: 0x28a604 id: 0x00000105 bucket: 20 next: 0x0 -Slot: 4 -Entry Ptr: 0x28a284 id: 0x00000400 bucket: 12 next: 0x0 -Slot: 5 -Entry Ptr: 0x289fe4 id: 0x00001100 bucket: 6 next: 0x28a2f4 -Entry Ptr: 0x28a2f4 id: 0x00000401 bucket: 13 next: 0x0 -Slot: 6 -Entry Ptr: 0x28a054 id: 0x00001101 bucket: 7 next: 0x28a364 -Entry Ptr: 0x28a364 id: 0x00000402 bucket: 14 next: 0x0 -Slot: 7 -Entry Ptr: 0x289d44 id: 0x00001000 bucket: 0 next: 0x28a0c4 -Entry Ptr: 0x28a0c4 id: 0x00001102 bucket: 8 next: 0x0 -Slot: 8 -Entry Ptr: 0x289db4 id: 0x00001001 bucket: 1 next: 0x28a134 -Entry Ptr: 0x28a134 id: 0x00001103 bucket: 9 next: 0x0 -Slot: 9 -Entry Ptr: 0x289e24 id: 0x00001002 bucket: 2 next: 0x0 -Slot: 10 -Entry Ptr: 0x289e94 id: 0x00001003 bucket: 3 next: 0x0 -Slot: 11 -Entry Ptr: 0x289f04 id: 0x00001004 bucket: 4 next: 0x0 -Slot: 12 -Entry Ptr: 0x289f74 id: 0x00001005 bucket: 5 next: 0x0 -Slot: 13 -Entry Ptr: 0x28a3d4 id: 0x00000100 bucket: 15 next: 0x0 -Slot: 14 -Entry Ptr: 0x28a444 id: 0x00000101 bucket: 16 next: 0x0 - -[ OK ] TlmChanTest.MultiChannelTest (3 ms) -[ RUN ] TlmChanTest.OffNominal - -*************************************** -TESTCASE 107.2.1: Off-nominal channelized telemetry -*************************************** - -*************************************** -Attempt to read a channel that hasn't been written. -*************************************** -[ OK ] TlmChanTest.OffNominal (3 ms) -[ RUN ] TlmChanTest.TooManyChannels - -*************************************** -Too Many Channel Test -*************************************** -[ OK ] TlmChanTest.TooManyChannels (3 ms) -[----------] 4 tests from TlmChanTest (13 ms total) - -[----------] Global test environment tear-down -[==========] 4 tests from 1 test case ran. (13 ms total) -[ PASSED ] 4 tests. -make[1]: Leaving directory '/home/tcanham/source/isf/Svc/TlmChan' - -08:35:49 Build Finished (took 7s.48ms) -