F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
CommandDispatcherComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title CommandDispatcherComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for CommandDispatcher component base class
5 // ======================================================================
6 
7 #include "Fw/Types/Assert.hpp"
9 #if FW_ENABLE_TEXT_LOGGING
10 #include "Fw/Types/String.hpp"
11 #endif
13 
14 namespace Svc {
15 
16  namespace {
17  enum MsgTypeEnum {
18  COMMANDDISPATCHER_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT,
19  COMPCMDSTAT_CMDRESPONSE,
20  PINGIN_PING,
21  RUN_SCHED,
22  SEQCMDBUFF_COM,
23  CMD_CMD_NO_OP,
24  CMD_CMD_NO_OP_STRING,
25  CMD_CMD_TEST_CMD_1,
26  CMD_CMD_CLEAR_TRACKING,
27  };
28 
29  // Get the max size by constructing a union of the async input, command, and
30  // internal port serialization sizes
31  union BuffUnion {
35  BYTE seqCmdBuffPortSize[Fw::InputComPort::SERIALIZED_SIZE];
37  };
38 
39  // Define a message buffer class large enough to handle all the
40  // asynchronous inputs to the component
41  class ComponentIpcSerializableBuffer :
43  {
44 
45  public:
46 
47  enum {
48  // Offset into data in buffer: Size of message ID and port number
49  DATA_OFFSET = sizeof(FwEnumStoreType) + sizeof(FwIndexType),
50  // Max data size
51  MAX_DATA_SIZE = sizeof(BuffUnion),
52  // Max message size: Size of message id + size of port + max data size
53  SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
54  };
55 
56  Fw::Serializable::SizeType getCapacity() const {
57  return sizeof(m_buff);
58  }
59 
60  U8* getBuffAddr() {
61  return m_buff;
62  }
63 
64  const U8* getBuffAddr() const {
65  return m_buff;
66  }
67 
68  private:
69  // Should be the max of all the input ports serialized sizes...
70  U8 m_buff[SERIALIZATION_SIZE];
71 
72  };
73  }
74 
75  // ----------------------------------------------------------------------
76  // Component initialization
77  // ----------------------------------------------------------------------
78 
81  FwSizeType queueDepth,
82  FwEnumStoreType instance
83  )
84  {
85  // Initialize base class
87 
88  // Connect input port CmdDisp
89  for (
90  FwIndexType port = 0;
91  port < static_cast<FwIndexType>(this->getNum_CmdDisp_InputPorts());
92  port++
93  ) {
94  this->m_CmdDisp_InputPort[port].init();
95  this->m_CmdDisp_InputPort[port].addCallComp(
96  this,
97  m_p_CmdDisp_in
98  );
99  this->m_CmdDisp_InputPort[port].setPortNum(port);
100 
101 #if FW_OBJECT_NAMES == 1
102  Fw::ObjectName portName;
103  portName.format(
104  "%s_CmdDisp_InputPort[%" PRI_FwIndexType "]",
105  this->m_objName.toChar(),
106  port
107  );
108  this->m_CmdDisp_InputPort[port].setObjName(portName.toChar());
109 #endif
110  }
111 
112  // Connect input port compCmdReg
113  for (
114  FwIndexType port = 0;
115  port < static_cast<FwIndexType>(this->getNum_compCmdReg_InputPorts());
116  port++
117  ) {
118  this->m_compCmdReg_InputPort[port].init();
119  this->m_compCmdReg_InputPort[port].addCallComp(
120  this,
121  m_p_compCmdReg_in
122  );
123  this->m_compCmdReg_InputPort[port].setPortNum(port);
124 
125 #if FW_OBJECT_NAMES == 1
126  Fw::ObjectName portName;
127  portName.format(
128  "%s_compCmdReg_InputPort[%" PRI_FwIndexType "]",
129  this->m_objName.toChar(),
130  port
131  );
132  this->m_compCmdReg_InputPort[port].setObjName(portName.toChar());
133 #endif
134  }
135 
136  // Connect input port compCmdStat
137  for (
138  FwIndexType port = 0;
139  port < static_cast<FwIndexType>(this->getNum_compCmdStat_InputPorts());
140  port++
141  ) {
142  this->m_compCmdStat_InputPort[port].init();
143  this->m_compCmdStat_InputPort[port].addCallComp(
144  this,
145  m_p_compCmdStat_in
146  );
147  this->m_compCmdStat_InputPort[port].setPortNum(port);
148 
149 #if FW_OBJECT_NAMES == 1
150  Fw::ObjectName portName;
151  portName.format(
152  "%s_compCmdStat_InputPort[%" PRI_FwIndexType "]",
153  this->m_objName.toChar(),
154  port
155  );
156  this->m_compCmdStat_InputPort[port].setObjName(portName.toChar());
157 #endif
158  }
159 
160  // Connect input port pingIn
161  for (
162  FwIndexType port = 0;
163  port < static_cast<FwIndexType>(this->getNum_pingIn_InputPorts());
164  port++
165  ) {
166  this->m_pingIn_InputPort[port].init();
167  this->m_pingIn_InputPort[port].addCallComp(
168  this,
169  m_p_pingIn_in
170  );
171  this->m_pingIn_InputPort[port].setPortNum(port);
172 
173 #if FW_OBJECT_NAMES == 1
174  Fw::ObjectName portName;
175  portName.format(
176  "%s_pingIn_InputPort[%" PRI_FwIndexType "]",
177  this->m_objName.toChar(),
178  port
179  );
180  this->m_pingIn_InputPort[port].setObjName(portName.toChar());
181 #endif
182  }
183 
184  // Connect input port run
185  for (
186  FwIndexType port = 0;
187  port < static_cast<FwIndexType>(this->getNum_run_InputPorts());
188  port++
189  ) {
190  this->m_run_InputPort[port].init();
191  this->m_run_InputPort[port].addCallComp(
192  this,
193  m_p_run_in
194  );
195  this->m_run_InputPort[port].setPortNum(port);
196 
197 #if FW_OBJECT_NAMES == 1
198  Fw::ObjectName portName;
199  portName.format(
200  "%s_run_InputPort[%" PRI_FwIndexType "]",
201  this->m_objName.toChar(),
202  port
203  );
204  this->m_run_InputPort[port].setObjName(portName.toChar());
205 #endif
206  }
207 
208  // Connect input port seqCmdBuff
209  for (
210  FwIndexType port = 0;
211  port < static_cast<FwIndexType>(this->getNum_seqCmdBuff_InputPorts());
212  port++
213  ) {
214  this->m_seqCmdBuff_InputPort[port].init();
215  this->m_seqCmdBuff_InputPort[port].addCallComp(
216  this,
217  m_p_seqCmdBuff_in
218  );
219  this->m_seqCmdBuff_InputPort[port].setPortNum(port);
220 
221 #if FW_OBJECT_NAMES == 1
222  Fw::ObjectName portName;
223  portName.format(
224  "%s_seqCmdBuff_InputPort[%" PRI_FwIndexType "]",
225  this->m_objName.toChar(),
226  port
227  );
228  this->m_seqCmdBuff_InputPort[port].setObjName(portName.toChar());
229 #endif
230  }
231 
232  // Connect output port CmdReg
233  for (
234  FwIndexType port = 0;
235  port < static_cast<FwIndexType>(this->getNum_CmdReg_OutputPorts());
236  port++
237  ) {
238  this->m_CmdReg_OutputPort[port].init();
239 
240 #if FW_OBJECT_NAMES == 1
241  Fw::ObjectName portName;
242  portName.format(
243  "%s_CmdReg_OutputPort[%" PRI_FwIndexType "]",
244  this->m_objName.toChar(),
245  port
246  );
247  this->m_CmdReg_OutputPort[port].setObjName(portName.toChar());
248 #endif
249  }
250 
251  // Connect output port CmdStatus
252  for (
253  FwIndexType port = 0;
254  port < static_cast<FwIndexType>(this->getNum_CmdStatus_OutputPorts());
255  port++
256  ) {
257  this->m_CmdStatus_OutputPort[port].init();
258 
259 #if FW_OBJECT_NAMES == 1
260  Fw::ObjectName portName;
261  portName.format(
262  "%s_CmdStatus_OutputPort[%" PRI_FwIndexType "]",
263  this->m_objName.toChar(),
264  port
265  );
266  this->m_CmdStatus_OutputPort[port].setObjName(portName.toChar());
267 #endif
268  }
269 
270  // Connect output port Log
271  for (
272  FwIndexType port = 0;
273  port < static_cast<FwIndexType>(this->getNum_Log_OutputPorts());
274  port++
275  ) {
276  this->m_Log_OutputPort[port].init();
277 
278 #if FW_OBJECT_NAMES == 1
279  Fw::ObjectName portName;
280  portName.format(
281  "%s_Log_OutputPort[%" PRI_FwIndexType "]",
282  this->m_objName.toChar(),
283  port
284  );
285  this->m_Log_OutputPort[port].setObjName(portName.toChar());
286 #endif
287  }
288 
289 #if FW_ENABLE_TEXT_LOGGING == 1
290  // Connect output port LogText
291  for (
292  FwIndexType port = 0;
293  port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
294  port++
295  ) {
296  this->m_LogText_OutputPort[port].init();
297 
298 #if FW_OBJECT_NAMES == 1
299  Fw::ObjectName portName;
300  portName.format(
301  "%s_LogText_OutputPort[%" PRI_FwIndexType "]",
302  this->m_objName.toChar(),
303  port
304  );
305  this->m_LogText_OutputPort[port].setObjName(portName.toChar());
306 #endif
307  }
308 #endif
309 
310  // Connect output port Time
311  for (
312  FwIndexType port = 0;
313  port < static_cast<FwIndexType>(this->getNum_Time_OutputPorts());
314  port++
315  ) {
316  this->m_Time_OutputPort[port].init();
317 
318 #if FW_OBJECT_NAMES == 1
319  Fw::ObjectName portName;
320  portName.format(
321  "%s_Time_OutputPort[%" PRI_FwIndexType "]",
322  this->m_objName.toChar(),
323  port
324  );
325  this->m_Time_OutputPort[port].setObjName(portName.toChar());
326 #endif
327  }
328 
329  // Connect output port Tlm
330  for (
331  FwIndexType port = 0;
332  port < static_cast<FwIndexType>(this->getNum_Tlm_OutputPorts());
333  port++
334  ) {
335  this->m_Tlm_OutputPort[port].init();
336 
337 #if FW_OBJECT_NAMES == 1
338  Fw::ObjectName portName;
339  portName.format(
340  "%s_Tlm_OutputPort[%" PRI_FwIndexType "]",
341  this->m_objName.toChar(),
342  port
343  );
344  this->m_Tlm_OutputPort[port].setObjName(portName.toChar());
345 #endif
346  }
347 
348  // Connect output port compCmdSend
349  for (
350  FwIndexType port = 0;
351  port < static_cast<FwIndexType>(this->getNum_compCmdSend_OutputPorts());
352  port++
353  ) {
354  this->m_compCmdSend_OutputPort[port].init();
355 
356 #if FW_OBJECT_NAMES == 1
357  Fw::ObjectName portName;
358  portName.format(
359  "%s_compCmdSend_OutputPort[%" PRI_FwIndexType "]",
360  this->m_objName.toChar(),
361  port
362  );
363  this->m_compCmdSend_OutputPort[port].setObjName(portName.toChar());
364 #endif
365  }
366 
367  // Connect output port pingOut
368  for (
369  FwIndexType port = 0;
370  port < static_cast<FwIndexType>(this->getNum_pingOut_OutputPorts());
371  port++
372  ) {
373  this->m_pingOut_OutputPort[port].init();
374 
375 #if FW_OBJECT_NAMES == 1
376  Fw::ObjectName portName;
377  portName.format(
378  "%s_pingOut_OutputPort[%" PRI_FwIndexType "]",
379  this->m_objName.toChar(),
380  port
381  );
382  this->m_pingOut_OutputPort[port].setObjName(portName.toChar());
383 #endif
384  }
385 
386  // Connect output port seqCmdStatus
387  for (
388  FwIndexType port = 0;
389  port < static_cast<FwIndexType>(this->getNum_seqCmdStatus_OutputPorts());
390  port++
391  ) {
392  this->m_seqCmdStatus_OutputPort[port].init();
393 
394 #if FW_OBJECT_NAMES == 1
395  Fw::ObjectName portName;
396  portName.format(
397  "%s_seqCmdStatus_OutputPort[%" PRI_FwIndexType "]",
398  this->m_objName.toChar(),
399  port
400  );
401  this->m_seqCmdStatus_OutputPort[port].setObjName(portName.toChar());
402 #endif
403  }
404 
405  // Create the queue
406  Os::Queue::Status qStat = this->createQueue(
407  queueDepth,
408  static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
409  );
410  FW_ASSERT(
411  Os::Queue::Status::OP_OK == qStat,
412  static_cast<FwAssertArgType>(qStat)
413  );
414  }
415 
416  // ----------------------------------------------------------------------
417  // Getters for special input ports
418  // ----------------------------------------------------------------------
419 
422  {
423  FW_ASSERT(
424  (0 <= portNum) && (portNum < this->getNum_CmdDisp_InputPorts()),
425  static_cast<FwAssertArgType>(portNum)
426  );
427 
428  return &this->m_CmdDisp_InputPort[portNum];
429  }
430 
431  // ----------------------------------------------------------------------
432  // Getters for typed input ports
433  // ----------------------------------------------------------------------
434 
437  {
438  FW_ASSERT(
439  (0 <= portNum) && (portNum < this->getNum_compCmdReg_InputPorts()),
440  static_cast<FwAssertArgType>(portNum)
441  );
442 
443  return &this->m_compCmdReg_InputPort[portNum];
444  }
445 
448  {
449  FW_ASSERT(
450  (0 <= portNum) && (portNum < this->getNum_compCmdStat_InputPorts()),
451  static_cast<FwAssertArgType>(portNum)
452  );
453 
454  return &this->m_compCmdStat_InputPort[portNum];
455  }
456 
459  {
460  FW_ASSERT(
461  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
462  static_cast<FwAssertArgType>(portNum)
463  );
464 
465  return &this->m_pingIn_InputPort[portNum];
466  }
467 
470  {
471  FW_ASSERT(
472  (0 <= portNum) && (portNum < this->getNum_run_InputPorts()),
473  static_cast<FwAssertArgType>(portNum)
474  );
475 
476  return &this->m_run_InputPort[portNum];
477  }
478 
481  {
482  FW_ASSERT(
483  (0 <= portNum) && (portNum < this->getNum_seqCmdBuff_InputPorts()),
484  static_cast<FwAssertArgType>(portNum)
485  );
486 
487  return &this->m_seqCmdBuff_InputPort[portNum];
488  }
489 
490  // ----------------------------------------------------------------------
491  // Connect input ports to special output ports
492  // ----------------------------------------------------------------------
493 
496  FwIndexType portNum,
497  Fw::InputCmdRegPort* port
498  )
499  {
500  FW_ASSERT(
501  (0 <= portNum) && (portNum < this->getNum_CmdReg_OutputPorts()),
502  static_cast<FwAssertArgType>(portNum)
503  );
504 
505  this->m_CmdReg_OutputPort[portNum].addCallPort(port);
506  }
507 
510  FwIndexType portNum,
512  )
513  {
514  FW_ASSERT(
515  (0 <= portNum) && (portNum < this->getNum_CmdStatus_OutputPorts()),
516  static_cast<FwAssertArgType>(portNum)
517  );
518 
519  this->m_CmdStatus_OutputPort[portNum].addCallPort(port);
520  }
521 
524  FwIndexType portNum,
525  Fw::InputLogPort* port
526  )
527  {
528  FW_ASSERT(
529  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
530  static_cast<FwAssertArgType>(portNum)
531  );
532 
533  this->m_Log_OutputPort[portNum].addCallPort(port);
534  }
535 
536 #if FW_ENABLE_TEXT_LOGGING == 1
537 
538  void CommandDispatcherComponentBase ::
539  set_LogText_OutputPort(
540  FwIndexType portNum,
542  )
543  {
544  FW_ASSERT(
545  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
546  static_cast<FwAssertArgType>(portNum)
547  );
548 
549  this->m_LogText_OutputPort[portNum].addCallPort(port);
550  }
551 
552 #endif
553 
556  FwIndexType portNum,
557  Fw::InputTimePort* port
558  )
559  {
560  FW_ASSERT(
561  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
562  static_cast<FwAssertArgType>(portNum)
563  );
564 
565  this->m_Time_OutputPort[portNum].addCallPort(port);
566  }
567 
570  FwIndexType portNum,
571  Fw::InputTlmPort* port
572  )
573  {
574  FW_ASSERT(
575  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
576  static_cast<FwAssertArgType>(portNum)
577  );
578 
579  this->m_Tlm_OutputPort[portNum].addCallPort(port);
580  }
581 
582  // ----------------------------------------------------------------------
583  // Connect typed input ports to typed output ports
584  // ----------------------------------------------------------------------
585 
588  FwIndexType portNum,
589  Fw::InputCmdPort* port
590  )
591  {
592  FW_ASSERT(
593  (0 <= portNum) && (portNum < this->getNum_compCmdSend_OutputPorts()),
594  static_cast<FwAssertArgType>(portNum)
595  );
596 
597  this->m_compCmdSend_OutputPort[portNum].addCallPort(port);
598  }
599 
602  FwIndexType portNum,
603  Svc::InputPingPort* port
604  )
605  {
606  FW_ASSERT(
607  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
608  static_cast<FwAssertArgType>(portNum)
609  );
610 
611  this->m_pingOut_OutputPort[portNum].addCallPort(port);
612  }
613 
616  FwIndexType portNum,
618  )
619  {
620  FW_ASSERT(
621  (0 <= portNum) && (portNum < this->getNum_seqCmdStatus_OutputPorts()),
622  static_cast<FwAssertArgType>(portNum)
623  );
624 
625  this->m_seqCmdStatus_OutputPort[portNum].addCallPort(port);
626  }
627 
628 #if FW_PORT_SERIALIZATION
629 
630  // ----------------------------------------------------------------------
631  // Connect serial input ports to special output ports
632  // ----------------------------------------------------------------------
633 
636  FwIndexType portNum,
637  Fw::InputSerializePort* port
638  )
639  {
640  FW_ASSERT(
641  (0 <= portNum) && (portNum < this->getNum_CmdReg_OutputPorts()),
642  static_cast<FwAssertArgType>(portNum)
643  );
644 
645  this->m_CmdReg_OutputPort[portNum].registerSerialPort(port);
646  }
647 
650  FwIndexType portNum,
651  Fw::InputSerializePort* port
652  )
653  {
654  FW_ASSERT(
655  (0 <= portNum) && (portNum < this->getNum_CmdStatus_OutputPorts()),
656  static_cast<FwAssertArgType>(portNum)
657  );
658 
659  this->m_CmdStatus_OutputPort[portNum].registerSerialPort(port);
660  }
661 
664  FwIndexType portNum,
665  Fw::InputSerializePort* port
666  )
667  {
668  FW_ASSERT(
669  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
670  static_cast<FwAssertArgType>(portNum)
671  );
672 
673  this->m_Log_OutputPort[portNum].registerSerialPort(port);
674  }
675 
676 #if FW_ENABLE_TEXT_LOGGING == 1
677 
678  void CommandDispatcherComponentBase ::
679  set_LogText_OutputPort(
680  FwIndexType portNum,
681  Fw::InputSerializePort* port
682  )
683  {
684  FW_ASSERT(
685  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
686  static_cast<FwAssertArgType>(portNum)
687  );
688 
689  this->m_LogText_OutputPort[portNum].registerSerialPort(port);
690  }
691 
692 #endif
693 
696  FwIndexType portNum,
697  Fw::InputSerializePort* port
698  )
699  {
700  FW_ASSERT(
701  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
702  static_cast<FwAssertArgType>(portNum)
703  );
704 
705  this->m_Time_OutputPort[portNum].registerSerialPort(port);
706  }
707 
710  FwIndexType portNum,
711  Fw::InputSerializePort* port
712  )
713  {
714  FW_ASSERT(
715  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
716  static_cast<FwAssertArgType>(portNum)
717  );
718 
719  this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
720  }
721 
722 #endif
723 
724 #if FW_PORT_SERIALIZATION
725 
726  // ----------------------------------------------------------------------
727  // Connect serial input ports to typed output ports
728  // ----------------------------------------------------------------------
729 
732  FwIndexType portNum,
733  Fw::InputSerializePort* port
734  )
735  {
736  FW_ASSERT(
737  (0 <= portNum) && (portNum < this->getNum_compCmdSend_OutputPorts()),
738  static_cast<FwAssertArgType>(portNum)
739  );
740 
741  this->m_compCmdSend_OutputPort[portNum].registerSerialPort(port);
742  }
743 
746  FwIndexType portNum,
747  Fw::InputSerializePort* port
748  )
749  {
750  FW_ASSERT(
751  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
752  static_cast<FwAssertArgType>(portNum)
753  );
754 
755  this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
756  }
757 
760  FwIndexType portNum,
761  Fw::InputSerializePort* port
762  )
763  {
764  FW_ASSERT(
765  (0 <= portNum) && (portNum < this->getNum_seqCmdStatus_OutputPorts()),
766  static_cast<FwAssertArgType>(portNum)
767  );
768 
769  this->m_seqCmdStatus_OutputPort[portNum].registerSerialPort(port);
770  }
771 
772 #endif
773 
774  // ----------------------------------------------------------------------
775  // Command registration
776  // ----------------------------------------------------------------------
777 
780  {
781  FW_ASSERT(this->m_CmdReg_OutputPort[0].isConnected());
782 
783  this->m_CmdReg_OutputPort[0].invoke(
784  this->getIdBase() + OPCODE_CMD_NO_OP
785  );
786 
787  this->m_CmdReg_OutputPort[0].invoke(
789  );
790 
791  this->m_CmdReg_OutputPort[0].invoke(
793  );
794 
795  this->m_CmdReg_OutputPort[0].invoke(
797  );
798  }
799 
800  // ----------------------------------------------------------------------
801  // Component construction and destruction
802  // ----------------------------------------------------------------------
803 
805  CommandDispatcherComponentBase(const char* compName) :
806  Fw::ActiveComponentBase(compName)
807  {
808  this->m_CommandDroppedQueueOverflowThrottle = 0;
809  }
810 
813  {
814 
815  }
816 
817  // ----------------------------------------------------------------------
818  // Connection status queries for special output ports
819  // ----------------------------------------------------------------------
820 
823  {
824  FW_ASSERT(
825  (0 <= portNum) && (portNum < this->getNum_CmdReg_OutputPorts()),
826  static_cast<FwAssertArgType>(portNum)
827  );
828 
829  return this->m_CmdReg_OutputPort[portNum].isConnected();
830  }
831 
834  {
835  FW_ASSERT(
836  (0 <= portNum) && (portNum < this->getNum_CmdStatus_OutputPorts()),
837  static_cast<FwAssertArgType>(portNum)
838  );
839 
840  return this->m_CmdStatus_OutputPort[portNum].isConnected();
841  }
842 
845  {
846  FW_ASSERT(
847  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
848  static_cast<FwAssertArgType>(portNum)
849  );
850 
851  return this->m_Log_OutputPort[portNum].isConnected();
852  }
853 
854 #if FW_ENABLE_TEXT_LOGGING == 1
855 
856  bool CommandDispatcherComponentBase ::
857  isConnected_LogText_OutputPort(FwIndexType portNum)
858  {
859  FW_ASSERT(
860  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
861  static_cast<FwAssertArgType>(portNum)
862  );
863 
864  return this->m_LogText_OutputPort[portNum].isConnected();
865  }
866 
867 #endif
868 
871  {
872  FW_ASSERT(
873  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
874  static_cast<FwAssertArgType>(portNum)
875  );
876 
877  return this->m_Time_OutputPort[portNum].isConnected();
878  }
879 
882  {
883  FW_ASSERT(
884  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
885  static_cast<FwAssertArgType>(portNum)
886  );
887 
888  return this->m_Tlm_OutputPort[portNum].isConnected();
889  }
890 
891  // ----------------------------------------------------------------------
892  // Connection status queries for typed output ports
893  // ----------------------------------------------------------------------
894 
897  {
898  FW_ASSERT(
899  (0 <= portNum) && (portNum < this->getNum_compCmdSend_OutputPorts()),
900  static_cast<FwAssertArgType>(portNum)
901  );
902 
903  return this->m_compCmdSend_OutputPort[portNum].isConnected();
904  }
905 
908  {
909  FW_ASSERT(
910  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
911  static_cast<FwAssertArgType>(portNum)
912  );
913 
914  return this->m_pingOut_OutputPort[portNum].isConnected();
915  }
916 
919  {
920  FW_ASSERT(
921  (0 <= portNum) && (portNum < this->getNum_seqCmdStatus_OutputPorts()),
922  static_cast<FwAssertArgType>(portNum)
923  );
924 
925  return this->m_seqCmdStatus_OutputPort[portNum].isConnected();
926  }
927 
928  // ----------------------------------------------------------------------
929  // Port handler base-class functions for typed input ports
930  //
931  // Call these functions directly to bypass the corresponding ports
932  // ----------------------------------------------------------------------
933 
936  FwIndexType portNum,
937  FwOpcodeType opCode
938  )
939  {
940  // Make sure port number is valid
941  FW_ASSERT(
942  (0 <= portNum) && (portNum < this->getNum_compCmdReg_InputPorts()),
943  static_cast<FwAssertArgType>(portNum)
944  );
945 
946  // Lock guard mutex before calling
947  this->lock();
948 
949  // Call handler function
950  this->compCmdReg_handler(
951  portNum,
952  opCode
953  );
954 
955  // Unlock guard mutex
956  this->unLock();
957  }
958 
961  FwIndexType portNum,
962  FwOpcodeType opCode,
963  U32 cmdSeq,
964  const Fw::CmdResponse& response
965  )
966  {
967  // Make sure port number is valid
968  FW_ASSERT(
969  (0 <= portNum) && (portNum < this->getNum_compCmdStat_InputPorts()),
970  static_cast<FwAssertArgType>(portNum)
971  );
972 
973  // Call pre-message hook
975  portNum,
976  opCode,
977  cmdSeq,
978  response
979  );
980  ComponentIpcSerializableBuffer msg;
982 
983  // Serialize message ID
984  _status = msg.serializeFrom(
985  static_cast<FwEnumStoreType>(COMPCMDSTAT_CMDRESPONSE)
986  );
987  FW_ASSERT(
988  _status == Fw::FW_SERIALIZE_OK,
989  static_cast<FwAssertArgType>(_status)
990  );
991 
992  // Serialize port number
993  _status = msg.serializeFrom(portNum);
994  FW_ASSERT(
995  _status == Fw::FW_SERIALIZE_OK,
996  static_cast<FwAssertArgType>(_status)
997  );
998 
999  // Serialize argument opCode
1000  _status = msg.serializeFrom(opCode);
1001  FW_ASSERT(
1002  _status == Fw::FW_SERIALIZE_OK,
1003  static_cast<FwAssertArgType>(_status)
1004  );
1005 
1006  // Serialize argument cmdSeq
1007  _status = msg.serializeFrom(cmdSeq);
1008  FW_ASSERT(
1009  _status == Fw::FW_SERIALIZE_OK,
1010  static_cast<FwAssertArgType>(_status)
1011  );
1012 
1013  // Serialize argument response
1014  _status = msg.serializeFrom(response);
1015  FW_ASSERT(
1016  _status == Fw::FW_SERIALIZE_OK,
1017  static_cast<FwAssertArgType>(_status)
1018  );
1019 
1020  // Send message
1022  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1023 
1024  FW_ASSERT(
1025  qStatus == Os::Queue::OP_OK,
1026  static_cast<FwAssertArgType>(qStatus)
1027  );
1028  }
1029 
1032  FwIndexType portNum,
1033  U32 key
1034  )
1035  {
1036  // Make sure port number is valid
1037  FW_ASSERT(
1038  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
1039  static_cast<FwAssertArgType>(portNum)
1040  );
1041 
1042  // Call pre-message hook
1044  portNum,
1045  key
1046  );
1047  ComponentIpcSerializableBuffer msg;
1049 
1050  // Serialize message ID
1051  _status = msg.serializeFrom(
1052  static_cast<FwEnumStoreType>(PINGIN_PING)
1053  );
1054  FW_ASSERT(
1055  _status == Fw::FW_SERIALIZE_OK,
1056  static_cast<FwAssertArgType>(_status)
1057  );
1058 
1059  // Serialize port number
1060  _status = msg.serializeFrom(portNum);
1061  FW_ASSERT(
1062  _status == Fw::FW_SERIALIZE_OK,
1063  static_cast<FwAssertArgType>(_status)
1064  );
1065 
1066  // Serialize argument key
1067  _status = msg.serializeFrom(key);
1068  FW_ASSERT(
1069  _status == Fw::FW_SERIALIZE_OK,
1070  static_cast<FwAssertArgType>(_status)
1071  );
1072 
1073  // Send message
1075  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1076 
1077  FW_ASSERT(
1078  qStatus == Os::Queue::OP_OK,
1079  static_cast<FwAssertArgType>(qStatus)
1080  );
1081  }
1082 
1085  FwIndexType portNum,
1086  U32 context
1087  )
1088  {
1089  // Make sure port number is valid
1090  FW_ASSERT(
1091  (0 <= portNum) && (portNum < this->getNum_run_InputPorts()),
1092  static_cast<FwAssertArgType>(portNum)
1093  );
1094 
1095  // Call pre-message hook
1097  portNum,
1098  context
1099  );
1100  ComponentIpcSerializableBuffer msg;
1102 
1103  // Serialize message ID
1104  _status = msg.serializeFrom(
1105  static_cast<FwEnumStoreType>(RUN_SCHED)
1106  );
1107  FW_ASSERT(
1108  _status == Fw::FW_SERIALIZE_OK,
1109  static_cast<FwAssertArgType>(_status)
1110  );
1111 
1112  // Serialize port number
1113  _status = msg.serializeFrom(portNum);
1114  FW_ASSERT(
1115  _status == Fw::FW_SERIALIZE_OK,
1116  static_cast<FwAssertArgType>(_status)
1117  );
1118 
1119  // Serialize argument context
1120  _status = msg.serializeFrom(context);
1121  FW_ASSERT(
1122  _status == Fw::FW_SERIALIZE_OK,
1123  static_cast<FwAssertArgType>(_status)
1124  );
1125 
1126  // Send message
1128  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1129 
1130  FW_ASSERT(
1131  qStatus == Os::Queue::OP_OK,
1132  static_cast<FwAssertArgType>(qStatus)
1133  );
1134  }
1135 
1138  FwIndexType portNum,
1139  Fw::ComBuffer& data,
1140  U32 context
1141  )
1142  {
1143  // Make sure port number is valid
1144  FW_ASSERT(
1145  (0 <= portNum) && (portNum < this->getNum_seqCmdBuff_InputPorts()),
1146  static_cast<FwAssertArgType>(portNum)
1147  );
1148 
1149  // Call pre-message hook
1151  portNum,
1152  data,
1153  context
1154  );
1155  ComponentIpcSerializableBuffer msg;
1157 
1158  // Serialize message ID
1159  _status = msg.serializeFrom(
1160  static_cast<FwEnumStoreType>(SEQCMDBUFF_COM)
1161  );
1162  FW_ASSERT(
1163  _status == Fw::FW_SERIALIZE_OK,
1164  static_cast<FwAssertArgType>(_status)
1165  );
1166 
1167  // Serialize port number
1168  _status = msg.serializeFrom(portNum);
1169  FW_ASSERT(
1170  _status == Fw::FW_SERIALIZE_OK,
1171  static_cast<FwAssertArgType>(_status)
1172  );
1173 
1174  // Serialize argument data
1175  _status = msg.serializeFrom(data);
1176  FW_ASSERT(
1177  _status == Fw::FW_SERIALIZE_OK,
1178  static_cast<FwAssertArgType>(_status)
1179  );
1180 
1181  // Serialize argument context
1182  _status = msg.serializeFrom(context);
1183  FW_ASSERT(
1184  _status == Fw::FW_SERIALIZE_OK,
1185  static_cast<FwAssertArgType>(_status)
1186  );
1187 
1188  // Send message
1190  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1191 
1192  if (qStatus == Os::Queue::Status::FULL) {
1193  this->seqCmdBuff_overflowHook(portNum, data, context);
1194  return;
1195  }
1196 
1197  FW_ASSERT(
1198  qStatus == Os::Queue::OP_OK,
1199  static_cast<FwAssertArgType>(qStatus)
1200  );
1201  }
1202 
1203  // ----------------------------------------------------------------------
1204  // Pre-message hooks for typed async input ports
1205  //
1206  // Each of these functions is invoked just before processing a message
1207  // on the corresponding port. By default, they do nothing. You can
1208  // override them to provide specific pre-message behavior.
1209  // ----------------------------------------------------------------------
1210 
1213  FwIndexType portNum,
1214  FwOpcodeType opCode,
1215  U32 cmdSeq,
1216  const Fw::CmdResponse& response
1217  )
1218  {
1219  // Default: no-op
1220  }
1221 
1224  FwIndexType portNum,
1225  U32 key
1226  )
1227  {
1228  // Default: no-op
1229  }
1230 
1233  FwIndexType portNum,
1234  U32 context
1235  )
1236  {
1237  // Default: no-op
1238  }
1239 
1242  FwIndexType portNum,
1243  Fw::ComBuffer& data,
1244  U32 context
1245  )
1246  {
1247  // Default: no-op
1248  }
1249 
1250  // ----------------------------------------------------------------------
1251  // Invocation functions for typed output ports
1252  // ----------------------------------------------------------------------
1253 
1256  FwIndexType portNum,
1257  FwOpcodeType opCode,
1258  U32 cmdSeq,
1259  Fw::CmdArgBuffer& args
1260  )
1261  {
1262  FW_ASSERT(
1263  (0 <= portNum) && (portNum < this->getNum_compCmdSend_OutputPorts()),
1264  static_cast<FwAssertArgType>(portNum)
1265  );
1266 
1267  FW_ASSERT(
1268  this->m_compCmdSend_OutputPort[portNum].isConnected(),
1269  static_cast<FwAssertArgType>(portNum)
1270  );
1271  this->m_compCmdSend_OutputPort[portNum].invoke(
1272  opCode,
1273  cmdSeq,
1274  args
1275  );
1276  }
1277 
1280  FwIndexType portNum,
1281  U32 key
1282  )
1283  {
1284  FW_ASSERT(
1285  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
1286  static_cast<FwAssertArgType>(portNum)
1287  );
1288 
1289  FW_ASSERT(
1290  this->m_pingOut_OutputPort[portNum].isConnected(),
1291  static_cast<FwAssertArgType>(portNum)
1292  );
1293  this->m_pingOut_OutputPort[portNum].invoke(
1294  key
1295  );
1296  }
1297 
1300  FwIndexType portNum,
1301  FwOpcodeType opCode,
1302  U32 cmdSeq,
1303  const Fw::CmdResponse& response
1304  )
1305  {
1306  FW_ASSERT(
1307  (0 <= portNum) && (portNum < this->getNum_seqCmdStatus_OutputPorts()),
1308  static_cast<FwAssertArgType>(portNum)
1309  );
1310 
1311  FW_ASSERT(
1312  this->m_seqCmdStatus_OutputPort[portNum].isConnected(),
1313  static_cast<FwAssertArgType>(portNum)
1314  );
1315  this->m_seqCmdStatus_OutputPort[portNum].invoke(
1316  opCode,
1317  cmdSeq,
1318  response
1319  );
1320  }
1321 
1322  // ----------------------------------------------------------------------
1323  // Command response
1324  // ----------------------------------------------------------------------
1325 
1328  FwOpcodeType opCode,
1329  U32 cmdSeq,
1330  Fw::CmdResponse response
1331  )
1332  {
1333  FW_ASSERT(this->m_CmdStatus_OutputPort[0].isConnected());
1334  this->m_CmdStatus_OutputPort[0].invoke(opCode, cmdSeq, response);
1335  }
1336 
1337  // ----------------------------------------------------------------------
1338  // Command handler base-class functions
1339  //
1340  // Call these functions directly to bypass the command input port
1341  // ----------------------------------------------------------------------
1342 
1345  FwOpcodeType opCode,
1346  U32 cmdSeq,
1347  Fw::CmdArgBuffer& args
1348  )
1349  {
1350  // Call pre-message hook
1351  this->CMD_NO_OP_preMsgHook(opCode,cmdSeq);
1352 
1353  // Defer deserializing arguments to the message dispatcher
1354  // to avoid deserializing and reserializing just for IPC
1355  ComponentIpcSerializableBuffer msg;
1357 
1358  // Serialize for IPC
1359  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CMD_NO_OP));
1360  FW_ASSERT (
1361  _status == Fw::FW_SERIALIZE_OK,
1362  static_cast<FwAssertArgType>(_status)
1363  );
1364 
1365  // Fake port number to make message dequeue work
1366  FwIndexType port = 0;
1367 
1368  _status = msg.serializeFrom(port);
1369  FW_ASSERT (
1370  _status == Fw::FW_SERIALIZE_OK,
1371  static_cast<FwAssertArgType>(_status)
1372  );
1373 
1374  _status = msg.serializeFrom(opCode);
1375  FW_ASSERT (
1376  _status == Fw::FW_SERIALIZE_OK,
1377  static_cast<FwAssertArgType>(_status)
1378  );
1379 
1380  _status = msg.serializeFrom(cmdSeq);
1381  FW_ASSERT (
1382  _status == Fw::FW_SERIALIZE_OK,
1383  static_cast<FwAssertArgType>(_status)
1384  );
1385 
1386  _status = msg.serializeFrom(args);
1387  FW_ASSERT (
1388  _status == Fw::FW_SERIALIZE_OK,
1389  static_cast<FwAssertArgType>(_status)
1390  );
1391 
1392  // Send message
1394  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1395 
1396  FW_ASSERT(
1397  qStatus == Os::Queue::OP_OK,
1398  static_cast<FwAssertArgType>(qStatus)
1399  );
1400  }
1401 
1404  FwOpcodeType opCode,
1405  U32 cmdSeq,
1406  Fw::CmdArgBuffer& args
1407  )
1408  {
1409  // Call pre-message hook
1410  this->CMD_NO_OP_STRING_preMsgHook(opCode,cmdSeq);
1411 
1412  // Defer deserializing arguments to the message dispatcher
1413  // to avoid deserializing and reserializing just for IPC
1414  ComponentIpcSerializableBuffer msg;
1416 
1417  // Serialize for IPC
1418  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CMD_NO_OP_STRING));
1419  FW_ASSERT (
1420  _status == Fw::FW_SERIALIZE_OK,
1421  static_cast<FwAssertArgType>(_status)
1422  );
1423 
1424  // Fake port number to make message dequeue work
1425  FwIndexType port = 0;
1426 
1427  _status = msg.serializeFrom(port);
1428  FW_ASSERT (
1429  _status == Fw::FW_SERIALIZE_OK,
1430  static_cast<FwAssertArgType>(_status)
1431  );
1432 
1433  _status = msg.serializeFrom(opCode);
1434  FW_ASSERT (
1435  _status == Fw::FW_SERIALIZE_OK,
1436  static_cast<FwAssertArgType>(_status)
1437  );
1438 
1439  _status = msg.serializeFrom(cmdSeq);
1440  FW_ASSERT (
1441  _status == Fw::FW_SERIALIZE_OK,
1442  static_cast<FwAssertArgType>(_status)
1443  );
1444 
1445  _status = msg.serializeFrom(args);
1446  FW_ASSERT (
1447  _status == Fw::FW_SERIALIZE_OK,
1448  static_cast<FwAssertArgType>(_status)
1449  );
1450 
1451  // Send message
1453  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1454 
1455  FW_ASSERT(
1456  qStatus == Os::Queue::OP_OK,
1457  static_cast<FwAssertArgType>(qStatus)
1458  );
1459  }
1460 
1463  FwOpcodeType opCode,
1464  U32 cmdSeq,
1465  Fw::CmdArgBuffer& args
1466  )
1467  {
1468  // Call pre-message hook
1469  this->CMD_TEST_CMD_1_preMsgHook(opCode,cmdSeq);
1470 
1471  // Defer deserializing arguments to the message dispatcher
1472  // to avoid deserializing and reserializing just for IPC
1473  ComponentIpcSerializableBuffer msg;
1475 
1476  // Serialize for IPC
1477  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CMD_TEST_CMD_1));
1478  FW_ASSERT (
1479  _status == Fw::FW_SERIALIZE_OK,
1480  static_cast<FwAssertArgType>(_status)
1481  );
1482 
1483  // Fake port number to make message dequeue work
1484  FwIndexType port = 0;
1485 
1486  _status = msg.serializeFrom(port);
1487  FW_ASSERT (
1488  _status == Fw::FW_SERIALIZE_OK,
1489  static_cast<FwAssertArgType>(_status)
1490  );
1491 
1492  _status = msg.serializeFrom(opCode);
1493  FW_ASSERT (
1494  _status == Fw::FW_SERIALIZE_OK,
1495  static_cast<FwAssertArgType>(_status)
1496  );
1497 
1498  _status = msg.serializeFrom(cmdSeq);
1499  FW_ASSERT (
1500  _status == Fw::FW_SERIALIZE_OK,
1501  static_cast<FwAssertArgType>(_status)
1502  );
1503 
1504  _status = msg.serializeFrom(args);
1505  FW_ASSERT (
1506  _status == Fw::FW_SERIALIZE_OK,
1507  static_cast<FwAssertArgType>(_status)
1508  );
1509 
1510  // Send message
1512  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1513 
1514  FW_ASSERT(
1515  qStatus == Os::Queue::OP_OK,
1516  static_cast<FwAssertArgType>(qStatus)
1517  );
1518  }
1519 
1522  FwOpcodeType opCode,
1523  U32 cmdSeq,
1524  Fw::CmdArgBuffer& args
1525  )
1526  {
1527  // Call pre-message hook
1528  this->CMD_CLEAR_TRACKING_preMsgHook(opCode,cmdSeq);
1529 
1530  // Defer deserializing arguments to the message dispatcher
1531  // to avoid deserializing and reserializing just for IPC
1532  ComponentIpcSerializableBuffer msg;
1534 
1535  // Serialize for IPC
1536  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CMD_CLEAR_TRACKING));
1537  FW_ASSERT (
1538  _status == Fw::FW_SERIALIZE_OK,
1539  static_cast<FwAssertArgType>(_status)
1540  );
1541 
1542  // Fake port number to make message dequeue work
1543  FwIndexType port = 0;
1544 
1545  _status = msg.serializeFrom(port);
1546  FW_ASSERT (
1547  _status == Fw::FW_SERIALIZE_OK,
1548  static_cast<FwAssertArgType>(_status)
1549  );
1550 
1551  _status = msg.serializeFrom(opCode);
1552  FW_ASSERT (
1553  _status == Fw::FW_SERIALIZE_OK,
1554  static_cast<FwAssertArgType>(_status)
1555  );
1556 
1557  _status = msg.serializeFrom(cmdSeq);
1558  FW_ASSERT (
1559  _status == Fw::FW_SERIALIZE_OK,
1560  static_cast<FwAssertArgType>(_status)
1561  );
1562 
1563  _status = msg.serializeFrom(args);
1564  FW_ASSERT (
1565  _status == Fw::FW_SERIALIZE_OK,
1566  static_cast<FwAssertArgType>(_status)
1567  );
1568 
1569  // Send message
1571  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1572 
1573  FW_ASSERT(
1574  qStatus == Os::Queue::OP_OK,
1575  static_cast<FwAssertArgType>(qStatus)
1576  );
1577  }
1578 
1579  // ----------------------------------------------------------------------
1580  // Pre-message hooks for async commands
1581  //
1582  // Each of these functions is invoked just before processing the
1583  // corresponding command. By default they do nothing. You can
1584  // override them to provide specific pre-command behavior.
1585  // ----------------------------------------------------------------------
1586 
1589  FwOpcodeType opCode,
1590  U32 cmdSeq
1591  )
1592  {
1593  // Defaults to no-op; can be overridden
1594  (void) opCode;
1595  (void) cmdSeq;
1596  }
1597 
1600  FwOpcodeType opCode,
1601  U32 cmdSeq
1602  )
1603  {
1604  // Defaults to no-op; can be overridden
1605  (void) opCode;
1606  (void) cmdSeq;
1607  }
1608 
1611  FwOpcodeType opCode,
1612  U32 cmdSeq
1613  )
1614  {
1615  // Defaults to no-op; can be overridden
1616  (void) opCode;
1617  (void) cmdSeq;
1618  }
1619 
1622  FwOpcodeType opCode,
1623  U32 cmdSeq
1624  )
1625  {
1626  // Defaults to no-op; can be overridden
1627  (void) opCode;
1628  (void) cmdSeq;
1629  }
1630 
1631  // ----------------------------------------------------------------------
1632  // Event logging functions
1633  // ----------------------------------------------------------------------
1634 
1637  FwOpcodeType Opcode,
1638  I32 port,
1639  I32 slot
1640  ) const
1641  {
1642  // Get the time
1643  Fw::Time _logTime;
1644  if (this->m_Time_OutputPort[0].isConnected()) {
1645  this->m_Time_OutputPort[0].invoke(_logTime);
1646  }
1647 
1648  FwEventIdType _id = static_cast<FwEventIdType>(0);
1649 
1650  _id = this->getIdBase() + EVENTID_OPCODEREGISTERED;
1651 
1652  // Emit the event on the log port
1653  if (this->m_Log_OutputPort[0].isConnected()) {
1654  Fw::LogBuffer _logBuff;
1656 
1657 #if FW_AMPCS_COMPATIBLE
1658  // Serialize the number of arguments
1659  _status = _logBuff.serializeFrom(static_cast<U8>(3));
1660  FW_ASSERT(
1661  _status == Fw::FW_SERIALIZE_OK,
1662  static_cast<FwAssertArgType>(_status)
1663  );
1664 #endif
1665 
1666 #if FW_AMPCS_COMPATIBLE
1667  // Serialize the argument size
1668  _status = _logBuff.serializeFrom(
1669  static_cast<U8>(sizeof(FwOpcodeType))
1670  );
1671  FW_ASSERT(
1672  _status == Fw::FW_SERIALIZE_OK,
1673  static_cast<FwAssertArgType>(_status)
1674  );
1675 #endif
1676  _status = _logBuff.serializeFrom(Opcode);
1677  FW_ASSERT(
1678  _status == Fw::FW_SERIALIZE_OK,
1679  static_cast<FwAssertArgType>(_status)
1680  );
1681 
1682 #if FW_AMPCS_COMPATIBLE
1683  // Serialize the argument size
1684  _status = _logBuff.serializeFrom(
1685  static_cast<U8>(sizeof(I32))
1686  );
1687  FW_ASSERT(
1688  _status == Fw::FW_SERIALIZE_OK,
1689  static_cast<FwAssertArgType>(_status)
1690  );
1691 #endif
1692  _status = _logBuff.serializeFrom(port);
1693  FW_ASSERT(
1694  _status == Fw::FW_SERIALIZE_OK,
1695  static_cast<FwAssertArgType>(_status)
1696  );
1697 
1698 #if FW_AMPCS_COMPATIBLE
1699  // Serialize the argument size
1700  _status = _logBuff.serializeFrom(
1701  static_cast<U8>(sizeof(I32))
1702  );
1703  FW_ASSERT(
1704  _status == Fw::FW_SERIALIZE_OK,
1705  static_cast<FwAssertArgType>(_status)
1706  );
1707 #endif
1708  _status = _logBuff.serializeFrom(slot);
1709  FW_ASSERT(
1710  _status == Fw::FW_SERIALIZE_OK,
1711  static_cast<FwAssertArgType>(_status)
1712  );
1713 
1714  this->m_Log_OutputPort[0].invoke(
1715  _id,
1716  _logTime,
1718  _logBuff
1719  );
1720  }
1721 
1722  // Emit the event on the text log port
1723 #if FW_ENABLE_TEXT_LOGGING
1724  if (this->m_LogText_OutputPort[0].isConnected()) {
1725 #if FW_OBJECT_NAMES == 1
1726  const char* _formatString =
1727  "(%s) %s: Opcode 0x%" PRIx32 " registered to port %" PRIi32 " slot %" PRIi32 "";
1728 #else
1729  const char* _formatString =
1730  "%s: Opcode 0x%" PRIx32 " registered to port %" PRIi32 " slot %" PRIi32 "";
1731 #endif
1732 
1733  Fw::TextLogString _logString;
1734  _logString.format(
1735  _formatString,
1736 #if FW_OBJECT_NAMES == 1
1737  this->m_objName.toChar(),
1738 #endif
1739  "OpCodeRegistered ",
1740  Opcode,
1741  port,
1742  slot
1743  );
1744 
1745  this->m_LogText_OutputPort[0].invoke(
1746  _id,
1747  _logTime,
1749  _logString
1750  );
1751  }
1752 #endif
1753  }
1754 
1757  FwOpcodeType Opcode,
1758  I32 port
1759  ) const
1760  {
1761  // Get the time
1762  Fw::Time _logTime;
1763  if (this->m_Time_OutputPort[0].isConnected()) {
1764  this->m_Time_OutputPort[0].invoke(_logTime);
1765  }
1766 
1767  FwEventIdType _id = static_cast<FwEventIdType>(0);
1768 
1769  _id = this->getIdBase() + EVENTID_OPCODEDISPATCHED;
1770 
1771  // Emit the event on the log port
1772  if (this->m_Log_OutputPort[0].isConnected()) {
1773  Fw::LogBuffer _logBuff;
1775 
1776 #if FW_AMPCS_COMPATIBLE
1777  // Serialize the number of arguments
1778  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1779  FW_ASSERT(
1780  _status == Fw::FW_SERIALIZE_OK,
1781  static_cast<FwAssertArgType>(_status)
1782  );
1783 #endif
1784 
1785 #if FW_AMPCS_COMPATIBLE
1786  // Serialize the argument size
1787  _status = _logBuff.serializeFrom(
1788  static_cast<U8>(sizeof(FwOpcodeType))
1789  );
1790  FW_ASSERT(
1791  _status == Fw::FW_SERIALIZE_OK,
1792  static_cast<FwAssertArgType>(_status)
1793  );
1794 #endif
1795  _status = _logBuff.serializeFrom(Opcode);
1796  FW_ASSERT(
1797  _status == Fw::FW_SERIALIZE_OK,
1798  static_cast<FwAssertArgType>(_status)
1799  );
1800 
1801 #if FW_AMPCS_COMPATIBLE
1802  // Serialize the argument size
1803  _status = _logBuff.serializeFrom(
1804  static_cast<U8>(sizeof(I32))
1805  );
1806  FW_ASSERT(
1807  _status == Fw::FW_SERIALIZE_OK,
1808  static_cast<FwAssertArgType>(_status)
1809  );
1810 #endif
1811  _status = _logBuff.serializeFrom(port);
1812  FW_ASSERT(
1813  _status == Fw::FW_SERIALIZE_OK,
1814  static_cast<FwAssertArgType>(_status)
1815  );
1816 
1817  this->m_Log_OutputPort[0].invoke(
1818  _id,
1819  _logTime,
1821  _logBuff
1822  );
1823  }
1824 
1825  // Emit the event on the text log port
1826 #if FW_ENABLE_TEXT_LOGGING
1827  if (this->m_LogText_OutputPort[0].isConnected()) {
1828 #if FW_OBJECT_NAMES == 1
1829  const char* _formatString =
1830  "(%s) %s: Opcode 0x%" PRIx32 " dispatched to port %" PRIi32 "";
1831 #else
1832  const char* _formatString =
1833  "%s: Opcode 0x%" PRIx32 " dispatched to port %" PRIi32 "";
1834 #endif
1835 
1836  Fw::TextLogString _logString;
1837  _logString.format(
1838  _formatString,
1839 #if FW_OBJECT_NAMES == 1
1840  this->m_objName.toChar(),
1841 #endif
1842  "OpCodeDispatched ",
1843  Opcode,
1844  port
1845  );
1846 
1847  this->m_LogText_OutputPort[0].invoke(
1848  _id,
1849  _logTime,
1851  _logString
1852  );
1853  }
1854 #endif
1855  }
1856 
1859  {
1860  // Get the time
1861  Fw::Time _logTime;
1862  if (this->m_Time_OutputPort[0].isConnected()) {
1863  this->m_Time_OutputPort[0].invoke(_logTime);
1864  }
1865 
1866  FwEventIdType _id = static_cast<FwEventIdType>(0);
1867 
1868  _id = this->getIdBase() + EVENTID_OPCODECOMPLETED;
1869 
1870  // Emit the event on the log port
1871  if (this->m_Log_OutputPort[0].isConnected()) {
1872  Fw::LogBuffer _logBuff;
1874 
1875 #if FW_AMPCS_COMPATIBLE
1876  // Serialize the number of arguments
1877  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1878  FW_ASSERT(
1879  _status == Fw::FW_SERIALIZE_OK,
1880  static_cast<FwAssertArgType>(_status)
1881  );
1882 #endif
1883 
1884 #if FW_AMPCS_COMPATIBLE
1885  // Serialize the argument size
1886  _status = _logBuff.serializeFrom(
1887  static_cast<U8>(sizeof(FwOpcodeType))
1888  );
1889  FW_ASSERT(
1890  _status == Fw::FW_SERIALIZE_OK,
1891  static_cast<FwAssertArgType>(_status)
1892  );
1893 #endif
1894  _status = _logBuff.serializeFrom(Opcode);
1895  FW_ASSERT(
1896  _status == Fw::FW_SERIALIZE_OK,
1897  static_cast<FwAssertArgType>(_status)
1898  );
1899 
1900  this->m_Log_OutputPort[0].invoke(
1901  _id,
1902  _logTime,
1904  _logBuff
1905  );
1906  }
1907 
1908  // Emit the event on the text log port
1909 #if FW_ENABLE_TEXT_LOGGING
1910  if (this->m_LogText_OutputPort[0].isConnected()) {
1911 #if FW_OBJECT_NAMES == 1
1912  const char* _formatString =
1913  "(%s) %s: Opcode 0x%" PRIx32 " completed";
1914 #else
1915  const char* _formatString =
1916  "%s: Opcode 0x%" PRIx32 " completed";
1917 #endif
1918 
1919  Fw::TextLogString _logString;
1920  _logString.format(
1921  _formatString,
1922 #if FW_OBJECT_NAMES == 1
1923  this->m_objName.toChar(),
1924 #endif
1925  "OpCodeCompleted ",
1926  Opcode
1927  );
1928 
1929  this->m_LogText_OutputPort[0].invoke(
1930  _id,
1931  _logTime,
1933  _logString
1934  );
1935  }
1936 #endif
1937  }
1938 
1941  FwOpcodeType Opcode,
1942  Fw::CmdResponse error
1943  ) const
1944  {
1945  // Get the time
1946  Fw::Time _logTime;
1947  if (this->m_Time_OutputPort[0].isConnected()) {
1948  this->m_Time_OutputPort[0].invoke(_logTime);
1949  }
1950 
1951  FwEventIdType _id = static_cast<FwEventIdType>(0);
1952 
1953  _id = this->getIdBase() + EVENTID_OPCODEERROR;
1954 
1955  // Emit the event on the log port
1956  if (this->m_Log_OutputPort[0].isConnected()) {
1957  Fw::LogBuffer _logBuff;
1959 
1960 #if FW_AMPCS_COMPATIBLE
1961  // Serialize the number of arguments
1962  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1963  FW_ASSERT(
1964  _status == Fw::FW_SERIALIZE_OK,
1965  static_cast<FwAssertArgType>(_status)
1966  );
1967 #endif
1968 
1969 #if FW_AMPCS_COMPATIBLE
1970  // Serialize the argument size
1971  _status = _logBuff.serializeFrom(
1972  static_cast<U8>(sizeof(FwOpcodeType))
1973  );
1974  FW_ASSERT(
1975  _status == Fw::FW_SERIALIZE_OK,
1976  static_cast<FwAssertArgType>(_status)
1977  );
1978 #endif
1979  _status = _logBuff.serializeFrom(Opcode);
1980  FW_ASSERT(
1981  _status == Fw::FW_SERIALIZE_OK,
1982  static_cast<FwAssertArgType>(_status)
1983  );
1984 
1985 #if FW_AMPCS_COMPATIBLE
1986  // Serialize the argument size
1987  _status = _logBuff.serializeFrom(
1988  static_cast<U8>(Fw::CmdResponse::SERIALIZED_SIZE)
1989  );
1990  FW_ASSERT(
1991  _status == Fw::FW_SERIALIZE_OK,
1992  static_cast<FwAssertArgType>(_status)
1993  );
1994 #endif
1995  _status = _logBuff.serializeFrom(error);
1996  FW_ASSERT(
1997  _status == Fw::FW_SERIALIZE_OK,
1998  static_cast<FwAssertArgType>(_status)
1999  );
2000 
2001  this->m_Log_OutputPort[0].invoke(
2002  _id,
2003  _logTime,
2005  _logBuff
2006  );
2007  }
2008 
2009  // Emit the event on the text log port
2010 #if FW_ENABLE_TEXT_LOGGING
2011  if (this->m_LogText_OutputPort[0].isConnected()) {
2012 #if FW_OBJECT_NAMES == 1
2013  const char* _formatString =
2014  "(%s) %s: Opcode 0x%" PRIx32 " completed with error %s";
2015 #else
2016  const char* _formatString =
2017  "%s: Opcode 0x%" PRIx32 " completed with error %s";
2018 #endif
2019 
2020  Fw::String errorStr;
2021  error.toString(errorStr);
2022 
2023  Fw::TextLogString _logString;
2024  _logString.format(
2025  _formatString,
2026 #if FW_OBJECT_NAMES == 1
2027  this->m_objName.toChar(),
2028 #endif
2029  "OpCodeError ",
2030  Opcode,
2031  errorStr.toChar()
2032  );
2033 
2034  this->m_LogText_OutputPort[0].invoke(
2035  _id,
2036  _logTime,
2038  _logString
2039  );
2040  }
2041 #endif
2042  }
2043 
2046  {
2047  // Get the time
2048  Fw::Time _logTime;
2049  if (this->m_Time_OutputPort[0].isConnected()) {
2050  this->m_Time_OutputPort[0].invoke(_logTime);
2051  }
2052 
2053  FwEventIdType _id = static_cast<FwEventIdType>(0);
2054 
2055  _id = this->getIdBase() + EVENTID_MALFORMEDCOMMAND;
2056 
2057  // Emit the event on the log port
2058  if (this->m_Log_OutputPort[0].isConnected()) {
2059  Fw::LogBuffer _logBuff;
2061 
2062 #if FW_AMPCS_COMPATIBLE
2063  // Serialize the number of arguments
2064  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2065  FW_ASSERT(
2066  _status == Fw::FW_SERIALIZE_OK,
2067  static_cast<FwAssertArgType>(_status)
2068  );
2069 #endif
2070 
2071 #if FW_AMPCS_COMPATIBLE
2072  // Serialize the argument size
2073  _status = _logBuff.serializeFrom(
2074  static_cast<U8>(Fw::DeserialStatus::SERIALIZED_SIZE)
2075  );
2076  FW_ASSERT(
2077  _status == Fw::FW_SERIALIZE_OK,
2078  static_cast<FwAssertArgType>(_status)
2079  );
2080 #endif
2081  _status = _logBuff.serializeFrom(Status);
2082  FW_ASSERT(
2083  _status == Fw::FW_SERIALIZE_OK,
2084  static_cast<FwAssertArgType>(_status)
2085  );
2086 
2087  this->m_Log_OutputPort[0].invoke(
2088  _id,
2089  _logTime,
2091  _logBuff
2092  );
2093  }
2094 
2095  // Emit the event on the text log port
2096 #if FW_ENABLE_TEXT_LOGGING
2097  if (this->m_LogText_OutputPort[0].isConnected()) {
2098 #if FW_OBJECT_NAMES == 1
2099  const char* _formatString =
2100  "(%s) %s: Received malformed command packet. Status: %s";
2101 #else
2102  const char* _formatString =
2103  "%s: Received malformed command packet. Status: %s";
2104 #endif
2105 
2106  Fw::String StatusStr;
2107  Status.toString(StatusStr);
2108 
2109  Fw::TextLogString _logString;
2110  _logString.format(
2111  _formatString,
2112 #if FW_OBJECT_NAMES == 1
2113  this->m_objName.toChar(),
2114 #endif
2115  "MalformedCommand ",
2116  StatusStr.toChar()
2117  );
2118 
2119  this->m_LogText_OutputPort[0].invoke(
2120  _id,
2121  _logTime,
2123  _logString
2124  );
2125  }
2126 #endif
2127  }
2128 
2131  {
2132  // Get the time
2133  Fw::Time _logTime;
2134  if (this->m_Time_OutputPort[0].isConnected()) {
2135  this->m_Time_OutputPort[0].invoke(_logTime);
2136  }
2137 
2138  FwEventIdType _id = static_cast<FwEventIdType>(0);
2139 
2140  _id = this->getIdBase() + EVENTID_INVALIDCOMMAND;
2141 
2142  // Emit the event on the log port
2143  if (this->m_Log_OutputPort[0].isConnected()) {
2144  Fw::LogBuffer _logBuff;
2146 
2147 #if FW_AMPCS_COMPATIBLE
2148  // Serialize the number of arguments
2149  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2150  FW_ASSERT(
2151  _status == Fw::FW_SERIALIZE_OK,
2152  static_cast<FwAssertArgType>(_status)
2153  );
2154 #endif
2155 
2156 #if FW_AMPCS_COMPATIBLE
2157  // Serialize the argument size
2158  _status = _logBuff.serializeFrom(
2159  static_cast<U8>(sizeof(FwOpcodeType))
2160  );
2161  FW_ASSERT(
2162  _status == Fw::FW_SERIALIZE_OK,
2163  static_cast<FwAssertArgType>(_status)
2164  );
2165 #endif
2166  _status = _logBuff.serializeFrom(Opcode);
2167  FW_ASSERT(
2168  _status == Fw::FW_SERIALIZE_OK,
2169  static_cast<FwAssertArgType>(_status)
2170  );
2171 
2172  this->m_Log_OutputPort[0].invoke(
2173  _id,
2174  _logTime,
2176  _logBuff
2177  );
2178  }
2179 
2180  // Emit the event on the text log port
2181 #if FW_ENABLE_TEXT_LOGGING
2182  if (this->m_LogText_OutputPort[0].isConnected()) {
2183 #if FW_OBJECT_NAMES == 1
2184  const char* _formatString =
2185  "(%s) %s: Invalid opcode 0x%" PRIx32 " received";
2186 #else
2187  const char* _formatString =
2188  "%s: Invalid opcode 0x%" PRIx32 " received";
2189 #endif
2190 
2191  Fw::TextLogString _logString;
2192  _logString.format(
2193  _formatString,
2194 #if FW_OBJECT_NAMES == 1
2195  this->m_objName.toChar(),
2196 #endif
2197  "InvalidCommand ",
2198  Opcode
2199  );
2200 
2201  this->m_LogText_OutputPort[0].invoke(
2202  _id,
2203  _logTime,
2205  _logString
2206  );
2207  }
2208 #endif
2209  }
2210 
2213  {
2214  // Get the time
2215  Fw::Time _logTime;
2216  if (this->m_Time_OutputPort[0].isConnected()) {
2217  this->m_Time_OutputPort[0].invoke(_logTime);
2218  }
2219 
2220  FwEventIdType _id = static_cast<FwEventIdType>(0);
2221 
2222  _id = this->getIdBase() + EVENTID_TOOMANYCOMMANDS;
2223 
2224  // Emit the event on the log port
2225  if (this->m_Log_OutputPort[0].isConnected()) {
2226  Fw::LogBuffer _logBuff;
2228 
2229 #if FW_AMPCS_COMPATIBLE
2230  // Serialize the number of arguments
2231  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2232  FW_ASSERT(
2233  _status == Fw::FW_SERIALIZE_OK,
2234  static_cast<FwAssertArgType>(_status)
2235  );
2236 #endif
2237 
2238 #if FW_AMPCS_COMPATIBLE
2239  // Serialize the argument size
2240  _status = _logBuff.serializeFrom(
2241  static_cast<U8>(sizeof(FwOpcodeType))
2242  );
2243  FW_ASSERT(
2244  _status == Fw::FW_SERIALIZE_OK,
2245  static_cast<FwAssertArgType>(_status)
2246  );
2247 #endif
2248  _status = _logBuff.serializeFrom(Opcode);
2249  FW_ASSERT(
2250  _status == Fw::FW_SERIALIZE_OK,
2251  static_cast<FwAssertArgType>(_status)
2252  );
2253 
2254  this->m_Log_OutputPort[0].invoke(
2255  _id,
2256  _logTime,
2258  _logBuff
2259  );
2260  }
2261 
2262  // Emit the event on the text log port
2263 #if FW_ENABLE_TEXT_LOGGING
2264  if (this->m_LogText_OutputPort[0].isConnected()) {
2265 #if FW_OBJECT_NAMES == 1
2266  const char* _formatString =
2267  "(%s) %s: Too many outstanding commands. opcode=0x%" PRIx32 "";
2268 #else
2269  const char* _formatString =
2270  "%s: Too many outstanding commands. opcode=0x%" PRIx32 "";
2271 #endif
2272 
2273  Fw::TextLogString _logString;
2274  _logString.format(
2275  _formatString,
2276 #if FW_OBJECT_NAMES == 1
2277  this->m_objName.toChar(),
2278 #endif
2279  "TooManyCommands ",
2280  Opcode
2281  );
2282 
2283  this->m_LogText_OutputPort[0].invoke(
2284  _id,
2285  _logTime,
2287  _logString
2288  );
2289  }
2290 #endif
2291  }
2292 
2295  {
2296  // Get the time
2297  Fw::Time _logTime;
2298  if (this->m_Time_OutputPort[0].isConnected()) {
2299  this->m_Time_OutputPort[0].invoke(_logTime);
2300  }
2301 
2302  FwEventIdType _id = static_cast<FwEventIdType>(0);
2303 
2304  _id = this->getIdBase() + EVENTID_NOOPRECEIVED;
2305 
2306  // Emit the event on the log port
2307  if (this->m_Log_OutputPort[0].isConnected()) {
2308  Fw::LogBuffer _logBuff;
2309 
2310 #if FW_AMPCS_COMPATIBLE
2312  // Serialize the number of arguments
2313  _status = _logBuff.serializeFrom(static_cast<U8>(0));
2314  FW_ASSERT(
2315  _status == Fw::FW_SERIALIZE_OK,
2316  static_cast<FwAssertArgType>(_status)
2317  );
2318 #endif
2319 
2320  this->m_Log_OutputPort[0].invoke(
2321  _id,
2322  _logTime,
2324  _logBuff
2325  );
2326  }
2327 
2328  // Emit the event on the text log port
2329 #if FW_ENABLE_TEXT_LOGGING
2330  if (this->m_LogText_OutputPort[0].isConnected()) {
2331 #if FW_OBJECT_NAMES == 1
2332  const char* _formatString =
2333  "(%s) %s: Received a NO-OP command";
2334 #else
2335  const char* _formatString =
2336  "%s: Received a NO-OP command";
2337 #endif
2338 
2339  Fw::TextLogString _logString;
2340  _logString.format(
2341  _formatString,
2342 #if FW_OBJECT_NAMES == 1
2343  this->m_objName.toChar(),
2344 #endif
2345  "NoOpReceived "
2346  );
2347 
2348  this->m_LogText_OutputPort[0].invoke(
2349  _id,
2350  _logTime,
2352  _logString
2353  );
2354  }
2355 #endif
2356  }
2357 
2360  {
2361  // Get the time
2362  Fw::Time _logTime;
2363  if (this->m_Time_OutputPort[0].isConnected()) {
2364  this->m_Time_OutputPort[0].invoke(_logTime);
2365  }
2366 
2367  FwEventIdType _id = static_cast<FwEventIdType>(0);
2368 
2369  _id = this->getIdBase() + EVENTID_NOOPSTRINGRECEIVED;
2370 
2371  // Emit the event on the log port
2372  if (this->m_Log_OutputPort[0].isConnected()) {
2373  Fw::LogBuffer _logBuff;
2375 
2376 #if FW_AMPCS_COMPATIBLE
2377  // Serialize the number of arguments
2378  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2379  FW_ASSERT(
2380  _status == Fw::FW_SERIALIZE_OK,
2381  static_cast<FwAssertArgType>(_status)
2382  );
2383 #endif
2384 
2385  _status = message.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
2386  FW_ASSERT(
2387  _status == Fw::FW_SERIALIZE_OK,
2388  static_cast<FwAssertArgType>(_status)
2389  );
2390 
2391  this->m_Log_OutputPort[0].invoke(
2392  _id,
2393  _logTime,
2395  _logBuff
2396  );
2397  }
2398 
2399  // Emit the event on the text log port
2400 #if FW_ENABLE_TEXT_LOGGING
2401  if (this->m_LogText_OutputPort[0].isConnected()) {
2402 #if FW_OBJECT_NAMES == 1
2403  const char* _formatString =
2404  "(%s) %s: Received a NO-OP string=%s";
2405 #else
2406  const char* _formatString =
2407  "%s: Received a NO-OP string=%s";
2408 #endif
2409 
2410  Fw::TextLogString _logString;
2411  _logString.format(
2412  _formatString,
2413 #if FW_OBJECT_NAMES == 1
2414  this->m_objName.toChar(),
2415 #endif
2416  "NoOpStringReceived ",
2417  message.toChar()
2418  );
2419 
2420  this->m_LogText_OutputPort[0].invoke(
2421  _id,
2422  _logTime,
2424  _logString
2425  );
2426  }
2427 #endif
2428  }
2429 
2432  I32 arg1,
2433  F32 arg2,
2434  U8 arg3
2435  ) const
2436  {
2437  // Get the time
2438  Fw::Time _logTime;
2439  if (this->m_Time_OutputPort[0].isConnected()) {
2440  this->m_Time_OutputPort[0].invoke(_logTime);
2441  }
2442 
2443  FwEventIdType _id = static_cast<FwEventIdType>(0);
2444 
2445  _id = this->getIdBase() + EVENTID_TESTCMD1ARGS;
2446 
2447  // Emit the event on the log port
2448  if (this->m_Log_OutputPort[0].isConnected()) {
2449  Fw::LogBuffer _logBuff;
2451 
2452 #if FW_AMPCS_COMPATIBLE
2453  // Serialize the number of arguments
2454  _status = _logBuff.serializeFrom(static_cast<U8>(3));
2455  FW_ASSERT(
2456  _status == Fw::FW_SERIALIZE_OK,
2457  static_cast<FwAssertArgType>(_status)
2458  );
2459 #endif
2460 
2461 #if FW_AMPCS_COMPATIBLE
2462  // Serialize the argument size
2463  _status = _logBuff.serializeFrom(
2464  static_cast<U8>(sizeof(I32))
2465  );
2466  FW_ASSERT(
2467  _status == Fw::FW_SERIALIZE_OK,
2468  static_cast<FwAssertArgType>(_status)
2469  );
2470 #endif
2471  _status = _logBuff.serializeFrom(arg1);
2472  FW_ASSERT(
2473  _status == Fw::FW_SERIALIZE_OK,
2474  static_cast<FwAssertArgType>(_status)
2475  );
2476 
2477 #if FW_AMPCS_COMPATIBLE
2478  // Serialize the argument size
2479  _status = _logBuff.serializeFrom(
2480  static_cast<U8>(sizeof(F32))
2481  );
2482  FW_ASSERT(
2483  _status == Fw::FW_SERIALIZE_OK,
2484  static_cast<FwAssertArgType>(_status)
2485  );
2486 #endif
2487  _status = _logBuff.serializeFrom(arg2);
2488  FW_ASSERT(
2489  _status == Fw::FW_SERIALIZE_OK,
2490  static_cast<FwAssertArgType>(_status)
2491  );
2492 
2493 #if FW_AMPCS_COMPATIBLE
2494  // Serialize the argument size
2495  _status = _logBuff.serializeFrom(
2496  static_cast<U8>(sizeof(U8))
2497  );
2498  FW_ASSERT(
2499  _status == Fw::FW_SERIALIZE_OK,
2500  static_cast<FwAssertArgType>(_status)
2501  );
2502 #endif
2503  _status = _logBuff.serializeFrom(arg3);
2504  FW_ASSERT(
2505  _status == Fw::FW_SERIALIZE_OK,
2506  static_cast<FwAssertArgType>(_status)
2507  );
2508 
2509  this->m_Log_OutputPort[0].invoke(
2510  _id,
2511  _logTime,
2513  _logBuff
2514  );
2515  }
2516 
2517  // Emit the event on the text log port
2518 #if FW_ENABLE_TEXT_LOGGING
2519  if (this->m_LogText_OutputPort[0].isConnected()) {
2520 #if FW_OBJECT_NAMES == 1
2521  const char* _formatString =
2522  "(%s) %s: TEST_CMD_1 args: I32: %" PRIi32 ", F32: %f, U8: %" PRIu8 "";
2523 #else
2524  const char* _formatString =
2525  "%s: TEST_CMD_1 args: I32: %" PRIi32 ", F32: %f, U8: %" PRIu8 "";
2526 #endif
2527 
2528  Fw::TextLogString _logString;
2529  _logString.format(
2530  _formatString,
2531 #if FW_OBJECT_NAMES == 1
2532  this->m_objName.toChar(),
2533 #endif
2534  "TestCmd1Args ",
2535  arg1,
2536  static_cast<F64>(arg2),
2537  arg3
2538  );
2539 
2540  this->m_LogText_OutputPort[0].invoke(
2541  _id,
2542  _logTime,
2544  _logString
2545  );
2546  }
2547 #endif
2548  }
2549 
2552  FwOpcodeType Opcode,
2553  I32 port
2554  ) const
2555  {
2556  // Get the time
2557  Fw::Time _logTime;
2558  if (this->m_Time_OutputPort[0].isConnected()) {
2559  this->m_Time_OutputPort[0].invoke(_logTime);
2560  }
2561 
2562  FwEventIdType _id = static_cast<FwEventIdType>(0);
2563 
2564  _id = this->getIdBase() + EVENTID_OPCODEREREGISTERED;
2565 
2566  // Emit the event on the log port
2567  if (this->m_Log_OutputPort[0].isConnected()) {
2568  Fw::LogBuffer _logBuff;
2570 
2571 #if FW_AMPCS_COMPATIBLE
2572  // Serialize the number of arguments
2573  _status = _logBuff.serializeFrom(static_cast<U8>(2));
2574  FW_ASSERT(
2575  _status == Fw::FW_SERIALIZE_OK,
2576  static_cast<FwAssertArgType>(_status)
2577  );
2578 #endif
2579 
2580 #if FW_AMPCS_COMPATIBLE
2581  // Serialize the argument size
2582  _status = _logBuff.serializeFrom(
2583  static_cast<U8>(sizeof(FwOpcodeType))
2584  );
2585  FW_ASSERT(
2586  _status == Fw::FW_SERIALIZE_OK,
2587  static_cast<FwAssertArgType>(_status)
2588  );
2589 #endif
2590  _status = _logBuff.serializeFrom(Opcode);
2591  FW_ASSERT(
2592  _status == Fw::FW_SERIALIZE_OK,
2593  static_cast<FwAssertArgType>(_status)
2594  );
2595 
2596 #if FW_AMPCS_COMPATIBLE
2597  // Serialize the argument size
2598  _status = _logBuff.serializeFrom(
2599  static_cast<U8>(sizeof(I32))
2600  );
2601  FW_ASSERT(
2602  _status == Fw::FW_SERIALIZE_OK,
2603  static_cast<FwAssertArgType>(_status)
2604  );
2605 #endif
2606  _status = _logBuff.serializeFrom(port);
2607  FW_ASSERT(
2608  _status == Fw::FW_SERIALIZE_OK,
2609  static_cast<FwAssertArgType>(_status)
2610  );
2611 
2612  this->m_Log_OutputPort[0].invoke(
2613  _id,
2614  _logTime,
2616  _logBuff
2617  );
2618  }
2619 
2620  // Emit the event on the text log port
2621 #if FW_ENABLE_TEXT_LOGGING
2622  if (this->m_LogText_OutputPort[0].isConnected()) {
2623 #if FW_OBJECT_NAMES == 1
2624  const char* _formatString =
2625  "(%s) %s: Opcode 0x%" PRIx32 " is already registered to port %" PRIi32 "";
2626 #else
2627  const char* _formatString =
2628  "%s: Opcode 0x%" PRIx32 " is already registered to port %" PRIi32 "";
2629 #endif
2630 
2631  Fw::TextLogString _logString;
2632  _logString.format(
2633  _formatString,
2634 #if FW_OBJECT_NAMES == 1
2635  this->m_objName.toChar(),
2636 #endif
2637  "OpCodeReregistered ",
2638  Opcode,
2639  port
2640  );
2641 
2642  this->m_LogText_OutputPort[0].invoke(
2643  _id,
2644  _logTime,
2646  _logString
2647  );
2648  }
2649 #endif
2650  }
2651 
2654  FwOpcodeType OpCode,
2655  U32 Context
2656  )
2657  {
2658  // Check throttle value
2659  if (this->m_CommandDroppedQueueOverflowThrottle >= EVENTID_COMMANDDROPPEDQUEUEOVERFLOW_THROTTLE) {
2660  return;
2661  }
2662  else {
2663  this->m_CommandDroppedQueueOverflowThrottle++;
2664  }
2665 
2666  // Get the time
2667  Fw::Time _logTime;
2668  if (this->m_Time_OutputPort[0].isConnected()) {
2669  this->m_Time_OutputPort[0].invoke(_logTime);
2670  }
2671 
2672  FwEventIdType _id = static_cast<FwEventIdType>(0);
2673 
2675 
2676  // Emit the event on the log port
2677  if (this->m_Log_OutputPort[0].isConnected()) {
2678  Fw::LogBuffer _logBuff;
2680 
2681 #if FW_AMPCS_COMPATIBLE
2682  // Serialize the number of arguments
2683  _status = _logBuff.serializeFrom(static_cast<U8>(2));
2684  FW_ASSERT(
2685  _status == Fw::FW_SERIALIZE_OK,
2686  static_cast<FwAssertArgType>(_status)
2687  );
2688 #endif
2689 
2690 #if FW_AMPCS_COMPATIBLE
2691  // Serialize the argument size
2692  _status = _logBuff.serializeFrom(
2693  static_cast<U8>(sizeof(FwOpcodeType))
2694  );
2695  FW_ASSERT(
2696  _status == Fw::FW_SERIALIZE_OK,
2697  static_cast<FwAssertArgType>(_status)
2698  );
2699 #endif
2700  _status = _logBuff.serializeFrom(OpCode);
2701  FW_ASSERT(
2702  _status == Fw::FW_SERIALIZE_OK,
2703  static_cast<FwAssertArgType>(_status)
2704  );
2705 
2706 #if FW_AMPCS_COMPATIBLE
2707  // Serialize the argument size
2708  _status = _logBuff.serializeFrom(
2709  static_cast<U8>(sizeof(U32))
2710  );
2711  FW_ASSERT(
2712  _status == Fw::FW_SERIALIZE_OK,
2713  static_cast<FwAssertArgType>(_status)
2714  );
2715 #endif
2716  _status = _logBuff.serializeFrom(Context);
2717  FW_ASSERT(
2718  _status == Fw::FW_SERIALIZE_OK,
2719  static_cast<FwAssertArgType>(_status)
2720  );
2721 
2722  this->m_Log_OutputPort[0].invoke(
2723  _id,
2724  _logTime,
2726  _logBuff
2727  );
2728  }
2729 
2730  // Emit the event on the text log port
2731 #if FW_ENABLE_TEXT_LOGGING
2732  if (this->m_LogText_OutputPort[0].isConnected()) {
2733 #if FW_OBJECT_NAMES == 1
2734  const char* _formatString =
2735  "(%s) %s: Opcode 0x%" PRIx32 " was dropped due to buffer overflow and not processed. Context %" PRIu32 "";
2736 #else
2737  const char* _formatString =
2738  "%s: Opcode 0x%" PRIx32 " was dropped due to buffer overflow and not processed. Context %" PRIu32 "";
2739 #endif
2740 
2741  Fw::TextLogString _logString;
2742  _logString.format(
2743  _formatString,
2744 #if FW_OBJECT_NAMES == 1
2745  this->m_objName.toChar(),
2746 #endif
2747  "CommandDroppedQueueOverflow ",
2748  OpCode,
2749  Context
2750  );
2751 
2752  this->m_LogText_OutputPort[0].invoke(
2753  _id,
2754  _logTime,
2756  _logString
2757  );
2758  }
2759 #endif
2760  }
2761 
2762  // ----------------------------------------------------------------------
2763  // Event throttle reset functions
2764  // ----------------------------------------------------------------------
2765 
2768  {
2769  // Reset throttle counter
2770  this->m_CommandDroppedQueueOverflowThrottle = 0;
2771  }
2772 
2773  // ----------------------------------------------------------------------
2774  // Telemetry write functions
2775  // ----------------------------------------------------------------------
2776 
2779  U32 arg,
2780  Fw::Time _tlmTime
2781  )
2782  {
2783  // Check to see if it is the first time
2784  if (not this->m_first_update_CommandsDispatched) {
2785  // Check to see if value has changed. If not, don't write it.
2786  if (arg == this->m_last_CommandsDispatched) {
2787  return;
2788  }
2789  else {
2790  this->m_last_CommandsDispatched = arg;
2791  }
2792  }
2793  else {
2794  this->m_first_update_CommandsDispatched = false;
2795  this->m_last_CommandsDispatched = arg;
2796  }
2797 
2798  if (this->m_Tlm_OutputPort[0].isConnected()) {
2799  if (
2800  this->m_Time_OutputPort[0].isConnected() &&
2801  (_tlmTime == Fw::ZERO_TIME)
2802  ) {
2803  this->m_Time_OutputPort[0].invoke(_tlmTime);
2804  }
2805 
2806  Fw::TlmBuffer _tlmBuff;
2807  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
2808  FW_ASSERT(
2809  _stat == Fw::FW_SERIALIZE_OK,
2810  static_cast<FwAssertArgType>(_stat)
2811  );
2812 
2813  FwChanIdType _id;
2814 
2815  _id = this->getIdBase() + CHANNELID_COMMANDSDISPATCHED;
2816 
2817  this->m_Tlm_OutputPort[0].invoke(
2818  _id,
2819  _tlmTime,
2820  _tlmBuff
2821  );
2822  }
2823  }
2824 
2827  U32 arg,
2828  Fw::Time _tlmTime
2829  )
2830  {
2831  // Check to see if it is the first time
2832  if (not this->m_first_update_CommandErrors) {
2833  // Check to see if value has changed. If not, don't write it.
2834  if (arg == this->m_last_CommandErrors) {
2835  return;
2836  }
2837  else {
2838  this->m_last_CommandErrors = arg;
2839  }
2840  }
2841  else {
2842  this->m_first_update_CommandErrors = false;
2843  this->m_last_CommandErrors = arg;
2844  }
2845 
2846  if (this->m_Tlm_OutputPort[0].isConnected()) {
2847  if (
2848  this->m_Time_OutputPort[0].isConnected() &&
2849  (_tlmTime == Fw::ZERO_TIME)
2850  ) {
2851  this->m_Time_OutputPort[0].invoke(_tlmTime);
2852  }
2853 
2854  Fw::TlmBuffer _tlmBuff;
2855  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
2856  FW_ASSERT(
2857  _stat == Fw::FW_SERIALIZE_OK,
2858  static_cast<FwAssertArgType>(_stat)
2859  );
2860 
2861  FwChanIdType _id;
2862 
2863  _id = this->getIdBase() + CHANNELID_COMMANDERRORS;
2864 
2865  this->m_Tlm_OutputPort[0].invoke(
2866  _id,
2867  _tlmTime,
2868  _tlmBuff
2869  );
2870  }
2871  }
2872 
2875  U32 arg,
2876  Fw::Time _tlmTime
2877  )
2878  {
2879  // Check to see if it is the first time
2880  if (not this->m_first_update_CommandsDropped) {
2881  // Check to see if value has changed. If not, don't write it.
2882  if (arg == this->m_last_CommandsDropped) {
2883  return;
2884  }
2885  else {
2886  this->m_last_CommandsDropped = arg;
2887  }
2888  }
2889  else {
2890  this->m_first_update_CommandsDropped = false;
2891  this->m_last_CommandsDropped = arg;
2892  }
2893 
2894  if (this->m_Tlm_OutputPort[0].isConnected()) {
2895  if (
2896  this->m_Time_OutputPort[0].isConnected() &&
2897  (_tlmTime == Fw::ZERO_TIME)
2898  ) {
2899  this->m_Time_OutputPort[0].invoke(_tlmTime);
2900  }
2901 
2902  Fw::TlmBuffer _tlmBuff;
2903  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
2904  FW_ASSERT(
2905  _stat == Fw::FW_SERIALIZE_OK,
2906  static_cast<FwAssertArgType>(_stat)
2907  );
2908 
2909  FwChanIdType _id;
2910 
2911  _id = this->getIdBase() + CHANNELID_COMMANDSDROPPED;
2912 
2913  this->m_Tlm_OutputPort[0].invoke(
2914  _id,
2915  _tlmTime,
2916  _tlmBuff
2917  );
2918  }
2919  }
2920 
2921  // ----------------------------------------------------------------------
2922  // Time
2923  // ----------------------------------------------------------------------
2924 
2926  getTime() const
2927  {
2928  if (this->m_Time_OutputPort[0].isConnected()) {
2929  Fw::Time _time;
2930  this->m_Time_OutputPort[0].invoke(_time);
2931  return _time;
2932  }
2933  else {
2934  return Fw::Time(TimeBase::TB_NONE, 0, 0);
2935  }
2936  }
2937 
2938  // ----------------------------------------------------------------------
2939  // Mutex operations for guarded ports
2940  //
2941  // You can override these operations to provide more sophisticated
2942  // synchronization
2943  // ----------------------------------------------------------------------
2944 
2947  {
2948  this->m_guardedPortMutex.lock();
2949  }
2950 
2953  {
2954  this->m_guardedPortMutex.unLock();
2955  }
2956 
2957  // ----------------------------------------------------------------------
2958  // Message dispatch functions
2959  // ----------------------------------------------------------------------
2960 
2961  Fw::QueuedComponentBase::MsgDispatchStatus CommandDispatcherComponentBase ::
2962  doDispatch()
2963  {
2964  ComponentIpcSerializableBuffer _msg;
2965  FwQueuePriorityType _priority = 0;
2966 
2967  Os::Queue::Status _msgStatus = this->m_queue.receive(
2968  _msg,
2970  _priority
2971  );
2972  FW_ASSERT(
2973  _msgStatus == Os::Queue::OP_OK,
2974  static_cast<FwAssertArgType>(_msgStatus)
2975  );
2976 
2977  // Reset to beginning of buffer
2978  _msg.resetDeser();
2979 
2980  FwEnumStoreType _desMsg = 0;
2981  Fw::SerializeStatus _deserStatus = _msg.deserializeTo(_desMsg);
2982  FW_ASSERT(
2983  _deserStatus == Fw::FW_SERIALIZE_OK,
2984  static_cast<FwAssertArgType>(_deserStatus)
2985  );
2986 
2987  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
2988 
2989  if (_msgType == COMMANDDISPATCHER_COMPONENT_EXIT) {
2990  return MSG_DISPATCH_EXIT;
2991  }
2992 
2993  FwIndexType portNum = 0;
2994  _deserStatus = _msg.deserializeTo(portNum);
2995  FW_ASSERT(
2996  _deserStatus == Fw::FW_SERIALIZE_OK,
2997  static_cast<FwAssertArgType>(_deserStatus)
2998  );
2999 
3000  switch (_msgType) {
3001  // Handle async input port compCmdStat
3002  case COMPCMDSTAT_CMDRESPONSE: {
3003  // Deserialize argument opCode
3004  FwOpcodeType opCode;
3005  _deserStatus = _msg.deserializeTo(opCode);
3006  FW_ASSERT(
3007  _deserStatus == Fw::FW_SERIALIZE_OK,
3008  static_cast<FwAssertArgType>(_deserStatus)
3009  );
3010 
3011  // Deserialize argument cmdSeq
3012  U32 cmdSeq;
3013  _deserStatus = _msg.deserializeTo(cmdSeq);
3014  FW_ASSERT(
3015  _deserStatus == Fw::FW_SERIALIZE_OK,
3016  static_cast<FwAssertArgType>(_deserStatus)
3017  );
3018 
3019  // Deserialize argument response
3020  Fw::CmdResponse response;
3021  _deserStatus = _msg.deserializeTo(response);
3022  FW_ASSERT(
3023  _deserStatus == Fw::FW_SERIALIZE_OK,
3024  static_cast<FwAssertArgType>(_deserStatus)
3025  );
3026  // Call handler function
3027  this->compCmdStat_handler(
3028  portNum,
3029  opCode,
3030  cmdSeq,
3031  response
3032  );
3033 
3034  break;
3035  }
3036 
3037  // Handle async input port pingIn
3038  case PINGIN_PING: {
3039  // Deserialize argument key
3040  U32 key;
3041  _deserStatus = _msg.deserializeTo(key);
3042  FW_ASSERT(
3043  _deserStatus == Fw::FW_SERIALIZE_OK,
3044  static_cast<FwAssertArgType>(_deserStatus)
3045  );
3046  // Call handler function
3047  this->pingIn_handler(
3048  portNum,
3049  key
3050  );
3051 
3052  break;
3053  }
3054 
3055  // Handle async input port run
3056  case RUN_SCHED: {
3057  // Deserialize argument context
3058  U32 context;
3059  _deserStatus = _msg.deserializeTo(context);
3060  FW_ASSERT(
3061  _deserStatus == Fw::FW_SERIALIZE_OK,
3062  static_cast<FwAssertArgType>(_deserStatus)
3063  );
3064  // Call handler function
3065  this->run_handler(
3066  portNum,
3067  context
3068  );
3069 
3070  break;
3071  }
3072 
3073  // Handle async input port seqCmdBuff
3074  case SEQCMDBUFF_COM: {
3075  // Deserialize argument data
3076  Fw::ComBuffer data;
3077  _deserStatus = _msg.deserializeTo(data);
3078  FW_ASSERT(
3079  _deserStatus == Fw::FW_SERIALIZE_OK,
3080  static_cast<FwAssertArgType>(_deserStatus)
3081  );
3082 
3083  // Deserialize argument context
3084  U32 context;
3085  _deserStatus = _msg.deserializeTo(context);
3086  FW_ASSERT(
3087  _deserStatus == Fw::FW_SERIALIZE_OK,
3088  static_cast<FwAssertArgType>(_deserStatus)
3089  );
3090  // Call handler function
3091  this->seqCmdBuff_handler(
3092  portNum,
3093  data,
3094  context
3095  );
3096 
3097  break;
3098  }
3099 
3100  // Handle command CMD_NO_OP
3101  case CMD_CMD_NO_OP: {
3102  // Deserialize opcode
3103  FwOpcodeType _opCode = 0;
3104  _deserStatus = _msg.deserializeTo(_opCode);
3105  FW_ASSERT (
3106  _deserStatus == Fw::FW_SERIALIZE_OK,
3107  static_cast<FwAssertArgType>(_deserStatus)
3108  );
3109 
3110  // Deserialize command sequence
3111  U32 _cmdSeq = 0;
3112  _deserStatus = _msg.deserializeTo(_cmdSeq);
3113  FW_ASSERT (
3114  _deserStatus == Fw::FW_SERIALIZE_OK,
3115  static_cast<FwAssertArgType>(_deserStatus)
3116  );
3117 
3118  // Deserialize command argument buffer
3119  Fw::CmdArgBuffer args;
3120  _deserStatus = _msg.deserializeTo(args);
3121  FW_ASSERT (
3122  _deserStatus == Fw::FW_SERIALIZE_OK,
3123  static_cast<FwAssertArgType>(_deserStatus)
3124  );
3125 
3126  // Reset buffer
3127  args.resetDeser();
3128 
3129  // Make sure there was no data left over.
3130  // That means the argument buffer size was incorrect.
3131 #if FW_CMD_CHECK_RESIDUAL
3132  if (args.getDeserializeSizeLeft() != 0) {
3133  if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3134  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3135  }
3136  // Don't crash the task if bad arguments were passed from the ground
3137  break;
3138  }
3139 #endif
3140 
3141  // Call handler function
3142  this->CMD_NO_OP_cmdHandler(_opCode, _cmdSeq);
3143 
3144  break;
3145  }
3146 
3147  // Handle command CMD_NO_OP_STRING
3148  case CMD_CMD_NO_OP_STRING: {
3149  // Deserialize opcode
3150  FwOpcodeType _opCode = 0;
3151  _deserStatus = _msg.deserializeTo(_opCode);
3152  FW_ASSERT (
3153  _deserStatus == Fw::FW_SERIALIZE_OK,
3154  static_cast<FwAssertArgType>(_deserStatus)
3155  );
3156 
3157  // Deserialize command sequence
3158  U32 _cmdSeq = 0;
3159  _deserStatus = _msg.deserializeTo(_cmdSeq);
3160  FW_ASSERT (
3161  _deserStatus == Fw::FW_SERIALIZE_OK,
3162  static_cast<FwAssertArgType>(_deserStatus)
3163  );
3164 
3165  // Deserialize command argument buffer
3166  Fw::CmdArgBuffer args;
3167  _deserStatus = _msg.deserializeTo(args);
3168  FW_ASSERT (
3169  _deserStatus == Fw::FW_SERIALIZE_OK,
3170  static_cast<FwAssertArgType>(_deserStatus)
3171  );
3172 
3173  // Reset buffer
3174  args.resetDeser();
3175 
3176  // Deserialize argument arg1
3177  Fw::CmdStringArg arg1;
3178  _deserStatus = args.deserializeTo(arg1);
3179  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3180  if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3181  this->cmdResponse_out(
3182  _opCode,
3183  _cmdSeq,
3185  );
3186  }
3187  // Don't crash the task if bad arguments were passed from the ground
3188  break;
3189  }
3190 
3191  // Make sure there was no data left over.
3192  // That means the argument buffer size was incorrect.
3193 #if FW_CMD_CHECK_RESIDUAL
3194  if (args.getDeserializeSizeLeft() != 0) {
3195  if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3196  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3197  }
3198  // Don't crash the task if bad arguments were passed from the ground
3199  break;
3200  }
3201 #endif
3202 
3203  // Call handler function
3205  _opCode, _cmdSeq,
3206  arg1
3207  );
3208 
3209  break;
3210  }
3211 
3212  // Handle command CMD_TEST_CMD_1
3213  case CMD_CMD_TEST_CMD_1: {
3214  // Deserialize opcode
3215  FwOpcodeType _opCode = 0;
3216  _deserStatus = _msg.deserializeTo(_opCode);
3217  FW_ASSERT (
3218  _deserStatus == Fw::FW_SERIALIZE_OK,
3219  static_cast<FwAssertArgType>(_deserStatus)
3220  );
3221 
3222  // Deserialize command sequence
3223  U32 _cmdSeq = 0;
3224  _deserStatus = _msg.deserializeTo(_cmdSeq);
3225  FW_ASSERT (
3226  _deserStatus == Fw::FW_SERIALIZE_OK,
3227  static_cast<FwAssertArgType>(_deserStatus)
3228  );
3229 
3230  // Deserialize command argument buffer
3231  Fw::CmdArgBuffer args;
3232  _deserStatus = _msg.deserializeTo(args);
3233  FW_ASSERT (
3234  _deserStatus == Fw::FW_SERIALIZE_OK,
3235  static_cast<FwAssertArgType>(_deserStatus)
3236  );
3237 
3238  // Reset buffer
3239  args.resetDeser();
3240 
3241  // Deserialize argument arg1
3242  I32 arg1;
3243  _deserStatus = args.deserializeTo(arg1);
3244  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3245  if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3246  this->cmdResponse_out(
3247  _opCode,
3248  _cmdSeq,
3250  );
3251  }
3252  // Don't crash the task if bad arguments were passed from the ground
3253  break;
3254  }
3255 
3256  // Deserialize argument arg2
3257  F32 arg2;
3258  _deserStatus = args.deserializeTo(arg2);
3259  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3260  if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3261  this->cmdResponse_out(
3262  _opCode,
3263  _cmdSeq,
3265  );
3266  }
3267  // Don't crash the task if bad arguments were passed from the ground
3268  break;
3269  }
3270 
3271  // Deserialize argument arg3
3272  U8 arg3;
3273  _deserStatus = args.deserializeTo(arg3);
3274  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3275  if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3276  this->cmdResponse_out(
3277  _opCode,
3278  _cmdSeq,
3280  );
3281  }
3282  // Don't crash the task if bad arguments were passed from the ground
3283  break;
3284  }
3285 
3286  // Make sure there was no data left over.
3287  // That means the argument buffer size was incorrect.
3288 #if FW_CMD_CHECK_RESIDUAL
3289  if (args.getDeserializeSizeLeft() != 0) {
3290  if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3291  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3292  }
3293  // Don't crash the task if bad arguments were passed from the ground
3294  break;
3295  }
3296 #endif
3297 
3298  // Call handler function
3300  _opCode, _cmdSeq,
3301  arg1,
3302  arg2,
3303  arg3
3304  );
3305 
3306  break;
3307  }
3308 
3309  // Handle command CMD_CLEAR_TRACKING
3310  case CMD_CMD_CLEAR_TRACKING: {
3311  // Deserialize opcode
3312  FwOpcodeType _opCode = 0;
3313  _deserStatus = _msg.deserializeTo(_opCode);
3314  FW_ASSERT (
3315  _deserStatus == Fw::FW_SERIALIZE_OK,
3316  static_cast<FwAssertArgType>(_deserStatus)
3317  );
3318 
3319  // Deserialize command sequence
3320  U32 _cmdSeq = 0;
3321  _deserStatus = _msg.deserializeTo(_cmdSeq);
3322  FW_ASSERT (
3323  _deserStatus == Fw::FW_SERIALIZE_OK,
3324  static_cast<FwAssertArgType>(_deserStatus)
3325  );
3326 
3327  // Deserialize command argument buffer
3328  Fw::CmdArgBuffer args;
3329  _deserStatus = _msg.deserializeTo(args);
3330  FW_ASSERT (
3331  _deserStatus == Fw::FW_SERIALIZE_OK,
3332  static_cast<FwAssertArgType>(_deserStatus)
3333  );
3334 
3335  // Reset buffer
3336  args.resetDeser();
3337 
3338  // Make sure there was no data left over.
3339  // That means the argument buffer size was incorrect.
3340 #if FW_CMD_CHECK_RESIDUAL
3341  if (args.getDeserializeSizeLeft() != 0) {
3342  if (this->m_CmdStatus_OutputPort[0].isConnected()) {
3343  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3344  }
3345  // Don't crash the task if bad arguments were passed from the ground
3346  break;
3347  }
3348 #endif
3349 
3350  // Call handler function
3351  this->CMD_CLEAR_TRACKING_cmdHandler(_opCode, _cmdSeq);
3352 
3353  break;
3354  }
3355 
3356  default:
3357  return MSG_DISPATCH_ERROR;
3358  }
3359 
3360  return MSG_DISPATCH_OK;
3361  }
3362 
3363  // ----------------------------------------------------------------------
3364  // Calls for messages received on special input ports
3365  // ----------------------------------------------------------------------
3366 
3367  void CommandDispatcherComponentBase ::
3368  m_p_CmdDisp_in(
3369  Fw::PassiveComponentBase* callComp,
3370  FwIndexType portNum,
3371  FwOpcodeType opCode,
3372  U32 cmdSeq,
3373  Fw::CmdArgBuffer& args
3374  )
3375  {
3376  FW_ASSERT(callComp);
3377  CommandDispatcherComponentBase* compPtr = static_cast<CommandDispatcherComponentBase*>(callComp);
3378 
3379  const U32 idBase = callComp->getIdBase();
3380  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
3381 
3382  // Select base class function based on opcode
3383  switch (opCode - idBase) {
3384  case OPCODE_CMD_NO_OP: {
3385  compPtr->CMD_NO_OP_cmdHandlerBase(
3386  opCode,
3387  cmdSeq,
3388  args
3389  );
3390  break;
3391  }
3392 
3393  case OPCODE_CMD_NO_OP_STRING: {
3394  compPtr->CMD_NO_OP_STRING_cmdHandlerBase(
3395  opCode,
3396  cmdSeq,
3397  args
3398  );
3399  break;
3400  }
3401 
3402  case OPCODE_CMD_TEST_CMD_1: {
3403  compPtr->CMD_TEST_CMD_1_cmdHandlerBase(
3404  opCode,
3405  cmdSeq,
3406  args
3407  );
3408  break;
3409  }
3410 
3412  compPtr->CMD_CLEAR_TRACKING_cmdHandlerBase(
3413  opCode,
3414  cmdSeq,
3415  args
3416  );
3417  break;
3418  }
3419  }
3420  }
3421 
3422  // ----------------------------------------------------------------------
3423  // Calls for messages received on typed input ports
3424  // ----------------------------------------------------------------------
3425 
3426  void CommandDispatcherComponentBase ::
3427  m_p_compCmdReg_in(
3428  Fw::PassiveComponentBase* callComp,
3429  FwIndexType portNum,
3430  FwOpcodeType opCode
3431  )
3432  {
3433  FW_ASSERT(callComp);
3434  CommandDispatcherComponentBase* compPtr = static_cast<CommandDispatcherComponentBase*>(callComp);
3435  compPtr->compCmdReg_handlerBase(
3436  portNum,
3437  opCode
3438  );
3439  }
3440 
3441  void CommandDispatcherComponentBase ::
3442  m_p_compCmdStat_in(
3443  Fw::PassiveComponentBase* callComp,
3444  FwIndexType portNum,
3445  FwOpcodeType opCode,
3446  U32 cmdSeq,
3447  const Fw::CmdResponse& response
3448  )
3449  {
3450  FW_ASSERT(callComp);
3451  CommandDispatcherComponentBase* compPtr = static_cast<CommandDispatcherComponentBase*>(callComp);
3452  compPtr->compCmdStat_handlerBase(
3453  portNum,
3454  opCode,
3455  cmdSeq,
3456  response
3457  );
3458  }
3459 
3460  void CommandDispatcherComponentBase ::
3461  m_p_pingIn_in(
3462  Fw::PassiveComponentBase* callComp,
3463  FwIndexType portNum,
3464  U32 key
3465  )
3466  {
3467  FW_ASSERT(callComp);
3468  CommandDispatcherComponentBase* compPtr = static_cast<CommandDispatcherComponentBase*>(callComp);
3469  compPtr->pingIn_handlerBase(
3470  portNum,
3471  key
3472  );
3473  }
3474 
3475  void CommandDispatcherComponentBase ::
3476  m_p_run_in(
3477  Fw::PassiveComponentBase* callComp,
3478  FwIndexType portNum,
3479  U32 context
3480  )
3481  {
3482  FW_ASSERT(callComp);
3483  CommandDispatcherComponentBase* compPtr = static_cast<CommandDispatcherComponentBase*>(callComp);
3484  compPtr->run_handlerBase(
3485  portNum,
3486  context
3487  );
3488  }
3489 
3490  void CommandDispatcherComponentBase ::
3491  m_p_seqCmdBuff_in(
3492  Fw::PassiveComponentBase* callComp,
3493  FwIndexType portNum,
3494  Fw::ComBuffer& data,
3495  U32 context
3496  )
3497  {
3498  FW_ASSERT(callComp);
3499  CommandDispatcherComponentBase* compPtr = static_cast<CommandDispatcherComponentBase*>(callComp);
3500  compPtr->seqCmdBuff_handlerBase(
3501  portNum,
3502  data,
3503  context
3504  );
3505  }
3506 
3507 }
This log event message returns the TEST_CMD_1 arguments.
Serialization/Deserialization operation was successful.
The size of the serial representation.
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:134
void set_seqCmdStatus_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to seqCmdStatus[portNum].
static constexpr FwIndexType getNum_run_InputPorts()
virtual void CMD_NO_OP_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CMD_NO_OP.
Clear command tracking info to recover from components not returning status.
FwIdType FwOpcodeType
The type of a command opcode.
Operation succeeded.
Definition: Os.hpp:26
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
static constexpr FwIndexType getNum_Log_OutputPorts()
void invoke(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args) const
Invoke a port interface.
Definition: CmdPortAc.cpp:163
PlatformSizeType FwSizeType
Svc::InputSchedPort * get_run_InputPort(FwIndexType portNum)
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
Definition: Queue.cpp:71
CommandDispatcherComponentBase(const char *compName="")
Construct CommandDispatcherComponentBase object.
I32 FwEnumStoreType
void regCommands()
Register commands with the Command Dispatcher.
The command dispatcher has successfully received a NO-OP command.
void log_WARNING_HI_CommandDroppedQueueOverflow(FwOpcodeType OpCode, U32 Context)
Status
status returned from the queue send function
Definition: Queue.hpp:30
Fw::InputCmdRegPort * get_compCmdReg_InputPort(FwIndexType portNum)
void CMD_NO_OP_STRING_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void init()
Initialization function.
Definition: SchedPortAc.cpp:56
Deserialization status.
const char * toChar() const
Convert to a C-style char*.
Definition: String.hpp:50
virtual void run_preMsgHook(FwIndexType portNum, U32 context)
Pre-message hook for async input port run.
The size of the serial representations of the port arguments.
Definition: PingPortAc.hpp:36
virtual void unLock()
Unlock the guarded mutex.
void init()
Initialization function.
Definition: CmdPortAc.cpp:56
void unLock()
unlock the mutex and assert success
Definition: Mutex.cpp:41
Fw::InputCmdPort * get_CmdDisp_InputPort(FwIndexType portNum)
void invoke(U32 key) const
Invoke a port interface.
Definition: PingPortAc.cpp:147
The size of the serial representations of the port arguments.
virtual const CHAR * toChar() const =0
Convert to a C-style char*.
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
virtual void compCmdStat_handler(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)=0
Handler for input port compCmdStat.
const Time ZERO_TIME
Definition: Time.cpp:5
Exceeded the number of commands that can be simultaneously executed.
virtual void run_handler(FwIndexType portNum, U32 context)=0
Handler for input port run.
virtual void CMD_NO_OP_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
void log_ACTIVITY_HI_TestCmd1Args(I32 arg1, F32 arg2, U8 arg3) const
void pingOut_out(FwIndexType portNum, U32 key)
Invoke output port pingOut.
void init()
Initialization function.
Definition: TlmPortAc.cpp:144
Enum representing a command response.
static constexpr FwIndexType getNum_CmdDisp_InputPorts()
No time base has been established (Required)
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
virtual void pingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port pingIn.
static constexpr FwIndexType getNum_pingIn_InputPorts()
static constexpr FwIndexType getNum_pingOut_OutputPorts()
bool isConnected_CmdStatus_OutputPort(FwIndexType portNum)
void compCmdSend_out(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Invoke output port compCmdSend.
void log_DIAGNOSTIC_OpCodeReregistered(FwOpcodeType Opcode, I32 port) const
Os::Queue m_queue
queue object for active component
static constexpr FwIndexType getNum_CmdStatus_OutputPorts()
Software diagnostic events.
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_Tlm_OutputPorts()
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:150
void init()
Object initializer.
Definition: ObjBase.cpp:24
void init()
Initialization function.
Definition: ComPortAc.cpp:56
virtual void CMD_TEST_CMD_1_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CMD_TEST_CMD_1.
SerializeStatus
forward declaration for string
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: CmdPortAc.cpp:62
float F32
32-bit floating point
Definition: BasicTypes.h:83
Message will block until space is available.
Definition: Queue.hpp:47
void log_COMMAND_OpCodeCompleted(FwOpcodeType Opcode) const
FwIdType FwEventIdType
The type of an event identifier.
void log_ACTIVITY_HI_NoOpStringReceived(const Fw::StringBase &message) const
void tlmWrite_CommandsDispatched(U32 arg, Fw::Time _tlmTime=Fw::Time())
static constexpr FwIndexType getNum_CmdReg_OutputPorts()
void invoke(FwOpcodeType opCode) const
Invoke a port interface.
void set_CmdReg_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to CmdReg[portNum].
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:26
The size of the serial representations of the port arguments.
Definition: ComPortAc.hpp:37
void init()
Initialization function.
Definition: TimePortAc.cpp:128
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: ComPortAc.cpp:62
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
#define FW_MIN(a, b)
MIN macro.
Definition: BasicTypes.h:92
An activity related to commanding.
void init()
Initialization function.
void set_compCmdSend_OutputPort(FwIndexType portNum, Fw::InputCmdPort *port)
Connect port to compCmdSend[portNum].
void log_WARNING_HI_MalformedCommand(Fw::DeserialStatus Status) const
void init()
Initialization function.
Definition: PingPortAc.cpp:128
void addCallPort(InputCmdPort *callPort)
Register an input port.
Definition: CmdPortAc.cpp:150
void tlmWrite_CommandsDropped(U32 arg, Fw::Time _tlmTime=Fw::Time())
void invoke(Fw::Time &time) const
Invoke a port interface.
Definition: TimePortAc.cpp:147
virtual ~CommandDispatcherComponentBase()
Destroy CommandDispatcherComponentBase object.
Status
Generic OK/ERROR status.
Definition: Os.hpp:25
Fw::InputCmdResponsePort * get_compCmdStat_InputPort(FwIndexType portNum)
Serializable::SizeType getDeserializeSizeLeft() const override
Get remaining deserialization buffer size.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
const char * toChar() const
Convert to a C-style char*.
Definition: ObjectName.hpp:50
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke a port interface.
static constexpr FwIndexType getNum_Time_OutputPorts()
FwIdType FwChanIdType
The type of a telemetry channel identifier.
FwSizeType SizeType
void addCallPort(InputPingPort *callPort)
Register an input port.
Definition: PingPortAc.cpp:134
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
The command dispatcher has successfully received a NO-OP command from GUI with a string.
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
Definition: Queue.cpp:54
virtual void CMD_TEST_CMD_1_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, I32 arg1, F32 arg2, U8 arg3)=0
void log_WARNING_HI_CommandDroppedQueueOverflow_ThrottleClear()
Reset throttle value for CommandDroppedQueueOverflow.
void init()
Initialization function.
Definition: CmdPortAc.cpp:144
virtual void compCmdReg_handler(FwIndexType portNum, FwOpcodeType opCode)=0
Handler for input port compCmdReg.
void resetDeser() override
Reset deserialization pointer to beginning of buffer.
void tlmWrite_CommandErrors(U32 arg, Fw::Time _tlmTime=Fw::Time())
virtual void compCmdStat_preMsgHook(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Pre-message hook for async input port compCmdStat.
A serious but recoverable event.
This log event reports the Command Sequence Buffer port queue has overflowed.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port interface.
Definition: TlmPortAc.cpp:163
static constexpr FwIndexType getNum_compCmdReg_InputPorts()
bool isConnected() const
Definition: PortBase.cpp:38
The size of the serial representations of the port arguments.
Definition: CmdPortAc.hpp:38
void log_WARNING_HI_InvalidCommand(FwOpcodeType Opcode) const
#define PRI_FwIndexType
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:39
void init()
Initialization function.
Definition: LogPortAc.cpp:151
void compCmdStat_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Handler base-class function for input port compCmdStat.
void setPortNum(FwIndexType portNum)
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:53
BlockingType
message type
Definition: Queue.hpp:46
void log_COMMAND_OpCodeError(FwOpcodeType Opcode, Fw::CmdResponse error) const
Command failed to deserialize.
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
Important informational events.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: SchedPortAc.cpp:62
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port interface.
Definition: LogPortAc.cpp:170
void init()
Initialization function.
A message was sent requesting an exit of the loop.
message to exit active component task
void seqCmdStatus_out(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Invoke output port seqCmdStatus.
PlatformIndexType FwIndexType
void run_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port run.
void log_DIAGNOSTIC_OpCodeRegistered(FwOpcodeType Opcode, I32 port, I32 slot) const
Log event OpCodeRegistered.
virtual void CMD_CLEAR_TRACKING_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CMD_CLEAR_TRACKING.
void set_Tlm_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to Tlm[portNum].
void CMD_CLEAR_TRACKING_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
double F64
64-bit floating point (double). Required for compiler-supplied double promotion.
Definition: BasicTypes.h:85
The size of the serial representation.
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:157
void seqCmdBuff_handlerBase(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Handler base-class function for input port seqCmdBuff.
virtual void CMD_NO_OP_STRING_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &arg1)=0
bool isConnected_seqCmdStatus_OutputPort(FwIndexType portNum)
void init()
Initialization function.
virtual void CMD_NO_OP_STRING_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CMD_NO_OP_STRING.
void init()
Initialization function.
Definition: PingPortAc.cpp:56
RateGroupDivider component implementation.
message sent/received okay
Definition: Queue.hpp:31
SerializeStatus deserializeTo(U8 &val, Endianness mode=Endianness::BIG) override
Deserialize an 8-bit unsigned integer value.
virtual void seqCmdBuff_overflowHook(FwIndexType portNum, Fw::ComBuffer &data, U32 context)=0
Overflow hook for async input port seqCmdBuff.
U8 BYTE
byte type
Definition: BasicTypes.h:56
virtual void CMD_CLEAR_TRACKING_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
static constexpr FwIndexType getNum_seqCmdBuff_InputPorts()
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: PingPortAc.cpp:62
Message will return with status when space is unavailable.
Definition: Queue.hpp:48
void CMD_NO_OP_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Implementation of malloc based allocator.
static constexpr FwIndexType getNum_compCmdSend_OutputPorts()
virtual void seqCmdBuff_handler(FwIndexType portNum, Fw::ComBuffer &data, U32 context)=0
Handler for input port seqCmdBuff.
The size of the serial representations of the port arguments.
Definition: SchedPortAc.hpp:36
static constexpr FwIndexType getNum_compCmdStat_InputPorts()
virtual void seqCmdBuff_preMsgHook(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Pre-message hook for async input port seqCmdBuff.
void init()
Initialization function.
Fw::InputComPort * get_seqCmdBuff_InputPort(FwIndexType portNum)
void compCmdReg_handlerBase(FwIndexType portNum, FwOpcodeType opCode)
Handler base-class function for input port compCmdReg.
void set_pingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
static constexpr FwIndexType getNum_seqCmdStatus_OutputPorts()
void log_WARNING_HI_TooManyCommands(FwOpcodeType Opcode) const
bool isConnected_compCmdSend_OutputPort(FwIndexType portNum)
virtual void lock()
Lock the guarded mutex.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
void log_COMMAND_OpCodeDispatched(FwOpcodeType Opcode, I32 port) const
void set_Log_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
void set_CmdStatus_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to CmdStatus[portNum].
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
void lock()
lock the mutex and assert success
Definition: Mutex.cpp:34
SerializeStatus serializeTo(SerialBufferBase &buffer, Endianness mode=Endianness::BIG) const override
Serialize the contents of this object to a buffer.
void CMD_TEST_CMD_1_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)