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