F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
TlmPacketizerComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title TlmPacketizerComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for TlmPacketizer 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  TLMPACKETIZER_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT,
19  RUN_SCHED,
20  CONFIGURESECTIONGROUPRATE_CONFIGUREGROUPRATE,
21  CONTROLIN_ENABLESECTION,
22  PINGIN_PING,
23  CMD_SET_LEVEL,
24  CMD_SEND_PKT,
25  CMD_ENABLE_SECTION,
26  CMD_ENABLE_GROUP,
27  CMD_FORCE_GROUP,
28  CMD_CONFIGURE_GROUP_RATES,
29  };
30 
31  // Get the max size by constructing a union of the async input, command, and
32  // internal port serialization sizes
33  union BuffUnion {
35  BYTE configureSectionGroupRatePortSize[Svc::InputConfigureGroupRatePort::SERIALIZED_SIZE];
39  };
40 
41  // Define a message buffer class large enough to handle all the
42  // asynchronous inputs to the component
43  class ComponentIpcSerializableBuffer :
45  {
46 
47  public:
48 
49  enum {
50  // Offset into data in buffer: Size of message ID and port number
51  DATA_OFFSET = sizeof(FwEnumStoreType) + sizeof(FwIndexType),
52  // Max data size
53  MAX_DATA_SIZE = sizeof(BuffUnion),
54  // Max message size: Size of message id + size of port + max data size
55  SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
56  };
57 
58  Fw::Serializable::SizeType getCapacity() const {
59  return sizeof(m_buff);
60  }
61 
62  U8* getBuffAddr() {
63  return m_buff;
64  }
65 
66  const U8* getBuffAddr() const {
67  return m_buff;
68  }
69 
70  private:
71  // Should be the max of all the input ports serialized sizes...
72  U8 m_buff[SERIALIZATION_SIZE];
73 
74  };
75  }
76 
77  // ----------------------------------------------------------------------
78  // Component initialization
79  // ----------------------------------------------------------------------
80 
83  FwSizeType queueDepth,
84  FwEnumStoreType instance
85  )
86  {
87  // Initialize base class
89 
90  // Connect input port cmdIn
91  for (
92  FwIndexType port = 0;
93  port < static_cast<FwIndexType>(this->getNum_cmdIn_InputPorts());
94  port++
95  ) {
96  this->m_cmdIn_InputPort[port].init();
97  this->m_cmdIn_InputPort[port].addCallComp(
98  this,
99  m_p_cmdIn_in
100  );
101  this->m_cmdIn_InputPort[port].setPortNum(port);
102 
103 #if FW_OBJECT_NAMES == 1
104  Fw::ObjectName portName;
105  portName.format(
106  "%s_cmdIn_InputPort[%" PRI_FwIndexType "]",
107  this->m_objName.toChar(),
108  port
109  );
110  this->m_cmdIn_InputPort[port].setObjName(portName.toChar());
111 #endif
112  }
113 
114  // Connect input port Run
115  for (
116  FwIndexType port = 0;
117  port < static_cast<FwIndexType>(this->getNum_Run_InputPorts());
118  port++
119  ) {
120  this->m_Run_InputPort[port].init();
121  this->m_Run_InputPort[port].addCallComp(
122  this,
123  m_p_Run_in
124  );
125  this->m_Run_InputPort[port].setPortNum(port);
126 
127 #if FW_OBJECT_NAMES == 1
128  Fw::ObjectName portName;
129  portName.format(
130  "%s_Run_InputPort[%" PRI_FwIndexType "]",
131  this->m_objName.toChar(),
132  port
133  );
134  this->m_Run_InputPort[port].setObjName(portName.toChar());
135 #endif
136  }
137 
138  // Connect input port TlmGet
139  for (
140  FwIndexType port = 0;
141  port < static_cast<FwIndexType>(this->getNum_TlmGet_InputPorts());
142  port++
143  ) {
144  this->m_TlmGet_InputPort[port].init();
145  this->m_TlmGet_InputPort[port].addCallComp(
146  this,
147  m_p_TlmGet_in
148  );
149  this->m_TlmGet_InputPort[port].setPortNum(port);
150 
151 #if FW_OBJECT_NAMES == 1
152  Fw::ObjectName portName;
153  portName.format(
154  "%s_TlmGet_InputPort[%" PRI_FwIndexType "]",
155  this->m_objName.toChar(),
156  port
157  );
158  this->m_TlmGet_InputPort[port].setObjName(portName.toChar());
159 #endif
160  }
161 
162  // Connect input port TlmRecv
163  for (
164  FwIndexType port = 0;
165  port < static_cast<FwIndexType>(this->getNum_TlmRecv_InputPorts());
166  port++
167  ) {
168  this->m_TlmRecv_InputPort[port].init();
169  this->m_TlmRecv_InputPort[port].addCallComp(
170  this,
171  m_p_TlmRecv_in
172  );
173  this->m_TlmRecv_InputPort[port].setPortNum(port);
174 
175 #if FW_OBJECT_NAMES == 1
176  Fw::ObjectName portName;
177  portName.format(
178  "%s_TlmRecv_InputPort[%" PRI_FwIndexType "]",
179  this->m_objName.toChar(),
180  port
181  );
182  this->m_TlmRecv_InputPort[port].setObjName(portName.toChar());
183 #endif
184  }
185 
186  // Connect input port configureSectionGroupRate
187  for (
188  FwIndexType port = 0;
189  port < static_cast<FwIndexType>(this->getNum_configureSectionGroupRate_InputPorts());
190  port++
191  ) {
192  this->m_configureSectionGroupRate_InputPort[port].init();
193  this->m_configureSectionGroupRate_InputPort[port].addCallComp(
194  this,
195  m_p_configureSectionGroupRate_in
196  );
197  this->m_configureSectionGroupRate_InputPort[port].setPortNum(port);
198 
199 #if FW_OBJECT_NAMES == 1
200  Fw::ObjectName portName;
201  portName.format(
202  "%s_configureSectionGroupRate_InputPort[%" PRI_FwIndexType "]",
203  this->m_objName.toChar(),
204  port
205  );
206  this->m_configureSectionGroupRate_InputPort[port].setObjName(portName.toChar());
207 #endif
208  }
209 
210  // Connect input port controlIn
211  for (
212  FwIndexType port = 0;
213  port < static_cast<FwIndexType>(this->getNum_controlIn_InputPorts());
214  port++
215  ) {
216  this->m_controlIn_InputPort[port].init();
217  this->m_controlIn_InputPort[port].addCallComp(
218  this,
219  m_p_controlIn_in
220  );
221  this->m_controlIn_InputPort[port].setPortNum(port);
222 
223 #if FW_OBJECT_NAMES == 1
224  Fw::ObjectName portName;
225  portName.format(
226  "%s_controlIn_InputPort[%" PRI_FwIndexType "]",
227  this->m_objName.toChar(),
228  port
229  );
230  this->m_controlIn_InputPort[port].setObjName(portName.toChar());
231 #endif
232  }
233 
234  // Connect input port pingIn
235  for (
236  FwIndexType port = 0;
237  port < static_cast<FwIndexType>(this->getNum_pingIn_InputPorts());
238  port++
239  ) {
240  this->m_pingIn_InputPort[port].init();
241  this->m_pingIn_InputPort[port].addCallComp(
242  this,
243  m_p_pingIn_in
244  );
245  this->m_pingIn_InputPort[port].setPortNum(port);
246 
247 #if FW_OBJECT_NAMES == 1
248  Fw::ObjectName portName;
249  portName.format(
250  "%s_pingIn_InputPort[%" PRI_FwIndexType "]",
251  this->m_objName.toChar(),
252  port
253  );
254  this->m_pingIn_InputPort[port].setObjName(portName.toChar());
255 #endif
256  }
257 
258  // Connect output port cmdRegOut
259  for (
260  FwIndexType port = 0;
261  port < static_cast<FwIndexType>(this->getNum_cmdRegOut_OutputPorts());
262  port++
263  ) {
264  this->m_cmdRegOut_OutputPort[port].init();
265 
266 #if FW_OBJECT_NAMES == 1
267  Fw::ObjectName portName;
268  portName.format(
269  "%s_cmdRegOut_OutputPort[%" PRI_FwIndexType "]",
270  this->m_objName.toChar(),
271  port
272  );
273  this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar());
274 #endif
275  }
276 
277  // Connect output port cmdResponseOut
278  for (
279  FwIndexType port = 0;
280  port < static_cast<FwIndexType>(this->getNum_cmdResponseOut_OutputPorts());
281  port++
282  ) {
283  this->m_cmdResponseOut_OutputPort[port].init();
284 
285 #if FW_OBJECT_NAMES == 1
286  Fw::ObjectName portName;
287  portName.format(
288  "%s_cmdResponseOut_OutputPort[%" PRI_FwIndexType "]",
289  this->m_objName.toChar(),
290  port
291  );
292  this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar());
293 #endif
294  }
295 
296  // Connect output port eventOut
297  for (
298  FwIndexType port = 0;
299  port < static_cast<FwIndexType>(this->getNum_eventOut_OutputPorts());
300  port++
301  ) {
302  this->m_eventOut_OutputPort[port].init();
303 
304 #if FW_OBJECT_NAMES == 1
305  Fw::ObjectName portName;
306  portName.format(
307  "%s_eventOut_OutputPort[%" PRI_FwIndexType "]",
308  this->m_objName.toChar(),
309  port
310  );
311  this->m_eventOut_OutputPort[port].setObjName(portName.toChar());
312 #endif
313  }
314 
315 #if FW_ENABLE_TEXT_LOGGING == 1
316  // Connect output port textEventOut
317  for (
318  FwIndexType port = 0;
319  port < static_cast<FwIndexType>(this->getNum_textEventOut_OutputPorts());
320  port++
321  ) {
322  this->m_textEventOut_OutputPort[port].init();
323 
324 #if FW_OBJECT_NAMES == 1
325  Fw::ObjectName portName;
326  portName.format(
327  "%s_textEventOut_OutputPort[%" PRI_FwIndexType "]",
328  this->m_objName.toChar(),
329  port
330  );
331  this->m_textEventOut_OutputPort[port].setObjName(portName.toChar());
332 #endif
333  }
334 #endif
335 
336  // Connect output port timeGetOut
337  for (
338  FwIndexType port = 0;
339  port < static_cast<FwIndexType>(this->getNum_timeGetOut_OutputPorts());
340  port++
341  ) {
342  this->m_timeGetOut_OutputPort[port].init();
343 
344 #if FW_OBJECT_NAMES == 1
345  Fw::ObjectName portName;
346  portName.format(
347  "%s_timeGetOut_OutputPort[%" PRI_FwIndexType "]",
348  this->m_objName.toChar(),
349  port
350  );
351  this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar());
352 #endif
353  }
354 
355  // Connect output port tlmOut
356  for (
357  FwIndexType port = 0;
358  port < static_cast<FwIndexType>(this->getNum_tlmOut_OutputPorts());
359  port++
360  ) {
361  this->m_tlmOut_OutputPort[port].init();
362 
363 #if FW_OBJECT_NAMES == 1
364  Fw::ObjectName portName;
365  portName.format(
366  "%s_tlmOut_OutputPort[%" PRI_FwIndexType "]",
367  this->m_objName.toChar(),
368  port
369  );
370  this->m_tlmOut_OutputPort[port].setObjName(portName.toChar());
371 #endif
372  }
373 
374  // Connect output port PktSend
375  for (
376  FwIndexType port = 0;
377  port < static_cast<FwIndexType>(this->getNum_PktSend_OutputPorts());
378  port++
379  ) {
380  this->m_PktSend_OutputPort[port].init();
381 
382 #if FW_OBJECT_NAMES == 1
383  Fw::ObjectName portName;
384  portName.format(
385  "%s_PktSend_OutputPort[%" PRI_FwIndexType "]",
386  this->m_objName.toChar(),
387  port
388  );
389  this->m_PktSend_OutputPort[port].setObjName(portName.toChar());
390 #endif
391  }
392 
393  // Connect output port pingOut
394  for (
395  FwIndexType port = 0;
396  port < static_cast<FwIndexType>(this->getNum_pingOut_OutputPorts());
397  port++
398  ) {
399  this->m_pingOut_OutputPort[port].init();
400 
401 #if FW_OBJECT_NAMES == 1
402  Fw::ObjectName portName;
403  portName.format(
404  "%s_pingOut_OutputPort[%" PRI_FwIndexType "]",
405  this->m_objName.toChar(),
406  port
407  );
408  this->m_pingOut_OutputPort[port].setObjName(portName.toChar());
409 #endif
410  }
411 
412  // Create the queue
413  Os::Queue::Status qStat = this->createQueue(
414  queueDepth,
415  static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
416  );
417  FW_ASSERT(
418  Os::Queue::Status::OP_OK == qStat,
419  static_cast<FwAssertArgType>(qStat)
420  );
421  }
422 
423  // ----------------------------------------------------------------------
424  // Getters for special input ports
425  // ----------------------------------------------------------------------
426 
429  {
430  FW_ASSERT(
431  (0 <= portNum) && (portNum < this->getNum_cmdIn_InputPorts()),
432  static_cast<FwAssertArgType>(portNum)
433  );
434 
435  return &this->m_cmdIn_InputPort[portNum];
436  }
437 
438  // ----------------------------------------------------------------------
439  // Getters for typed input ports
440  // ----------------------------------------------------------------------
441 
444  {
445  FW_ASSERT(
446  (0 <= portNum) && (portNum < this->getNum_Run_InputPorts()),
447  static_cast<FwAssertArgType>(portNum)
448  );
449 
450  return &this->m_Run_InputPort[portNum];
451  }
452 
455  {
456  FW_ASSERT(
457  (0 <= portNum) && (portNum < this->getNum_TlmGet_InputPorts()),
458  static_cast<FwAssertArgType>(portNum)
459  );
460 
461  return &this->m_TlmGet_InputPort[portNum];
462  }
463 
466  {
467  FW_ASSERT(
468  (0 <= portNum) && (portNum < this->getNum_TlmRecv_InputPorts()),
469  static_cast<FwAssertArgType>(portNum)
470  );
471 
472  return &this->m_TlmRecv_InputPort[portNum];
473  }
474 
477  {
478  FW_ASSERT(
479  (0 <= portNum) && (portNum < this->getNum_configureSectionGroupRate_InputPorts()),
480  static_cast<FwAssertArgType>(portNum)
481  );
482 
483  return &this->m_configureSectionGroupRate_InputPort[portNum];
484  }
485 
488  {
489  FW_ASSERT(
490  (0 <= portNum) && (portNum < this->getNum_controlIn_InputPorts()),
491  static_cast<FwAssertArgType>(portNum)
492  );
493 
494  return &this->m_controlIn_InputPort[portNum];
495  }
496 
499  {
500  FW_ASSERT(
501  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
502  static_cast<FwAssertArgType>(portNum)
503  );
504 
505  return &this->m_pingIn_InputPort[portNum];
506  }
507 
508  // ----------------------------------------------------------------------
509  // Connect input ports to special output ports
510  // ----------------------------------------------------------------------
511 
514  FwIndexType portNum,
515  Fw::InputCmdRegPort* port
516  )
517  {
518  FW_ASSERT(
519  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
520  static_cast<FwAssertArgType>(portNum)
521  );
522 
523  this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
524  }
525 
528  FwIndexType portNum,
530  )
531  {
532  FW_ASSERT(
533  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
534  static_cast<FwAssertArgType>(portNum)
535  );
536 
537  this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
538  }
539 
542  FwIndexType portNum,
543  Fw::InputLogPort* port
544  )
545  {
546  FW_ASSERT(
547  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
548  static_cast<FwAssertArgType>(portNum)
549  );
550 
551  this->m_eventOut_OutputPort[portNum].addCallPort(port);
552  }
553 
554 #if FW_ENABLE_TEXT_LOGGING == 1
555 
556  void TlmPacketizerComponentBase ::
557  set_textEventOut_OutputPort(
558  FwIndexType portNum,
560  )
561  {
562  FW_ASSERT(
563  (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
564  static_cast<FwAssertArgType>(portNum)
565  );
566 
567  this->m_textEventOut_OutputPort[portNum].addCallPort(port);
568  }
569 
570 #endif
571 
574  FwIndexType portNum,
575  Fw::InputTimePort* port
576  )
577  {
578  FW_ASSERT(
579  (0 <= portNum) && (portNum < this->getNum_timeGetOut_OutputPorts()),
580  static_cast<FwAssertArgType>(portNum)
581  );
582 
583  this->m_timeGetOut_OutputPort[portNum].addCallPort(port);
584  }
585 
588  FwIndexType portNum,
589  Fw::InputTlmPort* port
590  )
591  {
592  FW_ASSERT(
593  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
594  static_cast<FwAssertArgType>(portNum)
595  );
596 
597  this->m_tlmOut_OutputPort[portNum].addCallPort(port);
598  }
599 
600  // ----------------------------------------------------------------------
601  // Connect typed input ports to typed output ports
602  // ----------------------------------------------------------------------
603 
606  FwIndexType portNum,
607  Fw::InputComPort* port
608  )
609  {
610  FW_ASSERT(
611  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
612  static_cast<FwAssertArgType>(portNum)
613  );
614 
615  this->m_PktSend_OutputPort[portNum].addCallPort(port);
616  }
617 
620  FwIndexType portNum,
621  Svc::InputPingPort* port
622  )
623  {
624  FW_ASSERT(
625  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
626  static_cast<FwAssertArgType>(portNum)
627  );
628 
629  this->m_pingOut_OutputPort[portNum].addCallPort(port);
630  }
631 
632 #if FW_PORT_SERIALIZATION
633 
634  // ----------------------------------------------------------------------
635  // Connect serial input ports to special output ports
636  // ----------------------------------------------------------------------
637 
640  FwIndexType portNum,
641  Fw::InputSerializePort* port
642  )
643  {
644  FW_ASSERT(
645  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
646  static_cast<FwAssertArgType>(portNum)
647  );
648 
649  this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
650  }
651 
654  FwIndexType portNum,
655  Fw::InputSerializePort* port
656  )
657  {
658  FW_ASSERT(
659  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
660  static_cast<FwAssertArgType>(portNum)
661  );
662 
663  this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
664  }
665 
668  FwIndexType portNum,
669  Fw::InputSerializePort* port
670  )
671  {
672  FW_ASSERT(
673  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
674  static_cast<FwAssertArgType>(portNum)
675  );
676 
677  this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
678  }
679 
680 #if FW_ENABLE_TEXT_LOGGING == 1
681 
682  void TlmPacketizerComponentBase ::
683  set_textEventOut_OutputPort(
684  FwIndexType portNum,
685  Fw::InputSerializePort* port
686  )
687  {
688  FW_ASSERT(
689  (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
690  static_cast<FwAssertArgType>(portNum)
691  );
692 
693  this->m_textEventOut_OutputPort[portNum].registerSerialPort(port);
694  }
695 
696 #endif
697 
700  FwIndexType portNum,
701  Fw::InputSerializePort* port
702  )
703  {
704  FW_ASSERT(
705  (0 <= portNum) && (portNum < this->getNum_timeGetOut_OutputPorts()),
706  static_cast<FwAssertArgType>(portNum)
707  );
708 
709  this->m_timeGetOut_OutputPort[portNum].registerSerialPort(port);
710  }
711 
714  FwIndexType portNum,
715  Fw::InputSerializePort* port
716  )
717  {
718  FW_ASSERT(
719  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
720  static_cast<FwAssertArgType>(portNum)
721  );
722 
723  this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
724  }
725 
726 #endif
727 
728 #if FW_PORT_SERIALIZATION
729 
730  // ----------------------------------------------------------------------
731  // Connect serial input ports to typed output ports
732  // ----------------------------------------------------------------------
733 
736  FwIndexType portNum,
737  Fw::InputSerializePort* port
738  )
739  {
740  FW_ASSERT(
741  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
742  static_cast<FwAssertArgType>(portNum)
743  );
744 
745  this->m_PktSend_OutputPort[portNum].registerSerialPort(port);
746  }
747 
750  FwIndexType portNum,
751  Fw::InputSerializePort* port
752  )
753  {
754  FW_ASSERT(
755  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
756  static_cast<FwAssertArgType>(portNum)
757  );
758 
759  this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
760  }
761 
762 #endif
763 
764  // ----------------------------------------------------------------------
765  // Command registration
766  // ----------------------------------------------------------------------
767 
770  {
771  FW_ASSERT(this->m_cmdRegOut_OutputPort[0].isConnected());
772 
773  this->m_cmdRegOut_OutputPort[0].invoke(
774  this->getIdBase() + OPCODE_SET_LEVEL
775  );
776 
777  this->m_cmdRegOut_OutputPort[0].invoke(
778  this->getIdBase() + OPCODE_SEND_PKT
779  );
780 
781  this->m_cmdRegOut_OutputPort[0].invoke(
783  );
784 
785  this->m_cmdRegOut_OutputPort[0].invoke(
787  );
788 
789  this->m_cmdRegOut_OutputPort[0].invoke(
790  this->getIdBase() + OPCODE_FORCE_GROUP
791  );
792 
793  this->m_cmdRegOut_OutputPort[0].invoke(
795  );
796  }
797 
798  // ----------------------------------------------------------------------
799  // Component construction and destruction
800  // ----------------------------------------------------------------------
801 
803  TlmPacketizerComponentBase(const char* compName) :
804  Fw::ActiveComponentBase(compName)
805  {
806 
807  }
808 
811  {
812 
813  }
814 
815  // ----------------------------------------------------------------------
816  // Connection status queries for special output ports
817  // ----------------------------------------------------------------------
818 
821  {
822  FW_ASSERT(
823  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
824  static_cast<FwAssertArgType>(portNum)
825  );
826 
827  return this->m_cmdRegOut_OutputPort[portNum].isConnected();
828  }
829 
832  {
833  FW_ASSERT(
834  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
835  static_cast<FwAssertArgType>(portNum)
836  );
837 
838  return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
839  }
840 
843  {
844  FW_ASSERT(
845  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
846  static_cast<FwAssertArgType>(portNum)
847  );
848 
849  return this->m_eventOut_OutputPort[portNum].isConnected();
850  }
851 
852 #if FW_ENABLE_TEXT_LOGGING == 1
853 
854  bool TlmPacketizerComponentBase ::
855  isConnected_textEventOut_OutputPort(FwIndexType portNum)
856  {
857  FW_ASSERT(
858  (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
859  static_cast<FwAssertArgType>(portNum)
860  );
861 
862  return this->m_textEventOut_OutputPort[portNum].isConnected();
863  }
864 
865 #endif
866 
869  {
870  FW_ASSERT(
871  (0 <= portNum) && (portNum < this->getNum_timeGetOut_OutputPorts()),
872  static_cast<FwAssertArgType>(portNum)
873  );
874 
875  return this->m_timeGetOut_OutputPort[portNum].isConnected();
876  }
877 
880  {
881  FW_ASSERT(
882  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
883  static_cast<FwAssertArgType>(portNum)
884  );
885 
886  return this->m_tlmOut_OutputPort[portNum].isConnected();
887  }
888 
889  // ----------------------------------------------------------------------
890  // Connection status queries for typed output ports
891  // ----------------------------------------------------------------------
892 
895  {
896  FW_ASSERT(
897  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
898  static_cast<FwAssertArgType>(portNum)
899  );
900 
901  return this->m_PktSend_OutputPort[portNum].isConnected();
902  }
903 
906  {
907  FW_ASSERT(
908  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
909  static_cast<FwAssertArgType>(portNum)
910  );
911 
912  return this->m_pingOut_OutputPort[portNum].isConnected();
913  }
914 
915  // ----------------------------------------------------------------------
916  // Port handler base-class functions for typed input ports
917  //
918  // Call these functions directly to bypass the corresponding ports
919  // ----------------------------------------------------------------------
920 
923  FwIndexType portNum,
924  U32 context
925  )
926  {
927  // Make sure port number is valid
928  FW_ASSERT(
929  (0 <= portNum) && (portNum < this->getNum_Run_InputPorts()),
930  static_cast<FwAssertArgType>(portNum)
931  );
932 
933  // Call pre-message hook
935  portNum,
936  context
937  );
938  ComponentIpcSerializableBuffer msg;
940 
941  // Serialize message ID
942  _status = msg.serializeFrom(
943  static_cast<FwEnumStoreType>(RUN_SCHED)
944  );
945  FW_ASSERT(
946  _status == Fw::FW_SERIALIZE_OK,
947  static_cast<FwAssertArgType>(_status)
948  );
949 
950  // Serialize port number
951  _status = msg.serializeFrom(portNum);
952  FW_ASSERT(
953  _status == Fw::FW_SERIALIZE_OK,
954  static_cast<FwAssertArgType>(_status)
955  );
956 
957  // Serialize argument context
958  _status = msg.serializeFrom(context);
959  FW_ASSERT(
960  _status == Fw::FW_SERIALIZE_OK,
961  static_cast<FwAssertArgType>(_status)
962  );
963 
964  // Send message
966  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
967 
968  FW_ASSERT(
969  qStatus == Os::Queue::OP_OK,
970  static_cast<FwAssertArgType>(qStatus)
971  );
972  }
973 
976  FwIndexType portNum,
977  FwChanIdType id,
978  Fw::Time& timeTag,
979  Fw::TlmBuffer& val
980  )
981  {
982  // Make sure port number is valid
983  FW_ASSERT(
984  (0 <= portNum) && (portNum < this->getNum_TlmGet_InputPorts()),
985  static_cast<FwAssertArgType>(portNum)
986  );
987 
988  Fw::TlmValid retVal;
989 
990  // Call handler function
991  retVal = this->TlmGet_handler(
992  portNum,
993  id,
994  timeTag,
995  val
996  );
997 
998  return retVal;
999  }
1000 
1003  FwIndexType portNum,
1004  FwChanIdType id,
1005  Fw::Time& timeTag,
1006  Fw::TlmBuffer& val
1007  )
1008  {
1009  // Make sure port number is valid
1010  FW_ASSERT(
1011  (0 <= portNum) && (portNum < this->getNum_TlmRecv_InputPorts()),
1012  static_cast<FwAssertArgType>(portNum)
1013  );
1014 
1015  // Call handler function
1016  this->TlmRecv_handler(
1017  portNum,
1018  id,
1019  timeTag,
1020  val
1021  );
1022  }
1023 
1026  FwIndexType portNum,
1027  const Svc::TelemetrySection& section,
1028  FwChanIdType tlmGroup,
1029  const Svc::RateLogic& rateLogic,
1030  U32 minDelta,
1031  U32 maxDelta
1032  )
1033  {
1034  // Make sure port number is valid
1035  FW_ASSERT(
1036  (0 <= portNum) && (portNum < this->getNum_configureSectionGroupRate_InputPorts()),
1037  static_cast<FwAssertArgType>(portNum)
1038  );
1039 
1040  // Call pre-message hook
1042  portNum,
1043  section,
1044  tlmGroup,
1045  rateLogic,
1046  minDelta,
1047  maxDelta
1048  );
1049  ComponentIpcSerializableBuffer msg;
1051 
1052  // Serialize message ID
1053  _status = msg.serializeFrom(
1054  static_cast<FwEnumStoreType>(CONFIGURESECTIONGROUPRATE_CONFIGUREGROUPRATE)
1055  );
1056  FW_ASSERT(
1057  _status == Fw::FW_SERIALIZE_OK,
1058  static_cast<FwAssertArgType>(_status)
1059  );
1060 
1061  // Serialize port number
1062  _status = msg.serializeFrom(portNum);
1063  FW_ASSERT(
1064  _status == Fw::FW_SERIALIZE_OK,
1065  static_cast<FwAssertArgType>(_status)
1066  );
1067 
1068  // Serialize argument section
1069  _status = msg.serializeFrom(section);
1070  FW_ASSERT(
1071  _status == Fw::FW_SERIALIZE_OK,
1072  static_cast<FwAssertArgType>(_status)
1073  );
1074 
1075  // Serialize argument tlmGroup
1076  _status = msg.serializeFrom(tlmGroup);
1077  FW_ASSERT(
1078  _status == Fw::FW_SERIALIZE_OK,
1079  static_cast<FwAssertArgType>(_status)
1080  );
1081 
1082  // Serialize argument rateLogic
1083  _status = msg.serializeFrom(rateLogic);
1084  FW_ASSERT(
1085  _status == Fw::FW_SERIALIZE_OK,
1086  static_cast<FwAssertArgType>(_status)
1087  );
1088 
1089  // Serialize argument minDelta
1090  _status = msg.serializeFrom(minDelta);
1091  FW_ASSERT(
1092  _status == Fw::FW_SERIALIZE_OK,
1093  static_cast<FwAssertArgType>(_status)
1094  );
1095 
1096  // Serialize argument maxDelta
1097  _status = msg.serializeFrom(maxDelta);
1098  FW_ASSERT(
1099  _status == Fw::FW_SERIALIZE_OK,
1100  static_cast<FwAssertArgType>(_status)
1101  );
1102 
1103  // Send message
1105  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1106 
1107  FW_ASSERT(
1108  qStatus == Os::Queue::OP_OK,
1109  static_cast<FwAssertArgType>(qStatus)
1110  );
1111  }
1112 
1115  FwIndexType portNum,
1116  const Svc::TelemetrySection& section,
1117  const Fw::Enabled& enabled
1118  )
1119  {
1120  // Make sure port number is valid
1121  FW_ASSERT(
1122  (0 <= portNum) && (portNum < this->getNum_controlIn_InputPorts()),
1123  static_cast<FwAssertArgType>(portNum)
1124  );
1125 
1126  // Call pre-message hook
1128  portNum,
1129  section,
1130  enabled
1131  );
1132  ComponentIpcSerializableBuffer msg;
1134 
1135  // Serialize message ID
1136  _status = msg.serializeFrom(
1137  static_cast<FwEnumStoreType>(CONTROLIN_ENABLESECTION)
1138  );
1139  FW_ASSERT(
1140  _status == Fw::FW_SERIALIZE_OK,
1141  static_cast<FwAssertArgType>(_status)
1142  );
1143 
1144  // Serialize port number
1145  _status = msg.serializeFrom(portNum);
1146  FW_ASSERT(
1147  _status == Fw::FW_SERIALIZE_OK,
1148  static_cast<FwAssertArgType>(_status)
1149  );
1150 
1151  // Serialize argument section
1152  _status = msg.serializeFrom(section);
1153  FW_ASSERT(
1154  _status == Fw::FW_SERIALIZE_OK,
1155  static_cast<FwAssertArgType>(_status)
1156  );
1157 
1158  // Serialize argument enabled
1159  _status = msg.serializeFrom(enabled);
1160  FW_ASSERT(
1161  _status == Fw::FW_SERIALIZE_OK,
1162  static_cast<FwAssertArgType>(_status)
1163  );
1164 
1165  // Send message
1167  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1168 
1169  FW_ASSERT(
1170  qStatus == Os::Queue::OP_OK,
1171  static_cast<FwAssertArgType>(qStatus)
1172  );
1173  }
1174 
1177  FwIndexType portNum,
1178  U32 key
1179  )
1180  {
1181  // Make sure port number is valid
1182  FW_ASSERT(
1183  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
1184  static_cast<FwAssertArgType>(portNum)
1185  );
1186 
1187  // Call pre-message hook
1189  portNum,
1190  key
1191  );
1192  ComponentIpcSerializableBuffer msg;
1194 
1195  // Serialize message ID
1196  _status = msg.serializeFrom(
1197  static_cast<FwEnumStoreType>(PINGIN_PING)
1198  );
1199  FW_ASSERT(
1200  _status == Fw::FW_SERIALIZE_OK,
1201  static_cast<FwAssertArgType>(_status)
1202  );
1203 
1204  // Serialize port number
1205  _status = msg.serializeFrom(portNum);
1206  FW_ASSERT(
1207  _status == Fw::FW_SERIALIZE_OK,
1208  static_cast<FwAssertArgType>(_status)
1209  );
1210 
1211  // Serialize argument key
1212  _status = msg.serializeFrom(key);
1213  FW_ASSERT(
1214  _status == Fw::FW_SERIALIZE_OK,
1215  static_cast<FwAssertArgType>(_status)
1216  );
1217 
1218  // Send message
1220  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1221 
1222  FW_ASSERT(
1223  qStatus == Os::Queue::OP_OK,
1224  static_cast<FwAssertArgType>(qStatus)
1225  );
1226  }
1227 
1228  // ----------------------------------------------------------------------
1229  // Pre-message hooks for typed async input ports
1230  //
1231  // Each of these functions is invoked just before processing a message
1232  // on the corresponding port. By default, they do nothing. You can
1233  // override them to provide specific pre-message behavior.
1234  // ----------------------------------------------------------------------
1235 
1238  FwIndexType portNum,
1239  U32 context
1240  )
1241  {
1242  // Default: no-op
1243  }
1244 
1247  FwIndexType portNum,
1248  const Svc::TelemetrySection& section,
1249  FwChanIdType tlmGroup,
1250  const Svc::RateLogic& rateLogic,
1251  U32 minDelta,
1252  U32 maxDelta
1253  )
1254  {
1255  // Default: no-op
1256  }
1257 
1260  FwIndexType portNum,
1261  const Svc::TelemetrySection& section,
1262  const Fw::Enabled& enabled
1263  )
1264  {
1265  // Default: no-op
1266  }
1267 
1270  FwIndexType portNum,
1271  U32 key
1272  )
1273  {
1274  // Default: no-op
1275  }
1276 
1277  // ----------------------------------------------------------------------
1278  // Invocation functions for typed output ports
1279  // ----------------------------------------------------------------------
1280 
1283  FwIndexType portNum,
1284  Fw::ComBuffer& data,
1285  U32 context
1286  )
1287  {
1288  FW_ASSERT(
1289  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
1290  static_cast<FwAssertArgType>(portNum)
1291  );
1292 
1293  FW_ASSERT(
1294  this->m_PktSend_OutputPort[portNum].isConnected(),
1295  static_cast<FwAssertArgType>(portNum)
1296  );
1297  this->m_PktSend_OutputPort[portNum].invoke(
1298  data,
1299  context
1300  );
1301  }
1302 
1305  FwIndexType portNum,
1306  U32 key
1307  )
1308  {
1309  FW_ASSERT(
1310  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
1311  static_cast<FwAssertArgType>(portNum)
1312  );
1313 
1314  FW_ASSERT(
1315  this->m_pingOut_OutputPort[portNum].isConnected(),
1316  static_cast<FwAssertArgType>(portNum)
1317  );
1318  this->m_pingOut_OutputPort[portNum].invoke(
1319  key
1320  );
1321  }
1322 
1323  // ----------------------------------------------------------------------
1324  // Command response
1325  // ----------------------------------------------------------------------
1326 
1329  FwOpcodeType opCode,
1330  U32 cmdSeq,
1331  Fw::CmdResponse response
1332  )
1333  {
1334  FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
1335  this->m_cmdResponseOut_OutputPort[0].invoke(opCode, cmdSeq, response);
1336  }
1337 
1338  // ----------------------------------------------------------------------
1339  // Command handler base-class functions
1340  //
1341  // Call these functions directly to bypass the command input port
1342  // ----------------------------------------------------------------------
1343 
1346  FwOpcodeType opCode,
1347  U32 cmdSeq,
1348  Fw::CmdArgBuffer& args
1349  )
1350  {
1351  // Call pre-message hook
1352  this->SET_LEVEL_preMsgHook(opCode,cmdSeq);
1353 
1354  // Defer deserializing arguments to the message dispatcher
1355  // to avoid deserializing and reserializing just for IPC
1356  ComponentIpcSerializableBuffer msg;
1358 
1359  // Serialize for IPC
1360  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_SET_LEVEL));
1361  FW_ASSERT (
1362  _status == Fw::FW_SERIALIZE_OK,
1363  static_cast<FwAssertArgType>(_status)
1364  );
1365 
1366  // Fake port number to make message dequeue work
1367  FwIndexType port = 0;
1368 
1369  _status = msg.serializeFrom(port);
1370  FW_ASSERT (
1371  _status == Fw::FW_SERIALIZE_OK,
1372  static_cast<FwAssertArgType>(_status)
1373  );
1374 
1375  _status = msg.serializeFrom(opCode);
1376  FW_ASSERT (
1377  _status == Fw::FW_SERIALIZE_OK,
1378  static_cast<FwAssertArgType>(_status)
1379  );
1380 
1381  _status = msg.serializeFrom(cmdSeq);
1382  FW_ASSERT (
1383  _status == Fw::FW_SERIALIZE_OK,
1384  static_cast<FwAssertArgType>(_status)
1385  );
1386 
1387  _status = msg.serializeFrom(args);
1388  FW_ASSERT (
1389  _status == Fw::FW_SERIALIZE_OK,
1390  static_cast<FwAssertArgType>(_status)
1391  );
1392 
1393  // Send message
1395  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1396 
1397  FW_ASSERT(
1398  qStatus == Os::Queue::OP_OK,
1399  static_cast<FwAssertArgType>(qStatus)
1400  );
1401  }
1402 
1405  FwOpcodeType opCode,
1406  U32 cmdSeq,
1407  Fw::CmdArgBuffer& args
1408  )
1409  {
1410  // Call pre-message hook
1411  this->SEND_PKT_preMsgHook(opCode,cmdSeq);
1412 
1413  // Defer deserializing arguments to the message dispatcher
1414  // to avoid deserializing and reserializing just for IPC
1415  ComponentIpcSerializableBuffer msg;
1417 
1418  // Serialize for IPC
1419  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_SEND_PKT));
1420  FW_ASSERT (
1421  _status == Fw::FW_SERIALIZE_OK,
1422  static_cast<FwAssertArgType>(_status)
1423  );
1424 
1425  // Fake port number to make message dequeue work
1426  FwIndexType port = 0;
1427 
1428  _status = msg.serializeFrom(port);
1429  FW_ASSERT (
1430  _status == Fw::FW_SERIALIZE_OK,
1431  static_cast<FwAssertArgType>(_status)
1432  );
1433 
1434  _status = msg.serializeFrom(opCode);
1435  FW_ASSERT (
1436  _status == Fw::FW_SERIALIZE_OK,
1437  static_cast<FwAssertArgType>(_status)
1438  );
1439 
1440  _status = msg.serializeFrom(cmdSeq);
1441  FW_ASSERT (
1442  _status == Fw::FW_SERIALIZE_OK,
1443  static_cast<FwAssertArgType>(_status)
1444  );
1445 
1446  _status = msg.serializeFrom(args);
1447  FW_ASSERT (
1448  _status == Fw::FW_SERIALIZE_OK,
1449  static_cast<FwAssertArgType>(_status)
1450  );
1451 
1452  // Send message
1454  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1455 
1456  FW_ASSERT(
1457  qStatus == Os::Queue::OP_OK,
1458  static_cast<FwAssertArgType>(qStatus)
1459  );
1460  }
1461 
1464  FwOpcodeType opCode,
1465  U32 cmdSeq,
1466  Fw::CmdArgBuffer& args
1467  )
1468  {
1469  // Call pre-message hook
1470  this->ENABLE_SECTION_preMsgHook(opCode,cmdSeq);
1471 
1472  // Defer deserializing arguments to the message dispatcher
1473  // to avoid deserializing and reserializing just for IPC
1474  ComponentIpcSerializableBuffer msg;
1476 
1477  // Serialize for IPC
1478  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_ENABLE_SECTION));
1479  FW_ASSERT (
1480  _status == Fw::FW_SERIALIZE_OK,
1481  static_cast<FwAssertArgType>(_status)
1482  );
1483 
1484  // Fake port number to make message dequeue work
1485  FwIndexType port = 0;
1486 
1487  _status = msg.serializeFrom(port);
1488  FW_ASSERT (
1489  _status == Fw::FW_SERIALIZE_OK,
1490  static_cast<FwAssertArgType>(_status)
1491  );
1492 
1493  _status = msg.serializeFrom(opCode);
1494  FW_ASSERT (
1495  _status == Fw::FW_SERIALIZE_OK,
1496  static_cast<FwAssertArgType>(_status)
1497  );
1498 
1499  _status = msg.serializeFrom(cmdSeq);
1500  FW_ASSERT (
1501  _status == Fw::FW_SERIALIZE_OK,
1502  static_cast<FwAssertArgType>(_status)
1503  );
1504 
1505  _status = msg.serializeFrom(args);
1506  FW_ASSERT (
1507  _status == Fw::FW_SERIALIZE_OK,
1508  static_cast<FwAssertArgType>(_status)
1509  );
1510 
1511  // Send message
1513  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1514 
1515  FW_ASSERT(
1516  qStatus == Os::Queue::OP_OK,
1517  static_cast<FwAssertArgType>(qStatus)
1518  );
1519  }
1520 
1523  FwOpcodeType opCode,
1524  U32 cmdSeq,
1525  Fw::CmdArgBuffer& args
1526  )
1527  {
1528  // Call pre-message hook
1529  this->ENABLE_GROUP_preMsgHook(opCode,cmdSeq);
1530 
1531  // Defer deserializing arguments to the message dispatcher
1532  // to avoid deserializing and reserializing just for IPC
1533  ComponentIpcSerializableBuffer msg;
1535 
1536  // Serialize for IPC
1537  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_ENABLE_GROUP));
1538  FW_ASSERT (
1539  _status == Fw::FW_SERIALIZE_OK,
1540  static_cast<FwAssertArgType>(_status)
1541  );
1542 
1543  // Fake port number to make message dequeue work
1544  FwIndexType port = 0;
1545 
1546  _status = msg.serializeFrom(port);
1547  FW_ASSERT (
1548  _status == Fw::FW_SERIALIZE_OK,
1549  static_cast<FwAssertArgType>(_status)
1550  );
1551 
1552  _status = msg.serializeFrom(opCode);
1553  FW_ASSERT (
1554  _status == Fw::FW_SERIALIZE_OK,
1555  static_cast<FwAssertArgType>(_status)
1556  );
1557 
1558  _status = msg.serializeFrom(cmdSeq);
1559  FW_ASSERT (
1560  _status == Fw::FW_SERIALIZE_OK,
1561  static_cast<FwAssertArgType>(_status)
1562  );
1563 
1564  _status = msg.serializeFrom(args);
1565  FW_ASSERT (
1566  _status == Fw::FW_SERIALIZE_OK,
1567  static_cast<FwAssertArgType>(_status)
1568  );
1569 
1570  // Send message
1572  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1573 
1574  FW_ASSERT(
1575  qStatus == Os::Queue::OP_OK,
1576  static_cast<FwAssertArgType>(qStatus)
1577  );
1578  }
1579 
1582  FwOpcodeType opCode,
1583  U32 cmdSeq,
1584  Fw::CmdArgBuffer& args
1585  )
1586  {
1587  // Call pre-message hook
1588  this->FORCE_GROUP_preMsgHook(opCode,cmdSeq);
1589 
1590  // Defer deserializing arguments to the message dispatcher
1591  // to avoid deserializing and reserializing just for IPC
1592  ComponentIpcSerializableBuffer msg;
1594 
1595  // Serialize for IPC
1596  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_FORCE_GROUP));
1597  FW_ASSERT (
1598  _status == Fw::FW_SERIALIZE_OK,
1599  static_cast<FwAssertArgType>(_status)
1600  );
1601 
1602  // Fake port number to make message dequeue work
1603  FwIndexType port = 0;
1604 
1605  _status = msg.serializeFrom(port);
1606  FW_ASSERT (
1607  _status == Fw::FW_SERIALIZE_OK,
1608  static_cast<FwAssertArgType>(_status)
1609  );
1610 
1611  _status = msg.serializeFrom(opCode);
1612  FW_ASSERT (
1613  _status == Fw::FW_SERIALIZE_OK,
1614  static_cast<FwAssertArgType>(_status)
1615  );
1616 
1617  _status = msg.serializeFrom(cmdSeq);
1618  FW_ASSERT (
1619  _status == Fw::FW_SERIALIZE_OK,
1620  static_cast<FwAssertArgType>(_status)
1621  );
1622 
1623  _status = msg.serializeFrom(args);
1624  FW_ASSERT (
1625  _status == Fw::FW_SERIALIZE_OK,
1626  static_cast<FwAssertArgType>(_status)
1627  );
1628 
1629  // Send message
1631  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1632 
1633  FW_ASSERT(
1634  qStatus == Os::Queue::OP_OK,
1635  static_cast<FwAssertArgType>(qStatus)
1636  );
1637  }
1638 
1641  FwOpcodeType opCode,
1642  U32 cmdSeq,
1643  Fw::CmdArgBuffer& args
1644  )
1645  {
1646  // Call pre-message hook
1647  this->CONFIGURE_GROUP_RATES_preMsgHook(opCode,cmdSeq);
1648 
1649  // Defer deserializing arguments to the message dispatcher
1650  // to avoid deserializing and reserializing just for IPC
1651  ComponentIpcSerializableBuffer msg;
1653 
1654  // Serialize for IPC
1655  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CONFIGURE_GROUP_RATES));
1656  FW_ASSERT (
1657  _status == Fw::FW_SERIALIZE_OK,
1658  static_cast<FwAssertArgType>(_status)
1659  );
1660 
1661  // Fake port number to make message dequeue work
1662  FwIndexType port = 0;
1663 
1664  _status = msg.serializeFrom(port);
1665  FW_ASSERT (
1666  _status == Fw::FW_SERIALIZE_OK,
1667  static_cast<FwAssertArgType>(_status)
1668  );
1669 
1670  _status = msg.serializeFrom(opCode);
1671  FW_ASSERT (
1672  _status == Fw::FW_SERIALIZE_OK,
1673  static_cast<FwAssertArgType>(_status)
1674  );
1675 
1676  _status = msg.serializeFrom(cmdSeq);
1677  FW_ASSERT (
1678  _status == Fw::FW_SERIALIZE_OK,
1679  static_cast<FwAssertArgType>(_status)
1680  );
1681 
1682  _status = msg.serializeFrom(args);
1683  FW_ASSERT (
1684  _status == Fw::FW_SERIALIZE_OK,
1685  static_cast<FwAssertArgType>(_status)
1686  );
1687 
1688  // Send message
1690  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1691 
1692  FW_ASSERT(
1693  qStatus == Os::Queue::OP_OK,
1694  static_cast<FwAssertArgType>(qStatus)
1695  );
1696  }
1697 
1698  // ----------------------------------------------------------------------
1699  // Pre-message hooks for async commands
1700  //
1701  // Each of these functions is invoked just before processing the
1702  // corresponding command. By default they do nothing. You can
1703  // override them to provide specific pre-command behavior.
1704  // ----------------------------------------------------------------------
1705 
1708  FwOpcodeType opCode,
1709  U32 cmdSeq
1710  )
1711  {
1712  // Defaults to no-op; can be overridden
1713  (void) opCode;
1714  (void) cmdSeq;
1715  }
1716 
1719  FwOpcodeType opCode,
1720  U32 cmdSeq
1721  )
1722  {
1723  // Defaults to no-op; can be overridden
1724  (void) opCode;
1725  (void) cmdSeq;
1726  }
1727 
1730  FwOpcodeType opCode,
1731  U32 cmdSeq
1732  )
1733  {
1734  // Defaults to no-op; can be overridden
1735  (void) opCode;
1736  (void) cmdSeq;
1737  }
1738 
1741  FwOpcodeType opCode,
1742  U32 cmdSeq
1743  )
1744  {
1745  // Defaults to no-op; can be overridden
1746  (void) opCode;
1747  (void) cmdSeq;
1748  }
1749 
1752  FwOpcodeType opCode,
1753  U32 cmdSeq
1754  )
1755  {
1756  // Defaults to no-op; can be overridden
1757  (void) opCode;
1758  (void) cmdSeq;
1759  }
1760 
1763  FwOpcodeType opCode,
1764  U32 cmdSeq
1765  )
1766  {
1767  // Defaults to no-op; can be overridden
1768  (void) opCode;
1769  (void) cmdSeq;
1770  }
1771 
1772  // ----------------------------------------------------------------------
1773  // Event logging functions
1774  // ----------------------------------------------------------------------
1775 
1778  {
1779  // Get the time
1780  Fw::Time _logTime;
1781  if (this->m_timeGetOut_OutputPort[0].isConnected()) {
1782  this->m_timeGetOut_OutputPort[0].invoke(_logTime);
1783  }
1784 
1785  FwEventIdType _id = static_cast<FwEventIdType>(0);
1786 
1787  _id = this->getIdBase() + EVENTID_NOCHAN;
1788 
1789  // Emit the event on the log port
1790  if (this->m_eventOut_OutputPort[0].isConnected()) {
1791  Fw::LogBuffer _logBuff;
1793 
1794 #if FW_AMPCS_COMPATIBLE
1795  // Serialize the number of arguments
1796  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1797  FW_ASSERT(
1798  _status == Fw::FW_SERIALIZE_OK,
1799  static_cast<FwAssertArgType>(_status)
1800  );
1801 #endif
1802 
1803 #if FW_AMPCS_COMPATIBLE
1804  // Serialize the argument size
1805  _status = _logBuff.serializeFrom(
1806  static_cast<U8>(sizeof(FwChanIdType))
1807  );
1808  FW_ASSERT(
1809  _status == Fw::FW_SERIALIZE_OK,
1810  static_cast<FwAssertArgType>(_status)
1811  );
1812 #endif
1813  _status = _logBuff.serializeFrom(Id);
1814  FW_ASSERT(
1815  _status == Fw::FW_SERIALIZE_OK,
1816  static_cast<FwAssertArgType>(_status)
1817  );
1818 
1819  this->m_eventOut_OutputPort[0].invoke(
1820  _id,
1821  _logTime,
1823  _logBuff
1824  );
1825  }
1826 
1827  // Emit the event on the text log port
1828 #if FW_ENABLE_TEXT_LOGGING
1829  if (this->m_textEventOut_OutputPort[0].isConnected()) {
1830 #if FW_OBJECT_NAMES == 1
1831  const char* _formatString =
1832  "(%s) %s: Telemetry ID 0x%" PRIx32 " not packetized";
1833 #else
1834  const char* _formatString =
1835  "%s: Telemetry ID 0x%" PRIx32 " not packetized";
1836 #endif
1837 
1838  Fw::TextLogString _logString;
1839  _logString.format(
1840  _formatString,
1841 #if FW_OBJECT_NAMES == 1
1842  this->m_objName.toChar(),
1843 #endif
1844  "NoChan ",
1845  Id
1846  );
1847 
1848  this->m_textEventOut_OutputPort[0].invoke(
1849  _id,
1850  _logTime,
1852  _logString
1853  );
1854  }
1855 #endif
1856  }
1857 
1860  {
1861  // Get the time
1862  Fw::Time _logTime;
1863  if (this->m_timeGetOut_OutputPort[0].isConnected()) {
1864  this->m_timeGetOut_OutputPort[0].invoke(_logTime);
1865  }
1866 
1867  FwEventIdType _id = static_cast<FwEventIdType>(0);
1868 
1869  _id = this->getIdBase() + EVENTID_LEVELSET;
1870 
1871  // Emit the event on the log port
1872  if (this->m_eventOut_OutputPort[0].isConnected()) {
1873  Fw::LogBuffer _logBuff;
1875 
1876 #if FW_AMPCS_COMPATIBLE
1877  // Serialize the number of arguments
1878  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1879  FW_ASSERT(
1880  _status == Fw::FW_SERIALIZE_OK,
1881  static_cast<FwAssertArgType>(_status)
1882  );
1883 #endif
1884 
1885 #if FW_AMPCS_COMPATIBLE
1886  // Serialize the argument size
1887  _status = _logBuff.serializeFrom(
1888  static_cast<U8>(sizeof(FwChanIdType))
1889  );
1890  FW_ASSERT(
1891  _status == Fw::FW_SERIALIZE_OK,
1892  static_cast<FwAssertArgType>(_status)
1893  );
1894 #endif
1895  _status = _logBuff.serializeFrom(id);
1896  FW_ASSERT(
1897  _status == Fw::FW_SERIALIZE_OK,
1898  static_cast<FwAssertArgType>(_status)
1899  );
1900 
1901  this->m_eventOut_OutputPort[0].invoke(
1902  _id,
1903  _logTime,
1905  _logBuff
1906  );
1907  }
1908 
1909  // Emit the event on the text log port
1910 #if FW_ENABLE_TEXT_LOGGING
1911  if (this->m_textEventOut_OutputPort[0].isConnected()) {
1912 #if FW_OBJECT_NAMES == 1
1913  const char* _formatString =
1914  "(%s) %s: Telemetry send level to %" PRIu32 "";
1915 #else
1916  const char* _formatString =
1917  "%s: Telemetry send level to %" PRIu32 "";
1918 #endif
1919 
1920  Fw::TextLogString _logString;
1921  _logString.format(
1922  _formatString,
1923 #if FW_OBJECT_NAMES == 1
1924  this->m_objName.toChar(),
1925 #endif
1926  "LevelSet ",
1927  id
1928  );
1929 
1930  this->m_textEventOut_OutputPort[0].invoke(
1931  _id,
1932  _logTime,
1934  _logString
1935  );
1936  }
1937 #endif
1938  }
1939 
1942  FwChanIdType level,
1943  FwChanIdType max
1944  ) const
1945  {
1946  // Get the time
1947  Fw::Time _logTime;
1948  if (this->m_timeGetOut_OutputPort[0].isConnected()) {
1949  this->m_timeGetOut_OutputPort[0].invoke(_logTime);
1950  }
1951 
1952  FwEventIdType _id = static_cast<FwEventIdType>(0);
1953 
1954  _id = this->getIdBase() + EVENTID_MAXLEVELEXCEED;
1955 
1956  // Emit the event on the log port
1957  if (this->m_eventOut_OutputPort[0].isConnected()) {
1958  Fw::LogBuffer _logBuff;
1960 
1961 #if FW_AMPCS_COMPATIBLE
1962  // Serialize the number of arguments
1963  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1964  FW_ASSERT(
1965  _status == Fw::FW_SERIALIZE_OK,
1966  static_cast<FwAssertArgType>(_status)
1967  );
1968 #endif
1969 
1970 #if FW_AMPCS_COMPATIBLE
1971  // Serialize the argument size
1972  _status = _logBuff.serializeFrom(
1973  static_cast<U8>(sizeof(FwChanIdType))
1974  );
1975  FW_ASSERT(
1976  _status == Fw::FW_SERIALIZE_OK,
1977  static_cast<FwAssertArgType>(_status)
1978  );
1979 #endif
1980  _status = _logBuff.serializeFrom(level);
1981  FW_ASSERT(
1982  _status == Fw::FW_SERIALIZE_OK,
1983  static_cast<FwAssertArgType>(_status)
1984  );
1985 
1986 #if FW_AMPCS_COMPATIBLE
1987  // Serialize the argument size
1988  _status = _logBuff.serializeFrom(
1989  static_cast<U8>(sizeof(FwChanIdType))
1990  );
1991  FW_ASSERT(
1992  _status == Fw::FW_SERIALIZE_OK,
1993  static_cast<FwAssertArgType>(_status)
1994  );
1995 #endif
1996  _status = _logBuff.serializeFrom(max);
1997  FW_ASSERT(
1998  _status == Fw::FW_SERIALIZE_OK,
1999  static_cast<FwAssertArgType>(_status)
2000  );
2001 
2002  this->m_eventOut_OutputPort[0].invoke(
2003  _id,
2004  _logTime,
2006  _logBuff
2007  );
2008  }
2009 
2010  // Emit the event on the text log port
2011 #if FW_ENABLE_TEXT_LOGGING
2012  if (this->m_textEventOut_OutputPort[0].isConnected()) {
2013 #if FW_OBJECT_NAMES == 1
2014  const char* _formatString =
2015  "(%s) %s: Requested send level %" PRIu32 " higher than max packet level of %" PRIu32 "";
2016 #else
2017  const char* _formatString =
2018  "%s: Requested send level %" PRIu32 " higher than max packet level of %" PRIu32 "";
2019 #endif
2020 
2021  Fw::TextLogString _logString;
2022  _logString.format(
2023  _formatString,
2024 #if FW_OBJECT_NAMES == 1
2025  this->m_objName.toChar(),
2026 #endif
2027  "MaxLevelExceed ",
2028  level,
2029  max
2030  );
2031 
2032  this->m_textEventOut_OutputPort[0].invoke(
2033  _id,
2034  _logTime,
2036  _logString
2037  );
2038  }
2039 #endif
2040  }
2041 
2044  {
2045  // Get the time
2046  Fw::Time _logTime;
2047  if (this->m_timeGetOut_OutputPort[0].isConnected()) {
2048  this->m_timeGetOut_OutputPort[0].invoke(_logTime);
2049  }
2050 
2051  FwEventIdType _id = static_cast<FwEventIdType>(0);
2052 
2053  _id = this->getIdBase() + EVENTID_PACKETSENT;
2054 
2055  // Emit the event on the log port
2056  if (this->m_eventOut_OutputPort[0].isConnected()) {
2057  Fw::LogBuffer _logBuff;
2059 
2060 #if FW_AMPCS_COMPATIBLE
2061  // Serialize the number of arguments
2062  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2063  FW_ASSERT(
2064  _status == Fw::FW_SERIALIZE_OK,
2065  static_cast<FwAssertArgType>(_status)
2066  );
2067 #endif
2068 
2069 #if FW_AMPCS_COMPATIBLE
2070  // Serialize the argument size
2071  _status = _logBuff.serializeFrom(
2072  static_cast<U8>(sizeof(U32))
2073  );
2074  FW_ASSERT(
2075  _status == Fw::FW_SERIALIZE_OK,
2076  static_cast<FwAssertArgType>(_status)
2077  );
2078 #endif
2079  _status = _logBuff.serializeFrom(id);
2080  FW_ASSERT(
2081  _status == Fw::FW_SERIALIZE_OK,
2082  static_cast<FwAssertArgType>(_status)
2083  );
2084 
2085  this->m_eventOut_OutputPort[0].invoke(
2086  _id,
2087  _logTime,
2089  _logBuff
2090  );
2091  }
2092 
2093  // Emit the event on the text log port
2094 #if FW_ENABLE_TEXT_LOGGING
2095  if (this->m_textEventOut_OutputPort[0].isConnected()) {
2096 #if FW_OBJECT_NAMES == 1
2097  const char* _formatString =
2098  "(%s) %s: Sent packet ID %" PRIu32 "";
2099 #else
2100  const char* _formatString =
2101  "%s: Sent packet ID %" PRIu32 "";
2102 #endif
2103 
2104  Fw::TextLogString _logString;
2105  _logString.format(
2106  _formatString,
2107 #if FW_OBJECT_NAMES == 1
2108  this->m_objName.toChar(),
2109 #endif
2110  "PacketSent ",
2111  id
2112  );
2113 
2114  this->m_textEventOut_OutputPort[0].invoke(
2115  _id,
2116  _logTime,
2118  _logString
2119  );
2120  }
2121 #endif
2122  }
2123 
2126  {
2127  // Get the time
2128  Fw::Time _logTime;
2129  if (this->m_timeGetOut_OutputPort[0].isConnected()) {
2130  this->m_timeGetOut_OutputPort[0].invoke(_logTime);
2131  }
2132 
2133  FwEventIdType _id = static_cast<FwEventIdType>(0);
2134 
2135  _id = this->getIdBase() + EVENTID_PACKETNOTFOUND;
2136 
2137  // Emit the event on the log port
2138  if (this->m_eventOut_OutputPort[0].isConnected()) {
2139  Fw::LogBuffer _logBuff;
2141 
2142 #if FW_AMPCS_COMPATIBLE
2143  // Serialize the number of arguments
2144  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2145  FW_ASSERT(
2146  _status == Fw::FW_SERIALIZE_OK,
2147  static_cast<FwAssertArgType>(_status)
2148  );
2149 #endif
2150 
2151 #if FW_AMPCS_COMPATIBLE
2152  // Serialize the argument size
2153  _status = _logBuff.serializeFrom(
2154  static_cast<U8>(sizeof(U32))
2155  );
2156  FW_ASSERT(
2157  _status == Fw::FW_SERIALIZE_OK,
2158  static_cast<FwAssertArgType>(_status)
2159  );
2160 #endif
2161  _status = _logBuff.serializeFrom(id);
2162  FW_ASSERT(
2163  _status == Fw::FW_SERIALIZE_OK,
2164  static_cast<FwAssertArgType>(_status)
2165  );
2166 
2167  this->m_eventOut_OutputPort[0].invoke(
2168  _id,
2169  _logTime,
2171  _logBuff
2172  );
2173  }
2174 
2175  // Emit the event on the text log port
2176 #if FW_ENABLE_TEXT_LOGGING
2177  if (this->m_textEventOut_OutputPort[0].isConnected()) {
2178 #if FW_OBJECT_NAMES == 1
2179  const char* _formatString =
2180  "(%s) %s: Could not find packet ID %" PRIu32 "";
2181 #else
2182  const char* _formatString =
2183  "%s: Could not find packet ID %" PRIu32 "";
2184 #endif
2185 
2186  Fw::TextLogString _logString;
2187  _logString.format(
2188  _formatString,
2189 #if FW_OBJECT_NAMES == 1
2190  this->m_objName.toChar(),
2191 #endif
2192  "PacketNotFound ",
2193  id
2194  );
2195 
2196  this->m_textEventOut_OutputPort[0].invoke(
2197  _id,
2198  _logTime,
2200  _logString
2201  );
2202  }
2203 #endif
2204  }
2205 
2208  Svc::TelemetrySection section,
2209  Fw::Enabled enable
2210  ) const
2211  {
2212  // Get the time
2213  Fw::Time _logTime;
2214  if (this->m_timeGetOut_OutputPort[0].isConnected()) {
2215  this->m_timeGetOut_OutputPort[0].invoke(_logTime);
2216  }
2217 
2218  FwEventIdType _id = static_cast<FwEventIdType>(0);
2219 
2220  _id = this->getIdBase() + EVENTID_SECTIONUNCONFIGURABLE;
2221 
2222  // Emit the event on the log port
2223  if (this->m_eventOut_OutputPort[0].isConnected()) {
2224  Fw::LogBuffer _logBuff;
2226 
2227 #if FW_AMPCS_COMPATIBLE
2228  // Serialize the number of arguments
2229  _status = _logBuff.serializeFrom(static_cast<U8>(2));
2230  FW_ASSERT(
2231  _status == Fw::FW_SERIALIZE_OK,
2232  static_cast<FwAssertArgType>(_status)
2233  );
2234 #endif
2235 
2236 #if FW_AMPCS_COMPATIBLE
2237  // Serialize the argument size
2238  _status = _logBuff.serializeFrom(
2240  );
2241  FW_ASSERT(
2242  _status == Fw::FW_SERIALIZE_OK,
2243  static_cast<FwAssertArgType>(_status)
2244  );
2245 #endif
2246  _status = _logBuff.serializeFrom(section);
2247  FW_ASSERT(
2248  _status == Fw::FW_SERIALIZE_OK,
2249  static_cast<FwAssertArgType>(_status)
2250  );
2251 
2252 #if FW_AMPCS_COMPATIBLE
2253  // Serialize the argument size
2254  _status = _logBuff.serializeFrom(
2255  static_cast<U8>(Fw::Enabled::SERIALIZED_SIZE)
2256  );
2257  FW_ASSERT(
2258  _status == Fw::FW_SERIALIZE_OK,
2259  static_cast<FwAssertArgType>(_status)
2260  );
2261 #endif
2262  _status = _logBuff.serializeFrom(enable);
2263  FW_ASSERT(
2264  _status == Fw::FW_SERIALIZE_OK,
2265  static_cast<FwAssertArgType>(_status)
2266  );
2267 
2268  this->m_eventOut_OutputPort[0].invoke(
2269  _id,
2270  _logTime,
2272  _logBuff
2273  );
2274  }
2275 
2276  // Emit the event on the text log port
2277 #if FW_ENABLE_TEXT_LOGGING
2278  if (this->m_textEventOut_OutputPort[0].isConnected()) {
2279 #if FW_OBJECT_NAMES == 1
2280  const char* _formatString =
2281  "(%s) %s: Section %s is unconfigurable and cannot be set to %s";
2282 #else
2283  const char* _formatString =
2284  "%s: Section %s is unconfigurable and cannot be set to %s";
2285 #endif
2286 
2287  Fw::String sectionStr;
2288  section.toString(sectionStr);
2289  Fw::String enableStr;
2290  enable.toString(enableStr);
2291 
2292  Fw::TextLogString _logString;
2293  _logString.format(
2294  _formatString,
2295 #if FW_OBJECT_NAMES == 1
2296  this->m_objName.toChar(),
2297 #endif
2298  "SectionUnconfigurable ",
2299  sectionStr.toChar(),
2300  enableStr.toChar()
2301  );
2302 
2303  this->m_textEventOut_OutputPort[0].invoke(
2304  _id,
2305  _logTime,
2307  _logString
2308  );
2309  }
2310 #endif
2311  }
2312 
2313  // ----------------------------------------------------------------------
2314  // Telemetry write functions
2315  // ----------------------------------------------------------------------
2316 
2320  Fw::Time _tlmTime
2321  ) const
2322  {
2323  if (this->m_tlmOut_OutputPort[0].isConnected()) {
2324  if (
2325  this->m_timeGetOut_OutputPort[0].isConnected() &&
2326  (_tlmTime == Fw::ZERO_TIME)
2327  ) {
2328  this->m_timeGetOut_OutputPort[0].invoke(_tlmTime);
2329  }
2330 
2331  Fw::TlmBuffer _tlmBuff;
2332  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
2333  FW_ASSERT(
2334  _stat == Fw::FW_SERIALIZE_OK,
2335  static_cast<FwAssertArgType>(_stat)
2336  );
2337 
2338  FwChanIdType _id;
2339 
2340  _id = this->getIdBase() + CHANNELID_GROUPCONFIGS;
2341 
2342  this->m_tlmOut_OutputPort[0].invoke(
2343  _id,
2344  _tlmTime,
2345  _tlmBuff
2346  );
2347  }
2348  }
2349 
2353  Fw::Time _tlmTime
2354  ) const
2355  {
2356  if (this->m_tlmOut_OutputPort[0].isConnected()) {
2357  if (
2358  this->m_timeGetOut_OutputPort[0].isConnected() &&
2359  (_tlmTime == Fw::ZERO_TIME)
2360  ) {
2361  this->m_timeGetOut_OutputPort[0].invoke(_tlmTime);
2362  }
2363 
2364  Fw::TlmBuffer _tlmBuff;
2365  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
2366  FW_ASSERT(
2367  _stat == Fw::FW_SERIALIZE_OK,
2368  static_cast<FwAssertArgType>(_stat)
2369  );
2370 
2371  FwChanIdType _id;
2372 
2373  _id = this->getIdBase() + CHANNELID_SECTIONENABLED;
2374 
2375  this->m_tlmOut_OutputPort[0].invoke(
2376  _id,
2377  _tlmTime,
2378  _tlmBuff
2379  );
2380  }
2381  }
2382 
2383  // ----------------------------------------------------------------------
2384  // Time
2385  // ----------------------------------------------------------------------
2386 
2388  getTime() const
2389  {
2390  if (this->m_timeGetOut_OutputPort[0].isConnected()) {
2391  Fw::Time _time;
2392  this->m_timeGetOut_OutputPort[0].invoke(_time);
2393  return _time;
2394  }
2395  else {
2396  return Fw::Time(TimeBase::TB_NONE, 0, 0);
2397  }
2398  }
2399 
2400  // ----------------------------------------------------------------------
2401  // Message dispatch functions
2402  // ----------------------------------------------------------------------
2403 
2404  Fw::QueuedComponentBase::MsgDispatchStatus TlmPacketizerComponentBase ::
2405  doDispatch()
2406  {
2407  ComponentIpcSerializableBuffer _msg;
2408  FwQueuePriorityType _priority = 0;
2409 
2410  Os::Queue::Status _msgStatus = this->m_queue.receive(
2411  _msg,
2413  _priority
2414  );
2415  FW_ASSERT(
2416  _msgStatus == Os::Queue::OP_OK,
2417  static_cast<FwAssertArgType>(_msgStatus)
2418  );
2419 
2420  // Reset to beginning of buffer
2421  _msg.resetDeser();
2422 
2423  FwEnumStoreType _desMsg = 0;
2424  Fw::SerializeStatus _deserStatus = _msg.deserializeTo(_desMsg);
2425  FW_ASSERT(
2426  _deserStatus == Fw::FW_SERIALIZE_OK,
2427  static_cast<FwAssertArgType>(_deserStatus)
2428  );
2429 
2430  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
2431 
2432  if (_msgType == TLMPACKETIZER_COMPONENT_EXIT) {
2433  return MSG_DISPATCH_EXIT;
2434  }
2435 
2436  FwIndexType portNum = 0;
2437  _deserStatus = _msg.deserializeTo(portNum);
2438  FW_ASSERT(
2439  _deserStatus == Fw::FW_SERIALIZE_OK,
2440  static_cast<FwAssertArgType>(_deserStatus)
2441  );
2442 
2443  switch (_msgType) {
2444  // Handle async input port Run
2445  case RUN_SCHED: {
2446  // Deserialize argument context
2447  U32 context;
2448  _deserStatus = _msg.deserializeTo(context);
2449  FW_ASSERT(
2450  _deserStatus == Fw::FW_SERIALIZE_OK,
2451  static_cast<FwAssertArgType>(_deserStatus)
2452  );
2453  // Call handler function
2454  this->Run_handler(
2455  portNum,
2456  context
2457  );
2458 
2459  break;
2460  }
2461 
2462  // Handle async input port configureSectionGroupRate
2463  case CONFIGURESECTIONGROUPRATE_CONFIGUREGROUPRATE: {
2464  // Deserialize argument section
2465  Svc::TelemetrySection section;
2466  _deserStatus = _msg.deserializeTo(section);
2467  FW_ASSERT(
2468  _deserStatus == Fw::FW_SERIALIZE_OK,
2469  static_cast<FwAssertArgType>(_deserStatus)
2470  );
2471 
2472  // Deserialize argument tlmGroup
2473  FwChanIdType tlmGroup;
2474  _deserStatus = _msg.deserializeTo(tlmGroup);
2475  FW_ASSERT(
2476  _deserStatus == Fw::FW_SERIALIZE_OK,
2477  static_cast<FwAssertArgType>(_deserStatus)
2478  );
2479 
2480  // Deserialize argument rateLogic
2481  Svc::RateLogic rateLogic;
2482  _deserStatus = _msg.deserializeTo(rateLogic);
2483  FW_ASSERT(
2484  _deserStatus == Fw::FW_SERIALIZE_OK,
2485  static_cast<FwAssertArgType>(_deserStatus)
2486  );
2487 
2488  // Deserialize argument minDelta
2489  U32 minDelta;
2490  _deserStatus = _msg.deserializeTo(minDelta);
2491  FW_ASSERT(
2492  _deserStatus == Fw::FW_SERIALIZE_OK,
2493  static_cast<FwAssertArgType>(_deserStatus)
2494  );
2495 
2496  // Deserialize argument maxDelta
2497  U32 maxDelta;
2498  _deserStatus = _msg.deserializeTo(maxDelta);
2499  FW_ASSERT(
2500  _deserStatus == Fw::FW_SERIALIZE_OK,
2501  static_cast<FwAssertArgType>(_deserStatus)
2502  );
2503  // Call handler function
2505  portNum,
2506  section,
2507  tlmGroup,
2508  rateLogic,
2509  minDelta,
2510  maxDelta
2511  );
2512 
2513  break;
2514  }
2515 
2516  // Handle async input port controlIn
2517  case CONTROLIN_ENABLESECTION: {
2518  // Deserialize argument section
2519  Svc::TelemetrySection section;
2520  _deserStatus = _msg.deserializeTo(section);
2521  FW_ASSERT(
2522  _deserStatus == Fw::FW_SERIALIZE_OK,
2523  static_cast<FwAssertArgType>(_deserStatus)
2524  );
2525 
2526  // Deserialize argument enabled
2527  Fw::Enabled enabled;
2528  _deserStatus = _msg.deserializeTo(enabled);
2529  FW_ASSERT(
2530  _deserStatus == Fw::FW_SERIALIZE_OK,
2531  static_cast<FwAssertArgType>(_deserStatus)
2532  );
2533  // Call handler function
2534  this->controlIn_handler(
2535  portNum,
2536  section,
2537  enabled
2538  );
2539 
2540  break;
2541  }
2542 
2543  // Handle async input port pingIn
2544  case PINGIN_PING: {
2545  // Deserialize argument key
2546  U32 key;
2547  _deserStatus = _msg.deserializeTo(key);
2548  FW_ASSERT(
2549  _deserStatus == Fw::FW_SERIALIZE_OK,
2550  static_cast<FwAssertArgType>(_deserStatus)
2551  );
2552  // Call handler function
2553  this->pingIn_handler(
2554  portNum,
2555  key
2556  );
2557 
2558  break;
2559  }
2560 
2561  // Handle command SET_LEVEL
2562  case CMD_SET_LEVEL: {
2563  // Deserialize opcode
2564  FwOpcodeType _opCode = 0;
2565  _deserStatus = _msg.deserializeTo(_opCode);
2566  FW_ASSERT (
2567  _deserStatus == Fw::FW_SERIALIZE_OK,
2568  static_cast<FwAssertArgType>(_deserStatus)
2569  );
2570 
2571  // Deserialize command sequence
2572  U32 _cmdSeq = 0;
2573  _deserStatus = _msg.deserializeTo(_cmdSeq);
2574  FW_ASSERT (
2575  _deserStatus == Fw::FW_SERIALIZE_OK,
2576  static_cast<FwAssertArgType>(_deserStatus)
2577  );
2578 
2579  // Deserialize command argument buffer
2580  Fw::CmdArgBuffer args;
2581  _deserStatus = _msg.deserializeTo(args);
2582  FW_ASSERT (
2583  _deserStatus == Fw::FW_SERIALIZE_OK,
2584  static_cast<FwAssertArgType>(_deserStatus)
2585  );
2586 
2587  // Reset buffer
2588  args.resetDeser();
2589 
2590  // Deserialize argument level
2591  FwChanIdType level;
2592  _deserStatus = args.deserializeTo(level);
2593  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2594  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2595  this->cmdResponse_out(
2596  _opCode,
2597  _cmdSeq,
2599  );
2600  }
2601  // Don't crash the task if bad arguments were passed from the ground
2602  break;
2603  }
2604 
2605  // Make sure there was no data left over.
2606  // That means the argument buffer size was incorrect.
2607 #if FW_CMD_CHECK_RESIDUAL
2608  if (args.getDeserializeSizeLeft() != 0) {
2609  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2610  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2611  }
2612  // Don't crash the task if bad arguments were passed from the ground
2613  break;
2614  }
2615 #endif
2616 
2617  // Call handler function
2618  this->SET_LEVEL_cmdHandler(
2619  _opCode, _cmdSeq,
2620  level
2621  );
2622 
2623  break;
2624  }
2625 
2626  // Handle command SEND_PKT
2627  case CMD_SEND_PKT: {
2628  // Deserialize opcode
2629  FwOpcodeType _opCode = 0;
2630  _deserStatus = _msg.deserializeTo(_opCode);
2631  FW_ASSERT (
2632  _deserStatus == Fw::FW_SERIALIZE_OK,
2633  static_cast<FwAssertArgType>(_deserStatus)
2634  );
2635 
2636  // Deserialize command sequence
2637  U32 _cmdSeq = 0;
2638  _deserStatus = _msg.deserializeTo(_cmdSeq);
2639  FW_ASSERT (
2640  _deserStatus == Fw::FW_SERIALIZE_OK,
2641  static_cast<FwAssertArgType>(_deserStatus)
2642  );
2643 
2644  // Deserialize command argument buffer
2645  Fw::CmdArgBuffer args;
2646  _deserStatus = _msg.deserializeTo(args);
2647  FW_ASSERT (
2648  _deserStatus == Fw::FW_SERIALIZE_OK,
2649  static_cast<FwAssertArgType>(_deserStatus)
2650  );
2651 
2652  // Reset buffer
2653  args.resetDeser();
2654 
2655  // Deserialize argument id
2656  U32 id;
2657  _deserStatus = args.deserializeTo(id);
2658  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2659  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2660  this->cmdResponse_out(
2661  _opCode,
2662  _cmdSeq,
2664  );
2665  }
2666  // Don't crash the task if bad arguments were passed from the ground
2667  break;
2668  }
2669 
2670  // Deserialize argument section
2671  Svc::TelemetrySection section;
2672  _deserStatus = args.deserializeTo(section);
2673  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2674  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2675  this->cmdResponse_out(
2676  _opCode,
2677  _cmdSeq,
2679  );
2680  }
2681  // Don't crash the task if bad arguments were passed from the ground
2682  break;
2683  }
2684 
2685  // Make sure there was no data left over.
2686  // That means the argument buffer size was incorrect.
2687 #if FW_CMD_CHECK_RESIDUAL
2688  if (args.getDeserializeSizeLeft() != 0) {
2689  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2690  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2691  }
2692  // Don't crash the task if bad arguments were passed from the ground
2693  break;
2694  }
2695 #endif
2696 
2697  // Call handler function
2698  this->SEND_PKT_cmdHandler(
2699  _opCode, _cmdSeq,
2700  id,
2701  section
2702  );
2703 
2704  break;
2705  }
2706 
2707  // Handle command ENABLE_SECTION
2708  case CMD_ENABLE_SECTION: {
2709  // Deserialize opcode
2710  FwOpcodeType _opCode = 0;
2711  _deserStatus = _msg.deserializeTo(_opCode);
2712  FW_ASSERT (
2713  _deserStatus == Fw::FW_SERIALIZE_OK,
2714  static_cast<FwAssertArgType>(_deserStatus)
2715  );
2716 
2717  // Deserialize command sequence
2718  U32 _cmdSeq = 0;
2719  _deserStatus = _msg.deserializeTo(_cmdSeq);
2720  FW_ASSERT (
2721  _deserStatus == Fw::FW_SERIALIZE_OK,
2722  static_cast<FwAssertArgType>(_deserStatus)
2723  );
2724 
2725  // Deserialize command argument buffer
2726  Fw::CmdArgBuffer args;
2727  _deserStatus = _msg.deserializeTo(args);
2728  FW_ASSERT (
2729  _deserStatus == Fw::FW_SERIALIZE_OK,
2730  static_cast<FwAssertArgType>(_deserStatus)
2731  );
2732 
2733  // Reset buffer
2734  args.resetDeser();
2735 
2736  // Deserialize argument section
2737  Svc::TelemetrySection section;
2738  _deserStatus = args.deserializeTo(section);
2739  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2740  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2741  this->cmdResponse_out(
2742  _opCode,
2743  _cmdSeq,
2745  );
2746  }
2747  // Don't crash the task if bad arguments were passed from the ground
2748  break;
2749  }
2750 
2751  // Deserialize argument enable
2752  Fw::Enabled enable;
2753  _deserStatus = args.deserializeTo(enable);
2754  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2755  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2756  this->cmdResponse_out(
2757  _opCode,
2758  _cmdSeq,
2760  );
2761  }
2762  // Don't crash the task if bad arguments were passed from the ground
2763  break;
2764  }
2765 
2766  // Make sure there was no data left over.
2767  // That means the argument buffer size was incorrect.
2768 #if FW_CMD_CHECK_RESIDUAL
2769  if (args.getDeserializeSizeLeft() != 0) {
2770  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2771  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2772  }
2773  // Don't crash the task if bad arguments were passed from the ground
2774  break;
2775  }
2776 #endif
2777 
2778  // Call handler function
2780  _opCode, _cmdSeq,
2781  section,
2782  enable
2783  );
2784 
2785  break;
2786  }
2787 
2788  // Handle command ENABLE_GROUP
2789  case CMD_ENABLE_GROUP: {
2790  // Deserialize opcode
2791  FwOpcodeType _opCode = 0;
2792  _deserStatus = _msg.deserializeTo(_opCode);
2793  FW_ASSERT (
2794  _deserStatus == Fw::FW_SERIALIZE_OK,
2795  static_cast<FwAssertArgType>(_deserStatus)
2796  );
2797 
2798  // Deserialize command sequence
2799  U32 _cmdSeq = 0;
2800  _deserStatus = _msg.deserializeTo(_cmdSeq);
2801  FW_ASSERT (
2802  _deserStatus == Fw::FW_SERIALIZE_OK,
2803  static_cast<FwAssertArgType>(_deserStatus)
2804  );
2805 
2806  // Deserialize command argument buffer
2807  Fw::CmdArgBuffer args;
2808  _deserStatus = _msg.deserializeTo(args);
2809  FW_ASSERT (
2810  _deserStatus == Fw::FW_SERIALIZE_OK,
2811  static_cast<FwAssertArgType>(_deserStatus)
2812  );
2813 
2814  // Reset buffer
2815  args.resetDeser();
2816 
2817  // Deserialize argument section
2818  Svc::TelemetrySection section;
2819  _deserStatus = args.deserializeTo(section);
2820  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2821  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2822  this->cmdResponse_out(
2823  _opCode,
2824  _cmdSeq,
2826  );
2827  }
2828  // Don't crash the task if bad arguments were passed from the ground
2829  break;
2830  }
2831 
2832  // Deserialize argument tlmGroup
2833  FwChanIdType tlmGroup;
2834  _deserStatus = args.deserializeTo(tlmGroup);
2835  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2836  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2837  this->cmdResponse_out(
2838  _opCode,
2839  _cmdSeq,
2841  );
2842  }
2843  // Don't crash the task if bad arguments were passed from the ground
2844  break;
2845  }
2846 
2847  // Deserialize argument enable
2848  Fw::Enabled enable;
2849  _deserStatus = args.deserializeTo(enable);
2850  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2851  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2852  this->cmdResponse_out(
2853  _opCode,
2854  _cmdSeq,
2856  );
2857  }
2858  // Don't crash the task if bad arguments were passed from the ground
2859  break;
2860  }
2861 
2862  // Make sure there was no data left over.
2863  // That means the argument buffer size was incorrect.
2864 #if FW_CMD_CHECK_RESIDUAL
2865  if (args.getDeserializeSizeLeft() != 0) {
2866  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2867  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2868  }
2869  // Don't crash the task if bad arguments were passed from the ground
2870  break;
2871  }
2872 #endif
2873 
2874  // Call handler function
2876  _opCode, _cmdSeq,
2877  section,
2878  tlmGroup,
2879  enable
2880  );
2881 
2882  break;
2883  }
2884 
2885  // Handle command FORCE_GROUP
2886  case CMD_FORCE_GROUP: {
2887  // Deserialize opcode
2888  FwOpcodeType _opCode = 0;
2889  _deserStatus = _msg.deserializeTo(_opCode);
2890  FW_ASSERT (
2891  _deserStatus == Fw::FW_SERIALIZE_OK,
2892  static_cast<FwAssertArgType>(_deserStatus)
2893  );
2894 
2895  // Deserialize command sequence
2896  U32 _cmdSeq = 0;
2897  _deserStatus = _msg.deserializeTo(_cmdSeq);
2898  FW_ASSERT (
2899  _deserStatus == Fw::FW_SERIALIZE_OK,
2900  static_cast<FwAssertArgType>(_deserStatus)
2901  );
2902 
2903  // Deserialize command argument buffer
2904  Fw::CmdArgBuffer args;
2905  _deserStatus = _msg.deserializeTo(args);
2906  FW_ASSERT (
2907  _deserStatus == Fw::FW_SERIALIZE_OK,
2908  static_cast<FwAssertArgType>(_deserStatus)
2909  );
2910 
2911  // Reset buffer
2912  args.resetDeser();
2913 
2914  // Deserialize argument section
2915  Svc::TelemetrySection section;
2916  _deserStatus = args.deserializeTo(section);
2917  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2918  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2919  this->cmdResponse_out(
2920  _opCode,
2921  _cmdSeq,
2923  );
2924  }
2925  // Don't crash the task if bad arguments were passed from the ground
2926  break;
2927  }
2928 
2929  // Deserialize argument tlmGroup
2930  FwChanIdType tlmGroup;
2931  _deserStatus = args.deserializeTo(tlmGroup);
2932  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2933  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2934  this->cmdResponse_out(
2935  _opCode,
2936  _cmdSeq,
2938  );
2939  }
2940  // Don't crash the task if bad arguments were passed from the ground
2941  break;
2942  }
2943 
2944  // Deserialize argument enable
2945  Fw::Enabled enable;
2946  _deserStatus = args.deserializeTo(enable);
2947  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2948  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2949  this->cmdResponse_out(
2950  _opCode,
2951  _cmdSeq,
2953  );
2954  }
2955  // Don't crash the task if bad arguments were passed from the ground
2956  break;
2957  }
2958 
2959  // Make sure there was no data left over.
2960  // That means the argument buffer size was incorrect.
2961 #if FW_CMD_CHECK_RESIDUAL
2962  if (args.getDeserializeSizeLeft() != 0) {
2963  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2964  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2965  }
2966  // Don't crash the task if bad arguments were passed from the ground
2967  break;
2968  }
2969 #endif
2970 
2971  // Call handler function
2972  this->FORCE_GROUP_cmdHandler(
2973  _opCode, _cmdSeq,
2974  section,
2975  tlmGroup,
2976  enable
2977  );
2978 
2979  break;
2980  }
2981 
2982  // Handle command CONFIGURE_GROUP_RATES
2983  case CMD_CONFIGURE_GROUP_RATES: {
2984  // Deserialize opcode
2985  FwOpcodeType _opCode = 0;
2986  _deserStatus = _msg.deserializeTo(_opCode);
2987  FW_ASSERT (
2988  _deserStatus == Fw::FW_SERIALIZE_OK,
2989  static_cast<FwAssertArgType>(_deserStatus)
2990  );
2991 
2992  // Deserialize command sequence
2993  U32 _cmdSeq = 0;
2994  _deserStatus = _msg.deserializeTo(_cmdSeq);
2995  FW_ASSERT (
2996  _deserStatus == Fw::FW_SERIALIZE_OK,
2997  static_cast<FwAssertArgType>(_deserStatus)
2998  );
2999 
3000  // Deserialize command argument buffer
3001  Fw::CmdArgBuffer args;
3002  _deserStatus = _msg.deserializeTo(args);
3003  FW_ASSERT (
3004  _deserStatus == Fw::FW_SERIALIZE_OK,
3005  static_cast<FwAssertArgType>(_deserStatus)
3006  );
3007 
3008  // Reset buffer
3009  args.resetDeser();
3010 
3011  // Deserialize argument section
3012  Svc::TelemetrySection section;
3013  _deserStatus = args.deserializeTo(section);
3014  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3015  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3016  this->cmdResponse_out(
3017  _opCode,
3018  _cmdSeq,
3020  );
3021  }
3022  // Don't crash the task if bad arguments were passed from the ground
3023  break;
3024  }
3025 
3026  // Deserialize argument tlmGroup
3027  FwChanIdType tlmGroup;
3028  _deserStatus = args.deserializeTo(tlmGroup);
3029  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3030  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3031  this->cmdResponse_out(
3032  _opCode,
3033  _cmdSeq,
3035  );
3036  }
3037  // Don't crash the task if bad arguments were passed from the ground
3038  break;
3039  }
3040 
3041  // Deserialize argument rateLogic
3042  Svc::RateLogic rateLogic;
3043  _deserStatus = args.deserializeTo(rateLogic);
3044  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3045  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3046  this->cmdResponse_out(
3047  _opCode,
3048  _cmdSeq,
3050  );
3051  }
3052  // Don't crash the task if bad arguments were passed from the ground
3053  break;
3054  }
3055 
3056  // Deserialize argument minDelta
3057  U32 minDelta;
3058  _deserStatus = args.deserializeTo(minDelta);
3059  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3060  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3061  this->cmdResponse_out(
3062  _opCode,
3063  _cmdSeq,
3065  );
3066  }
3067  // Don't crash the task if bad arguments were passed from the ground
3068  break;
3069  }
3070 
3071  // Deserialize argument maxDelta
3072  U32 maxDelta;
3073  _deserStatus = args.deserializeTo(maxDelta);
3074  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3075  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3076  this->cmdResponse_out(
3077  _opCode,
3078  _cmdSeq,
3080  );
3081  }
3082  // Don't crash the task if bad arguments were passed from the ground
3083  break;
3084  }
3085 
3086  // Make sure there was no data left over.
3087  // That means the argument buffer size was incorrect.
3088 #if FW_CMD_CHECK_RESIDUAL
3089  if (args.getDeserializeSizeLeft() != 0) {
3090  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3091  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3092  }
3093  // Don't crash the task if bad arguments were passed from the ground
3094  break;
3095  }
3096 #endif
3097 
3098  // Call handler function
3100  _opCode, _cmdSeq,
3101  section,
3102  tlmGroup,
3103  rateLogic,
3104  minDelta,
3105  maxDelta
3106  );
3107 
3108  break;
3109  }
3110 
3111  default:
3112  return MSG_DISPATCH_ERROR;
3113  }
3114 
3115  return MSG_DISPATCH_OK;
3116  }
3117 
3118  // ----------------------------------------------------------------------
3119  // Calls for messages received on special input ports
3120  // ----------------------------------------------------------------------
3121 
3122  void TlmPacketizerComponentBase ::
3123  m_p_cmdIn_in(
3124  Fw::PassiveComponentBase* callComp,
3125  FwIndexType portNum,
3126  FwOpcodeType opCode,
3127  U32 cmdSeq,
3128  Fw::CmdArgBuffer& args
3129  )
3130  {
3131  FW_ASSERT(callComp);
3132  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
3133 
3134  const U32 idBase = callComp->getIdBase();
3135  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
3136 
3137  // Select base class function based on opcode
3138  switch (opCode - idBase) {
3139  case OPCODE_SET_LEVEL: {
3140  compPtr->SET_LEVEL_cmdHandlerBase(
3141  opCode,
3142  cmdSeq,
3143  args
3144  );
3145  break;
3146  }
3147 
3148  case OPCODE_SEND_PKT: {
3149  compPtr->SEND_PKT_cmdHandlerBase(
3150  opCode,
3151  cmdSeq,
3152  args
3153  );
3154  break;
3155  }
3156 
3157  case OPCODE_ENABLE_SECTION: {
3158  compPtr->ENABLE_SECTION_cmdHandlerBase(
3159  opCode,
3160  cmdSeq,
3161  args
3162  );
3163  break;
3164  }
3165 
3166  case OPCODE_ENABLE_GROUP: {
3167  compPtr->ENABLE_GROUP_cmdHandlerBase(
3168  opCode,
3169  cmdSeq,
3170  args
3171  );
3172  break;
3173  }
3174 
3175  case OPCODE_FORCE_GROUP: {
3176  compPtr->FORCE_GROUP_cmdHandlerBase(
3177  opCode,
3178  cmdSeq,
3179  args
3180  );
3181  break;
3182  }
3183 
3185  compPtr->CONFIGURE_GROUP_RATES_cmdHandlerBase(
3186  opCode,
3187  cmdSeq,
3188  args
3189  );
3190  break;
3191  }
3192  }
3193  }
3194 
3195  // ----------------------------------------------------------------------
3196  // Calls for messages received on typed input ports
3197  // ----------------------------------------------------------------------
3198 
3199  void TlmPacketizerComponentBase ::
3200  m_p_Run_in(
3201  Fw::PassiveComponentBase* callComp,
3202  FwIndexType portNum,
3203  U32 context
3204  )
3205  {
3206  FW_ASSERT(callComp);
3207  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
3208  compPtr->Run_handlerBase(
3209  portNum,
3210  context
3211  );
3212  }
3213 
3214  Fw::TlmValid TlmPacketizerComponentBase ::
3215  m_p_TlmGet_in(
3216  Fw::PassiveComponentBase* callComp,
3217  FwIndexType portNum,
3218  FwChanIdType id,
3219  Fw::Time& timeTag,
3220  Fw::TlmBuffer& val
3221  )
3222  {
3223  FW_ASSERT(callComp);
3224  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
3225  return compPtr->TlmGet_handlerBase(
3226  portNum,
3227  id,
3228  timeTag,
3229  val
3230  );
3231  }
3232 
3233  void TlmPacketizerComponentBase ::
3234  m_p_TlmRecv_in(
3235  Fw::PassiveComponentBase* callComp,
3236  FwIndexType portNum,
3237  FwChanIdType id,
3238  Fw::Time& timeTag,
3239  Fw::TlmBuffer& val
3240  )
3241  {
3242  FW_ASSERT(callComp);
3243  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
3244  compPtr->TlmRecv_handlerBase(
3245  portNum,
3246  id,
3247  timeTag,
3248  val
3249  );
3250  }
3251 
3252  void TlmPacketizerComponentBase ::
3253  m_p_configureSectionGroupRate_in(
3254  Fw::PassiveComponentBase* callComp,
3255  FwIndexType portNum,
3256  const Svc::TelemetrySection& section,
3257  FwChanIdType tlmGroup,
3258  const Svc::RateLogic& rateLogic,
3259  U32 minDelta,
3260  U32 maxDelta
3261  )
3262  {
3263  FW_ASSERT(callComp);
3264  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
3265  compPtr->configureSectionGroupRate_handlerBase(
3266  portNum,
3267  section,
3268  tlmGroup,
3269  rateLogic,
3270  minDelta,
3271  maxDelta
3272  );
3273  }
3274 
3275  void TlmPacketizerComponentBase ::
3276  m_p_controlIn_in(
3277  Fw::PassiveComponentBase* callComp,
3278  FwIndexType portNum,
3279  const Svc::TelemetrySection& section,
3280  const Fw::Enabled& enabled
3281  )
3282  {
3283  FW_ASSERT(callComp);
3284  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
3285  compPtr->controlIn_handlerBase(
3286  portNum,
3287  section,
3288  enabled
3289  );
3290  }
3291 
3292  void TlmPacketizerComponentBase ::
3293  m_p_pingIn_in(
3294  Fw::PassiveComponentBase* callComp,
3295  FwIndexType portNum,
3296  U32 key
3297  )
3298  {
3299  FW_ASSERT(callComp);
3300  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
3301  compPtr->pingIn_handlerBase(
3302  portNum,
3303  key
3304  );
3305  }
3306 
3307 }
Serialization/Deserialization operation was successful.
void SEND_PKT_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
The size of the serial representations of the port arguments.
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:134
Svc::InputEnableSectionPort * get_controlIn_InputPort(FwIndexType portNum)
void invoke(Fw::ComBuffer &data, U32 context) const
Invoke a port interface.
Definition: ComPortAc.cpp:156
void init()
Initialization function.
Definition: ComPortAc.cpp:137
void set_PktSend_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to PktSend[portNum].
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.
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
PlatformSizeType FwSizeType
void tlmWrite_GroupConfigs(const Svc::TlmPacketizer_SectionConfigs &arg, Fw::Time _tlmTime=Fw::Time()) const
void FORCE_GROUP_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
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
Fw::InputCmdPort * get_cmdIn_InputPort(FwIndexType portNum)
I32 FwEnumStoreType
static constexpr FwIndexType getNum_cmdResponseOut_OutputPorts()
void init()
Initialization function.
Svc::InputConfigureGroupRatePort * get_configureSectionGroupRate_InputPort(FwIndexType portNum)
virtual void TlmRecv_handler(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)=0
Handler for input port TlmRecv.
void Run_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port Run.
Status
status returned from the queue send function
Definition: Queue.hpp:30
void init()
Initialization function.
Definition: SchedPortAc.cpp:56
static constexpr FwIndexType getNum_PktSend_OutputPorts()
const char * toChar() const
Convert to a C-style char*.
Definition: String.hpp:50
The size of the serial representations of the port arguments.
void init()
Initialization function.
Definition: CmdPortAc.cpp:56
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: TlmPortAc.cpp:62
void log_WARNING_LO_NoChan(FwChanIdType Id) const
static constexpr FwIndexType getNum_pingIn_InputPorts()
virtual void configureSectionGroupRate_handler(FwIndexType portNum, const Svc::TelemetrySection &section, FwChanIdType tlmGroup, const Svc::RateLogic &rateLogic, U32 minDelta, U32 maxDelta)=0
Handler for input port configureSectionGroupRate.
virtual void FORCE_GROUP_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, Svc::TelemetrySection section, FwChanIdType tlmGroup, Fw::Enabled enable)=0
void invoke(U32 key) const
Invoke a port interface.
Definition: PingPortAc.cpp:147
void TlmRecv_handlerBase(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Handler base-class function for input port TlmRecv.
void controlIn_handlerBase(FwIndexType portNum, const Svc::TelemetrySection &section, const Fw::Enabled &enabled)
Handler base-class function for input port controlIn.
const Time ZERO_TIME
Definition: Time.cpp:5
void PktSend_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Invoke output port PktSend.
virtual void controlIn_handler(FwIndexType portNum, const Svc::TelemetrySection &section, const Fw::Enabled &enabled)=0
Handler for input port controlIn.
bool isConnected_tlmOut_OutputPort(FwIndexType portNum)
virtual void SEND_PKT_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, U32 id, Svc::TelemetrySection section)=0
void init()
Initialization function.
Definition: TlmPortAc.cpp:144
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
Enum representing a command response.
void init()
Initialization function.
Definition: TlmPortAc.cpp:56
No time base has been established (Required)
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
virtual void SET_LEVEL_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, FwChanIdType level)=0
Os::Queue m_queue
queue object for active component
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:150
virtual ~TlmPacketizerComponentBase()
Destroy TlmPacketizerComponentBase object.
void tlmWrite_SectionEnabled(const Svc::TlmPacketizer_SectionEnabled &arg, Fw::Time _tlmTime=Fw::Time()) const
Write telemetry channel SectionEnabled.
void set_pingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
void init()
Object initializer.
Definition: ObjBase.cpp:24
virtual void CONFIGURE_GROUP_RATES_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, Svc::TelemetrySection section, FwChanIdType tlmGroup, Svc::RateLogic rateLogic, U32 minDelta, U32 maxDelta)=0
The size of the serial representations of the port arguments.
Definition: CmdPortAc.hpp:38
SerializeStatus
forward declaration for string
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: CmdPortAc.cpp:62
Message will block until space is available.
Definition: Queue.hpp:47
virtual void configureSectionGroupRate_preMsgHook(FwIndexType portNum, const Svc::TelemetrySection &section, FwChanIdType tlmGroup, const Svc::RateLogic &rateLogic, U32 minDelta, U32 maxDelta)
Pre-message hook for async input port configureSectionGroupRate.
Enable / disable telemetry of a group on a section.
FwIdType FwEventIdType
The type of an event identifier.
virtual void FORCE_GROUP_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command FORCE_GROUP.
message to exit active component task
void invoke(FwOpcodeType opCode) const
Invoke a port interface.
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:26
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
void init()
Initialization function.
Definition: TimePortAc.cpp:128
static constexpr FwIndexType getNum_cmdRegOut_OutputPorts()
Fw::InputTlmGetPort * get_TlmGet_InputPort(FwIndexType portNum)
virtual void CONFIGURE_GROUP_RATES_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CONFIGURE_GROUP_RATES.
Set Min and Max Deltas between successive packets.
Less important informational events.
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
virtual void Run_preMsgHook(FwIndexType portNum, U32 context)
Pre-message hook for async input port Run.
Enumeration for rate logic types for telemetry groups.
A less serious but recoverable event.
void init()
Initialization function.
Definition: PingPortAc.cpp:128
static constexpr FwIndexType getNum_timeGetOut_OutputPorts()
void invoke(Fw::Time &time) const
Invoke a port interface.
Definition: TimePortAc.cpp:147
Serializable::SizeType getDeserializeSizeLeft() const override
Get remaining deserialization buffer size.
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.
virtual void ENABLE_GROUP_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, Svc::TelemetrySection section, FwChanIdType tlmGroup, Fw::Enabled enable)=0
FwIdType FwChanIdType
The type of a telemetry channel identifier.
FwSizeType SizeType
void addCallPort(InputPingPort *callPort)
Register an input port.
Definition: PingPortAc.cpp:134
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
Definition: Queue.cpp:54
Enable / disable telemetry of a group on a section.
void resetDeser() override
Reset deserialization pointer to beginning of buffer.
virtual void pingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port pingIn.
virtual void ENABLE_GROUP_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command ENABLE_GROUP.
The size of the serial representation.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port interface.
Definition: TlmPortAc.cpp:163
bool isConnected_cmdRegOut_OutputPort(FwIndexType portNum)
void set_eventOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to eventOut[portNum].
bool isConnected() const
Definition: PortBase.cpp:38
Telemetry channel is not part of a telemetry packet.
static constexpr FwIndexType getNum_tlmOut_OutputPorts()
virtual void ENABLE_SECTION_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, Svc::TelemetrySection section, Fw::Enabled enable)=0
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
#define PRI_FwIndexType
Enabled and disabled states.
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:39
Fw::TlmValid TlmGet_handlerBase(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Handler base-class function for input port TlmGet.
void init()
Initialization function.
Definition: LogPortAc.cpp:151
virtual void Run_handler(FwIndexType portNum, U32 context)=0
Handler for input port Run.
void setPortNum(FwIndexType portNum)
void init()
Initialization function.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:53
BlockingType
message type
Definition: Queue.hpp:46
static constexpr FwIndexType getNum_eventOut_OutputPorts()
void ENABLE_GROUP_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
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 log_WARNING_LO_SectionUnconfigurable(Svc::TelemetrySection section, Fw::Enabled enable) const
Log event SectionUnconfigurable.
Force telemetering a group on a section, even if disabled.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void log_WARNING_LO_MaxLevelExceed(FwChanIdType level, FwChanIdType max) const
virtual void controlIn_preMsgHook(FwIndexType portNum, const Svc::TelemetrySection &section, const Fw::Enabled &enabled)
Pre-message hook for async input port controlIn.
A message was sent requesting an exit of the loop.
PlatformIndexType FwIndexType
TlmPacketizerComponentBase(const char *compName="")
Construct TlmPacketizerComponentBase object.
static constexpr FwIndexType getNum_configureSectionGroupRate_InputPorts()
void log_ACTIVITY_HI_LevelSet(FwChanIdType id) const
void set_timeGetOut_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeGetOut[portNum].
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:157
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void ENABLE_SECTION_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void init()
Initialization function.
The size of the serial representations of the port arguments.
Definition: PingPortAc.hpp:36
The size of the serial representation.
virtual void SEND_PKT_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command SEND_PKT.
void init()
Initialization function.
Definition: PingPortAc.cpp:56
void init()
Initialization function.
void configureSectionGroupRate_handlerBase(FwIndexType portNum, const Svc::TelemetrySection &section, FwChanIdType tlmGroup, const Svc::RateLogic &rateLogic, U32 minDelta, U32 maxDelta)
Handler base-class function for input port configureSectionGroupRate.
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.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
U8 BYTE
byte type
Definition: BasicTypes.h:56
bool isConnected_PktSend_OutputPort(FwIndexType portNum)
Svc::InputSchedPort * get_Run_InputPort(FwIndexType portNum)
bool isConnected_pingOut_OutputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_TlmGet_InputPorts()
void addCallPort(InputComPort *callPort)
Register an input port.
Definition: ComPortAc.cpp:143
Fw::InputTlmPort * get_TlmRecv_InputPort(FwIndexType portNum)
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: PingPortAc.cpp:62
static constexpr FwIndexType getNum_controlIn_InputPorts()
virtual void ENABLE_SECTION_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command ENABLE_SECTION.
bool isConnected_timeGetOut_OutputPort(FwIndexType portNum)
void regCommands()
Register commands with the Command Dispatcher.
bool isConnected_eventOut_OutputPort(FwIndexType portNum)
Message will return with status when space is unavailable.
Definition: Queue.hpp:48
Implementation of malloc based allocator.
bool isConnected_cmdResponseOut_OutputPort(FwIndexType portNum)
void init()
Initialization function.
void CONFIGURE_GROUP_RATES_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void SET_LEVEL_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
virtual void SET_LEVEL_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command SET_LEVEL.
static constexpr FwIndexType getNum_pingOut_OutputPorts()
#define FW_ASSERT(...)
Definition: Assert.hpp:14
static constexpr FwIndexType getNum_Run_InputPorts()
void set_cmdResponseOut_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
void pingOut_out(FwIndexType portNum, U32 key)
Invoke output port pingOut.
The size of the serial representations of the port arguments.
Definition: SchedPortAc.hpp:36
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
virtual Fw::TlmValid TlmGet_handler(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)=0
Handler for input port TlmGet.
static constexpr FwIndexType getNum_TlmRecv_InputPorts()
void set_cmdRegOut_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to cmdRegOut[portNum].
static constexpr FwIndexType getNum_cmdIn_InputPorts()