F´ Flight Software - C/C++ Documentation devel
A framework for building embedded system applications to NASA flight quality standards.
Loading...
Searching...
No Matches
SystemResourcesComponentAc.cpp
Go to the documentation of this file.
1// ======================================================================
2// \title SystemResourcesComponentAc.cpp
3// \author Generated by fpp-to-cpp
4// \brief cpp file for SystemResources component base class
5// ======================================================================
6
7#include <cstdio>
8
10#include "Fw/Types/Assert.hpp"
11#if FW_ENABLE_TEXT_LOGGING
12#include "Fw/Types/String.hpp"
13#endif
14
15namespace Svc {
16
17 // ----------------------------------------------------------------------
18 // Component initialization
19 // ----------------------------------------------------------------------
20
21 void SystemResourcesComponentBase ::
22 init(NATIVE_INT_TYPE instance)
23 {
24 // Initialize base class
26
27 // Connect input port CmdDisp
28 for (
29 PlatformIntType port = 0;
30 port < static_cast<PlatformIntType>(this->getNum_CmdDisp_InputPorts());
31 port++
32 ) {
33 this->m_CmdDisp_InputPort[port].init();
34 this->m_CmdDisp_InputPort[port].addCallComp(
35 this,
36 m_p_CmdDisp_in
37 );
38 this->m_CmdDisp_InputPort[port].setPortNum(port);
39
40#if FW_OBJECT_NAMES == 1
41 char portName[120];
42 (void) snprintf(
43 portName,
44 sizeof(portName),
45 "%s_CmdDisp_InputPort[%" PRI_PlatformIntType "]",
46 this->m_objName,
47 port
48 );
49 this->m_CmdDisp_InputPort[port].setObjName(portName);
50#endif
51 }
52
53 // Connect input port run
54 for (
55 PlatformIntType port = 0;
56 port < static_cast<PlatformIntType>(this->getNum_run_InputPorts());
57 port++
58 ) {
59 this->m_run_InputPort[port].init();
60 this->m_run_InputPort[port].addCallComp(
61 this,
62 m_p_run_in
63 );
64 this->m_run_InputPort[port].setPortNum(port);
65
66#if FW_OBJECT_NAMES == 1
67 char portName[120];
68 (void) snprintf(
69 portName,
70 sizeof(portName),
71 "%s_run_InputPort[%" PRI_PlatformIntType "]",
72 this->m_objName,
73 port
74 );
75 this->m_run_InputPort[port].setObjName(portName);
76#endif
77 }
78
79 // Connect output port CmdReg
80 for (
81 PlatformIntType port = 0;
82 port < static_cast<PlatformIntType>(this->getNum_CmdReg_OutputPorts());
83 port++
84 ) {
85 this->m_CmdReg_OutputPort[port].init();
86
87#if FW_OBJECT_NAMES == 1
88 char portName[120];
89 (void) snprintf(
90 portName,
91 sizeof(portName),
92 "%s_CmdReg_OutputPort[%" PRI_PlatformIntType "]",
93 this->m_objName,
94 port
95 );
96 this->m_CmdReg_OutputPort[port].setObjName(portName);
97#endif
98 }
99
100 // Connect output port CmdStatus
101 for (
102 PlatformIntType port = 0;
103 port < static_cast<PlatformIntType>(this->getNum_CmdStatus_OutputPorts());
104 port++
105 ) {
106 this->m_CmdStatus_OutputPort[port].init();
107
108#if FW_OBJECT_NAMES == 1
109 char portName[120];
110 (void) snprintf(
111 portName,
112 sizeof(portName),
113 "%s_CmdStatus_OutputPort[%" PRI_PlatformIntType "]",
114 this->m_objName,
115 port
116 );
117 this->m_CmdStatus_OutputPort[port].setObjName(portName);
118#endif
119 }
120
121 // Connect output port Log
122 for (
123 PlatformIntType port = 0;
124 port < static_cast<PlatformIntType>(this->getNum_Log_OutputPorts());
125 port++
126 ) {
127 this->m_Log_OutputPort[port].init();
128
129#if FW_OBJECT_NAMES == 1
130 char portName[120];
131 (void) snprintf(
132 portName,
133 sizeof(portName),
134 "%s_Log_OutputPort[%" PRI_PlatformIntType "]",
135 this->m_objName,
136 port
137 );
138 this->m_Log_OutputPort[port].setObjName(portName);
139#endif
140 }
141
142#if FW_ENABLE_TEXT_LOGGING == 1
143 // Connect output port LogText
144 for (
145 PlatformIntType port = 0;
146 port < static_cast<PlatformIntType>(this->getNum_LogText_OutputPorts());
147 port++
148 ) {
149 this->m_LogText_OutputPort[port].init();
150
151#if FW_OBJECT_NAMES == 1
152 char portName[120];
153 (void) snprintf(
154 portName,
155 sizeof(portName),
156 "%s_LogText_OutputPort[%" PRI_PlatformIntType "]",
157 this->m_objName,
158 port
159 );
160 this->m_LogText_OutputPort[port].setObjName(portName);
161#endif
162 }
163#endif
164
165 // Connect output port Time
166 for (
167 PlatformIntType port = 0;
168 port < static_cast<PlatformIntType>(this->getNum_Time_OutputPorts());
169 port++
170 ) {
171 this->m_Time_OutputPort[port].init();
172
173#if FW_OBJECT_NAMES == 1
174 char portName[120];
175 (void) snprintf(
176 portName,
177 sizeof(portName),
178 "%s_Time_OutputPort[%" PRI_PlatformIntType "]",
179 this->m_objName,
180 port
181 );
182 this->m_Time_OutputPort[port].setObjName(portName);
183#endif
184 }
185
186 // Connect output port Tlm
187 for (
188 PlatformIntType port = 0;
189 port < static_cast<PlatformIntType>(this->getNum_Tlm_OutputPorts());
190 port++
191 ) {
192 this->m_Tlm_OutputPort[port].init();
193
194#if FW_OBJECT_NAMES == 1
195 char portName[120];
196 (void) snprintf(
197 portName,
198 sizeof(portName),
199 "%s_Tlm_OutputPort[%" PRI_PlatformIntType "]",
200 this->m_objName,
201 port
202 );
203 this->m_Tlm_OutputPort[port].setObjName(portName);
204#endif
205 }
206 }
207
208 // ----------------------------------------------------------------------
209 // Getters for special input ports
210 // ----------------------------------------------------------------------
211
212 Fw::InputCmdPort* SystemResourcesComponentBase ::
213 get_CmdDisp_InputPort(NATIVE_INT_TYPE portNum)
214 {
215 FW_ASSERT(
216 portNum < this->getNum_CmdDisp_InputPorts(),
217 static_cast<FwAssertArgType>(portNum)
218 );
219
220 return &this->m_CmdDisp_InputPort[portNum];
221 }
222
223 // ----------------------------------------------------------------------
224 // Getters for typed input ports
225 // ----------------------------------------------------------------------
226
227 Svc::InputSchedPort* SystemResourcesComponentBase ::
228 get_run_InputPort(NATIVE_INT_TYPE portNum)
229 {
230 FW_ASSERT(
231 portNum < this->getNum_run_InputPorts(),
232 static_cast<FwAssertArgType>(portNum)
233 );
234
235 return &this->m_run_InputPort[portNum];
236 }
237
238 // ----------------------------------------------------------------------
239 // Connect input ports to special output ports
240 // ----------------------------------------------------------------------
241
242 void SystemResourcesComponentBase ::
243 set_CmdReg_OutputPort(
244 NATIVE_INT_TYPE portNum,
246 )
247 {
248 FW_ASSERT(
249 portNum < this->getNum_CmdReg_OutputPorts(),
250 static_cast<FwAssertArgType>(portNum)
251 );
252
253 this->m_CmdReg_OutputPort[portNum].addCallPort(port);
254 }
255
256 void SystemResourcesComponentBase ::
257 set_CmdStatus_OutputPort(
258 NATIVE_INT_TYPE portNum,
260 )
261 {
262 FW_ASSERT(
263 portNum < this->getNum_CmdStatus_OutputPorts(),
264 static_cast<FwAssertArgType>(portNum)
265 );
266
267 this->m_CmdStatus_OutputPort[portNum].addCallPort(port);
268 }
269
270 void SystemResourcesComponentBase ::
271 set_Log_OutputPort(
272 NATIVE_INT_TYPE portNum,
273 Fw::InputLogPort* port
274 )
275 {
276 FW_ASSERT(
277 portNum < this->getNum_Log_OutputPorts(),
278 static_cast<FwAssertArgType>(portNum)
279 );
280
281 this->m_Log_OutputPort[portNum].addCallPort(port);
282 }
283
284#if FW_ENABLE_TEXT_LOGGING == 1
285
286 void SystemResourcesComponentBase ::
287 set_LogText_OutputPort(
288 NATIVE_INT_TYPE portNum,
290 )
291 {
292 FW_ASSERT(
293 portNum < this->getNum_LogText_OutputPorts(),
294 static_cast<FwAssertArgType>(portNum)
295 );
296
297 this->m_LogText_OutputPort[portNum].addCallPort(port);
298 }
299
300#endif
301
302 void SystemResourcesComponentBase ::
303 set_Time_OutputPort(
304 NATIVE_INT_TYPE portNum,
306 )
307 {
308 FW_ASSERT(
309 portNum < this->getNum_Time_OutputPorts(),
310 static_cast<FwAssertArgType>(portNum)
311 );
312
313 this->m_Time_OutputPort[portNum].addCallPort(port);
314 }
315
316 void SystemResourcesComponentBase ::
317 set_Tlm_OutputPort(
318 NATIVE_INT_TYPE portNum,
319 Fw::InputTlmPort* port
320 )
321 {
322 FW_ASSERT(
323 portNum < this->getNum_Tlm_OutputPorts(),
324 static_cast<FwAssertArgType>(portNum)
325 );
326
327 this->m_Tlm_OutputPort[portNum].addCallPort(port);
328 }
329
330#if FW_PORT_SERIALIZATION
331
332 // ----------------------------------------------------------------------
333 // Connect serial input ports to special output ports
334 // ----------------------------------------------------------------------
335
336 void SystemResourcesComponentBase ::
337 set_CmdReg_OutputPort(
338 NATIVE_INT_TYPE portNum,
339 Fw::InputSerializePort* port
340 )
341 {
342 FW_ASSERT(
343 portNum < this->getNum_CmdReg_OutputPorts(),
344 static_cast<FwAssertArgType>(portNum)
345 );
346
347 this->m_CmdReg_OutputPort[portNum].registerSerialPort(port);
348 }
349
350 void SystemResourcesComponentBase ::
351 set_CmdStatus_OutputPort(
352 NATIVE_INT_TYPE portNum,
353 Fw::InputSerializePort* port
354 )
355 {
356 FW_ASSERT(
357 portNum < this->getNum_CmdStatus_OutputPorts(),
358 static_cast<FwAssertArgType>(portNum)
359 );
360
361 this->m_CmdStatus_OutputPort[portNum].registerSerialPort(port);
362 }
363
364 void SystemResourcesComponentBase ::
365 set_Log_OutputPort(
366 NATIVE_INT_TYPE portNum,
367 Fw::InputSerializePort* port
368 )
369 {
370 FW_ASSERT(
371 portNum < this->getNum_Log_OutputPorts(),
372 static_cast<FwAssertArgType>(portNum)
373 );
374
375 this->m_Log_OutputPort[portNum].registerSerialPort(port);
376 }
377
378#if FW_ENABLE_TEXT_LOGGING == 1
379
380 void SystemResourcesComponentBase ::
381 set_LogText_OutputPort(
382 NATIVE_INT_TYPE portNum,
383 Fw::InputSerializePort* port
384 )
385 {
386 FW_ASSERT(
387 portNum < this->getNum_LogText_OutputPorts(),
388 static_cast<FwAssertArgType>(portNum)
389 );
390
391 this->m_LogText_OutputPort[portNum].registerSerialPort(port);
392 }
393
394#endif
395
396 void SystemResourcesComponentBase ::
397 set_Time_OutputPort(
398 NATIVE_INT_TYPE portNum,
399 Fw::InputSerializePort* port
400 )
401 {
402 FW_ASSERT(
403 portNum < this->getNum_Time_OutputPorts(),
404 static_cast<FwAssertArgType>(portNum)
405 );
406
407 this->m_Time_OutputPort[portNum].registerSerialPort(port);
408 }
409
410 void SystemResourcesComponentBase ::
411 set_Tlm_OutputPort(
412 NATIVE_INT_TYPE portNum,
413 Fw::InputSerializePort* port
414 )
415 {
416 FW_ASSERT(
417 portNum < this->getNum_Tlm_OutputPorts(),
418 static_cast<FwAssertArgType>(portNum)
419 );
420
421 this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
422 }
423
424#endif
425
426 // ----------------------------------------------------------------------
427 // Command registration
428 // ----------------------------------------------------------------------
429
430 void SystemResourcesComponentBase ::
431 regCommands()
432 {
433 FW_ASSERT(this->m_CmdReg_OutputPort[0].isConnected());
434
435 this->m_CmdReg_OutputPort[0].invoke(
436 this->getIdBase() + OPCODE_ENABLE
437 );
438
439 this->m_CmdReg_OutputPort[0].invoke(
440 this->getIdBase() + OPCODE_VERSION
441 );
442 }
443
444 // ----------------------------------------------------------------------
445 // Component construction and destruction
446 // ----------------------------------------------------------------------
447
448 SystemResourcesComponentBase ::
449 SystemResourcesComponentBase(const char* compName) :
450 Fw::PassiveComponentBase(compName)
451 {
452
453 }
454
455 SystemResourcesComponentBase ::
456 ~SystemResourcesComponentBase()
457 {
458
459 }
460
461 // ----------------------------------------------------------------------
462 // Getters for numbers of special input ports
463 // ----------------------------------------------------------------------
464
465 NATIVE_INT_TYPE SystemResourcesComponentBase ::
466 getNum_CmdDisp_InputPorts() const
467 {
468 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_CmdDisp_InputPort));
469 }
470
471 // ----------------------------------------------------------------------
472 // Getters for numbers of typed input ports
473 // ----------------------------------------------------------------------
474
475 NATIVE_INT_TYPE SystemResourcesComponentBase ::
476 getNum_run_InputPorts() const
477 {
478 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_run_InputPort));
479 }
480
481 // ----------------------------------------------------------------------
482 // Getters for numbers of special output ports
483 // ----------------------------------------------------------------------
484
485 NATIVE_INT_TYPE SystemResourcesComponentBase ::
486 getNum_CmdReg_OutputPorts() const
487 {
488 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_CmdReg_OutputPort));
489 }
490
491 NATIVE_INT_TYPE SystemResourcesComponentBase ::
492 getNum_CmdStatus_OutputPorts() const
493 {
494 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_CmdStatus_OutputPort));
495 }
496
497 NATIVE_INT_TYPE SystemResourcesComponentBase ::
498 getNum_Log_OutputPorts() const
499 {
500 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_Log_OutputPort));
501 }
502
503#if FW_ENABLE_TEXT_LOGGING == 1
504
505 NATIVE_INT_TYPE SystemResourcesComponentBase ::
506 getNum_LogText_OutputPorts() const
507 {
508 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_LogText_OutputPort));
509 }
510
511#endif
512
513 NATIVE_INT_TYPE SystemResourcesComponentBase ::
514 getNum_Time_OutputPorts() const
515 {
516 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_Time_OutputPort));
517 }
518
519 NATIVE_INT_TYPE SystemResourcesComponentBase ::
520 getNum_Tlm_OutputPorts() const
521 {
522 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_Tlm_OutputPort));
523 }
524
525 // ----------------------------------------------------------------------
526 // Connection status queries for special output ports
527 // ----------------------------------------------------------------------
528
529 bool SystemResourcesComponentBase ::
530 isConnected_CmdReg_OutputPort(NATIVE_INT_TYPE portNum)
531 {
532 FW_ASSERT(
533 portNum < this->getNum_CmdReg_OutputPorts(),
534 static_cast<FwAssertArgType>(portNum)
535 );
536
537 return this->m_CmdReg_OutputPort[portNum].isConnected();
538 }
539
540 bool SystemResourcesComponentBase ::
541 isConnected_CmdStatus_OutputPort(NATIVE_INT_TYPE portNum)
542 {
543 FW_ASSERT(
544 portNum < this->getNum_CmdStatus_OutputPorts(),
545 static_cast<FwAssertArgType>(portNum)
546 );
547
548 return this->m_CmdStatus_OutputPort[portNum].isConnected();
549 }
550
551 bool SystemResourcesComponentBase ::
552 isConnected_Log_OutputPort(NATIVE_INT_TYPE portNum)
553 {
554 FW_ASSERT(
555 portNum < this->getNum_Log_OutputPorts(),
556 static_cast<FwAssertArgType>(portNum)
557 );
558
559 return this->m_Log_OutputPort[portNum].isConnected();
560 }
561
562#if FW_ENABLE_TEXT_LOGGING == 1
563
564 bool SystemResourcesComponentBase ::
565 isConnected_LogText_OutputPort(NATIVE_INT_TYPE portNum)
566 {
567 FW_ASSERT(
568 portNum < this->getNum_LogText_OutputPorts(),
569 static_cast<FwAssertArgType>(portNum)
570 );
571
572 return this->m_LogText_OutputPort[portNum].isConnected();
573 }
574
575#endif
576
577 bool SystemResourcesComponentBase ::
578 isConnected_Time_OutputPort(NATIVE_INT_TYPE portNum)
579 {
580 FW_ASSERT(
581 portNum < this->getNum_Time_OutputPorts(),
582 static_cast<FwAssertArgType>(portNum)
583 );
584
585 return this->m_Time_OutputPort[portNum].isConnected();
586 }
587
588 bool SystemResourcesComponentBase ::
589 isConnected_Tlm_OutputPort(NATIVE_INT_TYPE portNum)
590 {
591 FW_ASSERT(
592 portNum < this->getNum_Tlm_OutputPorts(),
593 static_cast<FwAssertArgType>(portNum)
594 );
595
596 return this->m_Tlm_OutputPort[portNum].isConnected();
597 }
598
599 // ----------------------------------------------------------------------
600 // Port handler base-class functions for typed input ports
601 //
602 // Call these functions directly to bypass the corresponding ports
603 // ----------------------------------------------------------------------
604
605 void SystemResourcesComponentBase ::
606 run_handlerBase(
607 NATIVE_INT_TYPE portNum,
608 NATIVE_UINT_TYPE context
609 )
610 {
611 // Make sure port number is valid
612 FW_ASSERT(
613 portNum < this->getNum_run_InputPorts(),
614 static_cast<FwAssertArgType>(portNum)
615 );
616
617 // Lock guard mutex before calling
618 this->lock();
619
620 // Down call to pure virtual handler method implemented in Impl class
621 this->run_handler(
622 portNum,
623 context
624 );
625
626 // Unlock guard mutex
627 this->unLock();
628 }
629
630 // ----------------------------------------------------------------------
631 // Command response
632 // ----------------------------------------------------------------------
633
634 void SystemResourcesComponentBase ::
635 cmdResponse_out(
636 FwOpcodeType opCode,
637 U32 cmdSeq,
638 Fw::CmdResponse response
639 )
640 {
641 FW_ASSERT(this->m_CmdStatus_OutputPort[0].isConnected());
642 this->m_CmdStatus_OutputPort[0].invoke(opCode, cmdSeq, response);
643 }
644
645 // ----------------------------------------------------------------------
646 // Command handler base-class functions
647 //
648 // Call these functions directly to bypass the command input port
649 // ----------------------------------------------------------------------
650
651 void SystemResourcesComponentBase ::
652 ENABLE_cmdHandlerBase(
653 FwOpcodeType opCode,
654 U32 cmdSeq,
655 Fw::CmdArgBuffer& args
656 )
657 {
658 // Deserialize the arguments
660
661 // Reset the buffer
662 args.resetDeser();
663
665 _status = args.deserialize(enable);
666 if (_status != Fw::FW_SERIALIZE_OK) {
667 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
668 this->m_CmdStatus_OutputPort[0].invoke(
669 opCode,
670 cmdSeq,
672 );
673 }
674 return;
675 }
676
677#if FW_CMD_CHECK_RESIDUAL
678 // Make sure there was no data left over.
679 // That means the argument buffer size was incorrect.
680 if (args.getBuffLeft() != 0) {
681 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
682 this->m_CmdStatus_OutputPort[0].invoke(
683 opCode,
684 cmdSeq,
686 );
687 }
688 return;
689 }
690#endif
691
692 this->lock();
693
694 this->ENABLE_cmdHandler(
695 opCode, cmdSeq,
696 enable
697 );
698
699 this->unLock();
700 }
701
702 void SystemResourcesComponentBase ::
703 VERSION_cmdHandlerBase(
704 FwOpcodeType opCode,
705 U32 cmdSeq,
706 Fw::CmdArgBuffer& args
707 )
708 {
709#if FW_CMD_CHECK_RESIDUAL
710 // Make sure there was no data left over.
711 // That means the argument buffer size was incorrect.
712 if (args.getBuffLeft() != 0) {
713 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
714 this->m_CmdStatus_OutputPort[0].invoke(
715 opCode,
716 cmdSeq,
718 );
719 }
720 return;
721 }
722#endif
723
724 this->lock();
725
726 this->VERSION_cmdHandler(opCode, cmdSeq);
727
728 this->unLock();
729 }
730
731 // ----------------------------------------------------------------------
732 // Event logging functions
733 // ----------------------------------------------------------------------
734
735 void SystemResourcesComponentBase ::
736 log_ACTIVITY_LO_FRAMEWORK_VERSION(const Fw::LogStringArg& version)
737 {
738 // Get the time
739 Fw::Time _logTime;
740 if (this->m_Time_OutputPort[0].isConnected()) {
741 this->m_Time_OutputPort[0].invoke(_logTime);
742 }
743
744 FwEventIdType _id = static_cast<FwEventIdType>(0);
745
746 _id = this->getIdBase() + EVENTID_FRAMEWORK_VERSION;
747
748 // Emit the event on the log port
749 if (this->m_Log_OutputPort[0].isConnected()) {
750 Fw::LogBuffer _logBuff;
752
753#if FW_AMPCS_COMPATIBLE
754 // Serialize the number of arguments
755 _status = _logBuff.serialize(static_cast<U8>(1));
756 FW_ASSERT(
757 _status == Fw::FW_SERIALIZE_OK,
758 static_cast<FwAssertArgType>(_status)
759 );
760#endif
761
762 _status = version.serialize(_logBuff, 40);
763 FW_ASSERT(
764 _status == Fw::FW_SERIALIZE_OK,
765 static_cast<FwAssertArgType>(_status)
766 );
767
768 this->m_Log_OutputPort[0].invoke(
769 _id,
770 _logTime,
772 _logBuff
773 );
774 }
775
776 // Emit the event on the text log port
777#if FW_ENABLE_TEXT_LOGGING
778 if (this->m_LogText_OutputPort[0].isConnected()) {
779#if FW_OBJECT_NAMES == 1
780 const char* _formatString =
781 "(%s) %s: Framework Version: [%s]";
782#else
783 const char* _formatString =
784 "%s: Framework Version: [%s]";
785#endif
786
787 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
788
789 (void) snprintf(
790 _textBuffer,
792 _formatString,
793#if FW_OBJECT_NAMES == 1
794 this->m_objName,
795#endif
796 "FRAMEWORK_VERSION ",
797 version.toChar()
798 );
799
800 // Null terminate
801 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
802 Fw::TextLogString _logString = _textBuffer;
803 this->m_LogText_OutputPort[0].invoke(
804 _id,
805 _logTime,
807 _logString
808 );
809 }
810#endif
811 }
812
813 void SystemResourcesComponentBase ::
814 log_ACTIVITY_LO_PROJECT_VERSION(const Fw::LogStringArg& version)
815 {
816 // Get the time
817 Fw::Time _logTime;
818 if (this->m_Time_OutputPort[0].isConnected()) {
819 this->m_Time_OutputPort[0].invoke(_logTime);
820 }
821
822 FwEventIdType _id = static_cast<FwEventIdType>(0);
823
824 _id = this->getIdBase() + EVENTID_PROJECT_VERSION;
825
826 // Emit the event on the log port
827 if (this->m_Log_OutputPort[0].isConnected()) {
828 Fw::LogBuffer _logBuff;
830
831#if FW_AMPCS_COMPATIBLE
832 // Serialize the number of arguments
833 _status = _logBuff.serialize(static_cast<U8>(1));
834 FW_ASSERT(
835 _status == Fw::FW_SERIALIZE_OK,
836 static_cast<FwAssertArgType>(_status)
837 );
838#endif
839
840 _status = version.serialize(_logBuff, 40);
841 FW_ASSERT(
842 _status == Fw::FW_SERIALIZE_OK,
843 static_cast<FwAssertArgType>(_status)
844 );
845
846 this->m_Log_OutputPort[0].invoke(
847 _id,
848 _logTime,
850 _logBuff
851 );
852 }
853
854 // Emit the event on the text log port
855#if FW_ENABLE_TEXT_LOGGING
856 if (this->m_LogText_OutputPort[0].isConnected()) {
857#if FW_OBJECT_NAMES == 1
858 const char* _formatString =
859 "(%s) %s: Project Version: [%s]";
860#else
861 const char* _formatString =
862 "%s: Project Version: [%s]";
863#endif
864
865 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
866
867 (void) snprintf(
868 _textBuffer,
870 _formatString,
871#if FW_OBJECT_NAMES == 1
872 this->m_objName,
873#endif
874 "PROJECT_VERSION ",
875 version.toChar()
876 );
877
878 // Null terminate
879 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
880 Fw::TextLogString _logString = _textBuffer;
881 this->m_LogText_OutputPort[0].invoke(
882 _id,
883 _logTime,
885 _logString
886 );
887 }
888#endif
889 }
890
891 // ----------------------------------------------------------------------
892 // Telemetry write functions
893 // ----------------------------------------------------------------------
894
895 void SystemResourcesComponentBase ::
896 tlmWrite_MEMORY_TOTAL(
897 U64 arg,
898 Fw::Time _tlmTime
899 )
900 {
901 if (this->m_Tlm_OutputPort[0].isConnected()) {
902 if (
903 this->m_Time_OutputPort[0].isConnected() &&
904 (_tlmTime == Fw::ZERO_TIME)
905 ) {
906 this->m_Time_OutputPort[0].invoke(_tlmTime);
907 }
908
909 Fw::TlmBuffer _tlmBuff;
910 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
911 FW_ASSERT(
912 _stat == Fw::FW_SERIALIZE_OK,
913 static_cast<FwAssertArgType>(_stat)
914 );
915
916 FwChanIdType _id;
917
918 _id = this->getIdBase() + CHANNELID_MEMORY_TOTAL;
919
920 this->m_Tlm_OutputPort[0].invoke(
921 _id,
922 _tlmTime,
923 _tlmBuff
924 );
925 }
926 }
927
928 void SystemResourcesComponentBase ::
929 tlmWrite_MEMORY_USED(
930 U64 arg,
931 Fw::Time _tlmTime
932 )
933 {
934 if (this->m_Tlm_OutputPort[0].isConnected()) {
935 if (
936 this->m_Time_OutputPort[0].isConnected() &&
937 (_tlmTime == Fw::ZERO_TIME)
938 ) {
939 this->m_Time_OutputPort[0].invoke(_tlmTime);
940 }
941
942 Fw::TlmBuffer _tlmBuff;
943 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
944 FW_ASSERT(
945 _stat == Fw::FW_SERIALIZE_OK,
946 static_cast<FwAssertArgType>(_stat)
947 );
948
949 FwChanIdType _id;
950
951 _id = this->getIdBase() + CHANNELID_MEMORY_USED;
952
953 this->m_Tlm_OutputPort[0].invoke(
954 _id,
955 _tlmTime,
956 _tlmBuff
957 );
958 }
959 }
960
961 void SystemResourcesComponentBase ::
962 tlmWrite_NON_VOLATILE_TOTAL(
963 U64 arg,
964 Fw::Time _tlmTime
965 )
966 {
967 if (this->m_Tlm_OutputPort[0].isConnected()) {
968 if (
969 this->m_Time_OutputPort[0].isConnected() &&
970 (_tlmTime == Fw::ZERO_TIME)
971 ) {
972 this->m_Time_OutputPort[0].invoke(_tlmTime);
973 }
974
975 Fw::TlmBuffer _tlmBuff;
976 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
977 FW_ASSERT(
978 _stat == Fw::FW_SERIALIZE_OK,
979 static_cast<FwAssertArgType>(_stat)
980 );
981
982 FwChanIdType _id;
983
984 _id = this->getIdBase() + CHANNELID_NON_VOLATILE_TOTAL;
985
986 this->m_Tlm_OutputPort[0].invoke(
987 _id,
988 _tlmTime,
989 _tlmBuff
990 );
991 }
992 }
993
994 void SystemResourcesComponentBase ::
995 tlmWrite_NON_VOLATILE_FREE(
996 U64 arg,
997 Fw::Time _tlmTime
998 )
999 {
1000 if (this->m_Tlm_OutputPort[0].isConnected()) {
1001 if (
1002 this->m_Time_OutputPort[0].isConnected() &&
1003 (_tlmTime == Fw::ZERO_TIME)
1004 ) {
1005 this->m_Time_OutputPort[0].invoke(_tlmTime);
1006 }
1007
1008 Fw::TlmBuffer _tlmBuff;
1009 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1010 FW_ASSERT(
1011 _stat == Fw::FW_SERIALIZE_OK,
1012 static_cast<FwAssertArgType>(_stat)
1013 );
1014
1015 FwChanIdType _id;
1016
1017 _id = this->getIdBase() + CHANNELID_NON_VOLATILE_FREE;
1018
1019 this->m_Tlm_OutputPort[0].invoke(
1020 _id,
1021 _tlmTime,
1022 _tlmBuff
1023 );
1024 }
1025 }
1026
1027 void SystemResourcesComponentBase ::
1028 tlmWrite_CPU(
1029 F32 arg,
1030 Fw::Time _tlmTime
1031 )
1032 {
1033 if (this->m_Tlm_OutputPort[0].isConnected()) {
1034 if (
1035 this->m_Time_OutputPort[0].isConnected() &&
1036 (_tlmTime == Fw::ZERO_TIME)
1037 ) {
1038 this->m_Time_OutputPort[0].invoke(_tlmTime);
1039 }
1040
1041 Fw::TlmBuffer _tlmBuff;
1042 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1043 FW_ASSERT(
1044 _stat == Fw::FW_SERIALIZE_OK,
1045 static_cast<FwAssertArgType>(_stat)
1046 );
1047
1048 FwChanIdType _id;
1049
1050 _id = this->getIdBase() + CHANNELID_CPU;
1051
1052 this->m_Tlm_OutputPort[0].invoke(
1053 _id,
1054 _tlmTime,
1055 _tlmBuff
1056 );
1057 }
1058 }
1059
1060 void SystemResourcesComponentBase ::
1061 tlmWrite_CPU_00(
1062 F32 arg,
1063 Fw::Time _tlmTime
1064 )
1065 {
1066 if (this->m_Tlm_OutputPort[0].isConnected()) {
1067 if (
1068 this->m_Time_OutputPort[0].isConnected() &&
1069 (_tlmTime == Fw::ZERO_TIME)
1070 ) {
1071 this->m_Time_OutputPort[0].invoke(_tlmTime);
1072 }
1073
1074 Fw::TlmBuffer _tlmBuff;
1075 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1076 FW_ASSERT(
1077 _stat == Fw::FW_SERIALIZE_OK,
1078 static_cast<FwAssertArgType>(_stat)
1079 );
1080
1081 FwChanIdType _id;
1082
1083 _id = this->getIdBase() + CHANNELID_CPU_00;
1084
1085 this->m_Tlm_OutputPort[0].invoke(
1086 _id,
1087 _tlmTime,
1088 _tlmBuff
1089 );
1090 }
1091 }
1092
1093 void SystemResourcesComponentBase ::
1094 tlmWrite_CPU_01(
1095 F32 arg,
1096 Fw::Time _tlmTime
1097 )
1098 {
1099 if (this->m_Tlm_OutputPort[0].isConnected()) {
1100 if (
1101 this->m_Time_OutputPort[0].isConnected() &&
1102 (_tlmTime == Fw::ZERO_TIME)
1103 ) {
1104 this->m_Time_OutputPort[0].invoke(_tlmTime);
1105 }
1106
1107 Fw::TlmBuffer _tlmBuff;
1108 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1109 FW_ASSERT(
1110 _stat == Fw::FW_SERIALIZE_OK,
1111 static_cast<FwAssertArgType>(_stat)
1112 );
1113
1114 FwChanIdType _id;
1115
1116 _id = this->getIdBase() + CHANNELID_CPU_01;
1117
1118 this->m_Tlm_OutputPort[0].invoke(
1119 _id,
1120 _tlmTime,
1121 _tlmBuff
1122 );
1123 }
1124 }
1125
1126 void SystemResourcesComponentBase ::
1127 tlmWrite_CPU_02(
1128 F32 arg,
1129 Fw::Time _tlmTime
1130 )
1131 {
1132 if (this->m_Tlm_OutputPort[0].isConnected()) {
1133 if (
1134 this->m_Time_OutputPort[0].isConnected() &&
1135 (_tlmTime == Fw::ZERO_TIME)
1136 ) {
1137 this->m_Time_OutputPort[0].invoke(_tlmTime);
1138 }
1139
1140 Fw::TlmBuffer _tlmBuff;
1141 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1142 FW_ASSERT(
1143 _stat == Fw::FW_SERIALIZE_OK,
1144 static_cast<FwAssertArgType>(_stat)
1145 );
1146
1147 FwChanIdType _id;
1148
1149 _id = this->getIdBase() + CHANNELID_CPU_02;
1150
1151 this->m_Tlm_OutputPort[0].invoke(
1152 _id,
1153 _tlmTime,
1154 _tlmBuff
1155 );
1156 }
1157 }
1158
1159 void SystemResourcesComponentBase ::
1160 tlmWrite_CPU_03(
1161 F32 arg,
1162 Fw::Time _tlmTime
1163 )
1164 {
1165 if (this->m_Tlm_OutputPort[0].isConnected()) {
1166 if (
1167 this->m_Time_OutputPort[0].isConnected() &&
1168 (_tlmTime == Fw::ZERO_TIME)
1169 ) {
1170 this->m_Time_OutputPort[0].invoke(_tlmTime);
1171 }
1172
1173 Fw::TlmBuffer _tlmBuff;
1174 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1175 FW_ASSERT(
1176 _stat == Fw::FW_SERIALIZE_OK,
1177 static_cast<FwAssertArgType>(_stat)
1178 );
1179
1180 FwChanIdType _id;
1181
1182 _id = this->getIdBase() + CHANNELID_CPU_03;
1183
1184 this->m_Tlm_OutputPort[0].invoke(
1185 _id,
1186 _tlmTime,
1187 _tlmBuff
1188 );
1189 }
1190 }
1191
1192 void SystemResourcesComponentBase ::
1193 tlmWrite_CPU_04(
1194 F32 arg,
1195 Fw::Time _tlmTime
1196 )
1197 {
1198 if (this->m_Tlm_OutputPort[0].isConnected()) {
1199 if (
1200 this->m_Time_OutputPort[0].isConnected() &&
1201 (_tlmTime == Fw::ZERO_TIME)
1202 ) {
1203 this->m_Time_OutputPort[0].invoke(_tlmTime);
1204 }
1205
1206 Fw::TlmBuffer _tlmBuff;
1207 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1208 FW_ASSERT(
1209 _stat == Fw::FW_SERIALIZE_OK,
1210 static_cast<FwAssertArgType>(_stat)
1211 );
1212
1213 FwChanIdType _id;
1214
1215 _id = this->getIdBase() + CHANNELID_CPU_04;
1216
1217 this->m_Tlm_OutputPort[0].invoke(
1218 _id,
1219 _tlmTime,
1220 _tlmBuff
1221 );
1222 }
1223 }
1224
1225 void SystemResourcesComponentBase ::
1226 tlmWrite_CPU_05(
1227 F32 arg,
1228 Fw::Time _tlmTime
1229 )
1230 {
1231 if (this->m_Tlm_OutputPort[0].isConnected()) {
1232 if (
1233 this->m_Time_OutputPort[0].isConnected() &&
1234 (_tlmTime == Fw::ZERO_TIME)
1235 ) {
1236 this->m_Time_OutputPort[0].invoke(_tlmTime);
1237 }
1238
1239 Fw::TlmBuffer _tlmBuff;
1240 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1241 FW_ASSERT(
1242 _stat == Fw::FW_SERIALIZE_OK,
1243 static_cast<FwAssertArgType>(_stat)
1244 );
1245
1246 FwChanIdType _id;
1247
1248 _id = this->getIdBase() + CHANNELID_CPU_05;
1249
1250 this->m_Tlm_OutputPort[0].invoke(
1251 _id,
1252 _tlmTime,
1253 _tlmBuff
1254 );
1255 }
1256 }
1257
1258 void SystemResourcesComponentBase ::
1259 tlmWrite_CPU_06(
1260 F32 arg,
1261 Fw::Time _tlmTime
1262 )
1263 {
1264 if (this->m_Tlm_OutputPort[0].isConnected()) {
1265 if (
1266 this->m_Time_OutputPort[0].isConnected() &&
1267 (_tlmTime == Fw::ZERO_TIME)
1268 ) {
1269 this->m_Time_OutputPort[0].invoke(_tlmTime);
1270 }
1271
1272 Fw::TlmBuffer _tlmBuff;
1273 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1274 FW_ASSERT(
1275 _stat == Fw::FW_SERIALIZE_OK,
1276 static_cast<FwAssertArgType>(_stat)
1277 );
1278
1279 FwChanIdType _id;
1280
1281 _id = this->getIdBase() + CHANNELID_CPU_06;
1282
1283 this->m_Tlm_OutputPort[0].invoke(
1284 _id,
1285 _tlmTime,
1286 _tlmBuff
1287 );
1288 }
1289 }
1290
1291 void SystemResourcesComponentBase ::
1292 tlmWrite_CPU_07(
1293 F32 arg,
1294 Fw::Time _tlmTime
1295 )
1296 {
1297 if (this->m_Tlm_OutputPort[0].isConnected()) {
1298 if (
1299 this->m_Time_OutputPort[0].isConnected() &&
1300 (_tlmTime == Fw::ZERO_TIME)
1301 ) {
1302 this->m_Time_OutputPort[0].invoke(_tlmTime);
1303 }
1304
1305 Fw::TlmBuffer _tlmBuff;
1306 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1307 FW_ASSERT(
1308 _stat == Fw::FW_SERIALIZE_OK,
1309 static_cast<FwAssertArgType>(_stat)
1310 );
1311
1312 FwChanIdType _id;
1313
1314 _id = this->getIdBase() + CHANNELID_CPU_07;
1315
1316 this->m_Tlm_OutputPort[0].invoke(
1317 _id,
1318 _tlmTime,
1319 _tlmBuff
1320 );
1321 }
1322 }
1323
1324 void SystemResourcesComponentBase ::
1325 tlmWrite_CPU_08(
1326 F32 arg,
1327 Fw::Time _tlmTime
1328 )
1329 {
1330 if (this->m_Tlm_OutputPort[0].isConnected()) {
1331 if (
1332 this->m_Time_OutputPort[0].isConnected() &&
1333 (_tlmTime == Fw::ZERO_TIME)
1334 ) {
1335 this->m_Time_OutputPort[0].invoke(_tlmTime);
1336 }
1337
1338 Fw::TlmBuffer _tlmBuff;
1339 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1340 FW_ASSERT(
1341 _stat == Fw::FW_SERIALIZE_OK,
1342 static_cast<FwAssertArgType>(_stat)
1343 );
1344
1345 FwChanIdType _id;
1346
1347 _id = this->getIdBase() + CHANNELID_CPU_08;
1348
1349 this->m_Tlm_OutputPort[0].invoke(
1350 _id,
1351 _tlmTime,
1352 _tlmBuff
1353 );
1354 }
1355 }
1356
1357 void SystemResourcesComponentBase ::
1358 tlmWrite_CPU_09(
1359 F32 arg,
1360 Fw::Time _tlmTime
1361 )
1362 {
1363 if (this->m_Tlm_OutputPort[0].isConnected()) {
1364 if (
1365 this->m_Time_OutputPort[0].isConnected() &&
1366 (_tlmTime == Fw::ZERO_TIME)
1367 ) {
1368 this->m_Time_OutputPort[0].invoke(_tlmTime);
1369 }
1370
1371 Fw::TlmBuffer _tlmBuff;
1372 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1373 FW_ASSERT(
1374 _stat == Fw::FW_SERIALIZE_OK,
1375 static_cast<FwAssertArgType>(_stat)
1376 );
1377
1378 FwChanIdType _id;
1379
1380 _id = this->getIdBase() + CHANNELID_CPU_09;
1381
1382 this->m_Tlm_OutputPort[0].invoke(
1383 _id,
1384 _tlmTime,
1385 _tlmBuff
1386 );
1387 }
1388 }
1389
1390 void SystemResourcesComponentBase ::
1391 tlmWrite_CPU_10(
1392 F32 arg,
1393 Fw::Time _tlmTime
1394 )
1395 {
1396 if (this->m_Tlm_OutputPort[0].isConnected()) {
1397 if (
1398 this->m_Time_OutputPort[0].isConnected() &&
1399 (_tlmTime == Fw::ZERO_TIME)
1400 ) {
1401 this->m_Time_OutputPort[0].invoke(_tlmTime);
1402 }
1403
1404 Fw::TlmBuffer _tlmBuff;
1405 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1406 FW_ASSERT(
1407 _stat == Fw::FW_SERIALIZE_OK,
1408 static_cast<FwAssertArgType>(_stat)
1409 );
1410
1411 FwChanIdType _id;
1412
1413 _id = this->getIdBase() + CHANNELID_CPU_10;
1414
1415 this->m_Tlm_OutputPort[0].invoke(
1416 _id,
1417 _tlmTime,
1418 _tlmBuff
1419 );
1420 }
1421 }
1422
1423 void SystemResourcesComponentBase ::
1424 tlmWrite_CPU_11(
1425 F32 arg,
1426 Fw::Time _tlmTime
1427 )
1428 {
1429 if (this->m_Tlm_OutputPort[0].isConnected()) {
1430 if (
1431 this->m_Time_OutputPort[0].isConnected() &&
1432 (_tlmTime == Fw::ZERO_TIME)
1433 ) {
1434 this->m_Time_OutputPort[0].invoke(_tlmTime);
1435 }
1436
1437 Fw::TlmBuffer _tlmBuff;
1438 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1439 FW_ASSERT(
1440 _stat == Fw::FW_SERIALIZE_OK,
1441 static_cast<FwAssertArgType>(_stat)
1442 );
1443
1444 FwChanIdType _id;
1445
1446 _id = this->getIdBase() + CHANNELID_CPU_11;
1447
1448 this->m_Tlm_OutputPort[0].invoke(
1449 _id,
1450 _tlmTime,
1451 _tlmBuff
1452 );
1453 }
1454 }
1455
1456 void SystemResourcesComponentBase ::
1457 tlmWrite_CPU_12(
1458 F32 arg,
1459 Fw::Time _tlmTime
1460 )
1461 {
1462 if (this->m_Tlm_OutputPort[0].isConnected()) {
1463 if (
1464 this->m_Time_OutputPort[0].isConnected() &&
1465 (_tlmTime == Fw::ZERO_TIME)
1466 ) {
1467 this->m_Time_OutputPort[0].invoke(_tlmTime);
1468 }
1469
1470 Fw::TlmBuffer _tlmBuff;
1471 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1472 FW_ASSERT(
1473 _stat == Fw::FW_SERIALIZE_OK,
1474 static_cast<FwAssertArgType>(_stat)
1475 );
1476
1477 FwChanIdType _id;
1478
1479 _id = this->getIdBase() + CHANNELID_CPU_12;
1480
1481 this->m_Tlm_OutputPort[0].invoke(
1482 _id,
1483 _tlmTime,
1484 _tlmBuff
1485 );
1486 }
1487 }
1488
1489 void SystemResourcesComponentBase ::
1490 tlmWrite_CPU_13(
1491 F32 arg,
1492 Fw::Time _tlmTime
1493 )
1494 {
1495 if (this->m_Tlm_OutputPort[0].isConnected()) {
1496 if (
1497 this->m_Time_OutputPort[0].isConnected() &&
1498 (_tlmTime == Fw::ZERO_TIME)
1499 ) {
1500 this->m_Time_OutputPort[0].invoke(_tlmTime);
1501 }
1502
1503 Fw::TlmBuffer _tlmBuff;
1504 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1505 FW_ASSERT(
1506 _stat == Fw::FW_SERIALIZE_OK,
1507 static_cast<FwAssertArgType>(_stat)
1508 );
1509
1510 FwChanIdType _id;
1511
1512 _id = this->getIdBase() + CHANNELID_CPU_13;
1513
1514 this->m_Tlm_OutputPort[0].invoke(
1515 _id,
1516 _tlmTime,
1517 _tlmBuff
1518 );
1519 }
1520 }
1521
1522 void SystemResourcesComponentBase ::
1523 tlmWrite_CPU_14(
1524 F32 arg,
1525 Fw::Time _tlmTime
1526 )
1527 {
1528 if (this->m_Tlm_OutputPort[0].isConnected()) {
1529 if (
1530 this->m_Time_OutputPort[0].isConnected() &&
1531 (_tlmTime == Fw::ZERO_TIME)
1532 ) {
1533 this->m_Time_OutputPort[0].invoke(_tlmTime);
1534 }
1535
1536 Fw::TlmBuffer _tlmBuff;
1537 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1538 FW_ASSERT(
1539 _stat == Fw::FW_SERIALIZE_OK,
1540 static_cast<FwAssertArgType>(_stat)
1541 );
1542
1543 FwChanIdType _id;
1544
1545 _id = this->getIdBase() + CHANNELID_CPU_14;
1546
1547 this->m_Tlm_OutputPort[0].invoke(
1548 _id,
1549 _tlmTime,
1550 _tlmBuff
1551 );
1552 }
1553 }
1554
1555 void SystemResourcesComponentBase ::
1556 tlmWrite_CPU_15(
1557 F32 arg,
1558 Fw::Time _tlmTime
1559 )
1560 {
1561 if (this->m_Tlm_OutputPort[0].isConnected()) {
1562 if (
1563 this->m_Time_OutputPort[0].isConnected() &&
1564 (_tlmTime == Fw::ZERO_TIME)
1565 ) {
1566 this->m_Time_OutputPort[0].invoke(_tlmTime);
1567 }
1568
1569 Fw::TlmBuffer _tlmBuff;
1570 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1571 FW_ASSERT(
1572 _stat == Fw::FW_SERIALIZE_OK,
1573 static_cast<FwAssertArgType>(_stat)
1574 );
1575
1576 FwChanIdType _id;
1577
1578 _id = this->getIdBase() + CHANNELID_CPU_15;
1579
1580 this->m_Tlm_OutputPort[0].invoke(
1581 _id,
1582 _tlmTime,
1583 _tlmBuff
1584 );
1585 }
1586 }
1587
1588 void SystemResourcesComponentBase ::
1589 tlmWrite_FRAMEWORK_VERSION(
1590 const Fw::TlmString& arg,
1591 Fw::Time _tlmTime
1592 )
1593 {
1594 if (this->m_Tlm_OutputPort[0].isConnected()) {
1595 if (
1596 this->m_Time_OutputPort[0].isConnected() &&
1597 (_tlmTime == Fw::ZERO_TIME)
1598 ) {
1599 this->m_Time_OutputPort[0].invoke(_tlmTime);
1600 }
1601
1602 Fw::TlmBuffer _tlmBuff;
1603 Fw::SerializeStatus _stat = arg.serialize(_tlmBuff, 40);
1604 FW_ASSERT(
1605 _stat == Fw::FW_SERIALIZE_OK,
1606 static_cast<FwAssertArgType>(_stat)
1607 );
1608
1609 FwChanIdType _id;
1610
1611 _id = this->getIdBase() + CHANNELID_FRAMEWORK_VERSION;
1612
1613 this->m_Tlm_OutputPort[0].invoke(
1614 _id,
1615 _tlmTime,
1616 _tlmBuff
1617 );
1618 }
1619 }
1620
1621 void SystemResourcesComponentBase ::
1622 tlmWrite_PROJECT_VERSION(
1623 const Fw::TlmString& arg,
1624 Fw::Time _tlmTime
1625 )
1626 {
1627 if (this->m_Tlm_OutputPort[0].isConnected()) {
1628 if (
1629 this->m_Time_OutputPort[0].isConnected() &&
1630 (_tlmTime == Fw::ZERO_TIME)
1631 ) {
1632 this->m_Time_OutputPort[0].invoke(_tlmTime);
1633 }
1634
1635 Fw::TlmBuffer _tlmBuff;
1636 Fw::SerializeStatus _stat = arg.serialize(_tlmBuff, 40);
1637 FW_ASSERT(
1638 _stat == Fw::FW_SERIALIZE_OK,
1639 static_cast<FwAssertArgType>(_stat)
1640 );
1641
1642 FwChanIdType _id;
1643
1644 _id = this->getIdBase() + CHANNELID_PROJECT_VERSION;
1645
1646 this->m_Tlm_OutputPort[0].invoke(
1647 _id,
1648 _tlmTime,
1649 _tlmBuff
1650 );
1651 }
1652 }
1653
1654 // ----------------------------------------------------------------------
1655 // Time
1656 // ----------------------------------------------------------------------
1657
1658 Fw::Time SystemResourcesComponentBase ::
1659 getTime()
1660 {
1661 if (this->m_Time_OutputPort[0].isConnected()) {
1662 Fw::Time _time;
1663 this->m_Time_OutputPort[0].invoke(_time);
1664 return _time;
1665 }
1666 else {
1667 return Fw::Time(TB_NONE, 0, 0);
1668 }
1669 }
1670
1671 // ----------------------------------------------------------------------
1672 // Mutex operations for guarded ports
1673 //
1674 // You can override these operations to provide more sophisticated
1675 // synchronization
1676 // ----------------------------------------------------------------------
1677
1678 void SystemResourcesComponentBase ::
1679 lock()
1680 {
1681 this->m_guardedPortMutex.lock();
1682 }
1683
1684 void SystemResourcesComponentBase ::
1685 unLock()
1686 {
1687 this->m_guardedPortMutex.unLock();
1688 }
1689
1690 // ----------------------------------------------------------------------
1691 // Calls for messages received on special input ports
1692 // ----------------------------------------------------------------------
1693
1694 void SystemResourcesComponentBase ::
1695 m_p_CmdDisp_in(
1696 Fw::PassiveComponentBase* callComp,
1697 NATIVE_INT_TYPE portNum,
1698 FwOpcodeType opCode,
1699 U32 cmdSeq,
1700 Fw::CmdArgBuffer& args
1701 )
1702 {
1703 FW_ASSERT(callComp);
1704 SystemResourcesComponentBase* compPtr = static_cast<SystemResourcesComponentBase*>(callComp);
1705
1706 const U32 idBase = callComp->getIdBase();
1707 FW_ASSERT(opCode >= idBase, opCode, idBase);
1708
1709 // Select base class function based on opcode
1710 switch (opCode - idBase) {
1711 case OPCODE_ENABLE: {
1712 compPtr->ENABLE_cmdHandlerBase(
1713 opCode,
1714 cmdSeq,
1715 args
1716 );
1717 break;
1718 }
1719
1720 case OPCODE_VERSION: {
1721 compPtr->VERSION_cmdHandlerBase(
1722 opCode,
1723 cmdSeq,
1724 args
1725 );
1726 break;
1727 }
1728 }
1729 }
1730
1731 // ----------------------------------------------------------------------
1732 // Calls for messages received on typed input ports
1733 // ----------------------------------------------------------------------
1734
1735 void SystemResourcesComponentBase ::
1736 m_p_run_in(
1737 Fw::PassiveComponentBase* callComp,
1738 NATIVE_INT_TYPE portNum,
1739 NATIVE_UINT_TYPE context
1740 )
1741 {
1742 FW_ASSERT(callComp);
1743 SystemResourcesComponentBase* compPtr = static_cast<SystemResourcesComponentBase*>(callComp);
1744 compPtr->run_handlerBase(
1745 portNum,
1746 context
1747 );
1748 }
1749
1750}
#define FW_ASSERT(...)
Definition Assert.hpp:7
PlatformIntType NATIVE_INT_TYPE
Definition BasicTypes.h:51
float F32
32-bit floating point
Definition BasicTypes.h:45
uint8_t U8
8-bit unsigned integer
Definition BasicTypes.h:26
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition BasicTypes.h:66
PlatformUIntType NATIVE_UINT_TYPE
Definition BasicTypes.h:52
int PlatformIntType
DefaultTypes.hpp provides fallback defaults for the platform types.
#define PRI_PlatformIntType
@ TB_NONE
No time base has been established.
Definition FpConfig.h:39
PlatformAssertArgType FwAssertArgType
Definition FpConfig.h:21
U32 FwChanIdType
Definition FpConfig.h:59
U32 FwEventIdType
Definition FpConfig.h:62
U32 FwOpcodeType
Definition FpConfig.h:56
#define FW_LOG_TEXT_BUFFER_SIZE
Max size of string for text log message.
Definition FpConfig.h:291
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects)
Definition FpConfig.h:82
Enum representing a command response.
@ FORMAT_ERROR
Command failed to deserialize.
@ ACTIVITY_LO
Less important informational events.
const char * toChar() const override
Definition LogString.cpp:49
SerializeStatus serialize(SerializeBufferBase &buffer) const override
serialization function
Definition LogString.cpp:57
void init()
Object initializer.
Definition ObjBase.cpp:27
NATIVE_UINT_TYPE getBuffLeft() const
returns how much deserialization buffer is left
void resetDeser()
reset deserialization to beginning
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
SerializeStatus serialize(SerializeBufferBase &buffer) const override
serialization function
Definition TlmString.cpp:56
Auto-generated base for SystemResources component.
void ENABLE_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void run_handlerBase(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context)
Handler base-class function for input port run.
void VERSION_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.
const Time ZERO_TIME
Definition Time.cpp:5
#define U64(C)
Definition sha.h:176