F´ Flight Software - C/C++ Documentation devel
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CmdSequencerComponentAc.cpp
Go to the documentation of this file.
1// ======================================================================
2// \title CmdSequencerComponentAc.cpp
3// \author Generated by fpp-to-cpp
4// \brief cpp file for CmdSequencer 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 namespace {
18 enum MsgTypeEnum {
19 CMDSEQUENCER_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT,
20 CMDRESPONSEIN_CMDRESPONSE,
21 PINGIN_PING,
22 SCHEDIN_SCHED,
23 SEQCANCELIN_CMDSEQCANCEL,
24 SEQRUNIN_CMDSEQIN,
25 CMD_CS_RUN,
26 CMD_CS_VALIDATE,
27 CMD_CS_CANCEL,
28 CMD_CS_START,
29 CMD_CS_STEP,
30 CMD_CS_AUTO,
31 CMD_CS_MANUAL,
32 CMD_CS_JOIN_WAIT,
33 };
34
35 // Get the max size by constructing a union of the async input, command, and
36 // internal port serialization sizes
37 union BuffUnion {
44 };
45
46 // Define a message buffer class large enough to handle all the
47 // asynchronous inputs to the component
48 class ComponentIpcSerializableBuffer :
50 {
51
52 public:
53
54 enum {
55 // Max. message size = size of data + message id + port
56 SERIALIZATION_SIZE =
57 sizeof(BuffUnion) +
58 sizeof(NATIVE_INT_TYPE) +
59 sizeof(NATIVE_INT_TYPE)
60 };
61
62 NATIVE_UINT_TYPE getBuffCapacity() const {
63 return sizeof(m_buff);
64 }
65
66 U8* getBuffAddr() {
67 return m_buff;
68 }
69
70 const U8* getBuffAddr() const {
71 return m_buff;
72 }
73
74 private:
75 // Should be the max of all the input ports serialized sizes...
76 U8 m_buff[SERIALIZATION_SIZE];
77
78 };
79 }
80
81 // ----------------------------------------------------------------------
82 // Component initialization
83 // ----------------------------------------------------------------------
84
85 void CmdSequencerComponentBase ::
86 init(
87 NATIVE_INT_TYPE queueDepth,
88 NATIVE_INT_TYPE instance
89 )
90 {
91 // Initialize base class
93
94 // Connect input port cmdIn
95 for (
96 PlatformIntType port = 0;
97 port < static_cast<PlatformIntType>(this->getNum_cmdIn_InputPorts());
98 port++
99 ) {
100 this->m_cmdIn_InputPort[port].init();
101 this->m_cmdIn_InputPort[port].addCallComp(
102 this,
103 m_p_cmdIn_in
104 );
105 this->m_cmdIn_InputPort[port].setPortNum(port);
106
107#if FW_OBJECT_NAMES == 1
108 char portName[120];
109 (void) snprintf(
110 portName,
111 sizeof(portName),
112 "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]",
113 this->m_objName,
114 port
115 );
116 this->m_cmdIn_InputPort[port].setObjName(portName);
117#endif
118 }
119
120 // Connect input port cmdResponseIn
121 for (
122 PlatformIntType port = 0;
123 port < static_cast<PlatformIntType>(this->getNum_cmdResponseIn_InputPorts());
124 port++
125 ) {
126 this->m_cmdResponseIn_InputPort[port].init();
127 this->m_cmdResponseIn_InputPort[port].addCallComp(
128 this,
129 m_p_cmdResponseIn_in
130 );
131 this->m_cmdResponseIn_InputPort[port].setPortNum(port);
132
133#if FW_OBJECT_NAMES == 1
134 char portName[120];
135 (void) snprintf(
136 portName,
137 sizeof(portName),
138 "%s_cmdResponseIn_InputPort[%" PRI_PlatformIntType "]",
139 this->m_objName,
140 port
141 );
142 this->m_cmdResponseIn_InputPort[port].setObjName(portName);
143#endif
144 }
145
146 // Connect input port pingIn
147 for (
148 PlatformIntType port = 0;
149 port < static_cast<PlatformIntType>(this->getNum_pingIn_InputPorts());
150 port++
151 ) {
152 this->m_pingIn_InputPort[port].init();
153 this->m_pingIn_InputPort[port].addCallComp(
154 this,
155 m_p_pingIn_in
156 );
157 this->m_pingIn_InputPort[port].setPortNum(port);
158
159#if FW_OBJECT_NAMES == 1
160 char portName[120];
161 (void) snprintf(
162 portName,
163 sizeof(portName),
164 "%s_pingIn_InputPort[%" PRI_PlatformIntType "]",
165 this->m_objName,
166 port
167 );
168 this->m_pingIn_InputPort[port].setObjName(portName);
169#endif
170 }
171
172 // Connect input port schedIn
173 for (
174 PlatformIntType port = 0;
175 port < static_cast<PlatformIntType>(this->getNum_schedIn_InputPorts());
176 port++
177 ) {
178 this->m_schedIn_InputPort[port].init();
179 this->m_schedIn_InputPort[port].addCallComp(
180 this,
181 m_p_schedIn_in
182 );
183 this->m_schedIn_InputPort[port].setPortNum(port);
184
185#if FW_OBJECT_NAMES == 1
186 char portName[120];
187 (void) snprintf(
188 portName,
189 sizeof(portName),
190 "%s_schedIn_InputPort[%" PRI_PlatformIntType "]",
191 this->m_objName,
192 port
193 );
194 this->m_schedIn_InputPort[port].setObjName(portName);
195#endif
196 }
197
198 // Connect input port seqCancelIn
199 for (
200 PlatformIntType port = 0;
201 port < static_cast<PlatformIntType>(this->getNum_seqCancelIn_InputPorts());
202 port++
203 ) {
204 this->m_seqCancelIn_InputPort[port].init();
205 this->m_seqCancelIn_InputPort[port].addCallComp(
206 this,
207 m_p_seqCancelIn_in
208 );
209 this->m_seqCancelIn_InputPort[port].setPortNum(port);
210
211#if FW_OBJECT_NAMES == 1
212 char portName[120];
213 (void) snprintf(
214 portName,
215 sizeof(portName),
216 "%s_seqCancelIn_InputPort[%" PRI_PlatformIntType "]",
217 this->m_objName,
218 port
219 );
220 this->m_seqCancelIn_InputPort[port].setObjName(portName);
221#endif
222 }
223
224 // Connect input port seqRunIn
225 for (
226 PlatformIntType port = 0;
227 port < static_cast<PlatformIntType>(this->getNum_seqRunIn_InputPorts());
228 port++
229 ) {
230 this->m_seqRunIn_InputPort[port].init();
231 this->m_seqRunIn_InputPort[port].addCallComp(
232 this,
233 m_p_seqRunIn_in
234 );
235 this->m_seqRunIn_InputPort[port].setPortNum(port);
236
237#if FW_OBJECT_NAMES == 1
238 char portName[120];
239 (void) snprintf(
240 portName,
241 sizeof(portName),
242 "%s_seqRunIn_InputPort[%" PRI_PlatformIntType "]",
243 this->m_objName,
244 port
245 );
246 this->m_seqRunIn_InputPort[port].setObjName(portName);
247#endif
248 }
249
250#if FW_ENABLE_TEXT_LOGGING == 1
251 // Connect output port LogText
252 for (
253 PlatformIntType port = 0;
254 port < static_cast<PlatformIntType>(this->getNum_LogText_OutputPorts());
255 port++
256 ) {
257 this->m_LogText_OutputPort[port].init();
258
259#if FW_OBJECT_NAMES == 1
260 char portName[120];
261 (void) snprintf(
262 portName,
263 sizeof(portName),
264 "%s_LogText_OutputPort[%" PRI_PlatformIntType "]",
265 this->m_objName,
266 port
267 );
268 this->m_LogText_OutputPort[port].setObjName(portName);
269#endif
270 }
271#endif
272
273 // Connect output port cmdRegOut
274 for (
275 PlatformIntType port = 0;
276 port < static_cast<PlatformIntType>(this->getNum_cmdRegOut_OutputPorts());
277 port++
278 ) {
279 this->m_cmdRegOut_OutputPort[port].init();
280
281#if FW_OBJECT_NAMES == 1
282 char portName[120];
283 (void) snprintf(
284 portName,
285 sizeof(portName),
286 "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]",
287 this->m_objName,
288 port
289 );
290 this->m_cmdRegOut_OutputPort[port].setObjName(portName);
291#endif
292 }
293
294 // Connect output port cmdResponseOut
295 for (
296 PlatformIntType port = 0;
297 port < static_cast<PlatformIntType>(this->getNum_cmdResponseOut_OutputPorts());
298 port++
299 ) {
300 this->m_cmdResponseOut_OutputPort[port].init();
301
302#if FW_OBJECT_NAMES == 1
303 char portName[120];
304 (void) snprintf(
305 portName,
306 sizeof(portName),
307 "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]",
308 this->m_objName,
309 port
310 );
311 this->m_cmdResponseOut_OutputPort[port].setObjName(portName);
312#endif
313 }
314
315 // Connect output port logOut
316 for (
317 PlatformIntType port = 0;
318 port < static_cast<PlatformIntType>(this->getNum_logOut_OutputPorts());
319 port++
320 ) {
321 this->m_logOut_OutputPort[port].init();
322
323#if FW_OBJECT_NAMES == 1
324 char portName[120];
325 (void) snprintf(
326 portName,
327 sizeof(portName),
328 "%s_logOut_OutputPort[%" PRI_PlatformIntType "]",
329 this->m_objName,
330 port
331 );
332 this->m_logOut_OutputPort[port].setObjName(portName);
333#endif
334 }
335
336 // Connect output port timeCaller
337 for (
338 PlatformIntType port = 0;
339 port < static_cast<PlatformIntType>(this->getNum_timeCaller_OutputPorts());
340 port++
341 ) {
342 this->m_timeCaller_OutputPort[port].init();
343
344#if FW_OBJECT_NAMES == 1
345 char portName[120];
346 (void) snprintf(
347 portName,
348 sizeof(portName),
349 "%s_timeCaller_OutputPort[%" PRI_PlatformIntType "]",
350 this->m_objName,
351 port
352 );
353 this->m_timeCaller_OutputPort[port].setObjName(portName);
354#endif
355 }
356
357 // Connect output port tlmOut
358 for (
359 PlatformIntType port = 0;
360 port < static_cast<PlatformIntType>(this->getNum_tlmOut_OutputPorts());
361 port++
362 ) {
363 this->m_tlmOut_OutputPort[port].init();
364
365#if FW_OBJECT_NAMES == 1
366 char portName[120];
367 (void) snprintf(
368 portName,
369 sizeof(portName),
370 "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]",
371 this->m_objName,
372 port
373 );
374 this->m_tlmOut_OutputPort[port].setObjName(portName);
375#endif
376 }
377
378 // Connect output port comCmdOut
379 for (
380 PlatformIntType port = 0;
381 port < static_cast<PlatformIntType>(this->getNum_comCmdOut_OutputPorts());
382 port++
383 ) {
384 this->m_comCmdOut_OutputPort[port].init();
385
386#if FW_OBJECT_NAMES == 1
387 char portName[120];
388 (void) snprintf(
389 portName,
390 sizeof(portName),
391 "%s_comCmdOut_OutputPort[%" PRI_PlatformIntType "]",
392 this->m_objName,
393 port
394 );
395 this->m_comCmdOut_OutputPort[port].setObjName(portName);
396#endif
397 }
398
399 // Connect output port pingOut
400 for (
401 PlatformIntType port = 0;
402 port < static_cast<PlatformIntType>(this->getNum_pingOut_OutputPorts());
403 port++
404 ) {
405 this->m_pingOut_OutputPort[port].init();
406
407#if FW_OBJECT_NAMES == 1
408 char portName[120];
409 (void) snprintf(
410 portName,
411 sizeof(portName),
412 "%s_pingOut_OutputPort[%" PRI_PlatformIntType "]",
413 this->m_objName,
414 port
415 );
416 this->m_pingOut_OutputPort[port].setObjName(portName);
417#endif
418 }
419
420 // Connect output port seqDone
421 for (
422 PlatformIntType port = 0;
423 port < static_cast<PlatformIntType>(this->getNum_seqDone_OutputPorts());
424 port++
425 ) {
426 this->m_seqDone_OutputPort[port].init();
427
428#if FW_OBJECT_NAMES == 1
429 char portName[120];
430 (void) snprintf(
431 portName,
432 sizeof(portName),
433 "%s_seqDone_OutputPort[%" PRI_PlatformIntType "]",
434 this->m_objName,
435 port
436 );
437 this->m_seqDone_OutputPort[port].setObjName(portName);
438#endif
439 }
440
441 Os::Queue::QueueStatus qStat = this->createQueue(
442 queueDepth,
443 ComponentIpcSerializableBuffer::SERIALIZATION_SIZE
444 );
445 FW_ASSERT(
446 Os::Queue::QUEUE_OK == qStat,
447 static_cast<FwAssertArgType>(qStat)
448 );
449 }
450
451 // ----------------------------------------------------------------------
452 // Getters for special input ports
453 // ----------------------------------------------------------------------
454
455 Fw::InputCmdPort* CmdSequencerComponentBase ::
456 get_cmdIn_InputPort(NATIVE_INT_TYPE portNum)
457 {
458 FW_ASSERT(
459 portNum < this->getNum_cmdIn_InputPorts(),
460 static_cast<FwAssertArgType>(portNum)
461 );
462
463 return &this->m_cmdIn_InputPort[portNum];
464 }
465
466 // ----------------------------------------------------------------------
467 // Getters for typed input ports
468 // ----------------------------------------------------------------------
469
470 Fw::InputCmdResponsePort* CmdSequencerComponentBase ::
471 get_cmdResponseIn_InputPort(NATIVE_INT_TYPE portNum)
472 {
473 FW_ASSERT(
474 portNum < this->getNum_cmdResponseIn_InputPorts(),
475 static_cast<FwAssertArgType>(portNum)
476 );
477
478 return &this->m_cmdResponseIn_InputPort[portNum];
479 }
480
481 Svc::InputPingPort* CmdSequencerComponentBase ::
482 get_pingIn_InputPort(NATIVE_INT_TYPE portNum)
483 {
484 FW_ASSERT(
485 portNum < this->getNum_pingIn_InputPorts(),
486 static_cast<FwAssertArgType>(portNum)
487 );
488
489 return &this->m_pingIn_InputPort[portNum];
490 }
491
492 Svc::InputSchedPort* CmdSequencerComponentBase ::
493 get_schedIn_InputPort(NATIVE_INT_TYPE portNum)
494 {
495 FW_ASSERT(
496 portNum < this->getNum_schedIn_InputPorts(),
497 static_cast<FwAssertArgType>(portNum)
498 );
499
500 return &this->m_schedIn_InputPort[portNum];
501 }
502
503 Svc::InputCmdSeqCancelPort* CmdSequencerComponentBase ::
504 get_seqCancelIn_InputPort(NATIVE_INT_TYPE portNum)
505 {
506 FW_ASSERT(
507 portNum < this->getNum_seqCancelIn_InputPorts(),
508 static_cast<FwAssertArgType>(portNum)
509 );
510
511 return &this->m_seqCancelIn_InputPort[portNum];
512 }
513
514 Svc::InputCmdSeqInPort* CmdSequencerComponentBase ::
515 get_seqRunIn_InputPort(NATIVE_INT_TYPE portNum)
516 {
517 FW_ASSERT(
518 portNum < this->getNum_seqRunIn_InputPorts(),
519 static_cast<FwAssertArgType>(portNum)
520 );
521
522 return &this->m_seqRunIn_InputPort[portNum];
523 }
524
525 // ----------------------------------------------------------------------
526 // Connect input ports to special output ports
527 // ----------------------------------------------------------------------
528
529#if FW_ENABLE_TEXT_LOGGING == 1
530
531 void CmdSequencerComponentBase ::
532 set_LogText_OutputPort(
533 NATIVE_INT_TYPE portNum,
535 )
536 {
537 FW_ASSERT(
538 portNum < this->getNum_LogText_OutputPorts(),
539 static_cast<FwAssertArgType>(portNum)
540 );
541
542 this->m_LogText_OutputPort[portNum].addCallPort(port);
543 }
544
545#endif
546
547 void CmdSequencerComponentBase ::
548 set_cmdRegOut_OutputPort(
549 NATIVE_INT_TYPE portNum,
551 )
552 {
553 FW_ASSERT(
554 portNum < this->getNum_cmdRegOut_OutputPorts(),
555 static_cast<FwAssertArgType>(portNum)
556 );
557
558 this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
559 }
560
561 void CmdSequencerComponentBase ::
562 set_cmdResponseOut_OutputPort(
563 NATIVE_INT_TYPE portNum,
565 )
566 {
567 FW_ASSERT(
568 portNum < this->getNum_cmdResponseOut_OutputPorts(),
569 static_cast<FwAssertArgType>(portNum)
570 );
571
572 this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
573 }
574
575 void CmdSequencerComponentBase ::
576 set_logOut_OutputPort(
577 NATIVE_INT_TYPE portNum,
578 Fw::InputLogPort* port
579 )
580 {
581 FW_ASSERT(
582 portNum < this->getNum_logOut_OutputPorts(),
583 static_cast<FwAssertArgType>(portNum)
584 );
585
586 this->m_logOut_OutputPort[portNum].addCallPort(port);
587 }
588
589 void CmdSequencerComponentBase ::
590 set_timeCaller_OutputPort(
591 NATIVE_INT_TYPE portNum,
593 )
594 {
595 FW_ASSERT(
596 portNum < this->getNum_timeCaller_OutputPorts(),
597 static_cast<FwAssertArgType>(portNum)
598 );
599
600 this->m_timeCaller_OutputPort[portNum].addCallPort(port);
601 }
602
603 void CmdSequencerComponentBase ::
604 set_tlmOut_OutputPort(
605 NATIVE_INT_TYPE portNum,
606 Fw::InputTlmPort* port
607 )
608 {
609 FW_ASSERT(
610 portNum < this->getNum_tlmOut_OutputPorts(),
611 static_cast<FwAssertArgType>(portNum)
612 );
613
614 this->m_tlmOut_OutputPort[portNum].addCallPort(port);
615 }
616
617 // ----------------------------------------------------------------------
618 // Connect typed input ports to typed output ports
619 // ----------------------------------------------------------------------
620
621 void CmdSequencerComponentBase ::
622 set_comCmdOut_OutputPort(
623 NATIVE_INT_TYPE portNum,
624 Fw::InputComPort* port
625 )
626 {
627 FW_ASSERT(
628 portNum < this->getNum_comCmdOut_OutputPorts(),
629 static_cast<FwAssertArgType>(portNum)
630 );
631
632 this->m_comCmdOut_OutputPort[portNum].addCallPort(port);
633 }
634
635 void CmdSequencerComponentBase ::
636 set_pingOut_OutputPort(
637 NATIVE_INT_TYPE portNum,
639 )
640 {
641 FW_ASSERT(
642 portNum < this->getNum_pingOut_OutputPorts(),
643 static_cast<FwAssertArgType>(portNum)
644 );
645
646 this->m_pingOut_OutputPort[portNum].addCallPort(port);
647 }
648
649 void CmdSequencerComponentBase ::
650 set_seqDone_OutputPort(
651 NATIVE_INT_TYPE portNum,
653 )
654 {
655 FW_ASSERT(
656 portNum < this->getNum_seqDone_OutputPorts(),
657 static_cast<FwAssertArgType>(portNum)
658 );
659
660 this->m_seqDone_OutputPort[portNum].addCallPort(port);
661 }
662
663#if FW_PORT_SERIALIZATION
664
665 // ----------------------------------------------------------------------
666 // Connect serial input ports to special output ports
667 // ----------------------------------------------------------------------
668
669#if FW_ENABLE_TEXT_LOGGING == 1
670
671 void CmdSequencerComponentBase ::
672 set_LogText_OutputPort(
673 NATIVE_INT_TYPE portNum,
674 Fw::InputSerializePort* port
675 )
676 {
677 FW_ASSERT(
678 portNum < this->getNum_LogText_OutputPorts(),
679 static_cast<FwAssertArgType>(portNum)
680 );
681
682 this->m_LogText_OutputPort[portNum].registerSerialPort(port);
683 }
684
685#endif
686
687 void CmdSequencerComponentBase ::
688 set_cmdRegOut_OutputPort(
689 NATIVE_INT_TYPE portNum,
690 Fw::InputSerializePort* port
691 )
692 {
693 FW_ASSERT(
694 portNum < this->getNum_cmdRegOut_OutputPorts(),
695 static_cast<FwAssertArgType>(portNum)
696 );
697
698 this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
699 }
700
701 void CmdSequencerComponentBase ::
702 set_cmdResponseOut_OutputPort(
703 NATIVE_INT_TYPE portNum,
704 Fw::InputSerializePort* port
705 )
706 {
707 FW_ASSERT(
708 portNum < this->getNum_cmdResponseOut_OutputPorts(),
709 static_cast<FwAssertArgType>(portNum)
710 );
711
712 this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
713 }
714
715 void CmdSequencerComponentBase ::
716 set_logOut_OutputPort(
717 NATIVE_INT_TYPE portNum,
718 Fw::InputSerializePort* port
719 )
720 {
721 FW_ASSERT(
722 portNum < this->getNum_logOut_OutputPorts(),
723 static_cast<FwAssertArgType>(portNum)
724 );
725
726 this->m_logOut_OutputPort[portNum].registerSerialPort(port);
727 }
728
729 void CmdSequencerComponentBase ::
730 set_timeCaller_OutputPort(
731 NATIVE_INT_TYPE portNum,
732 Fw::InputSerializePort* port
733 )
734 {
735 FW_ASSERT(
736 portNum < this->getNum_timeCaller_OutputPorts(),
737 static_cast<FwAssertArgType>(portNum)
738 );
739
740 this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
741 }
742
743 void CmdSequencerComponentBase ::
744 set_tlmOut_OutputPort(
745 NATIVE_INT_TYPE portNum,
746 Fw::InputSerializePort* port
747 )
748 {
749 FW_ASSERT(
750 portNum < this->getNum_tlmOut_OutputPorts(),
751 static_cast<FwAssertArgType>(portNum)
752 );
753
754 this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
755 }
756
757#endif
758
759#if FW_PORT_SERIALIZATION
760
761 // ----------------------------------------------------------------------
762 // Connect serial input ports to typed output ports
763 // ----------------------------------------------------------------------
764
765 void CmdSequencerComponentBase ::
766 set_comCmdOut_OutputPort(
767 NATIVE_INT_TYPE portNum,
768 Fw::InputSerializePort* port
769 )
770 {
771 FW_ASSERT(
772 portNum < this->getNum_comCmdOut_OutputPorts(),
773 static_cast<FwAssertArgType>(portNum)
774 );
775
776 this->m_comCmdOut_OutputPort[portNum].registerSerialPort(port);
777 }
778
779 void CmdSequencerComponentBase ::
780 set_pingOut_OutputPort(
781 NATIVE_INT_TYPE portNum,
782 Fw::InputSerializePort* port
783 )
784 {
785 FW_ASSERT(
786 portNum < this->getNum_pingOut_OutputPorts(),
787 static_cast<FwAssertArgType>(portNum)
788 );
789
790 this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
791 }
792
793 void CmdSequencerComponentBase ::
794 set_seqDone_OutputPort(
795 NATIVE_INT_TYPE portNum,
796 Fw::InputSerializePort* port
797 )
798 {
799 FW_ASSERT(
800 portNum < this->getNum_seqDone_OutputPorts(),
801 static_cast<FwAssertArgType>(portNum)
802 );
803
804 this->m_seqDone_OutputPort[portNum].registerSerialPort(port);
805 }
806
807#endif
808
809 // ----------------------------------------------------------------------
810 // Command registration
811 // ----------------------------------------------------------------------
812
813 void CmdSequencerComponentBase ::
814 regCommands()
815 {
816 FW_ASSERT(this->m_cmdRegOut_OutputPort[0].isConnected());
817
818 this->m_cmdRegOut_OutputPort[0].invoke(
819 this->getIdBase() + OPCODE_CS_RUN
820 );
821
822 this->m_cmdRegOut_OutputPort[0].invoke(
823 this->getIdBase() + OPCODE_CS_VALIDATE
824 );
825
826 this->m_cmdRegOut_OutputPort[0].invoke(
827 this->getIdBase() + OPCODE_CS_CANCEL
828 );
829
830 this->m_cmdRegOut_OutputPort[0].invoke(
831 this->getIdBase() + OPCODE_CS_START
832 );
833
834 this->m_cmdRegOut_OutputPort[0].invoke(
835 this->getIdBase() + OPCODE_CS_STEP
836 );
837
838 this->m_cmdRegOut_OutputPort[0].invoke(
839 this->getIdBase() + OPCODE_CS_AUTO
840 );
841
842 this->m_cmdRegOut_OutputPort[0].invoke(
843 this->getIdBase() + OPCODE_CS_MANUAL
844 );
845
846 this->m_cmdRegOut_OutputPort[0].invoke(
847 this->getIdBase() + OPCODE_CS_JOIN_WAIT
848 );
849 }
850
851 // ----------------------------------------------------------------------
852 // Component construction and destruction
853 // ----------------------------------------------------------------------
854
855 CmdSequencerComponentBase ::
856 CmdSequencerComponentBase(const char* compName) :
857 Fw::ActiveComponentBase(compName)
858 {
859
860 }
861
862 CmdSequencerComponentBase ::
863 ~CmdSequencerComponentBase()
864 {
865
866 }
867
868 // ----------------------------------------------------------------------
869 // Getters for numbers of special input ports
870 // ----------------------------------------------------------------------
871
872 NATIVE_INT_TYPE CmdSequencerComponentBase ::
873 getNum_cmdIn_InputPorts() const
874 {
875 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdIn_InputPort));
876 }
877
878 // ----------------------------------------------------------------------
879 // Getters for numbers of typed input ports
880 // ----------------------------------------------------------------------
881
882 NATIVE_INT_TYPE CmdSequencerComponentBase ::
883 getNum_cmdResponseIn_InputPorts() const
884 {
885 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdResponseIn_InputPort));
886 }
887
888 NATIVE_INT_TYPE CmdSequencerComponentBase ::
889 getNum_pingIn_InputPorts() const
890 {
891 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_pingIn_InputPort));
892 }
893
894 NATIVE_INT_TYPE CmdSequencerComponentBase ::
895 getNum_schedIn_InputPorts() const
896 {
897 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_schedIn_InputPort));
898 }
899
900 NATIVE_INT_TYPE CmdSequencerComponentBase ::
901 getNum_seqCancelIn_InputPorts() const
902 {
903 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_seqCancelIn_InputPort));
904 }
905
906 NATIVE_INT_TYPE CmdSequencerComponentBase ::
907 getNum_seqRunIn_InputPorts() const
908 {
909 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_seqRunIn_InputPort));
910 }
911
912 // ----------------------------------------------------------------------
913 // Getters for numbers of special output ports
914 // ----------------------------------------------------------------------
915
916#if FW_ENABLE_TEXT_LOGGING == 1
917
918 NATIVE_INT_TYPE CmdSequencerComponentBase ::
919 getNum_LogText_OutputPorts() const
920 {
921 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_LogText_OutputPort));
922 }
923
924#endif
925
926 NATIVE_INT_TYPE CmdSequencerComponentBase ::
927 getNum_cmdRegOut_OutputPorts() const
928 {
929 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdRegOut_OutputPort));
930 }
931
932 NATIVE_INT_TYPE CmdSequencerComponentBase ::
933 getNum_cmdResponseOut_OutputPorts() const
934 {
935 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdResponseOut_OutputPort));
936 }
937
938 NATIVE_INT_TYPE CmdSequencerComponentBase ::
939 getNum_logOut_OutputPorts() const
940 {
941 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_logOut_OutputPort));
942 }
943
944 NATIVE_INT_TYPE CmdSequencerComponentBase ::
945 getNum_timeCaller_OutputPorts() const
946 {
947 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_timeCaller_OutputPort));
948 }
949
950 NATIVE_INT_TYPE CmdSequencerComponentBase ::
951 getNum_tlmOut_OutputPorts() const
952 {
953 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_tlmOut_OutputPort));
954 }
955
956 // ----------------------------------------------------------------------
957 // Getters for numbers of typed output ports
958 // ----------------------------------------------------------------------
959
960 NATIVE_INT_TYPE CmdSequencerComponentBase ::
961 getNum_comCmdOut_OutputPorts() const
962 {
963 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_comCmdOut_OutputPort));
964 }
965
966 NATIVE_INT_TYPE CmdSequencerComponentBase ::
967 getNum_pingOut_OutputPorts() const
968 {
969 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_pingOut_OutputPort));
970 }
971
972 NATIVE_INT_TYPE CmdSequencerComponentBase ::
973 getNum_seqDone_OutputPorts() const
974 {
975 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_seqDone_OutputPort));
976 }
977
978 // ----------------------------------------------------------------------
979 // Connection status queries for special output ports
980 // ----------------------------------------------------------------------
981
982#if FW_ENABLE_TEXT_LOGGING == 1
983
984 bool CmdSequencerComponentBase ::
985 isConnected_LogText_OutputPort(NATIVE_INT_TYPE portNum)
986 {
987 FW_ASSERT(
988 portNum < this->getNum_LogText_OutputPorts(),
989 static_cast<FwAssertArgType>(portNum)
990 );
991
992 return this->m_LogText_OutputPort[portNum].isConnected();
993 }
994
995#endif
996
997 bool CmdSequencerComponentBase ::
998 isConnected_cmdRegOut_OutputPort(NATIVE_INT_TYPE portNum)
999 {
1000 FW_ASSERT(
1001 portNum < this->getNum_cmdRegOut_OutputPorts(),
1002 static_cast<FwAssertArgType>(portNum)
1003 );
1004
1005 return this->m_cmdRegOut_OutputPort[portNum].isConnected();
1006 }
1007
1008 bool CmdSequencerComponentBase ::
1009 isConnected_cmdResponseOut_OutputPort(NATIVE_INT_TYPE portNum)
1010 {
1011 FW_ASSERT(
1012 portNum < this->getNum_cmdResponseOut_OutputPorts(),
1013 static_cast<FwAssertArgType>(portNum)
1014 );
1015
1016 return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
1017 }
1018
1019 bool CmdSequencerComponentBase ::
1020 isConnected_logOut_OutputPort(NATIVE_INT_TYPE portNum)
1021 {
1022 FW_ASSERT(
1023 portNum < this->getNum_logOut_OutputPorts(),
1024 static_cast<FwAssertArgType>(portNum)
1025 );
1026
1027 return this->m_logOut_OutputPort[portNum].isConnected();
1028 }
1029
1030 bool CmdSequencerComponentBase ::
1031 isConnected_timeCaller_OutputPort(NATIVE_INT_TYPE portNum)
1032 {
1033 FW_ASSERT(
1034 portNum < this->getNum_timeCaller_OutputPorts(),
1035 static_cast<FwAssertArgType>(portNum)
1036 );
1037
1038 return this->m_timeCaller_OutputPort[portNum].isConnected();
1039 }
1040
1041 bool CmdSequencerComponentBase ::
1042 isConnected_tlmOut_OutputPort(NATIVE_INT_TYPE portNum)
1043 {
1044 FW_ASSERT(
1045 portNum < this->getNum_tlmOut_OutputPorts(),
1046 static_cast<FwAssertArgType>(portNum)
1047 );
1048
1049 return this->m_tlmOut_OutputPort[portNum].isConnected();
1050 }
1051
1052 // ----------------------------------------------------------------------
1053 // Connection status queries for typed output ports
1054 // ----------------------------------------------------------------------
1055
1056 bool CmdSequencerComponentBase ::
1057 isConnected_comCmdOut_OutputPort(NATIVE_INT_TYPE portNum)
1058 {
1059 FW_ASSERT(
1060 portNum < this->getNum_comCmdOut_OutputPorts(),
1061 static_cast<FwAssertArgType>(portNum)
1062 );
1063
1064 return this->m_comCmdOut_OutputPort[portNum].isConnected();
1065 }
1066
1067 bool CmdSequencerComponentBase ::
1068 isConnected_pingOut_OutputPort(NATIVE_INT_TYPE portNum)
1069 {
1070 FW_ASSERT(
1071 portNum < this->getNum_pingOut_OutputPorts(),
1072 static_cast<FwAssertArgType>(portNum)
1073 );
1074
1075 return this->m_pingOut_OutputPort[portNum].isConnected();
1076 }
1077
1078 bool CmdSequencerComponentBase ::
1079 isConnected_seqDone_OutputPort(NATIVE_INT_TYPE portNum)
1080 {
1081 FW_ASSERT(
1082 portNum < this->getNum_seqDone_OutputPorts(),
1083 static_cast<FwAssertArgType>(portNum)
1084 );
1085
1086 return this->m_seqDone_OutputPort[portNum].isConnected();
1087 }
1088
1089 // ----------------------------------------------------------------------
1090 // Port handler base-class functions for typed input ports
1091 //
1092 // Call these functions directly to bypass the corresponding ports
1093 // ----------------------------------------------------------------------
1094
1095 void CmdSequencerComponentBase ::
1096 cmdResponseIn_handlerBase(
1097 NATIVE_INT_TYPE portNum,
1098 FwOpcodeType opCode,
1099 U32 cmdSeq,
1100 const Fw::CmdResponse& response
1101 )
1102 {
1103 // Make sure port number is valid
1104 FW_ASSERT(
1105 portNum < this->getNum_cmdResponseIn_InputPorts(),
1106 static_cast<FwAssertArgType>(portNum)
1107 );
1108
1109 // Call pre-message hook
1110 cmdResponseIn_preMsgHook(
1111 portNum,
1112 opCode,
1113 cmdSeq,
1114 response
1115 );
1116 ComponentIpcSerializableBuffer msg;
1118
1119 // Serialize message ID
1120 _status = msg.serialize(
1121 static_cast<NATIVE_INT_TYPE>(CMDRESPONSEIN_CMDRESPONSE)
1122 );
1123 FW_ASSERT(
1124 _status == Fw::FW_SERIALIZE_OK,
1125 static_cast<FwAssertArgType>(_status)
1126 );
1127
1128 // Serialize port number
1129 _status = msg.serialize(portNum);
1130 FW_ASSERT(
1131 _status == Fw::FW_SERIALIZE_OK,
1132 static_cast<FwAssertArgType>(_status)
1133 );
1134
1135 // Serialize argument opCode
1136 _status = msg.serialize(opCode);
1137 FW_ASSERT(
1138 _status == Fw::FW_SERIALIZE_OK,
1139 static_cast<FwAssertArgType>(_status)
1140 );
1141
1142 // Serialize argument cmdSeq
1143 _status = msg.serialize(cmdSeq);
1144 FW_ASSERT(
1145 _status == Fw::FW_SERIALIZE_OK,
1146 static_cast<FwAssertArgType>(_status)
1147 );
1148
1149 // Serialize argument response
1150 _status = msg.serialize(response);
1151 FW_ASSERT(
1152 _status == Fw::FW_SERIALIZE_OK,
1153 static_cast<FwAssertArgType>(_status)
1154 );
1155
1156 // Send message
1158 Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1159
1160 FW_ASSERT(
1161 qStatus == Os::Queue::QUEUE_OK,
1162 static_cast<FwAssertArgType>(qStatus)
1163 );
1164 }
1165
1166 void CmdSequencerComponentBase ::
1167 pingIn_handlerBase(
1168 NATIVE_INT_TYPE portNum,
1169 U32 key
1170 )
1171 {
1172 // Make sure port number is valid
1173 FW_ASSERT(
1174 portNum < this->getNum_pingIn_InputPorts(),
1175 static_cast<FwAssertArgType>(portNum)
1176 );
1177
1178 // Call pre-message hook
1179 pingIn_preMsgHook(
1180 portNum,
1181 key
1182 );
1183 ComponentIpcSerializableBuffer msg;
1185
1186 // Serialize message ID
1187 _status = msg.serialize(
1188 static_cast<NATIVE_INT_TYPE>(PINGIN_PING)
1189 );
1190 FW_ASSERT(
1191 _status == Fw::FW_SERIALIZE_OK,
1192 static_cast<FwAssertArgType>(_status)
1193 );
1194
1195 // Serialize port number
1196 _status = msg.serialize(portNum);
1197 FW_ASSERT(
1198 _status == Fw::FW_SERIALIZE_OK,
1199 static_cast<FwAssertArgType>(_status)
1200 );
1201
1202 // Serialize argument key
1203 _status = msg.serialize(key);
1204 FW_ASSERT(
1205 _status == Fw::FW_SERIALIZE_OK,
1206 static_cast<FwAssertArgType>(_status)
1207 );
1208
1209 // Send message
1211 Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1212
1213 FW_ASSERT(
1214 qStatus == Os::Queue::QUEUE_OK,
1215 static_cast<FwAssertArgType>(qStatus)
1216 );
1217 }
1218
1219 void CmdSequencerComponentBase ::
1220 schedIn_handlerBase(
1221 NATIVE_INT_TYPE portNum,
1222 NATIVE_UINT_TYPE context
1223 )
1224 {
1225 // Make sure port number is valid
1226 FW_ASSERT(
1227 portNum < this->getNum_schedIn_InputPorts(),
1228 static_cast<FwAssertArgType>(portNum)
1229 );
1230
1231 // Call pre-message hook
1232 schedIn_preMsgHook(
1233 portNum,
1234 context
1235 );
1236 ComponentIpcSerializableBuffer msg;
1238
1239 // Serialize message ID
1240 _status = msg.serialize(
1241 static_cast<NATIVE_INT_TYPE>(SCHEDIN_SCHED)
1242 );
1243 FW_ASSERT(
1244 _status == Fw::FW_SERIALIZE_OK,
1245 static_cast<FwAssertArgType>(_status)
1246 );
1247
1248 // Serialize port number
1249 _status = msg.serialize(portNum);
1250 FW_ASSERT(
1251 _status == Fw::FW_SERIALIZE_OK,
1252 static_cast<FwAssertArgType>(_status)
1253 );
1254
1255 // Serialize argument context
1256 _status = msg.serialize(context);
1257 FW_ASSERT(
1258 _status == Fw::FW_SERIALIZE_OK,
1259 static_cast<FwAssertArgType>(_status)
1260 );
1261
1262 // Send message
1264 Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1265
1266 FW_ASSERT(
1267 qStatus == Os::Queue::QUEUE_OK,
1268 static_cast<FwAssertArgType>(qStatus)
1269 );
1270 }
1271
1272 void CmdSequencerComponentBase ::
1273 seqCancelIn_handlerBase(NATIVE_INT_TYPE portNum)
1274 {
1275 // Make sure port number is valid
1276 FW_ASSERT(
1277 portNum < this->getNum_seqCancelIn_InputPorts(),
1278 static_cast<FwAssertArgType>(portNum)
1279 );
1280
1281 // Call pre-message hook
1282 seqCancelIn_preMsgHook(portNum);
1283 ComponentIpcSerializableBuffer msg;
1285
1286 // Serialize message ID
1287 _status = msg.serialize(
1288 static_cast<NATIVE_INT_TYPE>(SEQCANCELIN_CMDSEQCANCEL)
1289 );
1290 FW_ASSERT(
1291 _status == Fw::FW_SERIALIZE_OK,
1292 static_cast<FwAssertArgType>(_status)
1293 );
1294
1295 // Serialize port number
1296 _status = msg.serialize(portNum);
1297 FW_ASSERT(
1298 _status == Fw::FW_SERIALIZE_OK,
1299 static_cast<FwAssertArgType>(_status)
1300 );
1301
1302 // Send message
1304 Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1305
1306 FW_ASSERT(
1307 qStatus == Os::Queue::QUEUE_OK,
1308 static_cast<FwAssertArgType>(qStatus)
1309 );
1310 }
1311
1312 void CmdSequencerComponentBase ::
1313 seqRunIn_handlerBase(
1314 NATIVE_INT_TYPE portNum,
1315 Fw::String& filename
1316 )
1317 {
1318 // Make sure port number is valid
1319 FW_ASSERT(
1320 portNum < this->getNum_seqRunIn_InputPorts(),
1321 static_cast<FwAssertArgType>(portNum)
1322 );
1323
1324 // Call pre-message hook
1325 seqRunIn_preMsgHook(
1326 portNum,
1327 filename
1328 );
1329 ComponentIpcSerializableBuffer msg;
1331
1332 // Serialize message ID
1333 _status = msg.serialize(
1334 static_cast<NATIVE_INT_TYPE>(SEQRUNIN_CMDSEQIN)
1335 );
1336 FW_ASSERT(
1337 _status == Fw::FW_SERIALIZE_OK,
1338 static_cast<FwAssertArgType>(_status)
1339 );
1340
1341 // Serialize port number
1342 _status = msg.serialize(portNum);
1343 FW_ASSERT(
1344 _status == Fw::FW_SERIALIZE_OK,
1345 static_cast<FwAssertArgType>(_status)
1346 );
1347
1348 // Serialize argument filename
1349 _status = msg.serialize(filename);
1350 FW_ASSERT(
1351 _status == Fw::FW_SERIALIZE_OK,
1352 static_cast<FwAssertArgType>(_status)
1353 );
1354
1355 // Send message
1357 Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1358
1359 FW_ASSERT(
1360 qStatus == Os::Queue::QUEUE_OK,
1361 static_cast<FwAssertArgType>(qStatus)
1362 );
1363 }
1364
1365 // ----------------------------------------------------------------------
1366 // Pre-message hooks for typed async input ports
1367 //
1368 // Each of these functions is invoked just before processing a message
1369 // on the corresponding port. By default, they do nothing. You can
1370 // override them to provide specific pre-message behavior.
1371 // ----------------------------------------------------------------------
1372
1373 void CmdSequencerComponentBase ::
1374 cmdResponseIn_preMsgHook(
1375 NATIVE_INT_TYPE portNum,
1376 FwOpcodeType opCode,
1377 U32 cmdSeq,
1378 const Fw::CmdResponse& response
1379 )
1380 {
1381 // Default: no-op
1382 }
1383
1384 void CmdSequencerComponentBase ::
1385 pingIn_preMsgHook(
1386 NATIVE_INT_TYPE portNum,
1387 U32 key
1388 )
1389 {
1390 // Default: no-op
1391 }
1392
1393 void CmdSequencerComponentBase ::
1394 schedIn_preMsgHook(
1395 NATIVE_INT_TYPE portNum,
1396 NATIVE_UINT_TYPE context
1397 )
1398 {
1399 // Default: no-op
1400 }
1401
1402 void CmdSequencerComponentBase ::
1403 seqCancelIn_preMsgHook(NATIVE_INT_TYPE portNum)
1404 {
1405 // Default: no-op
1406 }
1407
1408 void CmdSequencerComponentBase ::
1409 seqRunIn_preMsgHook(
1410 NATIVE_INT_TYPE portNum,
1411 Fw::String& filename
1412 )
1413 {
1414 // Default: no-op
1415 }
1416
1417 // ----------------------------------------------------------------------
1418 // Invocation functions for typed output ports
1419 // ----------------------------------------------------------------------
1420
1421 void CmdSequencerComponentBase ::
1422 comCmdOut_out(
1423 NATIVE_INT_TYPE portNum,
1424 Fw::ComBuffer& data,
1425 U32 context
1426 )
1427 {
1428 FW_ASSERT(
1429 portNum < this->getNum_comCmdOut_OutputPorts(),
1430 static_cast<FwAssertArgType>(portNum)
1431 );
1432 this->m_comCmdOut_OutputPort[portNum].invoke(
1433 data,
1434 context
1435 );
1436 }
1437
1438 void CmdSequencerComponentBase ::
1439 pingOut_out(
1440 NATIVE_INT_TYPE portNum,
1441 U32 key
1442 )
1443 {
1444 FW_ASSERT(
1445 portNum < this->getNum_pingOut_OutputPorts(),
1446 static_cast<FwAssertArgType>(portNum)
1447 );
1448 this->m_pingOut_OutputPort[portNum].invoke(
1449 key
1450 );
1451 }
1452
1453 void CmdSequencerComponentBase ::
1454 seqDone_out(
1455 NATIVE_INT_TYPE portNum,
1456 FwOpcodeType opCode,
1457 U32 cmdSeq,
1458 const Fw::CmdResponse& response
1459 )
1460 {
1461 FW_ASSERT(
1462 portNum < this->getNum_seqDone_OutputPorts(),
1463 static_cast<FwAssertArgType>(portNum)
1464 );
1465 this->m_seqDone_OutputPort[portNum].invoke(
1466 opCode,
1467 cmdSeq,
1468 response
1469 );
1470 }
1471
1472 // ----------------------------------------------------------------------
1473 // Command response
1474 // ----------------------------------------------------------------------
1475
1476 void CmdSequencerComponentBase ::
1477 cmdResponse_out(
1478 FwOpcodeType opCode,
1479 U32 cmdSeq,
1480 Fw::CmdResponse response
1481 )
1482 {
1483 FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
1484 this->m_cmdResponseOut_OutputPort[0].invoke(opCode, cmdSeq, response);
1485 }
1486
1487 // ----------------------------------------------------------------------
1488 // Command handler base-class functions
1489 //
1490 // Call these functions directly to bypass the command input port
1491 // ----------------------------------------------------------------------
1492
1493 void CmdSequencerComponentBase ::
1494 CS_RUN_cmdHandlerBase(
1495 FwOpcodeType opCode,
1496 U32 cmdSeq,
1497 Fw::CmdArgBuffer& args
1498 )
1499 {
1500 // Call pre-message hook
1501 this->CS_RUN_preMsgHook(opCode,cmdSeq);
1502
1503 // Defer deserializing arguments to the message dispatcher
1504 // to avoid deserializing and reserializing just for IPC
1505 ComponentIpcSerializableBuffer msg;
1507
1508 // Serialize for IPC
1509 _status = msg.serialize(static_cast<NATIVE_INT_TYPE>(CMD_CS_RUN));
1510 FW_ASSERT (
1511 _status == Fw::FW_SERIALIZE_OK,
1512 static_cast<FwAssertArgType>(_status)
1513 );
1514
1515 // Fake port number to make message dequeue work
1516 NATIVE_INT_TYPE port = 0;
1517
1518 _status = msg.serialize(port);
1519 FW_ASSERT (
1520 _status == Fw::FW_SERIALIZE_OK,
1521 static_cast<FwAssertArgType>(_status)
1522 );
1523
1524 _status = msg.serialize(opCode);
1525 FW_ASSERT (
1526 _status == Fw::FW_SERIALIZE_OK,
1527 static_cast<FwAssertArgType>(_status)
1528 );
1529
1530 _status = msg.serialize(cmdSeq);
1531 FW_ASSERT (
1532 _status == Fw::FW_SERIALIZE_OK,
1533 static_cast<FwAssertArgType>(_status)
1534 );
1535
1536 _status = msg.serialize(args);
1537 FW_ASSERT (
1538 _status == Fw::FW_SERIALIZE_OK,
1539 static_cast<FwAssertArgType>(_status)
1540 );
1541
1542 // Send message
1544 Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1545
1546 FW_ASSERT(
1547 qStatus == Os::Queue::QUEUE_OK,
1548 static_cast<FwAssertArgType>(qStatus)
1549 );
1550 }
1551
1552 void CmdSequencerComponentBase ::
1553 CS_VALIDATE_cmdHandlerBase(
1554 FwOpcodeType opCode,
1555 U32 cmdSeq,
1556 Fw::CmdArgBuffer& args
1557 )
1558 {
1559 // Call pre-message hook
1560 this->CS_VALIDATE_preMsgHook(opCode,cmdSeq);
1561
1562 // Defer deserializing arguments to the message dispatcher
1563 // to avoid deserializing and reserializing just for IPC
1564 ComponentIpcSerializableBuffer msg;
1566
1567 // Serialize for IPC
1568 _status = msg.serialize(static_cast<NATIVE_INT_TYPE>(CMD_CS_VALIDATE));
1569 FW_ASSERT (
1570 _status == Fw::FW_SERIALIZE_OK,
1571 static_cast<FwAssertArgType>(_status)
1572 );
1573
1574 // Fake port number to make message dequeue work
1575 NATIVE_INT_TYPE port = 0;
1576
1577 _status = msg.serialize(port);
1578 FW_ASSERT (
1579 _status == Fw::FW_SERIALIZE_OK,
1580 static_cast<FwAssertArgType>(_status)
1581 );
1582
1583 _status = msg.serialize(opCode);
1584 FW_ASSERT (
1585 _status == Fw::FW_SERIALIZE_OK,
1586 static_cast<FwAssertArgType>(_status)
1587 );
1588
1589 _status = msg.serialize(cmdSeq);
1590 FW_ASSERT (
1591 _status == Fw::FW_SERIALIZE_OK,
1592 static_cast<FwAssertArgType>(_status)
1593 );
1594
1595 _status = msg.serialize(args);
1596 FW_ASSERT (
1597 _status == Fw::FW_SERIALIZE_OK,
1598 static_cast<FwAssertArgType>(_status)
1599 );
1600
1601 // Send message
1603 Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1604
1605 FW_ASSERT(
1606 qStatus == Os::Queue::QUEUE_OK,
1607 static_cast<FwAssertArgType>(qStatus)
1608 );
1609 }
1610
1611 void CmdSequencerComponentBase ::
1612 CS_CANCEL_cmdHandlerBase(
1613 FwOpcodeType opCode,
1614 U32 cmdSeq,
1615 Fw::CmdArgBuffer& args
1616 )
1617 {
1618 // Call pre-message hook
1619 this->CS_CANCEL_preMsgHook(opCode,cmdSeq);
1620
1621 // Defer deserializing arguments to the message dispatcher
1622 // to avoid deserializing and reserializing just for IPC
1623 ComponentIpcSerializableBuffer msg;
1625
1626 // Serialize for IPC
1627 _status = msg.serialize(static_cast<NATIVE_INT_TYPE>(CMD_CS_CANCEL));
1628 FW_ASSERT (
1629 _status == Fw::FW_SERIALIZE_OK,
1630 static_cast<FwAssertArgType>(_status)
1631 );
1632
1633 // Fake port number to make message dequeue work
1634 NATIVE_INT_TYPE port = 0;
1635
1636 _status = msg.serialize(port);
1637 FW_ASSERT (
1638 _status == Fw::FW_SERIALIZE_OK,
1639 static_cast<FwAssertArgType>(_status)
1640 );
1641
1642 _status = msg.serialize(opCode);
1643 FW_ASSERT (
1644 _status == Fw::FW_SERIALIZE_OK,
1645 static_cast<FwAssertArgType>(_status)
1646 );
1647
1648 _status = msg.serialize(cmdSeq);
1649 FW_ASSERT (
1650 _status == Fw::FW_SERIALIZE_OK,
1651 static_cast<FwAssertArgType>(_status)
1652 );
1653
1654 _status = msg.serialize(args);
1655 FW_ASSERT (
1656 _status == Fw::FW_SERIALIZE_OK,
1657 static_cast<FwAssertArgType>(_status)
1658 );
1659
1660 // Send message
1662 Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1663
1664 FW_ASSERT(
1665 qStatus == Os::Queue::QUEUE_OK,
1666 static_cast<FwAssertArgType>(qStatus)
1667 );
1668 }
1669
1670 void CmdSequencerComponentBase ::
1671 CS_START_cmdHandlerBase(
1672 FwOpcodeType opCode,
1673 U32 cmdSeq,
1674 Fw::CmdArgBuffer& args
1675 )
1676 {
1677 // Call pre-message hook
1678 this->CS_START_preMsgHook(opCode,cmdSeq);
1679
1680 // Defer deserializing arguments to the message dispatcher
1681 // to avoid deserializing and reserializing just for IPC
1682 ComponentIpcSerializableBuffer msg;
1684
1685 // Serialize for IPC
1686 _status = msg.serialize(static_cast<NATIVE_INT_TYPE>(CMD_CS_START));
1687 FW_ASSERT (
1688 _status == Fw::FW_SERIALIZE_OK,
1689 static_cast<FwAssertArgType>(_status)
1690 );
1691
1692 // Fake port number to make message dequeue work
1693 NATIVE_INT_TYPE port = 0;
1694
1695 _status = msg.serialize(port);
1696 FW_ASSERT (
1697 _status == Fw::FW_SERIALIZE_OK,
1698 static_cast<FwAssertArgType>(_status)
1699 );
1700
1701 _status = msg.serialize(opCode);
1702 FW_ASSERT (
1703 _status == Fw::FW_SERIALIZE_OK,
1704 static_cast<FwAssertArgType>(_status)
1705 );
1706
1707 _status = msg.serialize(cmdSeq);
1708 FW_ASSERT (
1709 _status == Fw::FW_SERIALIZE_OK,
1710 static_cast<FwAssertArgType>(_status)
1711 );
1712
1713 _status = msg.serialize(args);
1714 FW_ASSERT (
1715 _status == Fw::FW_SERIALIZE_OK,
1716 static_cast<FwAssertArgType>(_status)
1717 );
1718
1719 // Send message
1721 Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1722
1723 FW_ASSERT(
1724 qStatus == Os::Queue::QUEUE_OK,
1725 static_cast<FwAssertArgType>(qStatus)
1726 );
1727 }
1728
1729 void CmdSequencerComponentBase ::
1730 CS_STEP_cmdHandlerBase(
1731 FwOpcodeType opCode,
1732 U32 cmdSeq,
1733 Fw::CmdArgBuffer& args
1734 )
1735 {
1736 // Call pre-message hook
1737 this->CS_STEP_preMsgHook(opCode,cmdSeq);
1738
1739 // Defer deserializing arguments to the message dispatcher
1740 // to avoid deserializing and reserializing just for IPC
1741 ComponentIpcSerializableBuffer msg;
1743
1744 // Serialize for IPC
1745 _status = msg.serialize(static_cast<NATIVE_INT_TYPE>(CMD_CS_STEP));
1746 FW_ASSERT (
1747 _status == Fw::FW_SERIALIZE_OK,
1748 static_cast<FwAssertArgType>(_status)
1749 );
1750
1751 // Fake port number to make message dequeue work
1752 NATIVE_INT_TYPE port = 0;
1753
1754 _status = msg.serialize(port);
1755 FW_ASSERT (
1756 _status == Fw::FW_SERIALIZE_OK,
1757 static_cast<FwAssertArgType>(_status)
1758 );
1759
1760 _status = msg.serialize(opCode);
1761 FW_ASSERT (
1762 _status == Fw::FW_SERIALIZE_OK,
1763 static_cast<FwAssertArgType>(_status)
1764 );
1765
1766 _status = msg.serialize(cmdSeq);
1767 FW_ASSERT (
1768 _status == Fw::FW_SERIALIZE_OK,
1769 static_cast<FwAssertArgType>(_status)
1770 );
1771
1772 _status = msg.serialize(args);
1773 FW_ASSERT (
1774 _status == Fw::FW_SERIALIZE_OK,
1775 static_cast<FwAssertArgType>(_status)
1776 );
1777
1778 // Send message
1780 Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1781
1782 FW_ASSERT(
1783 qStatus == Os::Queue::QUEUE_OK,
1784 static_cast<FwAssertArgType>(qStatus)
1785 );
1786 }
1787
1788 void CmdSequencerComponentBase ::
1789 CS_AUTO_cmdHandlerBase(
1790 FwOpcodeType opCode,
1791 U32 cmdSeq,
1792 Fw::CmdArgBuffer& args
1793 )
1794 {
1795 // Call pre-message hook
1796 this->CS_AUTO_preMsgHook(opCode,cmdSeq);
1797
1798 // Defer deserializing arguments to the message dispatcher
1799 // to avoid deserializing and reserializing just for IPC
1800 ComponentIpcSerializableBuffer msg;
1802
1803 // Serialize for IPC
1804 _status = msg.serialize(static_cast<NATIVE_INT_TYPE>(CMD_CS_AUTO));
1805 FW_ASSERT (
1806 _status == Fw::FW_SERIALIZE_OK,
1807 static_cast<FwAssertArgType>(_status)
1808 );
1809
1810 // Fake port number to make message dequeue work
1811 NATIVE_INT_TYPE port = 0;
1812
1813 _status = msg.serialize(port);
1814 FW_ASSERT (
1815 _status == Fw::FW_SERIALIZE_OK,
1816 static_cast<FwAssertArgType>(_status)
1817 );
1818
1819 _status = msg.serialize(opCode);
1820 FW_ASSERT (
1821 _status == Fw::FW_SERIALIZE_OK,
1822 static_cast<FwAssertArgType>(_status)
1823 );
1824
1825 _status = msg.serialize(cmdSeq);
1826 FW_ASSERT (
1827 _status == Fw::FW_SERIALIZE_OK,
1828 static_cast<FwAssertArgType>(_status)
1829 );
1830
1831 _status = msg.serialize(args);
1832 FW_ASSERT (
1833 _status == Fw::FW_SERIALIZE_OK,
1834 static_cast<FwAssertArgType>(_status)
1835 );
1836
1837 // Send message
1839 Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1840
1841 FW_ASSERT(
1842 qStatus == Os::Queue::QUEUE_OK,
1843 static_cast<FwAssertArgType>(qStatus)
1844 );
1845 }
1846
1847 void CmdSequencerComponentBase ::
1848 CS_MANUAL_cmdHandlerBase(
1849 FwOpcodeType opCode,
1850 U32 cmdSeq,
1851 Fw::CmdArgBuffer& args
1852 )
1853 {
1854 // Call pre-message hook
1855 this->CS_MANUAL_preMsgHook(opCode,cmdSeq);
1856
1857 // Defer deserializing arguments to the message dispatcher
1858 // to avoid deserializing and reserializing just for IPC
1859 ComponentIpcSerializableBuffer msg;
1861
1862 // Serialize for IPC
1863 _status = msg.serialize(static_cast<NATIVE_INT_TYPE>(CMD_CS_MANUAL));
1864 FW_ASSERT (
1865 _status == Fw::FW_SERIALIZE_OK,
1866 static_cast<FwAssertArgType>(_status)
1867 );
1868
1869 // Fake port number to make message dequeue work
1870 NATIVE_INT_TYPE port = 0;
1871
1872 _status = msg.serialize(port);
1873 FW_ASSERT (
1874 _status == Fw::FW_SERIALIZE_OK,
1875 static_cast<FwAssertArgType>(_status)
1876 );
1877
1878 _status = msg.serialize(opCode);
1879 FW_ASSERT (
1880 _status == Fw::FW_SERIALIZE_OK,
1881 static_cast<FwAssertArgType>(_status)
1882 );
1883
1884 _status = msg.serialize(cmdSeq);
1885 FW_ASSERT (
1886 _status == Fw::FW_SERIALIZE_OK,
1887 static_cast<FwAssertArgType>(_status)
1888 );
1889
1890 _status = msg.serialize(args);
1891 FW_ASSERT (
1892 _status == Fw::FW_SERIALIZE_OK,
1893 static_cast<FwAssertArgType>(_status)
1894 );
1895
1896 // Send message
1898 Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1899
1900 FW_ASSERT(
1901 qStatus == Os::Queue::QUEUE_OK,
1902 static_cast<FwAssertArgType>(qStatus)
1903 );
1904 }
1905
1906 void CmdSequencerComponentBase ::
1907 CS_JOIN_WAIT_cmdHandlerBase(
1908 FwOpcodeType opCode,
1909 U32 cmdSeq,
1910 Fw::CmdArgBuffer& args
1911 )
1912 {
1913 // Call pre-message hook
1914 this->CS_JOIN_WAIT_preMsgHook(opCode,cmdSeq);
1915
1916 // Defer deserializing arguments to the message dispatcher
1917 // to avoid deserializing and reserializing just for IPC
1918 ComponentIpcSerializableBuffer msg;
1920
1921 // Serialize for IPC
1922 _status = msg.serialize(static_cast<NATIVE_INT_TYPE>(CMD_CS_JOIN_WAIT));
1923 FW_ASSERT (
1924 _status == Fw::FW_SERIALIZE_OK,
1925 static_cast<FwAssertArgType>(_status)
1926 );
1927
1928 // Fake port number to make message dequeue work
1929 NATIVE_INT_TYPE port = 0;
1930
1931 _status = msg.serialize(port);
1932 FW_ASSERT (
1933 _status == Fw::FW_SERIALIZE_OK,
1934 static_cast<FwAssertArgType>(_status)
1935 );
1936
1937 _status = msg.serialize(opCode);
1938 FW_ASSERT (
1939 _status == Fw::FW_SERIALIZE_OK,
1940 static_cast<FwAssertArgType>(_status)
1941 );
1942
1943 _status = msg.serialize(cmdSeq);
1944 FW_ASSERT (
1945 _status == Fw::FW_SERIALIZE_OK,
1946 static_cast<FwAssertArgType>(_status)
1947 );
1948
1949 _status = msg.serialize(args);
1950 FW_ASSERT (
1951 _status == Fw::FW_SERIALIZE_OK,
1952 static_cast<FwAssertArgType>(_status)
1953 );
1954
1955 // Send message
1957 Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1958
1959 FW_ASSERT(
1960 qStatus == Os::Queue::QUEUE_OK,
1961 static_cast<FwAssertArgType>(qStatus)
1962 );
1963 }
1964
1965 // ----------------------------------------------------------------------
1966 // Pre-message hooks for async commands
1967 //
1968 // Each of these functions is invoked just before processing the
1969 // corresponding command. By default they do nothing. You can
1970 // override them to provide specific pre-command behavior.
1971 // ----------------------------------------------------------------------
1972
1973 void CmdSequencerComponentBase ::
1974 CS_RUN_preMsgHook(
1975 FwOpcodeType opCode,
1976 U32 cmdSeq
1977 )
1978 {
1979 // Defaults to no-op; can be overridden
1980 }
1981
1982 void CmdSequencerComponentBase ::
1983 CS_VALIDATE_preMsgHook(
1984 FwOpcodeType opCode,
1985 U32 cmdSeq
1986 )
1987 {
1988 // Defaults to no-op; can be overridden
1989 }
1990
1991 void CmdSequencerComponentBase ::
1992 CS_CANCEL_preMsgHook(
1993 FwOpcodeType opCode,
1994 U32 cmdSeq
1995 )
1996 {
1997 // Defaults to no-op; can be overridden
1998 }
1999
2000 void CmdSequencerComponentBase ::
2001 CS_START_preMsgHook(
2002 FwOpcodeType opCode,
2003 U32 cmdSeq
2004 )
2005 {
2006 // Defaults to no-op; can be overridden
2007 }
2008
2009 void CmdSequencerComponentBase ::
2010 CS_STEP_preMsgHook(
2011 FwOpcodeType opCode,
2012 U32 cmdSeq
2013 )
2014 {
2015 // Defaults to no-op; can be overridden
2016 }
2017
2018 void CmdSequencerComponentBase ::
2019 CS_AUTO_preMsgHook(
2020 FwOpcodeType opCode,
2021 U32 cmdSeq
2022 )
2023 {
2024 // Defaults to no-op; can be overridden
2025 }
2026
2027 void CmdSequencerComponentBase ::
2028 CS_MANUAL_preMsgHook(
2029 FwOpcodeType opCode,
2030 U32 cmdSeq
2031 )
2032 {
2033 // Defaults to no-op; can be overridden
2034 }
2035
2036 void CmdSequencerComponentBase ::
2037 CS_JOIN_WAIT_preMsgHook(
2038 FwOpcodeType opCode,
2039 U32 cmdSeq
2040 )
2041 {
2042 // Defaults to no-op; can be overridden
2043 }
2044
2045 // ----------------------------------------------------------------------
2046 // Event logging functions
2047 // ----------------------------------------------------------------------
2048
2049 void CmdSequencerComponentBase ::
2050 log_ACTIVITY_LO_CS_SequenceLoaded(const Fw::LogStringArg& fileName)
2051 {
2052 // Get the time
2053 Fw::Time _logTime;
2054 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2055 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2056 }
2057
2058 FwEventIdType _id = static_cast<FwEventIdType>(0);
2059
2060 _id = this->getIdBase() + EVENTID_CS_SEQUENCELOADED;
2061
2062 // Emit the event on the log port
2063 if (this->m_logOut_OutputPort[0].isConnected()) {
2064 Fw::LogBuffer _logBuff;
2066
2067#if FW_AMPCS_COMPATIBLE
2068 // Serialize the number of arguments
2069 _status = _logBuff.serialize(static_cast<U8>(1));
2070 FW_ASSERT(
2071 _status == Fw::FW_SERIALIZE_OK,
2072 static_cast<FwAssertArgType>(_status)
2073 );
2074#endif
2075
2076 _status = fileName.serialize(_logBuff, 60);
2077 FW_ASSERT(
2078 _status == Fw::FW_SERIALIZE_OK,
2079 static_cast<FwAssertArgType>(_status)
2080 );
2081
2082 this->m_logOut_OutputPort[0].invoke(
2083 _id,
2084 _logTime,
2086 _logBuff
2087 );
2088 }
2089
2090 // Emit the event on the text log port
2091#if FW_ENABLE_TEXT_LOGGING
2092 if (this->m_LogText_OutputPort[0].isConnected()) {
2093#if FW_OBJECT_NAMES == 1
2094 const char* _formatString =
2095 "(%s) %s: Loaded sequence %s";
2096#else
2097 const char* _formatString =
2098 "%s: Loaded sequence %s";
2099#endif
2100
2101 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
2102
2103 (void) snprintf(
2104 _textBuffer,
2106 _formatString,
2107#if FW_OBJECT_NAMES == 1
2108 this->m_objName,
2109#endif
2110 "CS_SequenceLoaded ",
2111 fileName.toChar()
2112 );
2113
2114 // Null terminate
2115 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
2116 Fw::TextLogString _logString = _textBuffer;
2117 this->m_LogText_OutputPort[0].invoke(
2118 _id,
2119 _logTime,
2121 _logString
2122 );
2123 }
2124#endif
2125 }
2126
2127 void CmdSequencerComponentBase ::
2128 log_ACTIVITY_HI_CS_SequenceCanceled(const Fw::LogStringArg& fileName)
2129 {
2130 // Get the time
2131 Fw::Time _logTime;
2132 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2133 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2134 }
2135
2136 FwEventIdType _id = static_cast<FwEventIdType>(0);
2137
2138 _id = this->getIdBase() + EVENTID_CS_SEQUENCECANCELED;
2139
2140 // Emit the event on the log port
2141 if (this->m_logOut_OutputPort[0].isConnected()) {
2142 Fw::LogBuffer _logBuff;
2144
2145#if FW_AMPCS_COMPATIBLE
2146 // Serialize the number of arguments
2147 _status = _logBuff.serialize(static_cast<U8>(1));
2148 FW_ASSERT(
2149 _status == Fw::FW_SERIALIZE_OK,
2150 static_cast<FwAssertArgType>(_status)
2151 );
2152#endif
2153
2154 _status = fileName.serialize(_logBuff, 60);
2155 FW_ASSERT(
2156 _status == Fw::FW_SERIALIZE_OK,
2157 static_cast<FwAssertArgType>(_status)
2158 );
2159
2160 this->m_logOut_OutputPort[0].invoke(
2161 _id,
2162 _logTime,
2164 _logBuff
2165 );
2166 }
2167
2168 // Emit the event on the text log port
2169#if FW_ENABLE_TEXT_LOGGING
2170 if (this->m_LogText_OutputPort[0].isConnected()) {
2171#if FW_OBJECT_NAMES == 1
2172 const char* _formatString =
2173 "(%s) %s: Sequence file %s canceled";
2174#else
2175 const char* _formatString =
2176 "%s: Sequence file %s canceled";
2177#endif
2178
2179 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
2180
2181 (void) snprintf(
2182 _textBuffer,
2184 _formatString,
2185#if FW_OBJECT_NAMES == 1
2186 this->m_objName,
2187#endif
2188 "CS_SequenceCanceled ",
2189 fileName.toChar()
2190 );
2191
2192 // Null terminate
2193 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
2194 Fw::TextLogString _logString = _textBuffer;
2195 this->m_LogText_OutputPort[0].invoke(
2196 _id,
2197 _logTime,
2199 _logString
2200 );
2201 }
2202#endif
2203 }
2204
2205 void CmdSequencerComponentBase ::
2206 log_WARNING_HI_CS_FileReadError(const Fw::LogStringArg& fileName)
2207 {
2208 // Get the time
2209 Fw::Time _logTime;
2210 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2211 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2212 }
2213
2214 FwEventIdType _id = static_cast<FwEventIdType>(0);
2215
2216 _id = this->getIdBase() + EVENTID_CS_FILEREADERROR;
2217
2218 // Emit the event on the log port
2219 if (this->m_logOut_OutputPort[0].isConnected()) {
2220 Fw::LogBuffer _logBuff;
2222
2223#if FW_AMPCS_COMPATIBLE
2224 // Serialize the number of arguments
2225 _status = _logBuff.serialize(static_cast<U8>(1));
2226 FW_ASSERT(
2227 _status == Fw::FW_SERIALIZE_OK,
2228 static_cast<FwAssertArgType>(_status)
2229 );
2230#endif
2231
2232 _status = fileName.serialize(_logBuff, 60);
2233 FW_ASSERT(
2234 _status == Fw::FW_SERIALIZE_OK,
2235 static_cast<FwAssertArgType>(_status)
2236 );
2237
2238 this->m_logOut_OutputPort[0].invoke(
2239 _id,
2240 _logTime,
2242 _logBuff
2243 );
2244 }
2245
2246 // Emit the event on the text log port
2247#if FW_ENABLE_TEXT_LOGGING
2248 if (this->m_LogText_OutputPort[0].isConnected()) {
2249#if FW_OBJECT_NAMES == 1
2250 const char* _formatString =
2251 "(%s) %s: Error reading sequence file %s";
2252#else
2253 const char* _formatString =
2254 "%s: Error reading sequence file %s";
2255#endif
2256
2257 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
2258
2259 (void) snprintf(
2260 _textBuffer,
2262 _formatString,
2263#if FW_OBJECT_NAMES == 1
2264 this->m_objName,
2265#endif
2266 "CS_FileReadError ",
2267 fileName.toChar()
2268 );
2269
2270 // Null terminate
2271 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
2272 Fw::TextLogString _logString = _textBuffer;
2273 this->m_LogText_OutputPort[0].invoke(
2274 _id,
2275 _logTime,
2277 _logString
2278 );
2279 }
2280#endif
2281 }
2282
2283 void CmdSequencerComponentBase ::
2284 log_WARNING_HI_CS_FileInvalid(
2285 const Fw::LogStringArg& fileName,
2287 I32 error
2288 )
2289 {
2290 // Get the time
2291 Fw::Time _logTime;
2292 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2293 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2294 }
2295
2296 FwEventIdType _id = static_cast<FwEventIdType>(0);
2297
2298 _id = this->getIdBase() + EVENTID_CS_FILEINVALID;
2299
2300 // Emit the event on the log port
2301 if (this->m_logOut_OutputPort[0].isConnected()) {
2302 Fw::LogBuffer _logBuff;
2304
2305#if FW_AMPCS_COMPATIBLE
2306 // Serialize the number of arguments
2307 _status = _logBuff.serialize(static_cast<U8>(3));
2308 FW_ASSERT(
2309 _status == Fw::FW_SERIALIZE_OK,
2310 static_cast<FwAssertArgType>(_status)
2311 );
2312#endif
2313
2314 _status = fileName.serialize(_logBuff, 60);
2315 FW_ASSERT(
2316 _status == Fw::FW_SERIALIZE_OK,
2317 static_cast<FwAssertArgType>(_status)
2318 );
2319
2320#if FW_AMPCS_COMPATIBLE
2321 // Serialize the argument size
2322 _status = _logBuff.serialize(
2324 );
2325 FW_ASSERT(
2326 _status == Fw::FW_SERIALIZE_OK,
2327 static_cast<FwAssertArgType>(_status)
2328 );
2329#endif
2330 _status = _logBuff.serialize(stage);
2331 FW_ASSERT(
2332 _status == Fw::FW_SERIALIZE_OK,
2333 static_cast<FwAssertArgType>(_status)
2334 );
2335
2336#if FW_AMPCS_COMPATIBLE
2337 // Serialize the argument size
2338 _status = _logBuff.serialize(
2339 static_cast<U8>(sizeof(I32))
2340 );
2341 FW_ASSERT(
2342 _status == Fw::FW_SERIALIZE_OK,
2343 static_cast<FwAssertArgType>(_status)
2344 );
2345#endif
2346 _status = _logBuff.serialize(error);
2347 FW_ASSERT(
2348 _status == Fw::FW_SERIALIZE_OK,
2349 static_cast<FwAssertArgType>(_status)
2350 );
2351
2352 this->m_logOut_OutputPort[0].invoke(
2353 _id,
2354 _logTime,
2356 _logBuff
2357 );
2358 }
2359
2360 // Emit the event on the text log port
2361#if FW_ENABLE_TEXT_LOGGING
2362 if (this->m_LogText_OutputPort[0].isConnected()) {
2363#if FW_OBJECT_NAMES == 1
2364 const char* _formatString =
2365 "(%s) %s: Sequence file %s invalid. Stage: %s Error: %" PRIi32 "";
2366#else
2367 const char* _formatString =
2368 "%s: Sequence file %s invalid. Stage: %s Error: %" PRIi32 "";
2369#endif
2370
2371 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
2372
2373 Fw::String stageStr;
2374 stage.toString(stageStr);
2375
2376 (void) snprintf(
2377 _textBuffer,
2379 _formatString,
2380#if FW_OBJECT_NAMES == 1
2381 this->m_objName,
2382#endif
2383 "CS_FileInvalid ",
2384 fileName.toChar(),
2385 stageStr.toChar(),
2386 error
2387 );
2388
2389 // Null terminate
2390 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
2391 Fw::TextLogString _logString = _textBuffer;
2392 this->m_LogText_OutputPort[0].invoke(
2393 _id,
2394 _logTime,
2396 _logString
2397 );
2398 }
2399#endif
2400 }
2401
2402 void CmdSequencerComponentBase ::
2403 log_WARNING_HI_CS_RecordInvalid(
2404 const Fw::LogStringArg& fileName,
2405 U32 recordNumber,
2406 I32 error
2407 )
2408 {
2409 // Get the time
2410 Fw::Time _logTime;
2411 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2412 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2413 }
2414
2415 FwEventIdType _id = static_cast<FwEventIdType>(0);
2416
2417 _id = this->getIdBase() + EVENTID_CS_RECORDINVALID;
2418
2419 // Emit the event on the log port
2420 if (this->m_logOut_OutputPort[0].isConnected()) {
2421 Fw::LogBuffer _logBuff;
2423
2424#if FW_AMPCS_COMPATIBLE
2425 // Serialize the number of arguments
2426 _status = _logBuff.serialize(static_cast<U8>(3));
2427 FW_ASSERT(
2428 _status == Fw::FW_SERIALIZE_OK,
2429 static_cast<FwAssertArgType>(_status)
2430 );
2431#endif
2432
2433 _status = fileName.serialize(_logBuff, 60);
2434 FW_ASSERT(
2435 _status == Fw::FW_SERIALIZE_OK,
2436 static_cast<FwAssertArgType>(_status)
2437 );
2438
2439#if FW_AMPCS_COMPATIBLE
2440 // Serialize the argument size
2441 _status = _logBuff.serialize(
2442 static_cast<U8>(sizeof(U32))
2443 );
2444 FW_ASSERT(
2445 _status == Fw::FW_SERIALIZE_OK,
2446 static_cast<FwAssertArgType>(_status)
2447 );
2448#endif
2449 _status = _logBuff.serialize(recordNumber);
2450 FW_ASSERT(
2451 _status == Fw::FW_SERIALIZE_OK,
2452 static_cast<FwAssertArgType>(_status)
2453 );
2454
2455#if FW_AMPCS_COMPATIBLE
2456 // Serialize the argument size
2457 _status = _logBuff.serialize(
2458 static_cast<U8>(sizeof(I32))
2459 );
2460 FW_ASSERT(
2461 _status == Fw::FW_SERIALIZE_OK,
2462 static_cast<FwAssertArgType>(_status)
2463 );
2464#endif
2465 _status = _logBuff.serialize(error);
2466 FW_ASSERT(
2467 _status == Fw::FW_SERIALIZE_OK,
2468 static_cast<FwAssertArgType>(_status)
2469 );
2470
2471 this->m_logOut_OutputPort[0].invoke(
2472 _id,
2473 _logTime,
2475 _logBuff
2476 );
2477 }
2478
2479 // Emit the event on the text log port
2480#if FW_ENABLE_TEXT_LOGGING
2481 if (this->m_LogText_OutputPort[0].isConnected()) {
2482#if FW_OBJECT_NAMES == 1
2483 const char* _formatString =
2484 "(%s) %s: Sequence file %s: Record %" PRIu32 " invalid. Err: %" PRIi32 "";
2485#else
2486 const char* _formatString =
2487 "%s: Sequence file %s: Record %" PRIu32 " invalid. Err: %" PRIi32 "";
2488#endif
2489
2490 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
2491
2492 (void) snprintf(
2493 _textBuffer,
2495 _formatString,
2496#if FW_OBJECT_NAMES == 1
2497 this->m_objName,
2498#endif
2499 "CS_RecordInvalid ",
2500 fileName.toChar(),
2501 recordNumber,
2502 error
2503 );
2504
2505 // Null terminate
2506 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
2507 Fw::TextLogString _logString = _textBuffer;
2508 this->m_LogText_OutputPort[0].invoke(
2509 _id,
2510 _logTime,
2512 _logString
2513 );
2514 }
2515#endif
2516 }
2517
2518 void CmdSequencerComponentBase ::
2519 log_WARNING_HI_CS_FileSizeError(
2520 const Fw::LogStringArg& fileName,
2521 U32 size
2522 )
2523 {
2524 // Get the time
2525 Fw::Time _logTime;
2526 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2527 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2528 }
2529
2530 FwEventIdType _id = static_cast<FwEventIdType>(0);
2531
2532 _id = this->getIdBase() + EVENTID_CS_FILESIZEERROR;
2533
2534 // Emit the event on the log port
2535 if (this->m_logOut_OutputPort[0].isConnected()) {
2536 Fw::LogBuffer _logBuff;
2538
2539#if FW_AMPCS_COMPATIBLE
2540 // Serialize the number of arguments
2541 _status = _logBuff.serialize(static_cast<U8>(2));
2542 FW_ASSERT(
2543 _status == Fw::FW_SERIALIZE_OK,
2544 static_cast<FwAssertArgType>(_status)
2545 );
2546#endif
2547
2548 _status = fileName.serialize(_logBuff, 60);
2549 FW_ASSERT(
2550 _status == Fw::FW_SERIALIZE_OK,
2551 static_cast<FwAssertArgType>(_status)
2552 );
2553
2554#if FW_AMPCS_COMPATIBLE
2555 // Serialize the argument size
2556 _status = _logBuff.serialize(
2557 static_cast<U8>(sizeof(U32))
2558 );
2559 FW_ASSERT(
2560 _status == Fw::FW_SERIALIZE_OK,
2561 static_cast<FwAssertArgType>(_status)
2562 );
2563#endif
2564 _status = _logBuff.serialize(size);
2565 FW_ASSERT(
2566 _status == Fw::FW_SERIALIZE_OK,
2567 static_cast<FwAssertArgType>(_status)
2568 );
2569
2570 this->m_logOut_OutputPort[0].invoke(
2571 _id,
2572 _logTime,
2574 _logBuff
2575 );
2576 }
2577
2578 // Emit the event on the text log port
2579#if FW_ENABLE_TEXT_LOGGING
2580 if (this->m_LogText_OutputPort[0].isConnected()) {
2581#if FW_OBJECT_NAMES == 1
2582 const char* _formatString =
2583 "(%s) %s: Sequence file %s too large. Size: %" PRIu32 "";
2584#else
2585 const char* _formatString =
2586 "%s: Sequence file %s too large. Size: %" PRIu32 "";
2587#endif
2588
2589 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
2590
2591 (void) snprintf(
2592 _textBuffer,
2594 _formatString,
2595#if FW_OBJECT_NAMES == 1
2596 this->m_objName,
2597#endif
2598 "CS_FileSizeError ",
2599 fileName.toChar(),
2600 size
2601 );
2602
2603 // Null terminate
2604 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
2605 Fw::TextLogString _logString = _textBuffer;
2606 this->m_LogText_OutputPort[0].invoke(
2607 _id,
2608 _logTime,
2610 _logString
2611 );
2612 }
2613#endif
2614 }
2615
2616 void CmdSequencerComponentBase ::
2617 log_WARNING_HI_CS_FileNotFound(const Fw::LogStringArg& fileName)
2618 {
2619 // Get the time
2620 Fw::Time _logTime;
2621 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2622 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2623 }
2624
2625 FwEventIdType _id = static_cast<FwEventIdType>(0);
2626
2627 _id = this->getIdBase() + EVENTID_CS_FILENOTFOUND;
2628
2629 // Emit the event on the log port
2630 if (this->m_logOut_OutputPort[0].isConnected()) {
2631 Fw::LogBuffer _logBuff;
2633
2634#if FW_AMPCS_COMPATIBLE
2635 // Serialize the number of arguments
2636 _status = _logBuff.serialize(static_cast<U8>(1));
2637 FW_ASSERT(
2638 _status == Fw::FW_SERIALIZE_OK,
2639 static_cast<FwAssertArgType>(_status)
2640 );
2641#endif
2642
2643 _status = fileName.serialize(_logBuff, 60);
2644 FW_ASSERT(
2645 _status == Fw::FW_SERIALIZE_OK,
2646 static_cast<FwAssertArgType>(_status)
2647 );
2648
2649 this->m_logOut_OutputPort[0].invoke(
2650 _id,
2651 _logTime,
2653 _logBuff
2654 );
2655 }
2656
2657 // Emit the event on the text log port
2658#if FW_ENABLE_TEXT_LOGGING
2659 if (this->m_LogText_OutputPort[0].isConnected()) {
2660#if FW_OBJECT_NAMES == 1
2661 const char* _formatString =
2662 "(%s) %s: Sequence file %s not found.";
2663#else
2664 const char* _formatString =
2665 "%s: Sequence file %s not found.";
2666#endif
2667
2668 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
2669
2670 (void) snprintf(
2671 _textBuffer,
2673 _formatString,
2674#if FW_OBJECT_NAMES == 1
2675 this->m_objName,
2676#endif
2677 "CS_FileNotFound ",
2678 fileName.toChar()
2679 );
2680
2681 // Null terminate
2682 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
2683 Fw::TextLogString _logString = _textBuffer;
2684 this->m_LogText_OutputPort[0].invoke(
2685 _id,
2686 _logTime,
2688 _logString
2689 );
2690 }
2691#endif
2692 }
2693
2694 void CmdSequencerComponentBase ::
2695 log_WARNING_HI_CS_FileCrcFailure(
2696 const Fw::LogStringArg& fileName,
2697 U32 storedCRC,
2698 U32 computedCRC
2699 )
2700 {
2701 // Get the time
2702 Fw::Time _logTime;
2703 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2704 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2705 }
2706
2707 FwEventIdType _id = static_cast<FwEventIdType>(0);
2708
2709 _id = this->getIdBase() + EVENTID_CS_FILECRCFAILURE;
2710
2711 // Emit the event on the log port
2712 if (this->m_logOut_OutputPort[0].isConnected()) {
2713 Fw::LogBuffer _logBuff;
2715
2716#if FW_AMPCS_COMPATIBLE
2717 // Serialize the number of arguments
2718 _status = _logBuff.serialize(static_cast<U8>(3));
2719 FW_ASSERT(
2720 _status == Fw::FW_SERIALIZE_OK,
2721 static_cast<FwAssertArgType>(_status)
2722 );
2723#endif
2724
2725 _status = fileName.serialize(_logBuff, 60);
2726 FW_ASSERT(
2727 _status == Fw::FW_SERIALIZE_OK,
2728 static_cast<FwAssertArgType>(_status)
2729 );
2730
2731#if FW_AMPCS_COMPATIBLE
2732 // Serialize the argument size
2733 _status = _logBuff.serialize(
2734 static_cast<U8>(sizeof(U32))
2735 );
2736 FW_ASSERT(
2737 _status == Fw::FW_SERIALIZE_OK,
2738 static_cast<FwAssertArgType>(_status)
2739 );
2740#endif
2741 _status = _logBuff.serialize(storedCRC);
2742 FW_ASSERT(
2743 _status == Fw::FW_SERIALIZE_OK,
2744 static_cast<FwAssertArgType>(_status)
2745 );
2746
2747#if FW_AMPCS_COMPATIBLE
2748 // Serialize the argument size
2749 _status = _logBuff.serialize(
2750 static_cast<U8>(sizeof(U32))
2751 );
2752 FW_ASSERT(
2753 _status == Fw::FW_SERIALIZE_OK,
2754 static_cast<FwAssertArgType>(_status)
2755 );
2756#endif
2757 _status = _logBuff.serialize(computedCRC);
2758 FW_ASSERT(
2759 _status == Fw::FW_SERIALIZE_OK,
2760 static_cast<FwAssertArgType>(_status)
2761 );
2762
2763 this->m_logOut_OutputPort[0].invoke(
2764 _id,
2765 _logTime,
2767 _logBuff
2768 );
2769 }
2770
2771 // Emit the event on the text log port
2772#if FW_ENABLE_TEXT_LOGGING
2773 if (this->m_LogText_OutputPort[0].isConnected()) {
2774#if FW_OBJECT_NAMES == 1
2775 const char* _formatString =
2776 "(%s) %s: Sequence file %s had invalid CRC. Stored 0x%" PRIx32 ", Computed 0x%" PRIx32 ".";
2777#else
2778 const char* _formatString =
2779 "%s: Sequence file %s had invalid CRC. Stored 0x%" PRIx32 ", Computed 0x%" PRIx32 ".";
2780#endif
2781
2782 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
2783
2784 (void) snprintf(
2785 _textBuffer,
2787 _formatString,
2788#if FW_OBJECT_NAMES == 1
2789 this->m_objName,
2790#endif
2791 "CS_FileCrcFailure ",
2792 fileName.toChar(),
2793 storedCRC,
2794 computedCRC
2795 );
2796
2797 // Null terminate
2798 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
2799 Fw::TextLogString _logString = _textBuffer;
2800 this->m_LogText_OutputPort[0].invoke(
2801 _id,
2802 _logTime,
2804 _logString
2805 );
2806 }
2807#endif
2808 }
2809
2810 void CmdSequencerComponentBase ::
2811 log_ACTIVITY_LO_CS_CommandComplete(
2812 const Fw::LogStringArg& fileName,
2813 U32 recordNumber,
2814 U32 opCode
2815 )
2816 {
2817 // Get the time
2818 Fw::Time _logTime;
2819 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2820 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2821 }
2822
2823 FwEventIdType _id = static_cast<FwEventIdType>(0);
2824
2825 _id = this->getIdBase() + EVENTID_CS_COMMANDCOMPLETE;
2826
2827 // Emit the event on the log port
2828 if (this->m_logOut_OutputPort[0].isConnected()) {
2829 Fw::LogBuffer _logBuff;
2831
2832#if FW_AMPCS_COMPATIBLE
2833 // Serialize the number of arguments
2834 _status = _logBuff.serialize(static_cast<U8>(3));
2835 FW_ASSERT(
2836 _status == Fw::FW_SERIALIZE_OK,
2837 static_cast<FwAssertArgType>(_status)
2838 );
2839#endif
2840
2841 _status = fileName.serialize(_logBuff, 60);
2842 FW_ASSERT(
2843 _status == Fw::FW_SERIALIZE_OK,
2844 static_cast<FwAssertArgType>(_status)
2845 );
2846
2847#if FW_AMPCS_COMPATIBLE
2848 // Serialize the argument size
2849 _status = _logBuff.serialize(
2850 static_cast<U8>(sizeof(U32))
2851 );
2852 FW_ASSERT(
2853 _status == Fw::FW_SERIALIZE_OK,
2854 static_cast<FwAssertArgType>(_status)
2855 );
2856#endif
2857 _status = _logBuff.serialize(recordNumber);
2858 FW_ASSERT(
2859 _status == Fw::FW_SERIALIZE_OK,
2860 static_cast<FwAssertArgType>(_status)
2861 );
2862
2863#if FW_AMPCS_COMPATIBLE
2864 // Serialize the argument size
2865 _status = _logBuff.serialize(
2866 static_cast<U8>(sizeof(U32))
2867 );
2868 FW_ASSERT(
2869 _status == Fw::FW_SERIALIZE_OK,
2870 static_cast<FwAssertArgType>(_status)
2871 );
2872#endif
2873 _status = _logBuff.serialize(opCode);
2874 FW_ASSERT(
2875 _status == Fw::FW_SERIALIZE_OK,
2876 static_cast<FwAssertArgType>(_status)
2877 );
2878
2879 this->m_logOut_OutputPort[0].invoke(
2880 _id,
2881 _logTime,
2883 _logBuff
2884 );
2885 }
2886
2887 // Emit the event on the text log port
2888#if FW_ENABLE_TEXT_LOGGING
2889 if (this->m_LogText_OutputPort[0].isConnected()) {
2890#if FW_OBJECT_NAMES == 1
2891 const char* _formatString =
2892 "(%s) %s: Sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") complete";
2893#else
2894 const char* _formatString =
2895 "%s: Sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") complete";
2896#endif
2897
2898 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
2899
2900 (void) snprintf(
2901 _textBuffer,
2903 _formatString,
2904#if FW_OBJECT_NAMES == 1
2905 this->m_objName,
2906#endif
2907 "CS_CommandComplete ",
2908 fileName.toChar(),
2909 recordNumber,
2910 opCode
2911 );
2912
2913 // Null terminate
2914 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
2915 Fw::TextLogString _logString = _textBuffer;
2916 this->m_LogText_OutputPort[0].invoke(
2917 _id,
2918 _logTime,
2920 _logString
2921 );
2922 }
2923#endif
2924 }
2925
2926 void CmdSequencerComponentBase ::
2927 log_ACTIVITY_HI_CS_SequenceComplete(const Fw::LogStringArg& fileName)
2928 {
2929 // Get the time
2930 Fw::Time _logTime;
2931 if (this->m_timeCaller_OutputPort[0].isConnected()) {
2932 this->m_timeCaller_OutputPort[0].invoke(_logTime);
2933 }
2934
2935 FwEventIdType _id = static_cast<FwEventIdType>(0);
2936
2937 _id = this->getIdBase() + EVENTID_CS_SEQUENCECOMPLETE;
2938
2939 // Emit the event on the log port
2940 if (this->m_logOut_OutputPort[0].isConnected()) {
2941 Fw::LogBuffer _logBuff;
2943
2944#if FW_AMPCS_COMPATIBLE
2945 // Serialize the number of arguments
2946 _status = _logBuff.serialize(static_cast<U8>(1));
2947 FW_ASSERT(
2948 _status == Fw::FW_SERIALIZE_OK,
2949 static_cast<FwAssertArgType>(_status)
2950 );
2951#endif
2952
2953 _status = fileName.serialize(_logBuff, 60);
2954 FW_ASSERT(
2955 _status == Fw::FW_SERIALIZE_OK,
2956 static_cast<FwAssertArgType>(_status)
2957 );
2958
2959 this->m_logOut_OutputPort[0].invoke(
2960 _id,
2961 _logTime,
2963 _logBuff
2964 );
2965 }
2966
2967 // Emit the event on the text log port
2968#if FW_ENABLE_TEXT_LOGGING
2969 if (this->m_LogText_OutputPort[0].isConnected()) {
2970#if FW_OBJECT_NAMES == 1
2971 const char* _formatString =
2972 "(%s) %s: Sequence file %s complete";
2973#else
2974 const char* _formatString =
2975 "%s: Sequence file %s complete";
2976#endif
2977
2978 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
2979
2980 (void) snprintf(
2981 _textBuffer,
2983 _formatString,
2984#if FW_OBJECT_NAMES == 1
2985 this->m_objName,
2986#endif
2987 "CS_SequenceComplete ",
2988 fileName.toChar()
2989 );
2990
2991 // Null terminate
2992 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
2993 Fw::TextLogString _logString = _textBuffer;
2994 this->m_LogText_OutputPort[0].invoke(
2995 _id,
2996 _logTime,
2998 _logString
2999 );
3000 }
3001#endif
3002 }
3003
3004 void CmdSequencerComponentBase ::
3005 log_WARNING_HI_CS_CommandError(
3006 const Fw::LogStringArg& fileName,
3007 U32 recordNumber,
3008 U32 opCode,
3009 U32 errorStatus
3010 )
3011 {
3012 // Get the time
3013 Fw::Time _logTime;
3014 if (this->m_timeCaller_OutputPort[0].isConnected()) {
3015 this->m_timeCaller_OutputPort[0].invoke(_logTime);
3016 }
3017
3018 FwEventIdType _id = static_cast<FwEventIdType>(0);
3019
3020 _id = this->getIdBase() + EVENTID_CS_COMMANDERROR;
3021
3022 // Emit the event on the log port
3023 if (this->m_logOut_OutputPort[0].isConnected()) {
3024 Fw::LogBuffer _logBuff;
3026
3027#if FW_AMPCS_COMPATIBLE
3028 // Serialize the number of arguments
3029 _status = _logBuff.serialize(static_cast<U8>(4));
3030 FW_ASSERT(
3031 _status == Fw::FW_SERIALIZE_OK,
3032 static_cast<FwAssertArgType>(_status)
3033 );
3034#endif
3035
3036 _status = fileName.serialize(_logBuff, 60);
3037 FW_ASSERT(
3038 _status == Fw::FW_SERIALIZE_OK,
3039 static_cast<FwAssertArgType>(_status)
3040 );
3041
3042#if FW_AMPCS_COMPATIBLE
3043 // Serialize the argument size
3044 _status = _logBuff.serialize(
3045 static_cast<U8>(sizeof(U32))
3046 );
3047 FW_ASSERT(
3048 _status == Fw::FW_SERIALIZE_OK,
3049 static_cast<FwAssertArgType>(_status)
3050 );
3051#endif
3052 _status = _logBuff.serialize(recordNumber);
3053 FW_ASSERT(
3054 _status == Fw::FW_SERIALIZE_OK,
3055 static_cast<FwAssertArgType>(_status)
3056 );
3057
3058#if FW_AMPCS_COMPATIBLE
3059 // Serialize the argument size
3060 _status = _logBuff.serialize(
3061 static_cast<U8>(sizeof(U32))
3062 );
3063 FW_ASSERT(
3064 _status == Fw::FW_SERIALIZE_OK,
3065 static_cast<FwAssertArgType>(_status)
3066 );
3067#endif
3068 _status = _logBuff.serialize(opCode);
3069 FW_ASSERT(
3070 _status == Fw::FW_SERIALIZE_OK,
3071 static_cast<FwAssertArgType>(_status)
3072 );
3073
3074#if FW_AMPCS_COMPATIBLE
3075 // Serialize the argument size
3076 _status = _logBuff.serialize(
3077 static_cast<U8>(sizeof(U32))
3078 );
3079 FW_ASSERT(
3080 _status == Fw::FW_SERIALIZE_OK,
3081 static_cast<FwAssertArgType>(_status)
3082 );
3083#endif
3084 _status = _logBuff.serialize(errorStatus);
3085 FW_ASSERT(
3086 _status == Fw::FW_SERIALIZE_OK,
3087 static_cast<FwAssertArgType>(_status)
3088 );
3089
3090 this->m_logOut_OutputPort[0].invoke(
3091 _id,
3092 _logTime,
3094 _logBuff
3095 );
3096 }
3097
3098 // Emit the event on the text log port
3099#if FW_ENABLE_TEXT_LOGGING
3100 if (this->m_LogText_OutputPort[0].isConnected()) {
3101#if FW_OBJECT_NAMES == 1
3102 const char* _formatString =
3103 "(%s) %s: Sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") completed with error %" PRIu32 "";
3104#else
3105 const char* _formatString =
3106 "%s: Sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") completed with error %" PRIu32 "";
3107#endif
3108
3109 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
3110
3111 (void) snprintf(
3112 _textBuffer,
3114 _formatString,
3115#if FW_OBJECT_NAMES == 1
3116 this->m_objName,
3117#endif
3118 "CS_CommandError ",
3119 fileName.toChar(),
3120 recordNumber,
3121 opCode,
3122 errorStatus
3123 );
3124
3125 // Null terminate
3126 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
3127 Fw::TextLogString _logString = _textBuffer;
3128 this->m_LogText_OutputPort[0].invoke(
3129 _id,
3130 _logTime,
3132 _logString
3133 );
3134 }
3135#endif
3136 }
3137
3138 void CmdSequencerComponentBase ::
3139 log_WARNING_HI_CS_InvalidMode()
3140 {
3141 // Get the time
3142 Fw::Time _logTime;
3143 if (this->m_timeCaller_OutputPort[0].isConnected()) {
3144 this->m_timeCaller_OutputPort[0].invoke(_logTime);
3145 }
3146
3147 FwEventIdType _id = static_cast<FwEventIdType>(0);
3148
3149 _id = this->getIdBase() + EVENTID_CS_INVALIDMODE;
3150
3151 // Emit the event on the log port
3152 if (this->m_logOut_OutputPort[0].isConnected()) {
3153 Fw::LogBuffer _logBuff;
3154
3155#if FW_AMPCS_COMPATIBLE
3157 // Serialize the number of arguments
3158 _status = _logBuff.serialize(static_cast<U8>(0));
3159 FW_ASSERT(
3160 _status == Fw::FW_SERIALIZE_OK,
3161 static_cast<FwAssertArgType>(_status)
3162 );
3163#endif
3164
3165 this->m_logOut_OutputPort[0].invoke(
3166 _id,
3167 _logTime,
3169 _logBuff
3170 );
3171 }
3172
3173 // Emit the event on the text log port
3174#if FW_ENABLE_TEXT_LOGGING
3175 if (this->m_LogText_OutputPort[0].isConnected()) {
3176#if FW_OBJECT_NAMES == 1
3177 const char* _formatString =
3178 "(%s) %s: Invalid mode";
3179#else
3180 const char* _formatString =
3181 "%s: Invalid mode";
3182#endif
3183
3184 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
3185
3186 (void) snprintf(
3187 _textBuffer,
3189 _formatString,
3190#if FW_OBJECT_NAMES == 1
3191 this->m_objName,
3192#endif
3193 "CS_InvalidMode "
3194 );
3195
3196 // Null terminate
3197 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
3198 Fw::TextLogString _logString = _textBuffer;
3199 this->m_LogText_OutputPort[0].invoke(
3200 _id,
3201 _logTime,
3203 _logString
3204 );
3205 }
3206#endif
3207 }
3208
3209 void CmdSequencerComponentBase ::
3210 log_WARNING_HI_CS_RecordMismatch(
3211 const Fw::LogStringArg& fileName,
3212 U32 header_records,
3213 U32 extra_bytes
3214 )
3215 {
3216 // Get the time
3217 Fw::Time _logTime;
3218 if (this->m_timeCaller_OutputPort[0].isConnected()) {
3219 this->m_timeCaller_OutputPort[0].invoke(_logTime);
3220 }
3221
3222 FwEventIdType _id = static_cast<FwEventIdType>(0);
3223
3224 _id = this->getIdBase() + EVENTID_CS_RECORDMISMATCH;
3225
3226 // Emit the event on the log port
3227 if (this->m_logOut_OutputPort[0].isConnected()) {
3228 Fw::LogBuffer _logBuff;
3230
3231#if FW_AMPCS_COMPATIBLE
3232 // Serialize the number of arguments
3233 _status = _logBuff.serialize(static_cast<U8>(3));
3234 FW_ASSERT(
3235 _status == Fw::FW_SERIALIZE_OK,
3236 static_cast<FwAssertArgType>(_status)
3237 );
3238#endif
3239
3240 _status = fileName.serialize(_logBuff, 60);
3241 FW_ASSERT(
3242 _status == Fw::FW_SERIALIZE_OK,
3243 static_cast<FwAssertArgType>(_status)
3244 );
3245
3246#if FW_AMPCS_COMPATIBLE
3247 // Serialize the argument size
3248 _status = _logBuff.serialize(
3249 static_cast<U8>(sizeof(U32))
3250 );
3251 FW_ASSERT(
3252 _status == Fw::FW_SERIALIZE_OK,
3253 static_cast<FwAssertArgType>(_status)
3254 );
3255#endif
3256 _status = _logBuff.serialize(header_records);
3257 FW_ASSERT(
3258 _status == Fw::FW_SERIALIZE_OK,
3259 static_cast<FwAssertArgType>(_status)
3260 );
3261
3262#if FW_AMPCS_COMPATIBLE
3263 // Serialize the argument size
3264 _status = _logBuff.serialize(
3265 static_cast<U8>(sizeof(U32))
3266 );
3267 FW_ASSERT(
3268 _status == Fw::FW_SERIALIZE_OK,
3269 static_cast<FwAssertArgType>(_status)
3270 );
3271#endif
3272 _status = _logBuff.serialize(extra_bytes);
3273 FW_ASSERT(
3274 _status == Fw::FW_SERIALIZE_OK,
3275 static_cast<FwAssertArgType>(_status)
3276 );
3277
3278 this->m_logOut_OutputPort[0].invoke(
3279 _id,
3280 _logTime,
3282 _logBuff
3283 );
3284 }
3285
3286 // Emit the event on the text log port
3287#if FW_ENABLE_TEXT_LOGGING
3288 if (this->m_LogText_OutputPort[0].isConnected()) {
3289#if FW_OBJECT_NAMES == 1
3290 const char* _formatString =
3291 "(%s) %s: Sequence file %s header records mismatch: %" PRIu32 " in header, found %" PRIu32 " extra bytes.";
3292#else
3293 const char* _formatString =
3294 "%s: Sequence file %s header records mismatch: %" PRIu32 " in header, found %" PRIu32 " extra bytes.";
3295#endif
3296
3297 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
3298
3299 (void) snprintf(
3300 _textBuffer,
3302 _formatString,
3303#if FW_OBJECT_NAMES == 1
3304 this->m_objName,
3305#endif
3306 "CS_RecordMismatch ",
3307 fileName.toChar(),
3308 header_records,
3309 extra_bytes
3310 );
3311
3312 // Null terminate
3313 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
3314 Fw::TextLogString _logString = _textBuffer;
3315 this->m_LogText_OutputPort[0].invoke(
3316 _id,
3317 _logTime,
3319 _logString
3320 );
3321 }
3322#endif
3323 }
3324
3325 void CmdSequencerComponentBase ::
3326 log_WARNING_HI_CS_TimeBaseMismatch(
3327 const Fw::LogStringArg& fileName,
3328 U16 time_base,
3329 U16 seq_time_base
3330 )
3331 {
3332 // Get the time
3333 Fw::Time _logTime;
3334 if (this->m_timeCaller_OutputPort[0].isConnected()) {
3335 this->m_timeCaller_OutputPort[0].invoke(_logTime);
3336 }
3337
3338 FwEventIdType _id = static_cast<FwEventIdType>(0);
3339
3340 _id = this->getIdBase() + EVENTID_CS_TIMEBASEMISMATCH;
3341
3342 // Emit the event on the log port
3343 if (this->m_logOut_OutputPort[0].isConnected()) {
3344 Fw::LogBuffer _logBuff;
3346
3347#if FW_AMPCS_COMPATIBLE
3348 // Serialize the number of arguments
3349 _status = _logBuff.serialize(static_cast<U8>(3));
3350 FW_ASSERT(
3351 _status == Fw::FW_SERIALIZE_OK,
3352 static_cast<FwAssertArgType>(_status)
3353 );
3354#endif
3355
3356 _status = fileName.serialize(_logBuff, 60);
3357 FW_ASSERT(
3358 _status == Fw::FW_SERIALIZE_OK,
3359 static_cast<FwAssertArgType>(_status)
3360 );
3361
3362#if FW_AMPCS_COMPATIBLE
3363 // Serialize the argument size
3364 _status = _logBuff.serialize(
3365 static_cast<U8>(sizeof(U16))
3366 );
3367 FW_ASSERT(
3368 _status == Fw::FW_SERIALIZE_OK,
3369 static_cast<FwAssertArgType>(_status)
3370 );
3371#endif
3372 _status = _logBuff.serialize(time_base);
3373 FW_ASSERT(
3374 _status == Fw::FW_SERIALIZE_OK,
3375 static_cast<FwAssertArgType>(_status)
3376 );
3377
3378#if FW_AMPCS_COMPATIBLE
3379 // Serialize the argument size
3380 _status = _logBuff.serialize(
3381 static_cast<U8>(sizeof(U16))
3382 );
3383 FW_ASSERT(
3384 _status == Fw::FW_SERIALIZE_OK,
3385 static_cast<FwAssertArgType>(_status)
3386 );
3387#endif
3388 _status = _logBuff.serialize(seq_time_base);
3389 FW_ASSERT(
3390 _status == Fw::FW_SERIALIZE_OK,
3391 static_cast<FwAssertArgType>(_status)
3392 );
3393
3394 this->m_logOut_OutputPort[0].invoke(
3395 _id,
3396 _logTime,
3398 _logBuff
3399 );
3400 }
3401
3402 // Emit the event on the text log port
3403#if FW_ENABLE_TEXT_LOGGING
3404 if (this->m_LogText_OutputPort[0].isConnected()) {
3405#if FW_OBJECT_NAMES == 1
3406 const char* _formatString =
3407 "(%s) %s: Sequence file %s: Current time base doesn't match sequence time: base: %" PRIu16 " seq: %" PRIu16 "";
3408#else
3409 const char* _formatString =
3410 "%s: Sequence file %s: Current time base doesn't match sequence time: base: %" PRIu16 " seq: %" PRIu16 "";
3411#endif
3412
3413 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
3414
3415 (void) snprintf(
3416 _textBuffer,
3418 _formatString,
3419#if FW_OBJECT_NAMES == 1
3420 this->m_objName,
3421#endif
3422 "CS_TimeBaseMismatch ",
3423 fileName.toChar(),
3424 time_base,
3425 seq_time_base
3426 );
3427
3428 // Null terminate
3429 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
3430 Fw::TextLogString _logString = _textBuffer;
3431 this->m_LogText_OutputPort[0].invoke(
3432 _id,
3433 _logTime,
3435 _logString
3436 );
3437 }
3438#endif
3439 }
3440
3441 void CmdSequencerComponentBase ::
3442 log_WARNING_HI_CS_TimeContextMismatch(
3443 const Fw::LogStringArg& fileName,
3444 U8 currTimeBase,
3445 U8 seqTimeBase
3446 )
3447 {
3448 // Get the time
3449 Fw::Time _logTime;
3450 if (this->m_timeCaller_OutputPort[0].isConnected()) {
3451 this->m_timeCaller_OutputPort[0].invoke(_logTime);
3452 }
3453
3454 FwEventIdType _id = static_cast<FwEventIdType>(0);
3455
3456 _id = this->getIdBase() + EVENTID_CS_TIMECONTEXTMISMATCH;
3457
3458 // Emit the event on the log port
3459 if (this->m_logOut_OutputPort[0].isConnected()) {
3460 Fw::LogBuffer _logBuff;
3462
3463#if FW_AMPCS_COMPATIBLE
3464 // Serialize the number of arguments
3465 _status = _logBuff.serialize(static_cast<U8>(3));
3466 FW_ASSERT(
3467 _status == Fw::FW_SERIALIZE_OK,
3468 static_cast<FwAssertArgType>(_status)
3469 );
3470#endif
3471
3472 _status = fileName.serialize(_logBuff, 60);
3473 FW_ASSERT(
3474 _status == Fw::FW_SERIALIZE_OK,
3475 static_cast<FwAssertArgType>(_status)
3476 );
3477
3478#if FW_AMPCS_COMPATIBLE
3479 // Serialize the argument size
3480 _status = _logBuff.serialize(
3481 static_cast<U8>(sizeof(U8))
3482 );
3483 FW_ASSERT(
3484 _status == Fw::FW_SERIALIZE_OK,
3485 static_cast<FwAssertArgType>(_status)
3486 );
3487#endif
3488 _status = _logBuff.serialize(currTimeBase);
3489 FW_ASSERT(
3490 _status == Fw::FW_SERIALIZE_OK,
3491 static_cast<FwAssertArgType>(_status)
3492 );
3493
3494#if FW_AMPCS_COMPATIBLE
3495 // Serialize the argument size
3496 _status = _logBuff.serialize(
3497 static_cast<U8>(sizeof(U8))
3498 );
3499 FW_ASSERT(
3500 _status == Fw::FW_SERIALIZE_OK,
3501 static_cast<FwAssertArgType>(_status)
3502 );
3503#endif
3504 _status = _logBuff.serialize(seqTimeBase);
3505 FW_ASSERT(
3506 _status == Fw::FW_SERIALIZE_OK,
3507 static_cast<FwAssertArgType>(_status)
3508 );
3509
3510 this->m_logOut_OutputPort[0].invoke(
3511 _id,
3512 _logTime,
3514 _logBuff
3515 );
3516 }
3517
3518 // Emit the event on the text log port
3519#if FW_ENABLE_TEXT_LOGGING
3520 if (this->m_LogText_OutputPort[0].isConnected()) {
3521#if FW_OBJECT_NAMES == 1
3522 const char* _formatString =
3523 "(%s) %s: Sequence file %s: Current time context doesn't match sequence context: base: %" PRIu8 " seq: %" PRIu8 "";
3524#else
3525 const char* _formatString =
3526 "%s: Sequence file %s: Current time context doesn't match sequence context: base: %" PRIu8 " seq: %" PRIu8 "";
3527#endif
3528
3529 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
3530
3531 (void) snprintf(
3532 _textBuffer,
3534 _formatString,
3535#if FW_OBJECT_NAMES == 1
3536 this->m_objName,
3537#endif
3538 "CS_TimeContextMismatch ",
3539 fileName.toChar(),
3540 currTimeBase,
3541 seqTimeBase
3542 );
3543
3544 // Null terminate
3545 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
3546 Fw::TextLogString _logString = _textBuffer;
3547 this->m_LogText_OutputPort[0].invoke(
3548 _id,
3549 _logTime,
3551 _logString
3552 );
3553 }
3554#endif
3555 }
3556
3557 void CmdSequencerComponentBase ::
3558 log_ACTIVITY_HI_CS_PortSequenceStarted(const Fw::LogStringArg& filename)
3559 {
3560 // Get the time
3561 Fw::Time _logTime;
3562 if (this->m_timeCaller_OutputPort[0].isConnected()) {
3563 this->m_timeCaller_OutputPort[0].invoke(_logTime);
3564 }
3565
3566 FwEventIdType _id = static_cast<FwEventIdType>(0);
3567
3568 _id = this->getIdBase() + EVENTID_CS_PORTSEQUENCESTARTED;
3569
3570 // Emit the event on the log port
3571 if (this->m_logOut_OutputPort[0].isConnected()) {
3572 Fw::LogBuffer _logBuff;
3574
3575#if FW_AMPCS_COMPATIBLE
3576 // Serialize the number of arguments
3577 _status = _logBuff.serialize(static_cast<U8>(1));
3578 FW_ASSERT(
3579 _status == Fw::FW_SERIALIZE_OK,
3580 static_cast<FwAssertArgType>(_status)
3581 );
3582#endif
3583
3584 _status = filename.serialize(_logBuff, 60);
3585 FW_ASSERT(
3586 _status == Fw::FW_SERIALIZE_OK,
3587 static_cast<FwAssertArgType>(_status)
3588 );
3589
3590 this->m_logOut_OutputPort[0].invoke(
3591 _id,
3592 _logTime,
3594 _logBuff
3595 );
3596 }
3597
3598 // Emit the event on the text log port
3599#if FW_ENABLE_TEXT_LOGGING
3600 if (this->m_LogText_OutputPort[0].isConnected()) {
3601#if FW_OBJECT_NAMES == 1
3602 const char* _formatString =
3603 "(%s) %s: Local request for sequence %s started.";
3604#else
3605 const char* _formatString =
3606 "%s: Local request for sequence %s started.";
3607#endif
3608
3609 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
3610
3611 (void) snprintf(
3612 _textBuffer,
3614 _formatString,
3615#if FW_OBJECT_NAMES == 1
3616 this->m_objName,
3617#endif
3618 "CS_PortSequenceStarted ",
3619 filename.toChar()
3620 );
3621
3622 // Null terminate
3623 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
3624 Fw::TextLogString _logString = _textBuffer;
3625 this->m_LogText_OutputPort[0].invoke(
3626 _id,
3627 _logTime,
3629 _logString
3630 );
3631 }
3632#endif
3633 }
3634
3635 void CmdSequencerComponentBase ::
3636 log_WARNING_HI_CS_UnexpectedCompletion(U32 opcode)
3637 {
3638 // Get the time
3639 Fw::Time _logTime;
3640 if (this->m_timeCaller_OutputPort[0].isConnected()) {
3641 this->m_timeCaller_OutputPort[0].invoke(_logTime);
3642 }
3643
3644 FwEventIdType _id = static_cast<FwEventIdType>(0);
3645
3646 _id = this->getIdBase() + EVENTID_CS_UNEXPECTEDCOMPLETION;
3647
3648 // Emit the event on the log port
3649 if (this->m_logOut_OutputPort[0].isConnected()) {
3650 Fw::LogBuffer _logBuff;
3652
3653#if FW_AMPCS_COMPATIBLE
3654 // Serialize the number of arguments
3655 _status = _logBuff.serialize(static_cast<U8>(1));
3656 FW_ASSERT(
3657 _status == Fw::FW_SERIALIZE_OK,
3658 static_cast<FwAssertArgType>(_status)
3659 );
3660#endif
3661
3662#if FW_AMPCS_COMPATIBLE
3663 // Serialize the argument size
3664 _status = _logBuff.serialize(
3665 static_cast<U8>(sizeof(U32))
3666 );
3667 FW_ASSERT(
3668 _status == Fw::FW_SERIALIZE_OK,
3669 static_cast<FwAssertArgType>(_status)
3670 );
3671#endif
3672 _status = _logBuff.serialize(opcode);
3673 FW_ASSERT(
3674 _status == Fw::FW_SERIALIZE_OK,
3675 static_cast<FwAssertArgType>(_status)
3676 );
3677
3678 this->m_logOut_OutputPort[0].invoke(
3679 _id,
3680 _logTime,
3682 _logBuff
3683 );
3684 }
3685
3686 // Emit the event on the text log port
3687#if FW_ENABLE_TEXT_LOGGING
3688 if (this->m_LogText_OutputPort[0].isConnected()) {
3689#if FW_OBJECT_NAMES == 1
3690 const char* _formatString =
3691 "(%s) %s: Command complete status received while no sequences active. Opcode: %" PRIu32 "";
3692#else
3693 const char* _formatString =
3694 "%s: Command complete status received while no sequences active. Opcode: %" PRIu32 "";
3695#endif
3696
3697 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
3698
3699 (void) snprintf(
3700 _textBuffer,
3702 _formatString,
3703#if FW_OBJECT_NAMES == 1
3704 this->m_objName,
3705#endif
3706 "CS_UnexpectedCompletion ",
3707 opcode
3708 );
3709
3710 // Null terminate
3711 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
3712 Fw::TextLogString _logString = _textBuffer;
3713 this->m_LogText_OutputPort[0].invoke(
3714 _id,
3715 _logTime,
3717 _logString
3718 );
3719 }
3720#endif
3721 }
3722
3723 void CmdSequencerComponentBase ::
3724 log_ACTIVITY_HI_CS_ModeSwitched(Svc::CmdSequencer_SeqMode mode)
3725 {
3726 // Get the time
3727 Fw::Time _logTime;
3728 if (this->m_timeCaller_OutputPort[0].isConnected()) {
3729 this->m_timeCaller_OutputPort[0].invoke(_logTime);
3730 }
3731
3732 FwEventIdType _id = static_cast<FwEventIdType>(0);
3733
3734 _id = this->getIdBase() + EVENTID_CS_MODESWITCHED;
3735
3736 // Emit the event on the log port
3737 if (this->m_logOut_OutputPort[0].isConnected()) {
3738 Fw::LogBuffer _logBuff;
3740
3741#if FW_AMPCS_COMPATIBLE
3742 // Serialize the number of arguments
3743 _status = _logBuff.serialize(static_cast<U8>(1));
3744 FW_ASSERT(
3745 _status == Fw::FW_SERIALIZE_OK,
3746 static_cast<FwAssertArgType>(_status)
3747 );
3748#endif
3749
3750#if FW_AMPCS_COMPATIBLE
3751 // Serialize the argument size
3752 _status = _logBuff.serialize(
3754 );
3755 FW_ASSERT(
3756 _status == Fw::FW_SERIALIZE_OK,
3757 static_cast<FwAssertArgType>(_status)
3758 );
3759#endif
3760 _status = _logBuff.serialize(mode);
3761 FW_ASSERT(
3762 _status == Fw::FW_SERIALIZE_OK,
3763 static_cast<FwAssertArgType>(_status)
3764 );
3765
3766 this->m_logOut_OutputPort[0].invoke(
3767 _id,
3768 _logTime,
3770 _logBuff
3771 );
3772 }
3773
3774 // Emit the event on the text log port
3775#if FW_ENABLE_TEXT_LOGGING
3776 if (this->m_LogText_OutputPort[0].isConnected()) {
3777#if FW_OBJECT_NAMES == 1
3778 const char* _formatString =
3779 "(%s) %s: Sequencer switched to %s step mode";
3780#else
3781 const char* _formatString =
3782 "%s: Sequencer switched to %s step mode";
3783#endif
3784
3785 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
3786
3787 Fw::String modeStr;
3788 mode.toString(modeStr);
3789
3790 (void) snprintf(
3791 _textBuffer,
3793 _formatString,
3794#if FW_OBJECT_NAMES == 1
3795 this->m_objName,
3796#endif
3797 "CS_ModeSwitched ",
3798 modeStr.toChar()
3799 );
3800
3801 // Null terminate
3802 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
3803 Fw::TextLogString _logString = _textBuffer;
3804 this->m_LogText_OutputPort[0].invoke(
3805 _id,
3806 _logTime,
3808 _logString
3809 );
3810 }
3811#endif
3812 }
3813
3814 void CmdSequencerComponentBase ::
3815 log_WARNING_LO_CS_NoSequenceActive()
3816 {
3817 // Get the time
3818 Fw::Time _logTime;
3819 if (this->m_timeCaller_OutputPort[0].isConnected()) {
3820 this->m_timeCaller_OutputPort[0].invoke(_logTime);
3821 }
3822
3823 FwEventIdType _id = static_cast<FwEventIdType>(0);
3824
3825 _id = this->getIdBase() + EVENTID_CS_NOSEQUENCEACTIVE;
3826
3827 // Emit the event on the log port
3828 if (this->m_logOut_OutputPort[0].isConnected()) {
3829 Fw::LogBuffer _logBuff;
3830
3831#if FW_AMPCS_COMPATIBLE
3833 // Serialize the number of arguments
3834 _status = _logBuff.serialize(static_cast<U8>(0));
3835 FW_ASSERT(
3836 _status == Fw::FW_SERIALIZE_OK,
3837 static_cast<FwAssertArgType>(_status)
3838 );
3839#endif
3840
3841 this->m_logOut_OutputPort[0].invoke(
3842 _id,
3843 _logTime,
3845 _logBuff
3846 );
3847 }
3848
3849 // Emit the event on the text log port
3850#if FW_ENABLE_TEXT_LOGGING
3851 if (this->m_LogText_OutputPort[0].isConnected()) {
3852#if FW_OBJECT_NAMES == 1
3853 const char* _formatString =
3854 "(%s) %s: No sequence active.";
3855#else
3856 const char* _formatString =
3857 "%s: No sequence active.";
3858#endif
3859
3860 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
3861
3862 (void) snprintf(
3863 _textBuffer,
3865 _formatString,
3866#if FW_OBJECT_NAMES == 1
3867 this->m_objName,
3868#endif
3869 "CS_NoSequenceActive "
3870 );
3871
3872 // Null terminate
3873 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
3874 Fw::TextLogString _logString = _textBuffer;
3875 this->m_LogText_OutputPort[0].invoke(
3876 _id,
3877 _logTime,
3879 _logString
3880 );
3881 }
3882#endif
3883 }
3884
3885 void CmdSequencerComponentBase ::
3886 log_ACTIVITY_HI_CS_SequenceValid(const Fw::LogStringArg& filename)
3887 {
3888 // Get the time
3889 Fw::Time _logTime;
3890 if (this->m_timeCaller_OutputPort[0].isConnected()) {
3891 this->m_timeCaller_OutputPort[0].invoke(_logTime);
3892 }
3893
3894 FwEventIdType _id = static_cast<FwEventIdType>(0);
3895
3896 _id = this->getIdBase() + EVENTID_CS_SEQUENCEVALID;
3897
3898 // Emit the event on the log port
3899 if (this->m_logOut_OutputPort[0].isConnected()) {
3900 Fw::LogBuffer _logBuff;
3902
3903#if FW_AMPCS_COMPATIBLE
3904 // Serialize the number of arguments
3905 _status = _logBuff.serialize(static_cast<U8>(1));
3906 FW_ASSERT(
3907 _status == Fw::FW_SERIALIZE_OK,
3908 static_cast<FwAssertArgType>(_status)
3909 );
3910#endif
3911
3912 _status = filename.serialize(_logBuff, 60);
3913 FW_ASSERT(
3914 _status == Fw::FW_SERIALIZE_OK,
3915 static_cast<FwAssertArgType>(_status)
3916 );
3917
3918 this->m_logOut_OutputPort[0].invoke(
3919 _id,
3920 _logTime,
3922 _logBuff
3923 );
3924 }
3925
3926 // Emit the event on the text log port
3927#if FW_ENABLE_TEXT_LOGGING
3928 if (this->m_LogText_OutputPort[0].isConnected()) {
3929#if FW_OBJECT_NAMES == 1
3930 const char* _formatString =
3931 "(%s) %s: Sequence %s is valid.";
3932#else
3933 const char* _formatString =
3934 "%s: Sequence %s is valid.";
3935#endif
3936
3937 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
3938
3939 (void) snprintf(
3940 _textBuffer,
3942 _formatString,
3943#if FW_OBJECT_NAMES == 1
3944 this->m_objName,
3945#endif
3946 "CS_SequenceValid ",
3947 filename.toChar()
3948 );
3949
3950 // Null terminate
3951 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
3952 Fw::TextLogString _logString = _textBuffer;
3953 this->m_LogText_OutputPort[0].invoke(
3954 _id,
3955 _logTime,
3957 _logString
3958 );
3959 }
3960#endif
3961 }
3962
3963 void CmdSequencerComponentBase ::
3964 log_WARNING_HI_CS_SequenceTimeout(
3965 const Fw::LogStringArg& filename,
3966 U32 command
3967 )
3968 {
3969 // Get the time
3970 Fw::Time _logTime;
3971 if (this->m_timeCaller_OutputPort[0].isConnected()) {
3972 this->m_timeCaller_OutputPort[0].invoke(_logTime);
3973 }
3974
3975 FwEventIdType _id = static_cast<FwEventIdType>(0);
3976
3977 _id = this->getIdBase() + EVENTID_CS_SEQUENCETIMEOUT;
3978
3979 // Emit the event on the log port
3980 if (this->m_logOut_OutputPort[0].isConnected()) {
3981 Fw::LogBuffer _logBuff;
3983
3984#if FW_AMPCS_COMPATIBLE
3985 // Serialize the number of arguments
3986 _status = _logBuff.serialize(static_cast<U8>(2));
3987 FW_ASSERT(
3988 _status == Fw::FW_SERIALIZE_OK,
3989 static_cast<FwAssertArgType>(_status)
3990 );
3991#endif
3992
3993 _status = filename.serialize(_logBuff, 60);
3994 FW_ASSERT(
3995 _status == Fw::FW_SERIALIZE_OK,
3996 static_cast<FwAssertArgType>(_status)
3997 );
3998
3999#if FW_AMPCS_COMPATIBLE
4000 // Serialize the argument size
4001 _status = _logBuff.serialize(
4002 static_cast<U8>(sizeof(U32))
4003 );
4004 FW_ASSERT(
4005 _status == Fw::FW_SERIALIZE_OK,
4006 static_cast<FwAssertArgType>(_status)
4007 );
4008#endif
4009 _status = _logBuff.serialize(command);
4010 FW_ASSERT(
4011 _status == Fw::FW_SERIALIZE_OK,
4012 static_cast<FwAssertArgType>(_status)
4013 );
4014
4015 this->m_logOut_OutputPort[0].invoke(
4016 _id,
4017 _logTime,
4019 _logBuff
4020 );
4021 }
4022
4023 // Emit the event on the text log port
4024#if FW_ENABLE_TEXT_LOGGING
4025 if (this->m_LogText_OutputPort[0].isConnected()) {
4026#if FW_OBJECT_NAMES == 1
4027 const char* _formatString =
4028 "(%s) %s: Sequence %s timed out on command %" PRIu32 "";
4029#else
4030 const char* _formatString =
4031 "%s: Sequence %s timed out on command %" PRIu32 "";
4032#endif
4033
4034 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
4035
4036 (void) snprintf(
4037 _textBuffer,
4039 _formatString,
4040#if FW_OBJECT_NAMES == 1
4041 this->m_objName,
4042#endif
4043 "CS_SequenceTimeout ",
4044 filename.toChar(),
4045 command
4046 );
4047
4048 // Null terminate
4049 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
4050 Fw::TextLogString _logString = _textBuffer;
4051 this->m_LogText_OutputPort[0].invoke(
4052 _id,
4053 _logTime,
4055 _logString
4056 );
4057 }
4058#endif
4059 }
4060
4061 void CmdSequencerComponentBase ::
4062 log_ACTIVITY_HI_CS_CmdStepped(
4063 const Fw::LogStringArg& filename,
4064 U32 command
4065 )
4066 {
4067 // Get the time
4068 Fw::Time _logTime;
4069 if (this->m_timeCaller_OutputPort[0].isConnected()) {
4070 this->m_timeCaller_OutputPort[0].invoke(_logTime);
4071 }
4072
4073 FwEventIdType _id = static_cast<FwEventIdType>(0);
4074
4075 _id = this->getIdBase() + EVENTID_CS_CMDSTEPPED;
4076
4077 // Emit the event on the log port
4078 if (this->m_logOut_OutputPort[0].isConnected()) {
4079 Fw::LogBuffer _logBuff;
4081
4082#if FW_AMPCS_COMPATIBLE
4083 // Serialize the number of arguments
4084 _status = _logBuff.serialize(static_cast<U8>(2));
4085 FW_ASSERT(
4086 _status == Fw::FW_SERIALIZE_OK,
4087 static_cast<FwAssertArgType>(_status)
4088 );
4089#endif
4090
4091 _status = filename.serialize(_logBuff, 60);
4092 FW_ASSERT(
4093 _status == Fw::FW_SERIALIZE_OK,
4094 static_cast<FwAssertArgType>(_status)
4095 );
4096
4097#if FW_AMPCS_COMPATIBLE
4098 // Serialize the argument size
4099 _status = _logBuff.serialize(
4100 static_cast<U8>(sizeof(U32))
4101 );
4102 FW_ASSERT(
4103 _status == Fw::FW_SERIALIZE_OK,
4104 static_cast<FwAssertArgType>(_status)
4105 );
4106#endif
4107 _status = _logBuff.serialize(command);
4108 FW_ASSERT(
4109 _status == Fw::FW_SERIALIZE_OK,
4110 static_cast<FwAssertArgType>(_status)
4111 );
4112
4113 this->m_logOut_OutputPort[0].invoke(
4114 _id,
4115 _logTime,
4117 _logBuff
4118 );
4119 }
4120
4121 // Emit the event on the text log port
4122#if FW_ENABLE_TEXT_LOGGING
4123 if (this->m_LogText_OutputPort[0].isConnected()) {
4124#if FW_OBJECT_NAMES == 1
4125 const char* _formatString =
4126 "(%s) %s: Sequence %s command %" PRIu32 " stepped";
4127#else
4128 const char* _formatString =
4129 "%s: Sequence %s command %" PRIu32 " stepped";
4130#endif
4131
4132 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
4133
4134 (void) snprintf(
4135 _textBuffer,
4137 _formatString,
4138#if FW_OBJECT_NAMES == 1
4139 this->m_objName,
4140#endif
4141 "CS_CmdStepped ",
4142 filename.toChar(),
4143 command
4144 );
4145
4146 // Null terminate
4147 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
4148 Fw::TextLogString _logString = _textBuffer;
4149 this->m_LogText_OutputPort[0].invoke(
4150 _id,
4151 _logTime,
4153 _logString
4154 );
4155 }
4156#endif
4157 }
4158
4159 void CmdSequencerComponentBase ::
4160 log_ACTIVITY_HI_CS_CmdStarted(const Fw::LogStringArg& filename)
4161 {
4162 // Get the time
4163 Fw::Time _logTime;
4164 if (this->m_timeCaller_OutputPort[0].isConnected()) {
4165 this->m_timeCaller_OutputPort[0].invoke(_logTime);
4166 }
4167
4168 FwEventIdType _id = static_cast<FwEventIdType>(0);
4169
4170 _id = this->getIdBase() + EVENTID_CS_CMDSTARTED;
4171
4172 // Emit the event on the log port
4173 if (this->m_logOut_OutputPort[0].isConnected()) {
4174 Fw::LogBuffer _logBuff;
4176
4177#if FW_AMPCS_COMPATIBLE
4178 // Serialize the number of arguments
4179 _status = _logBuff.serialize(static_cast<U8>(1));
4180 FW_ASSERT(
4181 _status == Fw::FW_SERIALIZE_OK,
4182 static_cast<FwAssertArgType>(_status)
4183 );
4184#endif
4185
4186 _status = filename.serialize(_logBuff, 60);
4187 FW_ASSERT(
4188 _status == Fw::FW_SERIALIZE_OK,
4189 static_cast<FwAssertArgType>(_status)
4190 );
4191
4192 this->m_logOut_OutputPort[0].invoke(
4193 _id,
4194 _logTime,
4196 _logBuff
4197 );
4198 }
4199
4200 // Emit the event on the text log port
4201#if FW_ENABLE_TEXT_LOGGING
4202 if (this->m_LogText_OutputPort[0].isConnected()) {
4203#if FW_OBJECT_NAMES == 1
4204 const char* _formatString =
4205 "(%s) %s: Sequence %s started";
4206#else
4207 const char* _formatString =
4208 "%s: Sequence %s started";
4209#endif
4210
4211 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
4212
4213 (void) snprintf(
4214 _textBuffer,
4216 _formatString,
4217#if FW_OBJECT_NAMES == 1
4218 this->m_objName,
4219#endif
4220 "CS_CmdStarted ",
4221 filename.toChar()
4222 );
4223
4224 // Null terminate
4225 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
4226 Fw::TextLogString _logString = _textBuffer;
4227 this->m_LogText_OutputPort[0].invoke(
4228 _id,
4229 _logTime,
4231 _logString
4232 );
4233 }
4234#endif
4235 }
4236
4237 void CmdSequencerComponentBase ::
4238 log_ACTIVITY_HI_CS_JoinWaiting(
4239 const Fw::LogStringArg& filename,
4240 U32 recordNumber,
4241 U32 opCode
4242 )
4243 {
4244 // Get the time
4245 Fw::Time _logTime;
4246 if (this->m_timeCaller_OutputPort[0].isConnected()) {
4247 this->m_timeCaller_OutputPort[0].invoke(_logTime);
4248 }
4249
4250 FwEventIdType _id = static_cast<FwEventIdType>(0);
4251
4252 _id = this->getIdBase() + EVENTID_CS_JOINWAITING;
4253
4254 // Emit the event on the log port
4255 if (this->m_logOut_OutputPort[0].isConnected()) {
4256 Fw::LogBuffer _logBuff;
4258
4259#if FW_AMPCS_COMPATIBLE
4260 // Serialize the number of arguments
4261 _status = _logBuff.serialize(static_cast<U8>(3));
4262 FW_ASSERT(
4263 _status == Fw::FW_SERIALIZE_OK,
4264 static_cast<FwAssertArgType>(_status)
4265 );
4266#endif
4267
4268 _status = filename.serialize(_logBuff, 60);
4269 FW_ASSERT(
4270 _status == Fw::FW_SERIALIZE_OK,
4271 static_cast<FwAssertArgType>(_status)
4272 );
4273
4274#if FW_AMPCS_COMPATIBLE
4275 // Serialize the argument size
4276 _status = _logBuff.serialize(
4277 static_cast<U8>(sizeof(U32))
4278 );
4279 FW_ASSERT(
4280 _status == Fw::FW_SERIALIZE_OK,
4281 static_cast<FwAssertArgType>(_status)
4282 );
4283#endif
4284 _status = _logBuff.serialize(recordNumber);
4285 FW_ASSERT(
4286 _status == Fw::FW_SERIALIZE_OK,
4287 static_cast<FwAssertArgType>(_status)
4288 );
4289
4290#if FW_AMPCS_COMPATIBLE
4291 // Serialize the argument size
4292 _status = _logBuff.serialize(
4293 static_cast<U8>(sizeof(U32))
4294 );
4295 FW_ASSERT(
4296 _status == Fw::FW_SERIALIZE_OK,
4297 static_cast<FwAssertArgType>(_status)
4298 );
4299#endif
4300 _status = _logBuff.serialize(opCode);
4301 FW_ASSERT(
4302 _status == Fw::FW_SERIALIZE_OK,
4303 static_cast<FwAssertArgType>(_status)
4304 );
4305
4306 this->m_logOut_OutputPort[0].invoke(
4307 _id,
4308 _logTime,
4310 _logBuff
4311 );
4312 }
4313
4314 // Emit the event on the text log port
4315#if FW_ENABLE_TEXT_LOGGING
4316 if (this->m_LogText_OutputPort[0].isConnected()) {
4317#if FW_OBJECT_NAMES == 1
4318 const char* _formatString =
4319 "(%s) %s: Start waiting for sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") to complete";
4320#else
4321 const char* _formatString =
4322 "%s: Start waiting for sequence file %s: Command %" PRIu32 " (opcode %" PRIu32 ") to complete";
4323#endif
4324
4325 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
4326
4327 (void) snprintf(
4328 _textBuffer,
4330 _formatString,
4331#if FW_OBJECT_NAMES == 1
4332 this->m_objName,
4333#endif
4334 "CS_JoinWaiting ",
4335 filename.toChar(),
4336 recordNumber,
4337 opCode
4338 );
4339
4340 // Null terminate
4341 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
4342 Fw::TextLogString _logString = _textBuffer;
4343 this->m_LogText_OutputPort[0].invoke(
4344 _id,
4345 _logTime,
4347 _logString
4348 );
4349 }
4350#endif
4351 }
4352
4353 void CmdSequencerComponentBase ::
4354 log_WARNING_HI_CS_JoinWaitingNotComplete()
4355 {
4356 // Get the time
4357 Fw::Time _logTime;
4358 if (this->m_timeCaller_OutputPort[0].isConnected()) {
4359 this->m_timeCaller_OutputPort[0].invoke(_logTime);
4360 }
4361
4362 FwEventIdType _id = static_cast<FwEventIdType>(0);
4363
4364 _id = this->getIdBase() + EVENTID_CS_JOINWAITINGNOTCOMPLETE;
4365
4366 // Emit the event on the log port
4367 if (this->m_logOut_OutputPort[0].isConnected()) {
4368 Fw::LogBuffer _logBuff;
4369
4370#if FW_AMPCS_COMPATIBLE
4372 // Serialize the number of arguments
4373 _status = _logBuff.serialize(static_cast<U8>(0));
4374 FW_ASSERT(
4375 _status == Fw::FW_SERIALIZE_OK,
4376 static_cast<FwAssertArgType>(_status)
4377 );
4378#endif
4379
4380 this->m_logOut_OutputPort[0].invoke(
4381 _id,
4382 _logTime,
4384 _logBuff
4385 );
4386 }
4387
4388 // Emit the event on the text log port
4389#if FW_ENABLE_TEXT_LOGGING
4390 if (this->m_LogText_OutputPort[0].isConnected()) {
4391#if FW_OBJECT_NAMES == 1
4392 const char* _formatString =
4393 "(%s) %s: Still waiting for sequence file to complete";
4394#else
4395 const char* _formatString =
4396 "%s: Still waiting for sequence file to complete";
4397#endif
4398
4399 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
4400
4401 (void) snprintf(
4402 _textBuffer,
4404 _formatString,
4405#if FW_OBJECT_NAMES == 1
4406 this->m_objName,
4407#endif
4408 "CS_JoinWaitingNotComplete "
4409 );
4410
4411 // Null terminate
4412 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
4413 Fw::TextLogString _logString = _textBuffer;
4414 this->m_LogText_OutputPort[0].invoke(
4415 _id,
4416 _logTime,
4418 _logString
4419 );
4420 }
4421#endif
4422 }
4423
4424 // ----------------------------------------------------------------------
4425 // Telemetry write functions
4426 // ----------------------------------------------------------------------
4427
4428 void CmdSequencerComponentBase ::
4429 tlmWrite_CS_LoadCommands(
4430 U32 arg,
4431 Fw::Time _tlmTime
4432 )
4433 {
4434 if (this->m_tlmOut_OutputPort[0].isConnected()) {
4435 if (
4436 this->m_timeCaller_OutputPort[0].isConnected() &&
4437 (_tlmTime == Fw::ZERO_TIME)
4438 ) {
4439 this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
4440 }
4441
4442 Fw::TlmBuffer _tlmBuff;
4443 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
4444 FW_ASSERT(
4445 _stat == Fw::FW_SERIALIZE_OK,
4446 static_cast<FwAssertArgType>(_stat)
4447 );
4448
4449 FwChanIdType _id;
4450
4451 _id = this->getIdBase() + CHANNELID_CS_LOADCOMMANDS;
4452
4453 this->m_tlmOut_OutputPort[0].invoke(
4454 _id,
4455 _tlmTime,
4456 _tlmBuff
4457 );
4458 }
4459 }
4460
4461 void CmdSequencerComponentBase ::
4462 tlmWrite_CS_CancelCommands(
4463 U32 arg,
4464 Fw::Time _tlmTime
4465 )
4466 {
4467 if (this->m_tlmOut_OutputPort[0].isConnected()) {
4468 if (
4469 this->m_timeCaller_OutputPort[0].isConnected() &&
4470 (_tlmTime == Fw::ZERO_TIME)
4471 ) {
4472 this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
4473 }
4474
4475 Fw::TlmBuffer _tlmBuff;
4476 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
4477 FW_ASSERT(
4478 _stat == Fw::FW_SERIALIZE_OK,
4479 static_cast<FwAssertArgType>(_stat)
4480 );
4481
4482 FwChanIdType _id;
4483
4484 _id = this->getIdBase() + CHANNELID_CS_CANCELCOMMANDS;
4485
4486 this->m_tlmOut_OutputPort[0].invoke(
4487 _id,
4488 _tlmTime,
4489 _tlmBuff
4490 );
4491 }
4492 }
4493
4494 void CmdSequencerComponentBase ::
4495 tlmWrite_CS_Errors(
4496 U32 arg,
4497 Fw::Time _tlmTime
4498 )
4499 {
4500 if (this->m_tlmOut_OutputPort[0].isConnected()) {
4501 if (
4502 this->m_timeCaller_OutputPort[0].isConnected() &&
4503 (_tlmTime == Fw::ZERO_TIME)
4504 ) {
4505 this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
4506 }
4507
4508 Fw::TlmBuffer _tlmBuff;
4509 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
4510 FW_ASSERT(
4511 _stat == Fw::FW_SERIALIZE_OK,
4512 static_cast<FwAssertArgType>(_stat)
4513 );
4514
4515 FwChanIdType _id;
4516
4517 _id = this->getIdBase() + CHANNELID_CS_ERRORS;
4518
4519 this->m_tlmOut_OutputPort[0].invoke(
4520 _id,
4521 _tlmTime,
4522 _tlmBuff
4523 );
4524 }
4525 }
4526
4527 void CmdSequencerComponentBase ::
4528 tlmWrite_CS_CommandsExecuted(
4529 U32 arg,
4530 Fw::Time _tlmTime
4531 )
4532 {
4533 if (this->m_tlmOut_OutputPort[0].isConnected()) {
4534 if (
4535 this->m_timeCaller_OutputPort[0].isConnected() &&
4536 (_tlmTime == Fw::ZERO_TIME)
4537 ) {
4538 this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
4539 }
4540
4541 Fw::TlmBuffer _tlmBuff;
4542 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
4543 FW_ASSERT(
4544 _stat == Fw::FW_SERIALIZE_OK,
4545 static_cast<FwAssertArgType>(_stat)
4546 );
4547
4548 FwChanIdType _id;
4549
4550 _id = this->getIdBase() + CHANNELID_CS_COMMANDSEXECUTED;
4551
4552 this->m_tlmOut_OutputPort[0].invoke(
4553 _id,
4554 _tlmTime,
4555 _tlmBuff
4556 );
4557 }
4558 }
4559
4560 void CmdSequencerComponentBase ::
4561 tlmWrite_CS_SequencesCompleted(
4562 U32 arg,
4563 Fw::Time _tlmTime
4564 )
4565 {
4566 if (this->m_tlmOut_OutputPort[0].isConnected()) {
4567 if (
4568 this->m_timeCaller_OutputPort[0].isConnected() &&
4569 (_tlmTime == Fw::ZERO_TIME)
4570 ) {
4571 this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
4572 }
4573
4574 Fw::TlmBuffer _tlmBuff;
4575 Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
4576 FW_ASSERT(
4577 _stat == Fw::FW_SERIALIZE_OK,
4578 static_cast<FwAssertArgType>(_stat)
4579 );
4580
4581 FwChanIdType _id;
4582
4583 _id = this->getIdBase() + CHANNELID_CS_SEQUENCESCOMPLETED;
4584
4585 this->m_tlmOut_OutputPort[0].invoke(
4586 _id,
4587 _tlmTime,
4588 _tlmBuff
4589 );
4590 }
4591 }
4592
4593 // ----------------------------------------------------------------------
4594 // Time
4595 // ----------------------------------------------------------------------
4596
4597 Fw::Time CmdSequencerComponentBase ::
4598 getTime()
4599 {
4600 if (this->m_timeCaller_OutputPort[0].isConnected()) {
4601 Fw::Time _time;
4602 this->m_timeCaller_OutputPort[0].invoke(_time);
4603 return _time;
4604 }
4605 else {
4606 return Fw::Time(TB_NONE, 0, 0);
4607 }
4608 }
4609
4610 // ----------------------------------------------------------------------
4611 // Message dispatch functions
4612 // ----------------------------------------------------------------------
4613
4614 Fw::QueuedComponentBase::MsgDispatchStatus CmdSequencerComponentBase ::
4615 doDispatch()
4616 {
4617 ComponentIpcSerializableBuffer msg;
4618 NATIVE_INT_TYPE priority = 0;
4619
4620 Os::Queue::QueueStatus msgStatus = this->m_queue.receive(
4621 msg,
4622 priority,
4624 );
4625 FW_ASSERT(
4626 msgStatus == Os::Queue::QUEUE_OK,
4627 static_cast<FwAssertArgType>(msgStatus)
4628 );
4629
4630 // Reset to beginning of buffer
4631 msg.resetDeser();
4632
4633 NATIVE_INT_TYPE desMsg = 0;
4634 Fw::SerializeStatus deserStatus = msg.deserialize(desMsg);
4635 FW_ASSERT(
4636 deserStatus == Fw::FW_SERIALIZE_OK,
4637 static_cast<FwAssertArgType>(deserStatus)
4638 );
4639
4640 MsgTypeEnum msgType = static_cast<MsgTypeEnum>(desMsg);
4641
4642 if (msgType == CMDSEQUENCER_COMPONENT_EXIT) {
4643 return MSG_DISPATCH_EXIT;
4644 }
4645
4646 NATIVE_INT_TYPE portNum = 0;
4647 deserStatus = msg.deserialize(portNum);
4648 FW_ASSERT(
4649 deserStatus == Fw::FW_SERIALIZE_OK,
4650 static_cast<FwAssertArgType>(deserStatus)
4651 );
4652
4653 switch (msgType) {
4654 // Handle async input port cmdResponseIn
4655 case CMDRESPONSEIN_CMDRESPONSE: {
4656 // Deserialize argument opCode
4657 FwOpcodeType opCode;
4658 deserStatus = msg.deserialize(opCode);
4659 FW_ASSERT(
4660 deserStatus == Fw::FW_SERIALIZE_OK,
4661 static_cast<FwAssertArgType>(deserStatus)
4662 );
4663
4664 // Deserialize argument cmdSeq
4665 U32 cmdSeq;
4666 deserStatus = msg.deserialize(cmdSeq);
4667 FW_ASSERT(
4668 deserStatus == Fw::FW_SERIALIZE_OK,
4669 static_cast<FwAssertArgType>(deserStatus)
4670 );
4671
4672 // Deserialize argument response
4673 Fw::CmdResponse response;
4674 deserStatus = msg.deserialize(response);
4675 FW_ASSERT(
4676 deserStatus == Fw::FW_SERIALIZE_OK,
4677 static_cast<FwAssertArgType>(deserStatus)
4678 );
4679 // Call handler function
4680 this->cmdResponseIn_handler(
4681 portNum,
4682 opCode,
4683 cmdSeq,
4684 response
4685 );
4686
4687 break;
4688 }
4689
4690 // Handle async input port pingIn
4691 case PINGIN_PING: {
4692 // Deserialize argument key
4693 U32 key;
4694 deserStatus = msg.deserialize(key);
4695 FW_ASSERT(
4696 deserStatus == Fw::FW_SERIALIZE_OK,
4697 static_cast<FwAssertArgType>(deserStatus)
4698 );
4699 // Call handler function
4700 this->pingIn_handler(
4701 portNum,
4702 key
4703 );
4704
4705 break;
4706 }
4707
4708 // Handle async input port schedIn
4709 case SCHEDIN_SCHED: {
4710 // Deserialize argument context
4711 NATIVE_UINT_TYPE context;
4712 deserStatus = msg.deserialize(context);
4713 FW_ASSERT(
4714 deserStatus == Fw::FW_SERIALIZE_OK,
4715 static_cast<FwAssertArgType>(deserStatus)
4716 );
4717 // Call handler function
4718 this->schedIn_handler(
4719 portNum,
4720 context
4721 );
4722
4723 break;
4724 }
4725
4726 // Handle async input port seqCancelIn
4727 case SEQCANCELIN_CMDSEQCANCEL: {
4728 // Call handler function
4729 this->seqCancelIn_handler(portNum);
4730
4731 break;
4732 }
4733
4734 // Handle async input port seqRunIn
4735 case SEQRUNIN_CMDSEQIN: {
4736 // Deserialize argument filename
4737 Fw::String filename;
4738 deserStatus = msg.deserialize(filename);
4739 FW_ASSERT(
4740 deserStatus == Fw::FW_SERIALIZE_OK,
4741 static_cast<FwAssertArgType>(deserStatus)
4742 );
4743 // Call handler function
4744 this->seqRunIn_handler(
4745 portNum,
4746 filename
4747 );
4748
4749 break;
4750 }
4751
4752 // Handle command CS_RUN
4753 case CMD_CS_RUN: {
4754 // Deserialize opcode
4755 FwOpcodeType opCode = 0;
4756 deserStatus = msg.deserialize(opCode);
4757 FW_ASSERT (
4758 deserStatus == Fw::FW_SERIALIZE_OK,
4759 static_cast<FwAssertArgType>(deserStatus)
4760 );
4761
4762 // Deserialize command sequence
4763 U32 cmdSeq = 0;
4764 deserStatus = msg.deserialize(cmdSeq);
4765 FW_ASSERT (
4766 deserStatus == Fw::FW_SERIALIZE_OK,
4767 static_cast<FwAssertArgType>(deserStatus)
4768 );
4769
4770 // Deserialize command argument buffer
4771 Fw::CmdArgBuffer args;
4772 deserStatus = msg.deserialize(args);
4773 FW_ASSERT (
4774 deserStatus == Fw::FW_SERIALIZE_OK,
4775 static_cast<FwAssertArgType>(deserStatus)
4776 );
4777
4778 // Reset buffer
4779 args.resetDeser();
4780
4781 // Deserialize argument fileName
4782 Fw::CmdStringArg fileName;
4783 deserStatus = args.deserialize(fileName);
4784 if (deserStatus != Fw::FW_SERIALIZE_OK) {
4785 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4786 this->cmdResponse_out(
4787 opCode,
4788 cmdSeq,
4790 );
4791 }
4792 // Don't crash the task if bad arguments were passed from the ground
4793 break;
4794 }
4795
4796 // Deserialize argument block
4798 deserStatus = args.deserialize(block);
4799 if (deserStatus != Fw::FW_SERIALIZE_OK) {
4800 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4801 this->cmdResponse_out(
4802 opCode,
4803 cmdSeq,
4805 );
4806 }
4807 // Don't crash the task if bad arguments were passed from the ground
4808 break;
4809 }
4810
4811 // Make sure there was no data left over.
4812 // That means the argument buffer size was incorrect.
4813#if FW_CMD_CHECK_RESIDUAL
4814 if (args.getBuffLeft() != 0) {
4815 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4816 this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4817 }
4818 // Don't crash the task if bad arguments were passed from the ground
4819 break;
4820 }
4821#endif
4822
4823 // Call handler function
4824 this->CS_RUN_cmdHandler(
4825 opCode, cmdSeq,
4826 fileName,
4827 block
4828 );
4829
4830 break;
4831 }
4832
4833 // Handle command CS_VALIDATE
4834 case CMD_CS_VALIDATE: {
4835 // Deserialize opcode
4836 FwOpcodeType opCode = 0;
4837 deserStatus = msg.deserialize(opCode);
4838 FW_ASSERT (
4839 deserStatus == Fw::FW_SERIALIZE_OK,
4840 static_cast<FwAssertArgType>(deserStatus)
4841 );
4842
4843 // Deserialize command sequence
4844 U32 cmdSeq = 0;
4845 deserStatus = msg.deserialize(cmdSeq);
4846 FW_ASSERT (
4847 deserStatus == Fw::FW_SERIALIZE_OK,
4848 static_cast<FwAssertArgType>(deserStatus)
4849 );
4850
4851 // Deserialize command argument buffer
4852 Fw::CmdArgBuffer args;
4853 deserStatus = msg.deserialize(args);
4854 FW_ASSERT (
4855 deserStatus == Fw::FW_SERIALIZE_OK,
4856 static_cast<FwAssertArgType>(deserStatus)
4857 );
4858
4859 // Reset buffer
4860 args.resetDeser();
4861
4862 // Deserialize argument fileName
4863 Fw::CmdStringArg fileName;
4864 deserStatus = args.deserialize(fileName);
4865 if (deserStatus != Fw::FW_SERIALIZE_OK) {
4866 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4867 this->cmdResponse_out(
4868 opCode,
4869 cmdSeq,
4871 );
4872 }
4873 // Don't crash the task if bad arguments were passed from the ground
4874 break;
4875 }
4876
4877 // Make sure there was no data left over.
4878 // That means the argument buffer size was incorrect.
4879#if FW_CMD_CHECK_RESIDUAL
4880 if (args.getBuffLeft() != 0) {
4881 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4882 this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4883 }
4884 // Don't crash the task if bad arguments were passed from the ground
4885 break;
4886 }
4887#endif
4888
4889 // Call handler function
4890 this->CS_VALIDATE_cmdHandler(
4891 opCode, cmdSeq,
4892 fileName
4893 );
4894
4895 break;
4896 }
4897
4898 // Handle command CS_CANCEL
4899 case CMD_CS_CANCEL: {
4900 // Deserialize opcode
4901 FwOpcodeType opCode = 0;
4902 deserStatus = msg.deserialize(opCode);
4903 FW_ASSERT (
4904 deserStatus == Fw::FW_SERIALIZE_OK,
4905 static_cast<FwAssertArgType>(deserStatus)
4906 );
4907
4908 // Deserialize command sequence
4909 U32 cmdSeq = 0;
4910 deserStatus = msg.deserialize(cmdSeq);
4911 FW_ASSERT (
4912 deserStatus == Fw::FW_SERIALIZE_OK,
4913 static_cast<FwAssertArgType>(deserStatus)
4914 );
4915
4916 // Deserialize command argument buffer
4917 Fw::CmdArgBuffer args;
4918 deserStatus = msg.deserialize(args);
4919 FW_ASSERT (
4920 deserStatus == Fw::FW_SERIALIZE_OK,
4921 static_cast<FwAssertArgType>(deserStatus)
4922 );
4923
4924 // Reset buffer
4925 args.resetDeser();
4926
4927 // Make sure there was no data left over.
4928 // That means the argument buffer size was incorrect.
4929#if FW_CMD_CHECK_RESIDUAL
4930 if (args.getBuffLeft() != 0) {
4931 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4932 this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4933 }
4934 // Don't crash the task if bad arguments were passed from the ground
4935 break;
4936 }
4937#endif
4938
4939 // Call handler function
4940 this->CS_CANCEL_cmdHandler(opCode, cmdSeq);
4941
4942 break;
4943 }
4944
4945 // Handle command CS_START
4946 case CMD_CS_START: {
4947 // Deserialize opcode
4948 FwOpcodeType opCode = 0;
4949 deserStatus = msg.deserialize(opCode);
4950 FW_ASSERT (
4951 deserStatus == Fw::FW_SERIALIZE_OK,
4952 static_cast<FwAssertArgType>(deserStatus)
4953 );
4954
4955 // Deserialize command sequence
4956 U32 cmdSeq = 0;
4957 deserStatus = msg.deserialize(cmdSeq);
4958 FW_ASSERT (
4959 deserStatus == Fw::FW_SERIALIZE_OK,
4960 static_cast<FwAssertArgType>(deserStatus)
4961 );
4962
4963 // Deserialize command argument buffer
4964 Fw::CmdArgBuffer args;
4965 deserStatus = msg.deserialize(args);
4966 FW_ASSERT (
4967 deserStatus == Fw::FW_SERIALIZE_OK,
4968 static_cast<FwAssertArgType>(deserStatus)
4969 );
4970
4971 // Reset buffer
4972 args.resetDeser();
4973
4974 // Make sure there was no data left over.
4975 // That means the argument buffer size was incorrect.
4976#if FW_CMD_CHECK_RESIDUAL
4977 if (args.getBuffLeft() != 0) {
4978 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
4979 this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4980 }
4981 // Don't crash the task if bad arguments were passed from the ground
4982 break;
4983 }
4984#endif
4985
4986 // Call handler function
4987 this->CS_START_cmdHandler(opCode, cmdSeq);
4988
4989 break;
4990 }
4991
4992 // Handle command CS_STEP
4993 case CMD_CS_STEP: {
4994 // Deserialize opcode
4995 FwOpcodeType opCode = 0;
4996 deserStatus = msg.deserialize(opCode);
4997 FW_ASSERT (
4998 deserStatus == Fw::FW_SERIALIZE_OK,
4999 static_cast<FwAssertArgType>(deserStatus)
5000 );
5001
5002 // Deserialize command sequence
5003 U32 cmdSeq = 0;
5004 deserStatus = msg.deserialize(cmdSeq);
5005 FW_ASSERT (
5006 deserStatus == Fw::FW_SERIALIZE_OK,
5007 static_cast<FwAssertArgType>(deserStatus)
5008 );
5009
5010 // Deserialize command argument buffer
5011 Fw::CmdArgBuffer args;
5012 deserStatus = msg.deserialize(args);
5013 FW_ASSERT (
5014 deserStatus == Fw::FW_SERIALIZE_OK,
5015 static_cast<FwAssertArgType>(deserStatus)
5016 );
5017
5018 // Reset buffer
5019 args.resetDeser();
5020
5021 // Make sure there was no data left over.
5022 // That means the argument buffer size was incorrect.
5023#if FW_CMD_CHECK_RESIDUAL
5024 if (args.getBuffLeft() != 0) {
5025 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
5026 this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5027 }
5028 // Don't crash the task if bad arguments were passed from the ground
5029 break;
5030 }
5031#endif
5032
5033 // Call handler function
5034 this->CS_STEP_cmdHandler(opCode, cmdSeq);
5035
5036 break;
5037 }
5038
5039 // Handle command CS_AUTO
5040 case CMD_CS_AUTO: {
5041 // Deserialize opcode
5042 FwOpcodeType opCode = 0;
5043 deserStatus = msg.deserialize(opCode);
5044 FW_ASSERT (
5045 deserStatus == Fw::FW_SERIALIZE_OK,
5046 static_cast<FwAssertArgType>(deserStatus)
5047 );
5048
5049 // Deserialize command sequence
5050 U32 cmdSeq = 0;
5051 deserStatus = msg.deserialize(cmdSeq);
5052 FW_ASSERT (
5053 deserStatus == Fw::FW_SERIALIZE_OK,
5054 static_cast<FwAssertArgType>(deserStatus)
5055 );
5056
5057 // Deserialize command argument buffer
5058 Fw::CmdArgBuffer args;
5059 deserStatus = msg.deserialize(args);
5060 FW_ASSERT (
5061 deserStatus == Fw::FW_SERIALIZE_OK,
5062 static_cast<FwAssertArgType>(deserStatus)
5063 );
5064
5065 // Reset buffer
5066 args.resetDeser();
5067
5068 // Make sure there was no data left over.
5069 // That means the argument buffer size was incorrect.
5070#if FW_CMD_CHECK_RESIDUAL
5071 if (args.getBuffLeft() != 0) {
5072 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
5073 this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5074 }
5075 // Don't crash the task if bad arguments were passed from the ground
5076 break;
5077 }
5078#endif
5079
5080 // Call handler function
5081 this->CS_AUTO_cmdHandler(opCode, cmdSeq);
5082
5083 break;
5084 }
5085
5086 // Handle command CS_MANUAL
5087 case CMD_CS_MANUAL: {
5088 // Deserialize opcode
5089 FwOpcodeType opCode = 0;
5090 deserStatus = msg.deserialize(opCode);
5091 FW_ASSERT (
5092 deserStatus == Fw::FW_SERIALIZE_OK,
5093 static_cast<FwAssertArgType>(deserStatus)
5094 );
5095
5096 // Deserialize command sequence
5097 U32 cmdSeq = 0;
5098 deserStatus = msg.deserialize(cmdSeq);
5099 FW_ASSERT (
5100 deserStatus == Fw::FW_SERIALIZE_OK,
5101 static_cast<FwAssertArgType>(deserStatus)
5102 );
5103
5104 // Deserialize command argument buffer
5105 Fw::CmdArgBuffer args;
5106 deserStatus = msg.deserialize(args);
5107 FW_ASSERT (
5108 deserStatus == Fw::FW_SERIALIZE_OK,
5109 static_cast<FwAssertArgType>(deserStatus)
5110 );
5111
5112 // Reset buffer
5113 args.resetDeser();
5114
5115 // Make sure there was no data left over.
5116 // That means the argument buffer size was incorrect.
5117#if FW_CMD_CHECK_RESIDUAL
5118 if (args.getBuffLeft() != 0) {
5119 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
5120 this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5121 }
5122 // Don't crash the task if bad arguments were passed from the ground
5123 break;
5124 }
5125#endif
5126
5127 // Call handler function
5128 this->CS_MANUAL_cmdHandler(opCode, cmdSeq);
5129
5130 break;
5131 }
5132
5133 // Handle command CS_JOIN_WAIT
5134 case CMD_CS_JOIN_WAIT: {
5135 // Deserialize opcode
5136 FwOpcodeType opCode = 0;
5137 deserStatus = msg.deserialize(opCode);
5138 FW_ASSERT (
5139 deserStatus == Fw::FW_SERIALIZE_OK,
5140 static_cast<FwAssertArgType>(deserStatus)
5141 );
5142
5143 // Deserialize command sequence
5144 U32 cmdSeq = 0;
5145 deserStatus = msg.deserialize(cmdSeq);
5146 FW_ASSERT (
5147 deserStatus == Fw::FW_SERIALIZE_OK,
5148 static_cast<FwAssertArgType>(deserStatus)
5149 );
5150
5151 // Deserialize command argument buffer
5152 Fw::CmdArgBuffer args;
5153 deserStatus = msg.deserialize(args);
5154 FW_ASSERT (
5155 deserStatus == Fw::FW_SERIALIZE_OK,
5156 static_cast<FwAssertArgType>(deserStatus)
5157 );
5158
5159 // Reset buffer
5160 args.resetDeser();
5161
5162 // Make sure there was no data left over.
5163 // That means the argument buffer size was incorrect.
5164#if FW_CMD_CHECK_RESIDUAL
5165 if (args.getBuffLeft() != 0) {
5166 if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
5167 this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5168 }
5169 // Don't crash the task if bad arguments were passed from the ground
5170 break;
5171 }
5172#endif
5173
5174 // Call handler function
5175 this->CS_JOIN_WAIT_cmdHandler(opCode, cmdSeq);
5176
5177 break;
5178 }
5179
5180 default:
5181 return MSG_DISPATCH_ERROR;
5182 }
5183
5184 return MSG_DISPATCH_OK;
5185 }
5186
5187 // ----------------------------------------------------------------------
5188 // Calls for messages received on special input ports
5189 // ----------------------------------------------------------------------
5190
5191 void CmdSequencerComponentBase ::
5192 m_p_cmdIn_in(
5193 Fw::PassiveComponentBase* callComp,
5194 NATIVE_INT_TYPE portNum,
5195 FwOpcodeType opCode,
5196 U32 cmdSeq,
5197 Fw::CmdArgBuffer& args
5198 )
5199 {
5200 FW_ASSERT(callComp);
5201 CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5202
5203 const U32 idBase = callComp->getIdBase();
5204 FW_ASSERT(opCode >= idBase, opCode, idBase);
5205
5206 // Select base class function based on opcode
5207 switch (opCode - idBase) {
5208 case OPCODE_CS_RUN: {
5209 compPtr->CS_RUN_cmdHandlerBase(
5210 opCode,
5211 cmdSeq,
5212 args
5213 );
5214 break;
5215 }
5216
5217 case OPCODE_CS_VALIDATE: {
5218 compPtr->CS_VALIDATE_cmdHandlerBase(
5219 opCode,
5220 cmdSeq,
5221 args
5222 );
5223 break;
5224 }
5225
5226 case OPCODE_CS_CANCEL: {
5227 compPtr->CS_CANCEL_cmdHandlerBase(
5228 opCode,
5229 cmdSeq,
5230 args
5231 );
5232 break;
5233 }
5234
5235 case OPCODE_CS_START: {
5236 compPtr->CS_START_cmdHandlerBase(
5237 opCode,
5238 cmdSeq,
5239 args
5240 );
5241 break;
5242 }
5243
5244 case OPCODE_CS_STEP: {
5245 compPtr->CS_STEP_cmdHandlerBase(
5246 opCode,
5247 cmdSeq,
5248 args
5249 );
5250 break;
5251 }
5252
5253 case OPCODE_CS_AUTO: {
5254 compPtr->CS_AUTO_cmdHandlerBase(
5255 opCode,
5256 cmdSeq,
5257 args
5258 );
5259 break;
5260 }
5261
5262 case OPCODE_CS_MANUAL: {
5263 compPtr->CS_MANUAL_cmdHandlerBase(
5264 opCode,
5265 cmdSeq,
5266 args
5267 );
5268 break;
5269 }
5270
5271 case OPCODE_CS_JOIN_WAIT: {
5272 compPtr->CS_JOIN_WAIT_cmdHandlerBase(
5273 opCode,
5274 cmdSeq,
5275 args
5276 );
5277 break;
5278 }
5279 }
5280 }
5281
5282 // ----------------------------------------------------------------------
5283 // Calls for messages received on typed input ports
5284 // ----------------------------------------------------------------------
5285
5286 void CmdSequencerComponentBase ::
5287 m_p_cmdResponseIn_in(
5288 Fw::PassiveComponentBase* callComp,
5289 NATIVE_INT_TYPE portNum,
5290 FwOpcodeType opCode,
5291 U32 cmdSeq,
5292 const Fw::CmdResponse& response
5293 )
5294 {
5295 FW_ASSERT(callComp);
5296 CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5297 compPtr->cmdResponseIn_handlerBase(
5298 portNum,
5299 opCode,
5300 cmdSeq,
5301 response
5302 );
5303 }
5304
5305 void CmdSequencerComponentBase ::
5306 m_p_pingIn_in(
5307 Fw::PassiveComponentBase* callComp,
5308 NATIVE_INT_TYPE portNum,
5309 U32 key
5310 )
5311 {
5312 FW_ASSERT(callComp);
5313 CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5314 compPtr->pingIn_handlerBase(
5315 portNum,
5316 key
5317 );
5318 }
5319
5320 void CmdSequencerComponentBase ::
5321 m_p_schedIn_in(
5322 Fw::PassiveComponentBase* callComp,
5323 NATIVE_INT_TYPE portNum,
5324 NATIVE_UINT_TYPE context
5325 )
5326 {
5327 FW_ASSERT(callComp);
5328 CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5329 compPtr->schedIn_handlerBase(
5330 portNum,
5331 context
5332 );
5333 }
5334
5335 void CmdSequencerComponentBase ::
5336 m_p_seqCancelIn_in(
5337 Fw::PassiveComponentBase* callComp,
5338 NATIVE_INT_TYPE portNum
5339 )
5340 {
5341 FW_ASSERT(callComp);
5342 CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5343 compPtr->seqCancelIn_handlerBase(portNum);
5344 }
5345
5346 void CmdSequencerComponentBase ::
5347 m_p_seqRunIn_in(
5348 Fw::PassiveComponentBase* callComp,
5349 NATIVE_INT_TYPE portNum,
5350 Fw::String& filename
5351 )
5352 {
5353 FW_ASSERT(callComp);
5354 CmdSequencerComponentBase* compPtr = static_cast<CmdSequencerComponentBase*>(callComp);
5355 compPtr->seqRunIn_handlerBase(
5356 portNum,
5357 filename
5358 );
5359 }
5360
5361}
#define FW_ASSERT(...)
Definition Assert.hpp:7
PlatformIntType NATIVE_INT_TYPE
Definition BasicTypes.h:51
U8 BYTE
byte type
Definition BasicTypes.h:27
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
@ ACTIVE_COMPONENT_EXIT
message to exit active component task
Enum representing a command response.
@ FORMAT_ERROR
Command failed to deserialize.
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
Definition CmdPortAc.hpp:37
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
@ WARNING_HI
A serious but recoverable event.
@ ACTIVITY_HI
Important informational events.
@ WARNING_LO
A less serious but recoverable event.
@ 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
const char * toChar() const
gets char buffer
Definition String.cpp:48
@ QUEUE_OK
message sent/received okay
Definition Queue.hpp:28
QueueBlocking
Definition Queue.hpp:40
@ QUEUE_BLOCKING
Queue receive blocks until a message arrives.
Definition Queue.hpp:41
@ QUEUE_NONBLOCKING
Queue receive always returns even if there is no message.
Definition Queue.hpp:42
The stage of the file read operation.
@ SERIALIZED_SIZE
The size of the serial representation.
@ SERIALIZED_SIZE
The size of the serial representation.
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.
const Time ZERO_TIME
Definition Time.cpp:5