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/Prm/ParamValid.hpp"
8 #include "Fw/Types/Assert.hpp"
10 #if FW_ENABLE_TEXT_LOGGING
11 #include "Fw/Types/String.hpp"
12 #endif
14 
15 namespace Svc {
16 
17  namespace {
18  enum MsgTypeEnum {
19  TLMPACKETIZER_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT,
20  RUN_SCHED,
21  CONFIGURESECTIONGROUPRATE_CONFIGUREGROUPRATE,
22  CONTROLIN_ENABLESECTION,
23  PINGIN_PING,
24  CMD_SET_LEVEL,
25  CMD_SEND_PKT,
26  CMD_ENABLE_SECTION,
27  CMD_ENABLE_GROUP,
28  CMD_FORCE_GROUP,
29  CMD_CONFIGURE_GROUP_RATES,
30  };
31 
32  // Get the max size by constructing a union of the async input, command, and
33  // internal port serialization sizes
34  union BuffUnion {
36  BYTE configureSectionGroupRatePortSize[Svc::ConfigureGroupRatePortBuffer::CAPACITY];
40  };
41 
42  // Define a message buffer class large enough to handle all the
43  // asynchronous inputs to the component
44  class ComponentIpcSerializableBuffer :
46  {
47 
48  public:
49 
50  enum {
51  // Offset into data in buffer: Size of message ID and port number
52  DATA_OFFSET = sizeof(FwEnumStoreType) + sizeof(FwIndexType),
53  // Max data size
54  MAX_DATA_SIZE = sizeof(BuffUnion),
55  // Max message size: Size of message id + size of port + max data size
56  SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
57  };
58 
59  ComponentIpcSerializableBuffer() : Fw::LinearBufferBase(m_buff, sizeof(m_buff)) {
60 
61  }
62 
63  private:
64  // Should be the max of all the input ports serialized sizes...
65  U8 m_buff[SERIALIZATION_SIZE];
66 
67  };
68  }
69 
70  // ----------------------------------------------------------------------
71  // Component initialization
72  // ----------------------------------------------------------------------
73 
76  FwSizeType queueDepth,
77  FwEnumStoreType instance
78  )
79  {
80  // Initialize base class
82 
83 #if !FW_DIRECT_PORT_CALLS
84  // Connect input port cmdIn
85  for (
86  FwIndexType port = 0;
87  port < static_cast<FwIndexType>(this->getNum_cmdIn_InputPorts());
88  port++
89  ) {
90  this->m_cmdIn_InputPort[port].init();
91  this->m_cmdIn_InputPort[port].addCallComp(
92  this,
93  m_p_cmdIn_in
94  );
95  this->m_cmdIn_InputPort[port].setPortNum(port);
96 
97 #if FW_OBJECT_NAMES == 1
98  Fw::ObjectName portName;
99  portName.format(
100  "%s_cmdIn_InputPort[%" PRI_FwIndexType "]",
101  this->m_objName.toChar(),
102  port
103  );
104  this->m_cmdIn_InputPort[port].setObjName(portName.toChar());
105 #endif
106  }
107 #endif
108 
109 #if !FW_DIRECT_PORT_CALLS
110  // Connect input port Run
111  for (
112  FwIndexType port = 0;
113  port < static_cast<FwIndexType>(this->getNum_Run_InputPorts());
114  port++
115  ) {
116  this->m_Run_InputPort[port].init();
117  this->m_Run_InputPort[port].addCallComp(
118  this,
119  m_p_Run_in
120  );
121  this->m_Run_InputPort[port].setPortNum(port);
122 
123 #if FW_OBJECT_NAMES == 1
124  Fw::ObjectName portName;
125  portName.format(
126  "%s_Run_InputPort[%" PRI_FwIndexType "]",
127  this->m_objName.toChar(),
128  port
129  );
130  this->m_Run_InputPort[port].setObjName(portName.toChar());
131 #endif
132  }
133 #endif
134 
135 #if !FW_DIRECT_PORT_CALLS
136  // Connect input port TlmGet
137  for (
138  FwIndexType port = 0;
139  port < static_cast<FwIndexType>(this->getNum_TlmGet_InputPorts());
140  port++
141  ) {
142  this->m_TlmGet_InputPort[port].init();
143  this->m_TlmGet_InputPort[port].addCallComp(
144  this,
145  m_p_TlmGet_in
146  );
147  this->m_TlmGet_InputPort[port].setPortNum(port);
148 
149 #if FW_OBJECT_NAMES == 1
150  Fw::ObjectName portName;
151  portName.format(
152  "%s_TlmGet_InputPort[%" PRI_FwIndexType "]",
153  this->m_objName.toChar(),
154  port
155  );
156  this->m_TlmGet_InputPort[port].setObjName(portName.toChar());
157 #endif
158  }
159 #endif
160 
161 #if !FW_DIRECT_PORT_CALLS
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 #endif
186 
187 #if !FW_DIRECT_PORT_CALLS
188  // Connect input port configureSectionGroupRate
189  for (
190  FwIndexType port = 0;
191  port < static_cast<FwIndexType>(this->getNum_configureSectionGroupRate_InputPorts());
192  port++
193  ) {
194  this->m_configureSectionGroupRate_InputPort[port].init();
195  this->m_configureSectionGroupRate_InputPort[port].addCallComp(
196  this,
197  m_p_configureSectionGroupRate_in
198  );
199  this->m_configureSectionGroupRate_InputPort[port].setPortNum(port);
200 
201 #if FW_OBJECT_NAMES == 1
202  Fw::ObjectName portName;
203  portName.format(
204  "%s_configureSectionGroupRate_InputPort[%" PRI_FwIndexType "]",
205  this->m_objName.toChar(),
206  port
207  );
208  this->m_configureSectionGroupRate_InputPort[port].setObjName(portName.toChar());
209 #endif
210  }
211 #endif
212 
213 #if !FW_DIRECT_PORT_CALLS
214  // Connect input port controlIn
215  for (
216  FwIndexType port = 0;
217  port < static_cast<FwIndexType>(this->getNum_controlIn_InputPorts());
218  port++
219  ) {
220  this->m_controlIn_InputPort[port].init();
221  this->m_controlIn_InputPort[port].addCallComp(
222  this,
223  m_p_controlIn_in
224  );
225  this->m_controlIn_InputPort[port].setPortNum(port);
226 
227 #if FW_OBJECT_NAMES == 1
228  Fw::ObjectName portName;
229  portName.format(
230  "%s_controlIn_InputPort[%" PRI_FwIndexType "]",
231  this->m_objName.toChar(),
232  port
233  );
234  this->m_controlIn_InputPort[port].setObjName(portName.toChar());
235 #endif
236  }
237 #endif
238 
239 #if !FW_DIRECT_PORT_CALLS
240  // Connect input port pingIn
241  for (
242  FwIndexType port = 0;
243  port < static_cast<FwIndexType>(this->getNum_pingIn_InputPorts());
244  port++
245  ) {
246  this->m_pingIn_InputPort[port].init();
247  this->m_pingIn_InputPort[port].addCallComp(
248  this,
249  m_p_pingIn_in
250  );
251  this->m_pingIn_InputPort[port].setPortNum(port);
252 
253 #if FW_OBJECT_NAMES == 1
254  Fw::ObjectName portName;
255  portName.format(
256  "%s_pingIn_InputPort[%" PRI_FwIndexType "]",
257  this->m_objName.toChar(),
258  port
259  );
260  this->m_pingIn_InputPort[port].setObjName(portName.toChar());
261 #endif
262  }
263 #endif
264 
265 #if !FW_DIRECT_PORT_CALLS
266  // Connect output port cmdRegOut
267  for (
268  FwIndexType port = 0;
269  port < static_cast<FwIndexType>(this->getNum_cmdRegOut_OutputPorts());
270  port++
271  ) {
272  this->m_cmdRegOut_OutputPort[port].init();
273 
274 #if FW_OBJECT_NAMES == 1
275  Fw::ObjectName portName;
276  portName.format(
277  "%s_cmdRegOut_OutputPort[%" PRI_FwIndexType "]",
278  this->m_objName.toChar(),
279  port
280  );
281  this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar());
282 #endif
283  }
284 #endif
285 
286 #if !FW_DIRECT_PORT_CALLS
287  // Connect output port cmdResponseOut
288  for (
289  FwIndexType port = 0;
290  port < static_cast<FwIndexType>(this->getNum_cmdResponseOut_OutputPorts());
291  port++
292  ) {
293  this->m_cmdResponseOut_OutputPort[port].init();
294 
295 #if FW_OBJECT_NAMES == 1
296  Fw::ObjectName portName;
297  portName.format(
298  "%s_cmdResponseOut_OutputPort[%" PRI_FwIndexType "]",
299  this->m_objName.toChar(),
300  port
301  );
302  this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar());
303 #endif
304  }
305 #endif
306 
307 #if !FW_DIRECT_PORT_CALLS
308  // Connect output port eventOut
309  for (
310  FwIndexType port = 0;
311  port < static_cast<FwIndexType>(this->getNum_eventOut_OutputPorts());
312  port++
313  ) {
314  this->m_eventOut_OutputPort[port].init();
315 
316 #if FW_OBJECT_NAMES == 1
317  Fw::ObjectName portName;
318  portName.format(
319  "%s_eventOut_OutputPort[%" PRI_FwIndexType "]",
320  this->m_objName.toChar(),
321  port
322  );
323  this->m_eventOut_OutputPort[port].setObjName(portName.toChar());
324 #endif
325  }
326 #endif
327 
328 #if !FW_DIRECT_PORT_CALLS
329  // Connect output port paramGetOut
330  for (
331  FwIndexType port = 0;
332  port < static_cast<FwIndexType>(this->getNum_paramGetOut_OutputPorts());
333  port++
334  ) {
335  this->m_paramGetOut_OutputPort[port].init();
336 
337 #if FW_OBJECT_NAMES == 1
338  Fw::ObjectName portName;
339  portName.format(
340  "%s_paramGetOut_OutputPort[%" PRI_FwIndexType "]",
341  this->m_objName.toChar(),
342  port
343  );
344  this->m_paramGetOut_OutputPort[port].setObjName(portName.toChar());
345 #endif
346  }
347 #endif
348 
349 #if !FW_DIRECT_PORT_CALLS
350  // Connect output port paramSetOut
351  for (
352  FwIndexType port = 0;
353  port < static_cast<FwIndexType>(this->getNum_paramSetOut_OutputPorts());
354  port++
355  ) {
356  this->m_paramSetOut_OutputPort[port].init();
357 
358 #if FW_OBJECT_NAMES == 1
359  Fw::ObjectName portName;
360  portName.format(
361  "%s_paramSetOut_OutputPort[%" PRI_FwIndexType "]",
362  this->m_objName.toChar(),
363  port
364  );
365  this->m_paramSetOut_OutputPort[port].setObjName(portName.toChar());
366 #endif
367  }
368 #endif
369 
370 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING
371  // Connect output port textEventOut
372  for (
373  FwIndexType port = 0;
374  port < static_cast<FwIndexType>(this->getNum_textEventOut_OutputPorts());
375  port++
376  ) {
377  this->m_textEventOut_OutputPort[port].init();
378 
379 #if FW_OBJECT_NAMES == 1
380  Fw::ObjectName portName;
381  portName.format(
382  "%s_textEventOut_OutputPort[%" PRI_FwIndexType "]",
383  this->m_objName.toChar(),
384  port
385  );
386  this->m_textEventOut_OutputPort[port].setObjName(portName.toChar());
387 #endif
388  }
389 #endif
390 
391 #if !FW_DIRECT_PORT_CALLS
392  // Connect output port timeGetOut
393  for (
394  FwIndexType port = 0;
395  port < static_cast<FwIndexType>(this->getNum_timeGetOut_OutputPorts());
396  port++
397  ) {
398  this->m_timeGetOut_OutputPort[port].init();
399 
400 #if FW_OBJECT_NAMES == 1
401  Fw::ObjectName portName;
402  portName.format(
403  "%s_timeGetOut_OutputPort[%" PRI_FwIndexType "]",
404  this->m_objName.toChar(),
405  port
406  );
407  this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar());
408 #endif
409  }
410 #endif
411 
412 #if !FW_DIRECT_PORT_CALLS
413  // Connect output port tlmOut
414  for (
415  FwIndexType port = 0;
416  port < static_cast<FwIndexType>(this->getNum_tlmOut_OutputPorts());
417  port++
418  ) {
419  this->m_tlmOut_OutputPort[port].init();
420 
421 #if FW_OBJECT_NAMES == 1
422  Fw::ObjectName portName;
423  portName.format(
424  "%s_tlmOut_OutputPort[%" PRI_FwIndexType "]",
425  this->m_objName.toChar(),
426  port
427  );
428  this->m_tlmOut_OutputPort[port].setObjName(portName.toChar());
429 #endif
430  }
431 #endif
432 
433 #if !FW_DIRECT_PORT_CALLS
434  // Connect output port PktSend
435  for (
436  FwIndexType port = 0;
437  port < static_cast<FwIndexType>(this->getNum_PktSend_OutputPorts());
438  port++
439  ) {
440  this->m_PktSend_OutputPort[port].init();
441 
442 #if FW_OBJECT_NAMES == 1
443  Fw::ObjectName portName;
444  portName.format(
445  "%s_PktSend_OutputPort[%" PRI_FwIndexType "]",
446  this->m_objName.toChar(),
447  port
448  );
449  this->m_PktSend_OutputPort[port].setObjName(portName.toChar());
450 #endif
451  }
452 #endif
453 
454 #if !FW_DIRECT_PORT_CALLS
455  // Connect output port pingOut
456  for (
457  FwIndexType port = 0;
458  port < static_cast<FwIndexType>(this->getNum_pingOut_OutputPorts());
459  port++
460  ) {
461  this->m_pingOut_OutputPort[port].init();
462 
463 #if FW_OBJECT_NAMES == 1
464  Fw::ObjectName portName;
465  portName.format(
466  "%s_pingOut_OutputPort[%" PRI_FwIndexType "]",
467  this->m_objName.toChar(),
468  port
469  );
470  this->m_pingOut_OutputPort[port].setObjName(portName.toChar());
471 #endif
472  }
473 #endif
474 
475  // Create the queue
476  Os::Queue::Status qStat = this->createQueue(
477  queueDepth,
478  static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
479  );
480  FW_ASSERT(
481  Os::Queue::Status::OP_OK == qStat,
482  static_cast<FwAssertArgType>(qStat)
483  );
484  }
485 
486 #if !FW_DIRECT_PORT_CALLS
487 
488  // ----------------------------------------------------------------------
489  // Getters for special input ports
490  // ----------------------------------------------------------------------
491 
494  {
495  FW_ASSERT(
496  (0 <= portNum) && (portNum < this->getNum_cmdIn_InputPorts()),
497  static_cast<FwAssertArgType>(portNum)
498  );
499 
500  return &this->m_cmdIn_InputPort[portNum];
501  }
502 
503 #endif
504 
505 #if !FW_DIRECT_PORT_CALLS
506 
507  // ----------------------------------------------------------------------
508  // Getters for typed input ports
509  // ----------------------------------------------------------------------
510 
513  {
514  FW_ASSERT(
515  (0 <= portNum) && (portNum < this->getNum_Run_InputPorts()),
516  static_cast<FwAssertArgType>(portNum)
517  );
518 
519  return &this->m_Run_InputPort[portNum];
520  }
521 
524  {
525  FW_ASSERT(
526  (0 <= portNum) && (portNum < this->getNum_TlmGet_InputPorts()),
527  static_cast<FwAssertArgType>(portNum)
528  );
529 
530  return &this->m_TlmGet_InputPort[portNum];
531  }
532 
535  {
536  FW_ASSERT(
537  (0 <= portNum) && (portNum < this->getNum_TlmRecv_InputPorts()),
538  static_cast<FwAssertArgType>(portNum)
539  );
540 
541  return &this->m_TlmRecv_InputPort[portNum];
542  }
543 
546  {
547  FW_ASSERT(
548  (0 <= portNum) && (portNum < this->getNum_configureSectionGroupRate_InputPorts()),
549  static_cast<FwAssertArgType>(portNum)
550  );
551 
552  return &this->m_configureSectionGroupRate_InputPort[portNum];
553  }
554 
557  {
558  FW_ASSERT(
559  (0 <= portNum) && (portNum < this->getNum_controlIn_InputPorts()),
560  static_cast<FwAssertArgType>(portNum)
561  );
562 
563  return &this->m_controlIn_InputPort[portNum];
564  }
565 
568  {
569  FW_ASSERT(
570  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
571  static_cast<FwAssertArgType>(portNum)
572  );
573 
574  return &this->m_pingIn_InputPort[portNum];
575  }
576 
577 #endif
578 
579 #if !FW_DIRECT_PORT_CALLS
580 
581  // ----------------------------------------------------------------------
582  // Connect input ports to special output ports
583  // ----------------------------------------------------------------------
584 
587  FwIndexType portNum,
588  Fw::InputCmdRegPort* port
589  )
590  {
591  FW_ASSERT(
592  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
593  static_cast<FwAssertArgType>(portNum)
594  );
595 
596  this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
597  }
598 
601  FwIndexType portNum,
603  )
604  {
605  FW_ASSERT(
606  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
607  static_cast<FwAssertArgType>(portNum)
608  );
609 
610  this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
611  }
612 
615  FwIndexType portNum,
616  Fw::InputLogPort* port
617  )
618  {
619  FW_ASSERT(
620  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
621  static_cast<FwAssertArgType>(portNum)
622  );
623 
624  this->m_eventOut_OutputPort[portNum].addCallPort(port);
625  }
626 
629  FwIndexType portNum,
630  Fw::InputPrmGetPort* port
631  )
632  {
633  FW_ASSERT(
634  (0 <= portNum) && (portNum < this->getNum_paramGetOut_OutputPorts()),
635  static_cast<FwAssertArgType>(portNum)
636  );
637 
638  this->m_paramGetOut_OutputPort[portNum].addCallPort(port);
639  }
640 
643  FwIndexType portNum,
644  Fw::InputPrmSetPort* port
645  )
646  {
647  FW_ASSERT(
648  (0 <= portNum) && (portNum < this->getNum_paramSetOut_OutputPorts()),
649  static_cast<FwAssertArgType>(portNum)
650  );
651 
652  this->m_paramSetOut_OutputPort[portNum].addCallPort(port);
653  }
654 
655 #if FW_ENABLE_TEXT_LOGGING == 1
656 
657  void TlmPacketizerComponentBase ::
658  set_textEventOut_OutputPort(
659  FwIndexType portNum,
661  )
662  {
663  FW_ASSERT(
664  (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
665  static_cast<FwAssertArgType>(portNum)
666  );
667 
668  this->m_textEventOut_OutputPort[portNum].addCallPort(port);
669  }
670 
671 #endif
672 
675  FwIndexType portNum,
676  Fw::InputTimePort* port
677  )
678  {
679  FW_ASSERT(
680  (0 <= portNum) && (portNum < this->getNum_timeGetOut_OutputPorts()),
681  static_cast<FwAssertArgType>(portNum)
682  );
683 
684  this->m_timeGetOut_OutputPort[portNum].addCallPort(port);
685  }
686 
689  FwIndexType portNum,
690  Fw::InputTlmPort* port
691  )
692  {
693  FW_ASSERT(
694  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
695  static_cast<FwAssertArgType>(portNum)
696  );
697 
698  this->m_tlmOut_OutputPort[portNum].addCallPort(port);
699  }
700 
701 #endif
702 
703 #if !FW_DIRECT_PORT_CALLS
704 
705  // ----------------------------------------------------------------------
706  // Connect typed input ports to typed output ports
707  // ----------------------------------------------------------------------
708 
711  FwIndexType portNum,
712  Fw::InputComPort* port
713  )
714  {
715  FW_ASSERT(
716  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
717  static_cast<FwAssertArgType>(portNum)
718  );
719 
720  this->m_PktSend_OutputPort[portNum].addCallPort(port);
721  }
722 
725  FwIndexType portNum,
726  Svc::InputPingPort* port
727  )
728  {
729  FW_ASSERT(
730  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
731  static_cast<FwAssertArgType>(portNum)
732  );
733 
734  this->m_pingOut_OutputPort[portNum].addCallPort(port);
735  }
736 
737 #endif
738 
739 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
740 
741  // ----------------------------------------------------------------------
742  // Connect serial input ports to special output ports
743  // ----------------------------------------------------------------------
744 
747  FwIndexType portNum,
748  Fw::InputSerializePort* port
749  )
750  {
751  FW_ASSERT(
752  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
753  static_cast<FwAssertArgType>(portNum)
754  );
755 
756  this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
757  }
758 
761  FwIndexType portNum,
762  Fw::InputSerializePort* port
763  )
764  {
765  FW_ASSERT(
766  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
767  static_cast<FwAssertArgType>(portNum)
768  );
769 
770  this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
771  }
772 
775  FwIndexType portNum,
776  Fw::InputSerializePort* port
777  )
778  {
779  FW_ASSERT(
780  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
781  static_cast<FwAssertArgType>(portNum)
782  );
783 
784  this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
785  }
786 
789  FwIndexType portNum,
790  Fw::InputSerializePort* port
791  )
792  {
793  FW_ASSERT(
794  (0 <= portNum) && (portNum < this->getNum_paramSetOut_OutputPorts()),
795  static_cast<FwAssertArgType>(portNum)
796  );
797 
798  this->m_paramSetOut_OutputPort[portNum].registerSerialPort(port);
799  }
800 
801 #if FW_ENABLE_TEXT_LOGGING == 1
802 
803  void TlmPacketizerComponentBase ::
804  set_textEventOut_OutputPort(
805  FwIndexType portNum,
806  Fw::InputSerializePort* port
807  )
808  {
809  FW_ASSERT(
810  (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
811  static_cast<FwAssertArgType>(portNum)
812  );
813 
814  this->m_textEventOut_OutputPort[portNum].registerSerialPort(port);
815  }
816 
817 #endif
818 
821  FwIndexType portNum,
822  Fw::InputSerializePort* port
823  )
824  {
825  FW_ASSERT(
826  (0 <= portNum) && (portNum < this->getNum_timeGetOut_OutputPorts()),
827  static_cast<FwAssertArgType>(portNum)
828  );
829 
830  this->m_timeGetOut_OutputPort[portNum].registerSerialPort(port);
831  }
832 
835  FwIndexType portNum,
836  Fw::InputSerializePort* port
837  )
838  {
839  FW_ASSERT(
840  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
841  static_cast<FwAssertArgType>(portNum)
842  );
843 
844  this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
845  }
846 
847 #endif
848 
849 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
850 
851  // ----------------------------------------------------------------------
852  // Connect serial input ports to typed output ports
853  // ----------------------------------------------------------------------
854 
857  FwIndexType portNum,
858  Fw::InputSerializePort* port
859  )
860  {
861  FW_ASSERT(
862  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
863  static_cast<FwAssertArgType>(portNum)
864  );
865 
866  this->m_PktSend_OutputPort[portNum].registerSerialPort(port);
867  }
868 
871  FwIndexType portNum,
872  Fw::InputSerializePort* port
873  )
874  {
875  FW_ASSERT(
876  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
877  static_cast<FwAssertArgType>(portNum)
878  );
879 
880  this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
881  }
882 
883 #endif
884 
885  // ----------------------------------------------------------------------
886  // Command registration
887  // ----------------------------------------------------------------------
888 
891  {
893 
894  this->cmdRegOut_out(
895  0,
896  this->getIdBase() + OPCODE_SET_LEVEL
897  );
898 
899  this->cmdRegOut_out(
900  0,
901  this->getIdBase() + OPCODE_SEND_PKT
902  );
903 
904  this->cmdRegOut_out(
905  0,
907  );
908 
909  this->cmdRegOut_out(
910  0,
912  );
913 
914  this->cmdRegOut_out(
915  0,
916  this->getIdBase() + OPCODE_FORCE_GROUP
917  );
918 
919  this->cmdRegOut_out(
920  0,
922  );
923 
924  this->cmdRegOut_out(
925  0,
927  );
928 
929  this->cmdRegOut_out(
930  0,
932  );
933 
934  this->cmdRegOut_out(
935  0,
937  );
938 
939  this->cmdRegOut_out(
940  0,
942  );
943  }
944 
945  // ----------------------------------------------------------------------
946  // Parameter loading
947  // ----------------------------------------------------------------------
948 
951  {
953  const FwPrmIdType _baseId = static_cast<FwPrmIdType>(this->getIdBase());
955 
956  FwPrmIdType _id{};
957  Fw::ParamBuffer _paramBuffer;
958 
959  _id = _baseId + PARAMID_SECTION_ENABLED;
960 
961  // Get serialized parameter SECTION_ENABLED
962  this->m_param_SECTION_ENABLED_valid = this->paramGetOut_out(
963  0,
964  _id,
965  _paramBuffer
966  );
967 
968  this->m_paramLock.lock();
969 
970  // Deserialize parameter or use default value
971  if (this->m_param_SECTION_ENABLED_valid == Fw::ParamValid::VALID) {
972  FW_ASSERT(this->paramDelegatePtr != nullptr);
973  _stat = this->paramDelegatePtr->deserializeParam(
974  _baseId,
976  this->m_param_SECTION_ENABLED_valid,
977  _paramBuffer
978  );
979  if (_stat != Fw::FW_SERIALIZE_OK) {
980  this->m_param_SECTION_ENABLED_valid = Fw::ParamValid::DEFAULT;
981  }
982  }
983  else {
984  this->m_param_SECTION_ENABLED_valid = Fw::ParamValid::DEFAULT;
985  }
986  if (this->m_param_SECTION_ENABLED_valid == Fw::ParamValid::DEFAULT) {
988  _paramBuffer.resetSer();
989  _stat = _paramBuffer.serializeFrom(_val);
990  FW_ASSERT(_stat == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(_stat));
991  FW_ASSERT(this->paramDelegatePtr != nullptr);
992  _stat = this->paramDelegatePtr->deserializeParam(
993  _baseId,
995  this->m_param_SECTION_ENABLED_valid,
996  _paramBuffer
997  );
998  if (_stat != Fw::FW_SERIALIZE_OK) {
999  this->m_param_SECTION_ENABLED_valid = Fw::ParamValid::INVALID;
1000  }
1001  }
1002 
1003  this->m_paramLock.unlock();
1004  this->parameterLoaded(PARAMID_SECTION_ENABLED, this->m_param_SECTION_ENABLED_valid);
1005 
1006  _id = _baseId + PARAMID_SECTION_CONFIGS;
1007 
1008  // Get serialized parameter SECTION_CONFIGS
1009  this->m_param_SECTION_CONFIGS_valid = this->paramGetOut_out(
1010  0,
1011  _id,
1012  _paramBuffer
1013  );
1014 
1015  this->m_paramLock.lock();
1016 
1017  // Deserialize parameter or use default value
1018  if (this->m_param_SECTION_CONFIGS_valid == Fw::ParamValid::VALID) {
1019  FW_ASSERT(this->paramDelegatePtr != nullptr);
1020  _stat = this->paramDelegatePtr->deserializeParam(
1021  _baseId,
1023  this->m_param_SECTION_CONFIGS_valid,
1024  _paramBuffer
1025  );
1026  if (_stat != Fw::FW_SERIALIZE_OK) {
1027  this->m_param_SECTION_CONFIGS_valid = Fw::ParamValid::DEFAULT;
1028  }
1029  }
1030  else {
1031  this->m_param_SECTION_CONFIGS_valid = Fw::ParamValid::DEFAULT;
1032  }
1033  if (this->m_param_SECTION_CONFIGS_valid == Fw::ParamValid::DEFAULT) {
1035  _paramBuffer.resetSer();
1036  _stat = _paramBuffer.serializeFrom(_val);
1037  FW_ASSERT(_stat == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(_stat));
1038  FW_ASSERT(this->paramDelegatePtr != nullptr);
1039  _stat = this->paramDelegatePtr->deserializeParam(
1040  _baseId,
1042  this->m_param_SECTION_CONFIGS_valid,
1043  _paramBuffer
1044  );
1045  if (_stat != Fw::FW_SERIALIZE_OK) {
1046  this->m_param_SECTION_CONFIGS_valid = Fw::ParamValid::INVALID;
1047  }
1048  }
1049 
1050  this->m_paramLock.unlock();
1051  this->parameterLoaded(PARAMID_SECTION_CONFIGS, this->m_param_SECTION_CONFIGS_valid);
1052 
1053  // Call notifier
1054  this->parametersLoaded();
1055  }
1056 
1057  // ----------------------------------------------------------------------
1058  // Component construction and destruction
1059  // ----------------------------------------------------------------------
1060 
1062  TlmPacketizerComponentBase(const char* compName) :
1063  Fw::ActiveComponentBase(compName)
1064  {
1065  this->m_OversizedChannelThrottle = 0;
1066  }
1067 
1070  {
1071 
1072  }
1073 
1074 #if !FW_DIRECT_PORT_CALLS
1075 
1076  // ----------------------------------------------------------------------
1077  // Connection status queries for special output ports
1078  // ----------------------------------------------------------------------
1079 
1082  {
1083  FW_ASSERT(
1084  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
1085  static_cast<FwAssertArgType>(portNum)
1086  );
1087 
1088  return this->m_cmdRegOut_OutputPort[portNum].isConnected();
1089  }
1090 
1093  {
1094  FW_ASSERT(
1095  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
1096  static_cast<FwAssertArgType>(portNum)
1097  );
1098 
1099  return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
1100  }
1101 
1104  {
1105  FW_ASSERT(
1106  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
1107  static_cast<FwAssertArgType>(portNum)
1108  );
1109 
1110  return this->m_eventOut_OutputPort[portNum].isConnected();
1111  }
1112 
1115  {
1116  FW_ASSERT(
1117  (0 <= portNum) && (portNum < this->getNum_paramGetOut_OutputPorts()),
1118  static_cast<FwAssertArgType>(portNum)
1119  );
1120 
1121  return this->m_paramGetOut_OutputPort[portNum].isConnected();
1122  }
1123 
1126  {
1127  FW_ASSERT(
1128  (0 <= portNum) && (portNum < this->getNum_paramSetOut_OutputPorts()),
1129  static_cast<FwAssertArgType>(portNum)
1130  );
1131 
1132  return this->m_paramSetOut_OutputPort[portNum].isConnected();
1133  }
1134 
1135 #if FW_ENABLE_TEXT_LOGGING == 1
1136 
1137  bool TlmPacketizerComponentBase ::
1138  isConnected_textEventOut_OutputPort(FwIndexType portNum) const
1139  {
1140  FW_ASSERT(
1141  (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
1142  static_cast<FwAssertArgType>(portNum)
1143  );
1144 
1145  return this->m_textEventOut_OutputPort[portNum].isConnected();
1146  }
1147 
1148 #endif
1149 
1152  {
1153  FW_ASSERT(
1154  (0 <= portNum) && (portNum < this->getNum_timeGetOut_OutputPorts()),
1155  static_cast<FwAssertArgType>(portNum)
1156  );
1157 
1158  return this->m_timeGetOut_OutputPort[portNum].isConnected();
1159  }
1160 
1163  {
1164  FW_ASSERT(
1165  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
1166  static_cast<FwAssertArgType>(portNum)
1167  );
1168 
1169  return this->m_tlmOut_OutputPort[portNum].isConnected();
1170  }
1171 
1172 #endif
1173 
1174 #if !FW_DIRECT_PORT_CALLS
1175 
1176  // ----------------------------------------------------------------------
1177  // Connection status queries for typed output ports
1178  // ----------------------------------------------------------------------
1179 
1182  {
1183  FW_ASSERT(
1184  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
1185  static_cast<FwAssertArgType>(portNum)
1186  );
1187 
1188  return this->m_PktSend_OutputPort[portNum].isConnected();
1189  }
1190 
1193  {
1194  FW_ASSERT(
1195  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
1196  static_cast<FwAssertArgType>(portNum)
1197  );
1198 
1199  return this->m_pingOut_OutputPort[portNum].isConnected();
1200  }
1201 
1202 #endif
1203 
1204  // ----------------------------------------------------------------------
1205  // Port handler base-class functions for special input ports
1206  //
1207  // Call these functions directly to bypass the corresponding ports
1208  // ----------------------------------------------------------------------
1209 
1212  FwIndexType portNum,
1213  FwOpcodeType opCode,
1214  U32 cmdSeq,
1215  Fw::CmdArgBuffer& args
1216  )
1217  {
1218 
1219  const U32 idBase = this->getIdBase();
1220  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
1221 
1222  // Select base class function based on opcode
1223  switch (opCode - idBase) {
1224  case OPCODE_SET_LEVEL: {
1226  opCode,
1227  cmdSeq,
1228  args
1229  );
1230  break;
1231  }
1232 
1233  case OPCODE_SEND_PKT: {
1235  opCode,
1236  cmdSeq,
1237  args
1238  );
1239  break;
1240  }
1241 
1242  case OPCODE_ENABLE_SECTION: {
1244  opCode,
1245  cmdSeq,
1246  args
1247  );
1248  break;
1249  }
1250 
1251  case OPCODE_ENABLE_GROUP: {
1253  opCode,
1254  cmdSeq,
1255  args
1256  );
1257  break;
1258  }
1259 
1260  case OPCODE_FORCE_GROUP: {
1262  opCode,
1263  cmdSeq,
1264  args
1265  );
1266  break;
1267  }
1268 
1271  opCode,
1272  cmdSeq,
1273  args
1274  );
1275  break;
1276  }
1277 
1279  Fw::CmdResponse _cstat = this->paramSet_SECTION_ENABLED(args);
1280  this->cmdResponse_out(
1281  opCode,
1282  cmdSeq,
1283  _cstat
1284  );
1285  break;
1286  }
1287 
1289  Fw::CmdResponse _cstat = this->paramSave_SECTION_ENABLED();
1290  this->cmdResponse_out(
1291  opCode,
1292  cmdSeq,
1293  _cstat
1294  );
1295  break;
1296  }
1297 
1299  Fw::CmdResponse _cstat = this->paramSet_SECTION_CONFIGS(args);
1300  this->cmdResponse_out(
1301  opCode,
1302  cmdSeq,
1303  _cstat
1304  );
1305  break;
1306  }
1307 
1309  Fw::CmdResponse _cstat = this->paramSave_SECTION_CONFIGS();
1310  this->cmdResponse_out(
1311  opCode,
1312  cmdSeq,
1313  _cstat
1314  );
1315  break;
1316  }
1317  default:
1318  // Unknown opcode: ignore it
1319  break;
1320  }
1321  }
1322 
1323  // ----------------------------------------------------------------------
1324  // Port handler base-class functions for typed input ports
1325  //
1326  // Call these functions directly to bypass the corresponding ports
1327  // ----------------------------------------------------------------------
1328 
1331  FwIndexType portNum,
1332  U32 context
1333  )
1334  {
1335  // Make sure port number is valid
1336  FW_ASSERT(
1337  (0 <= portNum) && (portNum < this->getNum_Run_InputPorts()),
1338  static_cast<FwAssertArgType>(portNum)
1339  );
1340 
1341  // Call pre-message hook
1343  portNum,
1344  context
1345  );
1346  ComponentIpcSerializableBuffer msg;
1348 
1349  // Serialize message ID
1350  _status = msg.serializeFrom(
1351  static_cast<FwEnumStoreType>(RUN_SCHED)
1352  );
1353  FW_ASSERT(
1354  _status == Fw::FW_SERIALIZE_OK,
1355  static_cast<FwAssertArgType>(_status)
1356  );
1357 
1358  // Serialize port number
1359  _status = msg.serializeFrom(portNum);
1360  FW_ASSERT(
1361  _status == Fw::FW_SERIALIZE_OK,
1362  static_cast<FwAssertArgType>(_status)
1363  );
1364 
1365  // Serialize argument context
1366  _status = msg.serializeFrom(context);
1367  FW_ASSERT(
1368  _status == Fw::FW_SERIALIZE_OK,
1369  static_cast<FwAssertArgType>(_status)
1370  );
1371 
1372  // Send message
1374  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1375 
1376  FW_ASSERT(
1377  qStatus == Os::Queue::OP_OK,
1378  static_cast<FwAssertArgType>(qStatus)
1379  );
1380  }
1381 
1384  FwIndexType portNum,
1385  FwChanIdType id,
1386  Fw::Time& timeTag,
1387  Fw::TlmBuffer& val
1388  )
1389  {
1390  // Make sure port number is valid
1391  FW_ASSERT(
1392  (0 <= portNum) && (portNum < this->getNum_TlmGet_InputPorts()),
1393  static_cast<FwAssertArgType>(portNum)
1394  );
1395 
1396  Fw::TlmValid retVal;
1397 
1398  // Call handler function
1399  retVal = this->TlmGet_handler(
1400  portNum,
1401  id,
1402  timeTag,
1403  val
1404  );
1405 
1406  return retVal;
1407  }
1408 
1411  FwIndexType portNum,
1412  FwChanIdType id,
1413  Fw::Time& timeTag,
1414  Fw::TlmBuffer& val
1415  )
1416  {
1417  // Make sure port number is valid
1418  FW_ASSERT(
1419  (0 <= portNum) && (portNum < this->getNum_TlmRecv_InputPorts()),
1420  static_cast<FwAssertArgType>(portNum)
1421  );
1422 
1423  // Call handler function
1424  this->TlmRecv_handler(
1425  portNum,
1426  id,
1427  timeTag,
1428  val
1429  );
1430  }
1431 
1434  FwIndexType portNum,
1435  const Svc::TelemetrySection& section,
1436  FwChanIdType tlmGroup,
1437  const Svc::RateLogic& rateLogic,
1438  U32 minDelta,
1439  U32 maxDelta
1440  )
1441  {
1442  // Make sure port number is valid
1443  FW_ASSERT(
1444  (0 <= portNum) && (portNum < this->getNum_configureSectionGroupRate_InputPorts()),
1445  static_cast<FwAssertArgType>(portNum)
1446  );
1447 
1448  // Call pre-message hook
1450  portNum,
1451  section,
1452  tlmGroup,
1453  rateLogic,
1454  minDelta,
1455  maxDelta
1456  );
1457  ComponentIpcSerializableBuffer msg;
1459 
1460  // Serialize message ID
1461  _status = msg.serializeFrom(
1462  static_cast<FwEnumStoreType>(CONFIGURESECTIONGROUPRATE_CONFIGUREGROUPRATE)
1463  );
1464  FW_ASSERT(
1465  _status == Fw::FW_SERIALIZE_OK,
1466  static_cast<FwAssertArgType>(_status)
1467  );
1468 
1469  // Serialize port number
1470  _status = msg.serializeFrom(portNum);
1471  FW_ASSERT(
1472  _status == Fw::FW_SERIALIZE_OK,
1473  static_cast<FwAssertArgType>(_status)
1474  );
1475 
1476  // Serialize argument section
1477  _status = msg.serializeFrom(section);
1478  FW_ASSERT(
1479  _status == Fw::FW_SERIALIZE_OK,
1480  static_cast<FwAssertArgType>(_status)
1481  );
1482 
1483  // Serialize argument tlmGroup
1484  _status = msg.serializeFrom(tlmGroup);
1485  FW_ASSERT(
1486  _status == Fw::FW_SERIALIZE_OK,
1487  static_cast<FwAssertArgType>(_status)
1488  );
1489 
1490  // Serialize argument rateLogic
1491  _status = msg.serializeFrom(rateLogic);
1492  FW_ASSERT(
1493  _status == Fw::FW_SERIALIZE_OK,
1494  static_cast<FwAssertArgType>(_status)
1495  );
1496 
1497  // Serialize argument minDelta
1498  _status = msg.serializeFrom(minDelta);
1499  FW_ASSERT(
1500  _status == Fw::FW_SERIALIZE_OK,
1501  static_cast<FwAssertArgType>(_status)
1502  );
1503 
1504  // Serialize argument maxDelta
1505  _status = msg.serializeFrom(maxDelta);
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  FwIndexType portNum,
1524  const Svc::TelemetrySection& section,
1525  const Fw::Enabled& enabled
1526  )
1527  {
1528  // Make sure port number is valid
1529  FW_ASSERT(
1530  (0 <= portNum) && (portNum < this->getNum_controlIn_InputPorts()),
1531  static_cast<FwAssertArgType>(portNum)
1532  );
1533 
1534  // Call pre-message hook
1536  portNum,
1537  section,
1538  enabled
1539  );
1540  ComponentIpcSerializableBuffer msg;
1542 
1543  // Serialize message ID
1544  _status = msg.serializeFrom(
1545  static_cast<FwEnumStoreType>(CONTROLIN_ENABLESECTION)
1546  );
1547  FW_ASSERT(
1548  _status == Fw::FW_SERIALIZE_OK,
1549  static_cast<FwAssertArgType>(_status)
1550  );
1551 
1552  // Serialize port number
1553  _status = msg.serializeFrom(portNum);
1554  FW_ASSERT(
1555  _status == Fw::FW_SERIALIZE_OK,
1556  static_cast<FwAssertArgType>(_status)
1557  );
1558 
1559  // Serialize argument section
1560  _status = msg.serializeFrom(section);
1561  FW_ASSERT(
1562  _status == Fw::FW_SERIALIZE_OK,
1563  static_cast<FwAssertArgType>(_status)
1564  );
1565 
1566  // Serialize argument enabled
1567  _status = msg.serializeFrom(enabled);
1568  FW_ASSERT(
1569  _status == Fw::FW_SERIALIZE_OK,
1570  static_cast<FwAssertArgType>(_status)
1571  );
1572 
1573  // Send message
1575  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1576 
1577  FW_ASSERT(
1578  qStatus == Os::Queue::OP_OK,
1579  static_cast<FwAssertArgType>(qStatus)
1580  );
1581  }
1582 
1585  FwIndexType portNum,
1586  U32 key
1587  )
1588  {
1589  // Make sure port number is valid
1590  FW_ASSERT(
1591  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
1592  static_cast<FwAssertArgType>(portNum)
1593  );
1594 
1595  // Call pre-message hook
1597  portNum,
1598  key
1599  );
1600  ComponentIpcSerializableBuffer msg;
1602 
1603  // Serialize message ID
1604  _status = msg.serializeFrom(
1605  static_cast<FwEnumStoreType>(PINGIN_PING)
1606  );
1607  FW_ASSERT(
1608  _status == Fw::FW_SERIALIZE_OK,
1609  static_cast<FwAssertArgType>(_status)
1610  );
1611 
1612  // Serialize port number
1613  _status = msg.serializeFrom(portNum);
1614  FW_ASSERT(
1615  _status == Fw::FW_SERIALIZE_OK,
1616  static_cast<FwAssertArgType>(_status)
1617  );
1618 
1619  // Serialize argument key
1620  _status = msg.serializeFrom(key);
1621  FW_ASSERT(
1622  _status == Fw::FW_SERIALIZE_OK,
1623  static_cast<FwAssertArgType>(_status)
1624  );
1625 
1626  // Send message
1628  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1629 
1630  if (qStatus == Os::Queue::Status::FULL) {
1631  this->incNumMsgDropped();
1632  return;
1633  }
1634 
1635  FW_ASSERT(
1636  qStatus == Os::Queue::OP_OK,
1637  static_cast<FwAssertArgType>(qStatus)
1638  );
1639  }
1640 
1641  // ----------------------------------------------------------------------
1642  // Pre-message hooks for typed async input ports
1643  //
1644  // Each of these functions is invoked just before processing a message
1645  // on the corresponding port. By default, they do nothing. You can
1646  // override them to provide specific pre-message behavior.
1647  // ----------------------------------------------------------------------
1648 
1651  FwIndexType portNum,
1652  U32 context
1653  )
1654  {
1655  // Default: no-op
1656  }
1657 
1660  FwIndexType portNum,
1661  const Svc::TelemetrySection& section,
1662  FwChanIdType tlmGroup,
1663  const Svc::RateLogic& rateLogic,
1664  U32 minDelta,
1665  U32 maxDelta
1666  )
1667  {
1668  // Default: no-op
1669  }
1670 
1673  FwIndexType portNum,
1674  const Svc::TelemetrySection& section,
1675  const Fw::Enabled& enabled
1676  )
1677  {
1678  // Default: no-op
1679  }
1680 
1683  FwIndexType portNum,
1684  U32 key
1685  )
1686  {
1687  // Default: no-op
1688  }
1689 
1690 #if !FW_DIRECT_PORT_CALLS
1691 
1692  // ----------------------------------------------------------------------
1693  // Invocation functions for typed output ports
1694  // ----------------------------------------------------------------------
1695 
1698  FwIndexType portNum,
1699  Fw::ComBuffer& data,
1700  U32 context
1701  ) const
1702  {
1703  FW_ASSERT(
1704  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
1705  static_cast<FwAssertArgType>(portNum)
1706  );
1707 
1708  FW_ASSERT(
1709  this->m_PktSend_OutputPort[portNum].isConnected(),
1710  static_cast<FwAssertArgType>(portNum)
1711  );
1712  this->m_PktSend_OutputPort[portNum].invoke(
1713  data,
1714  context
1715  );
1716  }
1717 
1720  FwIndexType portNum,
1721  U32 key
1722  ) const
1723  {
1724  FW_ASSERT(
1725  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
1726  static_cast<FwAssertArgType>(portNum)
1727  );
1728 
1729  FW_ASSERT(
1730  this->m_pingOut_OutputPort[portNum].isConnected(),
1731  static_cast<FwAssertArgType>(portNum)
1732  );
1733  this->m_pingOut_OutputPort[portNum].invoke(
1734  key
1735  );
1736  }
1737 
1738 #endif
1739 
1740  // ----------------------------------------------------------------------
1741  // Command response
1742  // ----------------------------------------------------------------------
1743 
1746  FwOpcodeType opCode,
1747  U32 cmdSeq,
1748  Fw::CmdResponse response
1749  )
1750  {
1752  this->cmdResponseOut_out(0, opCode, cmdSeq, response);
1753  }
1754 
1755  // ----------------------------------------------------------------------
1756  // Command handler base-class functions
1757  //
1758  // Call these functions directly to bypass the command input port
1759  // ----------------------------------------------------------------------
1760 
1763  FwOpcodeType opCode,
1764  U32 cmdSeq,
1765  Fw::CmdArgBuffer& args
1766  )
1767  {
1768  // Call pre-message hook
1769  this->SET_LEVEL_preMsgHook(opCode,cmdSeq);
1770 
1771  // Defer deserializing arguments to the message dispatcher
1772  // to avoid deserializing and reserializing just for IPC
1773  ComponentIpcSerializableBuffer msg;
1775 
1776  // Serialize for IPC
1777  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_SET_LEVEL));
1778  FW_ASSERT (
1779  _status == Fw::FW_SERIALIZE_OK,
1780  static_cast<FwAssertArgType>(_status)
1781  );
1782 
1783  // Fake port number to make message dequeue work
1784  FwIndexType port = 0;
1785 
1786  _status = msg.serializeFrom(port);
1787  FW_ASSERT (
1788  _status == Fw::FW_SERIALIZE_OK,
1789  static_cast<FwAssertArgType>(_status)
1790  );
1791 
1792  _status = msg.serializeFrom(opCode);
1793  FW_ASSERT (
1794  _status == Fw::FW_SERIALIZE_OK,
1795  static_cast<FwAssertArgType>(_status)
1796  );
1797 
1798  _status = msg.serializeFrom(cmdSeq);
1799  FW_ASSERT (
1800  _status == Fw::FW_SERIALIZE_OK,
1801  static_cast<FwAssertArgType>(_status)
1802  );
1803 
1804  _status = msg.serializeFrom(args);
1805  FW_ASSERT (
1806  _status == Fw::FW_SERIALIZE_OK,
1807  static_cast<FwAssertArgType>(_status)
1808  );
1809 
1810  // Send message
1812  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1813 
1814  FW_ASSERT(
1815  qStatus == Os::Queue::OP_OK,
1816  static_cast<FwAssertArgType>(qStatus)
1817  );
1818  }
1819 
1822  FwOpcodeType opCode,
1823  U32 cmdSeq,
1824  Fw::CmdArgBuffer& args
1825  )
1826  {
1827  // Call pre-message hook
1828  this->SEND_PKT_preMsgHook(opCode,cmdSeq);
1829 
1830  // Defer deserializing arguments to the message dispatcher
1831  // to avoid deserializing and reserializing just for IPC
1832  ComponentIpcSerializableBuffer msg;
1834 
1835  // Serialize for IPC
1836  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_SEND_PKT));
1837  FW_ASSERT (
1838  _status == Fw::FW_SERIALIZE_OK,
1839  static_cast<FwAssertArgType>(_status)
1840  );
1841 
1842  // Fake port number to make message dequeue work
1843  FwIndexType port = 0;
1844 
1845  _status = msg.serializeFrom(port);
1846  FW_ASSERT (
1847  _status == Fw::FW_SERIALIZE_OK,
1848  static_cast<FwAssertArgType>(_status)
1849  );
1850 
1851  _status = msg.serializeFrom(opCode);
1852  FW_ASSERT (
1853  _status == Fw::FW_SERIALIZE_OK,
1854  static_cast<FwAssertArgType>(_status)
1855  );
1856 
1857  _status = msg.serializeFrom(cmdSeq);
1858  FW_ASSERT (
1859  _status == Fw::FW_SERIALIZE_OK,
1860  static_cast<FwAssertArgType>(_status)
1861  );
1862 
1863  _status = msg.serializeFrom(args);
1864  FW_ASSERT (
1865  _status == Fw::FW_SERIALIZE_OK,
1866  static_cast<FwAssertArgType>(_status)
1867  );
1868 
1869  // Send message
1871  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1872 
1873  FW_ASSERT(
1874  qStatus == Os::Queue::OP_OK,
1875  static_cast<FwAssertArgType>(qStatus)
1876  );
1877  }
1878 
1881  FwOpcodeType opCode,
1882  U32 cmdSeq,
1883  Fw::CmdArgBuffer& args
1884  )
1885  {
1886  // Call pre-message hook
1887  this->ENABLE_SECTION_preMsgHook(opCode,cmdSeq);
1888 
1889  // Defer deserializing arguments to the message dispatcher
1890  // to avoid deserializing and reserializing just for IPC
1891  ComponentIpcSerializableBuffer msg;
1893 
1894  // Serialize for IPC
1895  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_ENABLE_SECTION));
1896  FW_ASSERT (
1897  _status == Fw::FW_SERIALIZE_OK,
1898  static_cast<FwAssertArgType>(_status)
1899  );
1900 
1901  // Fake port number to make message dequeue work
1902  FwIndexType port = 0;
1903 
1904  _status = msg.serializeFrom(port);
1905  FW_ASSERT (
1906  _status == Fw::FW_SERIALIZE_OK,
1907  static_cast<FwAssertArgType>(_status)
1908  );
1909 
1910  _status = msg.serializeFrom(opCode);
1911  FW_ASSERT (
1912  _status == Fw::FW_SERIALIZE_OK,
1913  static_cast<FwAssertArgType>(_status)
1914  );
1915 
1916  _status = msg.serializeFrom(cmdSeq);
1917  FW_ASSERT (
1918  _status == Fw::FW_SERIALIZE_OK,
1919  static_cast<FwAssertArgType>(_status)
1920  );
1921 
1922  _status = msg.serializeFrom(args);
1923  FW_ASSERT (
1924  _status == Fw::FW_SERIALIZE_OK,
1925  static_cast<FwAssertArgType>(_status)
1926  );
1927 
1928  // Send message
1930  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1931 
1932  FW_ASSERT(
1933  qStatus == Os::Queue::OP_OK,
1934  static_cast<FwAssertArgType>(qStatus)
1935  );
1936  }
1937 
1940  FwOpcodeType opCode,
1941  U32 cmdSeq,
1942  Fw::CmdArgBuffer& args
1943  )
1944  {
1945  // Call pre-message hook
1946  this->ENABLE_GROUP_preMsgHook(opCode,cmdSeq);
1947 
1948  // Defer deserializing arguments to the message dispatcher
1949  // to avoid deserializing and reserializing just for IPC
1950  ComponentIpcSerializableBuffer msg;
1952 
1953  // Serialize for IPC
1954  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_ENABLE_GROUP));
1955  FW_ASSERT (
1956  _status == Fw::FW_SERIALIZE_OK,
1957  static_cast<FwAssertArgType>(_status)
1958  );
1959 
1960  // Fake port number to make message dequeue work
1961  FwIndexType port = 0;
1962 
1963  _status = msg.serializeFrom(port);
1964  FW_ASSERT (
1965  _status == Fw::FW_SERIALIZE_OK,
1966  static_cast<FwAssertArgType>(_status)
1967  );
1968 
1969  _status = msg.serializeFrom(opCode);
1970  FW_ASSERT (
1971  _status == Fw::FW_SERIALIZE_OK,
1972  static_cast<FwAssertArgType>(_status)
1973  );
1974 
1975  _status = msg.serializeFrom(cmdSeq);
1976  FW_ASSERT (
1977  _status == Fw::FW_SERIALIZE_OK,
1978  static_cast<FwAssertArgType>(_status)
1979  );
1980 
1981  _status = msg.serializeFrom(args);
1982  FW_ASSERT (
1983  _status == Fw::FW_SERIALIZE_OK,
1984  static_cast<FwAssertArgType>(_status)
1985  );
1986 
1987  // Send message
1989  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1990 
1991  FW_ASSERT(
1992  qStatus == Os::Queue::OP_OK,
1993  static_cast<FwAssertArgType>(qStatus)
1994  );
1995  }
1996 
1999  FwOpcodeType opCode,
2000  U32 cmdSeq,
2001  Fw::CmdArgBuffer& args
2002  )
2003  {
2004  // Call pre-message hook
2005  this->FORCE_GROUP_preMsgHook(opCode,cmdSeq);
2006 
2007  // Defer deserializing arguments to the message dispatcher
2008  // to avoid deserializing and reserializing just for IPC
2009  ComponentIpcSerializableBuffer msg;
2011 
2012  // Serialize for IPC
2013  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_FORCE_GROUP));
2014  FW_ASSERT (
2015  _status == Fw::FW_SERIALIZE_OK,
2016  static_cast<FwAssertArgType>(_status)
2017  );
2018 
2019  // Fake port number to make message dequeue work
2020  FwIndexType port = 0;
2021 
2022  _status = msg.serializeFrom(port);
2023  FW_ASSERT (
2024  _status == Fw::FW_SERIALIZE_OK,
2025  static_cast<FwAssertArgType>(_status)
2026  );
2027 
2028  _status = msg.serializeFrom(opCode);
2029  FW_ASSERT (
2030  _status == Fw::FW_SERIALIZE_OK,
2031  static_cast<FwAssertArgType>(_status)
2032  );
2033 
2034  _status = msg.serializeFrom(cmdSeq);
2035  FW_ASSERT (
2036  _status == Fw::FW_SERIALIZE_OK,
2037  static_cast<FwAssertArgType>(_status)
2038  );
2039 
2040  _status = msg.serializeFrom(args);
2041  FW_ASSERT (
2042  _status == Fw::FW_SERIALIZE_OK,
2043  static_cast<FwAssertArgType>(_status)
2044  );
2045 
2046  // Send message
2048  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
2049 
2050  FW_ASSERT(
2051  qStatus == Os::Queue::OP_OK,
2052  static_cast<FwAssertArgType>(qStatus)
2053  );
2054  }
2055 
2058  FwOpcodeType opCode,
2059  U32 cmdSeq,
2060  Fw::CmdArgBuffer& args
2061  )
2062  {
2063  // Call pre-message hook
2064  this->CONFIGURE_GROUP_RATES_preMsgHook(opCode,cmdSeq);
2065 
2066  // Defer deserializing arguments to the message dispatcher
2067  // to avoid deserializing and reserializing just for IPC
2068  ComponentIpcSerializableBuffer msg;
2070 
2071  // Serialize for IPC
2072  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CONFIGURE_GROUP_RATES));
2073  FW_ASSERT (
2074  _status == Fw::FW_SERIALIZE_OK,
2075  static_cast<FwAssertArgType>(_status)
2076  );
2077 
2078  // Fake port number to make message dequeue work
2079  FwIndexType port = 0;
2080 
2081  _status = msg.serializeFrom(port);
2082  FW_ASSERT (
2083  _status == Fw::FW_SERIALIZE_OK,
2084  static_cast<FwAssertArgType>(_status)
2085  );
2086 
2087  _status = msg.serializeFrom(opCode);
2088  FW_ASSERT (
2089  _status == Fw::FW_SERIALIZE_OK,
2090  static_cast<FwAssertArgType>(_status)
2091  );
2092 
2093  _status = msg.serializeFrom(cmdSeq);
2094  FW_ASSERT (
2095  _status == Fw::FW_SERIALIZE_OK,
2096  static_cast<FwAssertArgType>(_status)
2097  );
2098 
2099  _status = msg.serializeFrom(args);
2100  FW_ASSERT (
2101  _status == Fw::FW_SERIALIZE_OK,
2102  static_cast<FwAssertArgType>(_status)
2103  );
2104 
2105  // Send message
2107  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
2108 
2109  FW_ASSERT(
2110  qStatus == Os::Queue::OP_OK,
2111  static_cast<FwAssertArgType>(qStatus)
2112  );
2113  }
2114 
2115  // ----------------------------------------------------------------------
2116  // Pre-message hooks for async commands
2117  //
2118  // Each of these functions is invoked just before processing the
2119  // corresponding command. By default they do nothing. You can
2120  // override them to provide specific pre-command behavior.
2121  // ----------------------------------------------------------------------
2122 
2125  FwOpcodeType opCode,
2126  U32 cmdSeq
2127  )
2128  {
2129  // Defaults to no-op; can be overridden
2130  (void) opCode;
2131  (void) cmdSeq;
2132  }
2133 
2136  FwOpcodeType opCode,
2137  U32 cmdSeq
2138  )
2139  {
2140  // Defaults to no-op; can be overridden
2141  (void) opCode;
2142  (void) cmdSeq;
2143  }
2144 
2147  FwOpcodeType opCode,
2148  U32 cmdSeq
2149  )
2150  {
2151  // Defaults to no-op; can be overridden
2152  (void) opCode;
2153  (void) cmdSeq;
2154  }
2155 
2158  FwOpcodeType opCode,
2159  U32 cmdSeq
2160  )
2161  {
2162  // Defaults to no-op; can be overridden
2163  (void) opCode;
2164  (void) cmdSeq;
2165  }
2166 
2169  FwOpcodeType opCode,
2170  U32 cmdSeq
2171  )
2172  {
2173  // Defaults to no-op; can be overridden
2174  (void) opCode;
2175  (void) cmdSeq;
2176  }
2177 
2180  FwOpcodeType opCode,
2181  U32 cmdSeq
2182  )
2183  {
2184  // Defaults to no-op; can be overridden
2185  (void) opCode;
2186  (void) cmdSeq;
2187  }
2188 
2189  // ----------------------------------------------------------------------
2190  // Event logging functions
2191  // ----------------------------------------------------------------------
2192 
2195  {
2196  // Get the time
2197  Fw::Time _logTime;
2198  if (this->isConnected_timeGetOut_OutputPort(0)) {
2199  this->timeGetOut_out(0, _logTime);
2200  }
2201 
2202  const FwEventIdType _id = this->getIdBase() + EVENTID_NOCHAN;
2203 
2204  // Emit the event on the log port
2205  if (this->isConnected_eventOut_OutputPort(0)) {
2206  Fw::LogBuffer _logBuff;
2208 
2209 #if FW_AMPCS_COMPATIBLE
2210  // Serialize the number of arguments
2211  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2212  FW_ASSERT(
2213  _status == Fw::FW_SERIALIZE_OK,
2214  static_cast<FwAssertArgType>(_status)
2215  );
2216 #endif
2217 
2218 #if FW_AMPCS_COMPATIBLE
2219  // Serialize the argument size
2220  _status = _logBuff.serializeFrom(
2221  static_cast<U8>(sizeof(FwChanIdType))
2222  );
2223  FW_ASSERT(
2224  _status == Fw::FW_SERIALIZE_OK,
2225  static_cast<FwAssertArgType>(_status)
2226  );
2227 #endif
2228  _status = _logBuff.serializeFrom(Id);
2229  FW_ASSERT(
2230  _status == Fw::FW_SERIALIZE_OK,
2231  static_cast<FwAssertArgType>(_status)
2232  );
2233 
2234  this->eventOut_out(
2235  0,
2236  _id,
2237  _logTime,
2239  _logBuff
2240  );
2241  }
2242 
2243  // Emit the event on the text log port
2244 #if FW_ENABLE_TEXT_LOGGING
2245  if (this->isConnected_textEventOut_OutputPort(0)) {
2246 #if FW_OBJECT_NAMES == 1
2247  const char* _formatString =
2248  "(%s) %s: Telemetry ID 0x%" PRIx32 " not packetized";
2249 #else
2250  const char* _formatString =
2251  "%s: Telemetry ID 0x%" PRIx32 " not packetized";
2252 #endif
2253 
2254  Fw::TextLogString _logString;
2255  (void) _logString.format(
2256  _formatString,
2257 #if FW_OBJECT_NAMES == 1
2258  this->m_objName.toChar(),
2259 #endif
2260  "NoChan ",
2261  Id
2262  );
2263 
2264  this->textEventOut_out(
2265  0,
2266  _id,
2267  _logTime,
2269  _logString
2270  );
2271  }
2272 #endif
2273  }
2274 
2277  {
2278  // Get the time
2279  Fw::Time _logTime;
2280  if (this->isConnected_timeGetOut_OutputPort(0)) {
2281  this->timeGetOut_out(0, _logTime);
2282  }
2283 
2284  const FwEventIdType _id = this->getIdBase() + EVENTID_LEVELSET;
2285 
2286  // Emit the event on the log port
2287  if (this->isConnected_eventOut_OutputPort(0)) {
2288  Fw::LogBuffer _logBuff;
2290 
2291 #if FW_AMPCS_COMPATIBLE
2292  // Serialize the number of arguments
2293  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2294  FW_ASSERT(
2295  _status == Fw::FW_SERIALIZE_OK,
2296  static_cast<FwAssertArgType>(_status)
2297  );
2298 #endif
2299 
2300 #if FW_AMPCS_COMPATIBLE
2301  // Serialize the argument size
2302  _status = _logBuff.serializeFrom(
2303  static_cast<U8>(sizeof(FwChanIdType))
2304  );
2305  FW_ASSERT(
2306  _status == Fw::FW_SERIALIZE_OK,
2307  static_cast<FwAssertArgType>(_status)
2308  );
2309 #endif
2310  _status = _logBuff.serializeFrom(level);
2311  FW_ASSERT(
2312  _status == Fw::FW_SERIALIZE_OK,
2313  static_cast<FwAssertArgType>(_status)
2314  );
2315 
2316  this->eventOut_out(
2317  0,
2318  _id,
2319  _logTime,
2321  _logBuff
2322  );
2323  }
2324 
2325  // Emit the event on the text log port
2326 #if FW_ENABLE_TEXT_LOGGING
2327  if (this->isConnected_textEventOut_OutputPort(0)) {
2328 #if FW_OBJECT_NAMES == 1
2329  const char* _formatString =
2330  "(%s) %s: Telemetry send level to %" PRIu32 "";
2331 #else
2332  const char* _formatString =
2333  "%s: Telemetry send level to %" PRIu32 "";
2334 #endif
2335 
2336  Fw::TextLogString _logString;
2337  (void) _logString.format(
2338  _formatString,
2339 #if FW_OBJECT_NAMES == 1
2340  this->m_objName.toChar(),
2341 #endif
2342  "LevelSet ",
2343  level
2344  );
2345 
2346  this->textEventOut_out(
2347  0,
2348  _id,
2349  _logTime,
2351  _logString
2352  );
2353  }
2354 #endif
2355  }
2356 
2359  FwChanIdType level,
2360  FwChanIdType max
2361  ) const
2362  {
2363  // Get the time
2364  Fw::Time _logTime;
2365  if (this->isConnected_timeGetOut_OutputPort(0)) {
2366  this->timeGetOut_out(0, _logTime);
2367  }
2368 
2369  const FwEventIdType _id = this->getIdBase() + EVENTID_MAXLEVELEXCEED;
2370 
2371  // Emit the event on the log port
2372  if (this->isConnected_eventOut_OutputPort(0)) {
2373  Fw::LogBuffer _logBuff;
2375 
2376 #if FW_AMPCS_COMPATIBLE
2377  // Serialize the number of arguments
2378  _status = _logBuff.serializeFrom(static_cast<U8>(2));
2379  FW_ASSERT(
2380  _status == Fw::FW_SERIALIZE_OK,
2381  static_cast<FwAssertArgType>(_status)
2382  );
2383 #endif
2384 
2385 #if FW_AMPCS_COMPATIBLE
2386  // Serialize the argument size
2387  _status = _logBuff.serializeFrom(
2388  static_cast<U8>(sizeof(FwChanIdType))
2389  );
2390  FW_ASSERT(
2391  _status == Fw::FW_SERIALIZE_OK,
2392  static_cast<FwAssertArgType>(_status)
2393  );
2394 #endif
2395  _status = _logBuff.serializeFrom(level);
2396  FW_ASSERT(
2397  _status == Fw::FW_SERIALIZE_OK,
2398  static_cast<FwAssertArgType>(_status)
2399  );
2400 
2401 #if FW_AMPCS_COMPATIBLE
2402  // Serialize the argument size
2403  _status = _logBuff.serializeFrom(
2404  static_cast<U8>(sizeof(FwChanIdType))
2405  );
2406  FW_ASSERT(
2407  _status == Fw::FW_SERIALIZE_OK,
2408  static_cast<FwAssertArgType>(_status)
2409  );
2410 #endif
2411  _status = _logBuff.serializeFrom(max);
2412  FW_ASSERT(
2413  _status == Fw::FW_SERIALIZE_OK,
2414  static_cast<FwAssertArgType>(_status)
2415  );
2416 
2417  this->eventOut_out(
2418  0,
2419  _id,
2420  _logTime,
2422  _logBuff
2423  );
2424  }
2425 
2426  // Emit the event on the text log port
2427 #if FW_ENABLE_TEXT_LOGGING
2428  if (this->isConnected_textEventOut_OutputPort(0)) {
2429 #if FW_OBJECT_NAMES == 1
2430  const char* _formatString =
2431  "(%s) %s: Requested send level %" PRIu32 " higher than max packet level of %" PRIu32 "";
2432 #else
2433  const char* _formatString =
2434  "%s: Requested send level %" PRIu32 " higher than max packet level of %" PRIu32 "";
2435 #endif
2436 
2437  Fw::TextLogString _logString;
2438  (void) _logString.format(
2439  _formatString,
2440 #if FW_OBJECT_NAMES == 1
2441  this->m_objName.toChar(),
2442 #endif
2443  "MaxLevelExceed ",
2444  level,
2445  max
2446  );
2447 
2448  this->textEventOut_out(
2449  0,
2450  _id,
2451  _logTime,
2453  _logString
2454  );
2455  }
2456 #endif
2457  }
2458 
2460  log_ACTIVITY_LO_PacketSent(U32 packetId) const
2461  {
2462  // Get the time
2463  Fw::Time _logTime;
2464  if (this->isConnected_timeGetOut_OutputPort(0)) {
2465  this->timeGetOut_out(0, _logTime);
2466  }
2467 
2468  const FwEventIdType _id = this->getIdBase() + EVENTID_PACKETSENT;
2469 
2470  // Emit the event on the log port
2471  if (this->isConnected_eventOut_OutputPort(0)) {
2472  Fw::LogBuffer _logBuff;
2474 
2475 #if FW_AMPCS_COMPATIBLE
2476  // Serialize the number of arguments
2477  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2478  FW_ASSERT(
2479  _status == Fw::FW_SERIALIZE_OK,
2480  static_cast<FwAssertArgType>(_status)
2481  );
2482 #endif
2483 
2484 #if FW_AMPCS_COMPATIBLE
2485  // Serialize the argument size
2486  _status = _logBuff.serializeFrom(
2487  static_cast<U8>(sizeof(U32))
2488  );
2489  FW_ASSERT(
2490  _status == Fw::FW_SERIALIZE_OK,
2491  static_cast<FwAssertArgType>(_status)
2492  );
2493 #endif
2494  _status = _logBuff.serializeFrom(packetId);
2495  FW_ASSERT(
2496  _status == Fw::FW_SERIALIZE_OK,
2497  static_cast<FwAssertArgType>(_status)
2498  );
2499 
2500  this->eventOut_out(
2501  0,
2502  _id,
2503  _logTime,
2505  _logBuff
2506  );
2507  }
2508 
2509  // Emit the event on the text log port
2510 #if FW_ENABLE_TEXT_LOGGING
2511  if (this->isConnected_textEventOut_OutputPort(0)) {
2512 #if FW_OBJECT_NAMES == 1
2513  const char* _formatString =
2514  "(%s) %s: Sent packet ID %" PRIu32 "";
2515 #else
2516  const char* _formatString =
2517  "%s: Sent packet ID %" PRIu32 "";
2518 #endif
2519 
2520  Fw::TextLogString _logString;
2521  (void) _logString.format(
2522  _formatString,
2523 #if FW_OBJECT_NAMES == 1
2524  this->m_objName.toChar(),
2525 #endif
2526  "PacketSent ",
2527  packetId
2528  );
2529 
2530  this->textEventOut_out(
2531  0,
2532  _id,
2533  _logTime,
2535  _logString
2536  );
2537  }
2538 #endif
2539  }
2540 
2543  {
2544  // Get the time
2545  Fw::Time _logTime;
2546  if (this->isConnected_timeGetOut_OutputPort(0)) {
2547  this->timeGetOut_out(0, _logTime);
2548  }
2549 
2550  const FwEventIdType _id = this->getIdBase() + EVENTID_PACKETNOTFOUND;
2551 
2552  // Emit the event on the log port
2553  if (this->isConnected_eventOut_OutputPort(0)) {
2554  Fw::LogBuffer _logBuff;
2556 
2557 #if FW_AMPCS_COMPATIBLE
2558  // Serialize the number of arguments
2559  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2560  FW_ASSERT(
2561  _status == Fw::FW_SERIALIZE_OK,
2562  static_cast<FwAssertArgType>(_status)
2563  );
2564 #endif
2565 
2566 #if FW_AMPCS_COMPATIBLE
2567  // Serialize the argument size
2568  _status = _logBuff.serializeFrom(
2569  static_cast<U8>(sizeof(U32))
2570  );
2571  FW_ASSERT(
2572  _status == Fw::FW_SERIALIZE_OK,
2573  static_cast<FwAssertArgType>(_status)
2574  );
2575 #endif
2576  _status = _logBuff.serializeFrom(packetId);
2577  FW_ASSERT(
2578  _status == Fw::FW_SERIALIZE_OK,
2579  static_cast<FwAssertArgType>(_status)
2580  );
2581 
2582  this->eventOut_out(
2583  0,
2584  _id,
2585  _logTime,
2587  _logBuff
2588  );
2589  }
2590 
2591  // Emit the event on the text log port
2592 #if FW_ENABLE_TEXT_LOGGING
2593  if (this->isConnected_textEventOut_OutputPort(0)) {
2594 #if FW_OBJECT_NAMES == 1
2595  const char* _formatString =
2596  "(%s) %s: Could not find packet ID %" PRIu32 "";
2597 #else
2598  const char* _formatString =
2599  "%s: Could not find packet ID %" PRIu32 "";
2600 #endif
2601 
2602  Fw::TextLogString _logString;
2603  (void) _logString.format(
2604  _formatString,
2605 #if FW_OBJECT_NAMES == 1
2606  this->m_objName.toChar(),
2607 #endif
2608  "PacketNotFound ",
2609  packetId
2610  );
2611 
2612  this->textEventOut_out(
2613  0,
2614  _id,
2615  _logTime,
2617  _logString
2618  );
2619  }
2620 #endif
2621  }
2622 
2625  const Svc::TelemetrySection& section,
2626  const Fw::Enabled& enable
2627  ) const
2628  {
2629  // Get the time
2630  Fw::Time _logTime;
2631  if (this->isConnected_timeGetOut_OutputPort(0)) {
2632  this->timeGetOut_out(0, _logTime);
2633  }
2634 
2636 
2637  // Emit the event on the log port
2638  if (this->isConnected_eventOut_OutputPort(0)) {
2639  Fw::LogBuffer _logBuff;
2641 
2642 #if FW_AMPCS_COMPATIBLE
2643  // Serialize the number of arguments
2644  _status = _logBuff.serializeFrom(static_cast<U8>(2));
2645  FW_ASSERT(
2646  _status == Fw::FW_SERIALIZE_OK,
2647  static_cast<FwAssertArgType>(_status)
2648  );
2649 #endif
2650 
2651 #if FW_AMPCS_COMPATIBLE
2652  // Serialize the argument size
2653  _status = _logBuff.serializeFrom(
2655  );
2656  FW_ASSERT(
2657  _status == Fw::FW_SERIALIZE_OK,
2658  static_cast<FwAssertArgType>(_status)
2659  );
2660 #endif
2661  _status = _logBuff.serializeFrom(section);
2662  FW_ASSERT(
2663  _status == Fw::FW_SERIALIZE_OK,
2664  static_cast<FwAssertArgType>(_status)
2665  );
2666 
2667 #if FW_AMPCS_COMPATIBLE
2668  // Serialize the argument size
2669  _status = _logBuff.serializeFrom(
2670  static_cast<U8>(Fw::Enabled::SERIALIZED_SIZE)
2671  );
2672  FW_ASSERT(
2673  _status == Fw::FW_SERIALIZE_OK,
2674  static_cast<FwAssertArgType>(_status)
2675  );
2676 #endif
2677  _status = _logBuff.serializeFrom(enable);
2678  FW_ASSERT(
2679  _status == Fw::FW_SERIALIZE_OK,
2680  static_cast<FwAssertArgType>(_status)
2681  );
2682 
2683  this->eventOut_out(
2684  0,
2685  _id,
2686  _logTime,
2688  _logBuff
2689  );
2690  }
2691 
2692  // Emit the event on the text log port
2693 #if FW_ENABLE_TEXT_LOGGING
2694  if (this->isConnected_textEventOut_OutputPort(0)) {
2695 #if FW_OBJECT_NAMES == 1
2696  const char* _formatString =
2697  "(%s) %s: Section %s is unconfigurable and cannot be set to %s";
2698 #else
2699  const char* _formatString =
2700  "%s: Section %s is unconfigurable and cannot be set to %s";
2701 #endif
2702 
2703  Fw::String sectionStr;
2704  section.toString(sectionStr);
2705  Fw::String enableStr;
2706  enable.toString(enableStr);
2707 
2708  Fw::TextLogString _logString;
2709  (void) _logString.format(
2710  _formatString,
2711 #if FW_OBJECT_NAMES == 1
2712  this->m_objName.toChar(),
2713 #endif
2714  "SectionUnconfigurable ",
2715  sectionStr.toChar(),
2716  enableStr.toChar()
2717  );
2718 
2719  this->textEventOut_out(
2720  0,
2721  _id,
2722  _logTime,
2724  _logString
2725  );
2726  }
2727 #endif
2728  }
2729 
2732  FwChanIdType Id,
2733  FwSizeType valSize,
2734  FwSizeType expected
2735  )
2736  {
2737  // Check throttle value
2738  if (this->m_OversizedChannelThrottle >= EVENTID_OVERSIZEDCHANNEL_THROTTLE) {
2739  return;
2740  }
2741  else {
2742  this->m_OversizedChannelThrottle++;
2743  }
2744 
2745  // Get the time
2746  Fw::Time _logTime;
2747  if (this->isConnected_timeGetOut_OutputPort(0)) {
2748  this->timeGetOut_out(0, _logTime);
2749  }
2750 
2751  const FwEventIdType _id = this->getIdBase() + EVENTID_OVERSIZEDCHANNEL;
2752 
2753  // Emit the event on the log port
2754  if (this->isConnected_eventOut_OutputPort(0)) {
2755  Fw::LogBuffer _logBuff;
2757 
2758 #if FW_AMPCS_COMPATIBLE
2759  // Serialize the number of arguments
2760  _status = _logBuff.serializeFrom(static_cast<U8>(3));
2761  FW_ASSERT(
2762  _status == Fw::FW_SERIALIZE_OK,
2763  static_cast<FwAssertArgType>(_status)
2764  );
2765 #endif
2766 
2767 #if FW_AMPCS_COMPATIBLE
2768  // Serialize the argument size
2769  _status = _logBuff.serializeFrom(
2770  static_cast<U8>(sizeof(FwChanIdType))
2771  );
2772  FW_ASSERT(
2773  _status == Fw::FW_SERIALIZE_OK,
2774  static_cast<FwAssertArgType>(_status)
2775  );
2776 #endif
2777  _status = _logBuff.serializeFrom(Id);
2778  FW_ASSERT(
2779  _status == Fw::FW_SERIALIZE_OK,
2780  static_cast<FwAssertArgType>(_status)
2781  );
2782 
2783 #if FW_AMPCS_COMPATIBLE
2784  // Serialize the argument size
2785  _status = _logBuff.serializeFrom(
2786  static_cast<U8>(sizeof(FwSizeType))
2787  );
2788  FW_ASSERT(
2789  _status == Fw::FW_SERIALIZE_OK,
2790  static_cast<FwAssertArgType>(_status)
2791  );
2792 #endif
2793  _status = _logBuff.serializeFrom(valSize);
2794  FW_ASSERT(
2795  _status == Fw::FW_SERIALIZE_OK,
2796  static_cast<FwAssertArgType>(_status)
2797  );
2798 
2799 #if FW_AMPCS_COMPATIBLE
2800  // Serialize the argument size
2801  _status = _logBuff.serializeFrom(
2802  static_cast<U8>(sizeof(FwSizeType))
2803  );
2804  FW_ASSERT(
2805  _status == Fw::FW_SERIALIZE_OK,
2806  static_cast<FwAssertArgType>(_status)
2807  );
2808 #endif
2809  _status = _logBuff.serializeFrom(expected);
2810  FW_ASSERT(
2811  _status == Fw::FW_SERIALIZE_OK,
2812  static_cast<FwAssertArgType>(_status)
2813  );
2814 
2815  this->eventOut_out(
2816  0,
2817  _id,
2818  _logTime,
2820  _logBuff
2821  );
2822  }
2823 
2824  // Emit the event on the text log port
2825 #if FW_ENABLE_TEXT_LOGGING
2826  if (this->isConnected_textEventOut_OutputPort(0)) {
2827 #if FW_OBJECT_NAMES == 1
2828  const char* _formatString =
2829  "(%s) %s: Telemetry ID 0x%" PRIx32 " update of size %" PRIu64 " exceeds configured size %" PRIu64 "";
2830 #else
2831  const char* _formatString =
2832  "%s: Telemetry ID 0x%" PRIx32 " update of size %" PRIu64 " exceeds configured size %" PRIu64 "";
2833 #endif
2834 
2835  Fw::TextLogString _logString;
2836  (void) _logString.format(
2837  _formatString,
2838 #if FW_OBJECT_NAMES == 1
2839  this->m_objName.toChar(),
2840 #endif
2841  "OversizedChannel ",
2842  Id,
2843  valSize,
2844  expected
2845  );
2846 
2847  this->textEventOut_out(
2848  0,
2849  _id,
2850  _logTime,
2852  _logString
2853  );
2854  }
2855 #endif
2856  }
2857 
2858  // ----------------------------------------------------------------------
2859  // Event throttle reset functions
2860  // ----------------------------------------------------------------------
2861 
2864  {
2865  // Reset throttle counter
2866  this->m_OversizedChannelThrottle = 0;
2867  }
2868 
2869  // ----------------------------------------------------------------------
2870  // Telemetry serialized write
2871  // ----------------------------------------------------------------------
2872 
2875  FwChanIdType id,
2876  Fw::TlmBuffer& _tlmBuff,
2877  Fw::Time _tlmTime
2878  ) const
2879  {
2880  if (this->isConnected_tlmOut_OutputPort(0)) {
2881  if (
2883  (_tlmTime == Fw::ZERO_TIME)
2884  ) {
2885  this->timeGetOut_out(0, _tlmTime);
2886  }
2887 
2888  FwChanIdType _id;
2889  _id = this->getIdBase() + id;
2890 
2891  this->tlmOut_out(
2892  0,
2893  _id,
2894  _tlmTime,
2895  _tlmBuff
2896  );
2897  }
2898  }
2899 
2900  // ----------------------------------------------------------------------
2901  // Telemetry write functions
2902  // ----------------------------------------------------------------------
2903 
2907  Fw::Time _tlmTime
2908  ) const
2909  {
2910  if (this->isConnected_tlmOut_OutputPort(0)) {
2911  Fw::TlmBuffer _tlmBuff;
2912  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
2913  FW_ASSERT(
2914  _stat == Fw::FW_SERIALIZE_OK,
2915  static_cast<FwAssertArgType>(_stat)
2916  );
2917 
2918  this->tlmWrite(
2920  _tlmBuff,
2921  _tlmTime
2922  );
2923  }
2924  }
2925 
2929  Fw::Time _tlmTime
2930  ) const
2931  {
2932  if (this->isConnected_tlmOut_OutputPort(0)) {
2933  Fw::TlmBuffer _tlmBuff;
2934  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
2935  FW_ASSERT(
2936  _stat == Fw::FW_SERIALIZE_OK,
2937  static_cast<FwAssertArgType>(_stat)
2938  );
2939 
2940  this->tlmWrite(
2942  _tlmBuff,
2943  _tlmTime
2944  );
2945  }
2946  }
2947 
2948  // ----------------------------------------------------------------------
2949  // Parameter hook functions
2950  // ----------------------------------------------------------------------
2951 
2954  {
2955  // Do nothing by default
2956  }
2957 
2960  {
2961  // Do nothing by default
2962  }
2963 
2966  FwPrmIdType id,
2967  Fw::ParamValid valid
2968  )
2969  {
2970  if (FW_PARAM_OK(valid)) {
2971  this->parameterUpdated(id);
2972  }
2973  }
2974 
2975  // ----------------------------------------------------------------------
2976  // Parameter get functions
2977  // ----------------------------------------------------------------------
2978 
2981  {
2983  this->m_paramLock.lock();
2984  valid = this->m_param_SECTION_ENABLED_valid;
2985  if ((valid == Fw::ParamValid::VALID) || (valid == Fw::ParamValid::DEFAULT)) {
2986  Fw::ParamBuffer _paramBuffer;
2987  FW_ASSERT(this->paramDelegatePtr != nullptr);
2988  Fw::SerializeStatus _stat = this->paramDelegatePtr->serializeParam(
2989  static_cast<FwPrmIdType>(this->getIdBase()),
2991  _paramBuffer
2992  );
2993  if(_stat == Fw::FW_SERIALIZE_OK) {
2994  _stat = _paramBuffer.deserializeTo(_local);
2995  FW_ASSERT(_stat == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(_stat));
2996  } else {
2997  valid = Fw::ParamValid::INVALID;
2998  }
2999  }
3000  this->m_paramLock.unlock();
3001  return _local;
3002  }
3003 
3006  {
3008  this->m_paramLock.lock();
3009  valid = this->m_param_SECTION_CONFIGS_valid;
3010  if ((valid == Fw::ParamValid::VALID) || (valid == Fw::ParamValid::DEFAULT)) {
3011  Fw::ParamBuffer _paramBuffer;
3012  FW_ASSERT(this->paramDelegatePtr != nullptr);
3013  Fw::SerializeStatus _stat = this->paramDelegatePtr->serializeParam(
3014  static_cast<FwPrmIdType>(this->getIdBase()),
3016  _paramBuffer
3017  );
3018  if(_stat == Fw::FW_SERIALIZE_OK) {
3019  _stat = _paramBuffer.deserializeTo(_local);
3020  FW_ASSERT(_stat == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(_stat));
3021  } else {
3022  valid = Fw::ParamValid::INVALID;
3023  }
3024  }
3025  this->m_paramLock.unlock();
3026  return _local;
3027  }
3028 
3029  // ----------------------------------------------------------------------
3030  // External parameter delegate initialization
3031  // ----------------------------------------------------------------------
3032 
3035  {
3036  FW_ASSERT(paramExternalDelegatePtr != nullptr);
3037  this->paramDelegatePtr = paramExternalDelegatePtr;
3038  }
3039 
3040  // ----------------------------------------------------------------------
3041  // Time
3042  // ----------------------------------------------------------------------
3043 
3045  getTime() const
3046  {
3047  if (this->isConnected_timeGetOut_OutputPort(0)) {
3048  Fw::Time _time;
3049  this->timeGetOut_out(0, _time);
3050  return _time;
3051  }
3052  else {
3053  return Fw::Time(TimeBase::TB_NONE, 0, 0);
3054  }
3055  }
3056 
3057  // ----------------------------------------------------------------------
3058  // Message dispatch functions
3059  // ----------------------------------------------------------------------
3060 
3061  Fw::QueuedComponentBase::MsgDispatchStatus TlmPacketizerComponentBase ::
3062  doDispatch()
3063  {
3064  ComponentIpcSerializableBuffer _msg;
3065  FwQueuePriorityType _priority = 0;
3066 
3067  Os::Queue::Status _msgStatus = this->m_queue.receive(
3068  _msg,
3070  _priority
3071  );
3072  FW_ASSERT(
3073  _msgStatus == Os::Queue::OP_OK,
3074  static_cast<FwAssertArgType>(_msgStatus)
3075  );
3076 
3077  // Reset to beginning of buffer
3078  _msg.resetDeser();
3079 
3080  FwEnumStoreType _desMsg = 0;
3081  Fw::SerializeStatus _deserStatus = _msg.deserializeTo(_desMsg);
3082  FW_ASSERT(
3083  _deserStatus == Fw::FW_SERIALIZE_OK,
3084  static_cast<FwAssertArgType>(_deserStatus)
3085  );
3086 
3087  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
3088 
3089  if (_msgType == TLMPACKETIZER_COMPONENT_EXIT) {
3090  return MSG_DISPATCH_EXIT;
3091  }
3092 
3093  FwIndexType portNum = 0;
3094  _deserStatus = _msg.deserializeTo(portNum);
3095  FW_ASSERT(
3096  _deserStatus == Fw::FW_SERIALIZE_OK,
3097  static_cast<FwAssertArgType>(_deserStatus)
3098  );
3099 
3100  switch (_msgType) {
3101  // Handle async input port Run
3102  case RUN_SCHED: {
3103  // Deserialize argument context
3104  U32 context;
3105  _deserStatus = _msg.deserializeTo(context);
3106  FW_ASSERT(
3107  _deserStatus == Fw::FW_SERIALIZE_OK,
3108  static_cast<FwAssertArgType>(_deserStatus)
3109  );
3110  // Call handler function
3111  this->Run_handler(
3112  portNum,
3113  context
3114  );
3115 
3116  break;
3117  }
3118 
3119  // Handle async input port configureSectionGroupRate
3120  case CONFIGURESECTIONGROUPRATE_CONFIGUREGROUPRATE: {
3121  // Deserialize argument section
3122  Svc::TelemetrySection section;
3123  _deserStatus = _msg.deserializeTo(section);
3124  FW_ASSERT(
3125  _deserStatus == Fw::FW_SERIALIZE_OK,
3126  static_cast<FwAssertArgType>(_deserStatus)
3127  );
3128 
3129  // Deserialize argument tlmGroup
3130  FwChanIdType tlmGroup;
3131  _deserStatus = _msg.deserializeTo(tlmGroup);
3132  FW_ASSERT(
3133  _deserStatus == Fw::FW_SERIALIZE_OK,
3134  static_cast<FwAssertArgType>(_deserStatus)
3135  );
3136 
3137  // Deserialize argument rateLogic
3138  Svc::RateLogic rateLogic;
3139  _deserStatus = _msg.deserializeTo(rateLogic);
3140  FW_ASSERT(
3141  _deserStatus == Fw::FW_SERIALIZE_OK,
3142  static_cast<FwAssertArgType>(_deserStatus)
3143  );
3144 
3145  // Deserialize argument minDelta
3146  U32 minDelta;
3147  _deserStatus = _msg.deserializeTo(minDelta);
3148  FW_ASSERT(
3149  _deserStatus == Fw::FW_SERIALIZE_OK,
3150  static_cast<FwAssertArgType>(_deserStatus)
3151  );
3152 
3153  // Deserialize argument maxDelta
3154  U32 maxDelta;
3155  _deserStatus = _msg.deserializeTo(maxDelta);
3156  FW_ASSERT(
3157  _deserStatus == Fw::FW_SERIALIZE_OK,
3158  static_cast<FwAssertArgType>(_deserStatus)
3159  );
3160  // Call handler function
3162  portNum,
3163  section,
3164  tlmGroup,
3165  rateLogic,
3166  minDelta,
3167  maxDelta
3168  );
3169 
3170  break;
3171  }
3172 
3173  // Handle async input port controlIn
3174  case CONTROLIN_ENABLESECTION: {
3175  // Deserialize argument section
3176  Svc::TelemetrySection section;
3177  _deserStatus = _msg.deserializeTo(section);
3178  FW_ASSERT(
3179  _deserStatus == Fw::FW_SERIALIZE_OK,
3180  static_cast<FwAssertArgType>(_deserStatus)
3181  );
3182 
3183  // Deserialize argument enabled
3184  Fw::Enabled enabled;
3185  _deserStatus = _msg.deserializeTo(enabled);
3186  FW_ASSERT(
3187  _deserStatus == Fw::FW_SERIALIZE_OK,
3188  static_cast<FwAssertArgType>(_deserStatus)
3189  );
3190  // Call handler function
3191  this->controlIn_handler(
3192  portNum,
3193  section,
3194  enabled
3195  );
3196 
3197  break;
3198  }
3199 
3200  // Handle async input port pingIn
3201  case PINGIN_PING: {
3202  // Deserialize argument key
3203  U32 key;
3204  _deserStatus = _msg.deserializeTo(key);
3205  FW_ASSERT(
3206  _deserStatus == Fw::FW_SERIALIZE_OK,
3207  static_cast<FwAssertArgType>(_deserStatus)
3208  );
3209  // Call handler function
3210  this->pingIn_handler(
3211  portNum,
3212  key
3213  );
3214 
3215  break;
3216  }
3217 
3218  // Handle command SET_LEVEL
3219  case CMD_SET_LEVEL: {
3220  // Deserialize opcode
3221  FwOpcodeType _opCode = 0;
3222  _deserStatus = _msg.deserializeTo(_opCode);
3223  FW_ASSERT (
3224  _deserStatus == Fw::FW_SERIALIZE_OK,
3225  static_cast<FwAssertArgType>(_deserStatus)
3226  );
3227 
3228  // Deserialize command sequence
3229  U32 _cmdSeq = 0;
3230  _deserStatus = _msg.deserializeTo(_cmdSeq);
3231  FW_ASSERT (
3232  _deserStatus == Fw::FW_SERIALIZE_OK,
3233  static_cast<FwAssertArgType>(_deserStatus)
3234  );
3235 
3236  // Deserialize command argument buffer
3237  Fw::CmdArgBuffer args;
3238  _deserStatus = _msg.deserializeTo(args);
3239  FW_ASSERT (
3240  _deserStatus == Fw::FW_SERIALIZE_OK,
3241  static_cast<FwAssertArgType>(_deserStatus)
3242  );
3243 
3244  // Reset buffer
3245  args.resetDeser();
3246 
3247  // Deserialize argument level
3248  FwChanIdType level;
3249  _deserStatus = args.deserializeTo(level);
3250  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3252  this->cmdResponse_out(
3253  _opCode,
3254  _cmdSeq,
3256  );
3257  }
3258  // Don't crash the task if bad arguments were passed from the ground
3259  break;
3260  }
3261 
3262  // Make sure there was no data left over.
3263  // That means the argument buffer size was incorrect.
3264 #if FW_CMD_CHECK_RESIDUAL
3265  if (args.getDeserializeSizeLeft() != 0) {
3267  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3268  }
3269  // Don't crash the task if bad arguments were passed from the ground
3270  break;
3271  }
3272 #endif
3273 
3274  // Call handler function
3275  this->SET_LEVEL_cmdHandler(
3276  _opCode, _cmdSeq,
3277  level
3278  );
3279 
3280  break;
3281  }
3282 
3283  // Handle command SEND_PKT
3284  case CMD_SEND_PKT: {
3285  // Deserialize opcode
3286  FwOpcodeType _opCode = 0;
3287  _deserStatus = _msg.deserializeTo(_opCode);
3288  FW_ASSERT (
3289  _deserStatus == Fw::FW_SERIALIZE_OK,
3290  static_cast<FwAssertArgType>(_deserStatus)
3291  );
3292 
3293  // Deserialize command sequence
3294  U32 _cmdSeq = 0;
3295  _deserStatus = _msg.deserializeTo(_cmdSeq);
3296  FW_ASSERT (
3297  _deserStatus == Fw::FW_SERIALIZE_OK,
3298  static_cast<FwAssertArgType>(_deserStatus)
3299  );
3300 
3301  // Deserialize command argument buffer
3302  Fw::CmdArgBuffer args;
3303  _deserStatus = _msg.deserializeTo(args);
3304  FW_ASSERT (
3305  _deserStatus == Fw::FW_SERIALIZE_OK,
3306  static_cast<FwAssertArgType>(_deserStatus)
3307  );
3308 
3309  // Reset buffer
3310  args.resetDeser();
3311 
3312  // Deserialize argument id
3313  U32 id;
3314  _deserStatus = args.deserializeTo(id);
3315  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3317  this->cmdResponse_out(
3318  _opCode,
3319  _cmdSeq,
3321  );
3322  }
3323  // Don't crash the task if bad arguments were passed from the ground
3324  break;
3325  }
3326 
3327  // Deserialize argument section
3328  Svc::TelemetrySection section;
3329  _deserStatus = args.deserializeTo(section);
3330  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3332  this->cmdResponse_out(
3333  _opCode,
3334  _cmdSeq,
3336  );
3337  }
3338  // Don't crash the task if bad arguments were passed from the ground
3339  break;
3340  }
3341 
3342  // Make sure there was no data left over.
3343  // That means the argument buffer size was incorrect.
3344 #if FW_CMD_CHECK_RESIDUAL
3345  if (args.getDeserializeSizeLeft() != 0) {
3347  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3348  }
3349  // Don't crash the task if bad arguments were passed from the ground
3350  break;
3351  }
3352 #endif
3353 
3354  // Call handler function
3355  this->SEND_PKT_cmdHandler(
3356  _opCode, _cmdSeq,
3357  id,
3358  section
3359  );
3360 
3361  break;
3362  }
3363 
3364  // Handle command ENABLE_SECTION
3365  case CMD_ENABLE_SECTION: {
3366  // Deserialize opcode
3367  FwOpcodeType _opCode = 0;
3368  _deserStatus = _msg.deserializeTo(_opCode);
3369  FW_ASSERT (
3370  _deserStatus == Fw::FW_SERIALIZE_OK,
3371  static_cast<FwAssertArgType>(_deserStatus)
3372  );
3373 
3374  // Deserialize command sequence
3375  U32 _cmdSeq = 0;
3376  _deserStatus = _msg.deserializeTo(_cmdSeq);
3377  FW_ASSERT (
3378  _deserStatus == Fw::FW_SERIALIZE_OK,
3379  static_cast<FwAssertArgType>(_deserStatus)
3380  );
3381 
3382  // Deserialize command argument buffer
3383  Fw::CmdArgBuffer args;
3384  _deserStatus = _msg.deserializeTo(args);
3385  FW_ASSERT (
3386  _deserStatus == Fw::FW_SERIALIZE_OK,
3387  static_cast<FwAssertArgType>(_deserStatus)
3388  );
3389 
3390  // Reset buffer
3391  args.resetDeser();
3392 
3393  // Deserialize argument section
3394  Svc::TelemetrySection section;
3395  _deserStatus = args.deserializeTo(section);
3396  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3398  this->cmdResponse_out(
3399  _opCode,
3400  _cmdSeq,
3402  );
3403  }
3404  // Don't crash the task if bad arguments were passed from the ground
3405  break;
3406  }
3407 
3408  // Deserialize argument enable
3409  Fw::Enabled enable;
3410  _deserStatus = args.deserializeTo(enable);
3411  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3413  this->cmdResponse_out(
3414  _opCode,
3415  _cmdSeq,
3417  );
3418  }
3419  // Don't crash the task if bad arguments were passed from the ground
3420  break;
3421  }
3422 
3423  // Make sure there was no data left over.
3424  // That means the argument buffer size was incorrect.
3425 #if FW_CMD_CHECK_RESIDUAL
3426  if (args.getDeserializeSizeLeft() != 0) {
3428  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3429  }
3430  // Don't crash the task if bad arguments were passed from the ground
3431  break;
3432  }
3433 #endif
3434 
3435  // Call handler function
3437  _opCode, _cmdSeq,
3438  section,
3439  enable
3440  );
3441 
3442  break;
3443  }
3444 
3445  // Handle command ENABLE_GROUP
3446  case CMD_ENABLE_GROUP: {
3447  // Deserialize opcode
3448  FwOpcodeType _opCode = 0;
3449  _deserStatus = _msg.deserializeTo(_opCode);
3450  FW_ASSERT (
3451  _deserStatus == Fw::FW_SERIALIZE_OK,
3452  static_cast<FwAssertArgType>(_deserStatus)
3453  );
3454 
3455  // Deserialize command sequence
3456  U32 _cmdSeq = 0;
3457  _deserStatus = _msg.deserializeTo(_cmdSeq);
3458  FW_ASSERT (
3459  _deserStatus == Fw::FW_SERIALIZE_OK,
3460  static_cast<FwAssertArgType>(_deserStatus)
3461  );
3462 
3463  // Deserialize command argument buffer
3464  Fw::CmdArgBuffer args;
3465  _deserStatus = _msg.deserializeTo(args);
3466  FW_ASSERT (
3467  _deserStatus == Fw::FW_SERIALIZE_OK,
3468  static_cast<FwAssertArgType>(_deserStatus)
3469  );
3470 
3471  // Reset buffer
3472  args.resetDeser();
3473 
3474  // Deserialize argument section
3475  Svc::TelemetrySection section;
3476  _deserStatus = args.deserializeTo(section);
3477  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3479  this->cmdResponse_out(
3480  _opCode,
3481  _cmdSeq,
3483  );
3484  }
3485  // Don't crash the task if bad arguments were passed from the ground
3486  break;
3487  }
3488 
3489  // Deserialize argument tlmGroup
3490  FwChanIdType tlmGroup;
3491  _deserStatus = args.deserializeTo(tlmGroup);
3492  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3494  this->cmdResponse_out(
3495  _opCode,
3496  _cmdSeq,
3498  );
3499  }
3500  // Don't crash the task if bad arguments were passed from the ground
3501  break;
3502  }
3503 
3504  // Deserialize argument enable
3505  Fw::Enabled enable;
3506  _deserStatus = args.deserializeTo(enable);
3507  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3509  this->cmdResponse_out(
3510  _opCode,
3511  _cmdSeq,
3513  );
3514  }
3515  // Don't crash the task if bad arguments were passed from the ground
3516  break;
3517  }
3518 
3519  // Make sure there was no data left over.
3520  // That means the argument buffer size was incorrect.
3521 #if FW_CMD_CHECK_RESIDUAL
3522  if (args.getDeserializeSizeLeft() != 0) {
3524  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3525  }
3526  // Don't crash the task if bad arguments were passed from the ground
3527  break;
3528  }
3529 #endif
3530 
3531  // Call handler function
3533  _opCode, _cmdSeq,
3534  section,
3535  tlmGroup,
3536  enable
3537  );
3538 
3539  break;
3540  }
3541 
3542  // Handle command FORCE_GROUP
3543  case CMD_FORCE_GROUP: {
3544  // Deserialize opcode
3545  FwOpcodeType _opCode = 0;
3546  _deserStatus = _msg.deserializeTo(_opCode);
3547  FW_ASSERT (
3548  _deserStatus == Fw::FW_SERIALIZE_OK,
3549  static_cast<FwAssertArgType>(_deserStatus)
3550  );
3551 
3552  // Deserialize command sequence
3553  U32 _cmdSeq = 0;
3554  _deserStatus = _msg.deserializeTo(_cmdSeq);
3555  FW_ASSERT (
3556  _deserStatus == Fw::FW_SERIALIZE_OK,
3557  static_cast<FwAssertArgType>(_deserStatus)
3558  );
3559 
3560  // Deserialize command argument buffer
3561  Fw::CmdArgBuffer args;
3562  _deserStatus = _msg.deserializeTo(args);
3563  FW_ASSERT (
3564  _deserStatus == Fw::FW_SERIALIZE_OK,
3565  static_cast<FwAssertArgType>(_deserStatus)
3566  );
3567 
3568  // Reset buffer
3569  args.resetDeser();
3570 
3571  // Deserialize argument section
3572  Svc::TelemetrySection section;
3573  _deserStatus = args.deserializeTo(section);
3574  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3576  this->cmdResponse_out(
3577  _opCode,
3578  _cmdSeq,
3580  );
3581  }
3582  // Don't crash the task if bad arguments were passed from the ground
3583  break;
3584  }
3585 
3586  // Deserialize argument tlmGroup
3587  FwChanIdType tlmGroup;
3588  _deserStatus = args.deserializeTo(tlmGroup);
3589  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3591  this->cmdResponse_out(
3592  _opCode,
3593  _cmdSeq,
3595  );
3596  }
3597  // Don't crash the task if bad arguments were passed from the ground
3598  break;
3599  }
3600 
3601  // Deserialize argument enable
3602  Fw::Enabled enable;
3603  _deserStatus = args.deserializeTo(enable);
3604  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3606  this->cmdResponse_out(
3607  _opCode,
3608  _cmdSeq,
3610  );
3611  }
3612  // Don't crash the task if bad arguments were passed from the ground
3613  break;
3614  }
3615 
3616  // Make sure there was no data left over.
3617  // That means the argument buffer size was incorrect.
3618 #if FW_CMD_CHECK_RESIDUAL
3619  if (args.getDeserializeSizeLeft() != 0) {
3621  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3622  }
3623  // Don't crash the task if bad arguments were passed from the ground
3624  break;
3625  }
3626 #endif
3627 
3628  // Call handler function
3629  this->FORCE_GROUP_cmdHandler(
3630  _opCode, _cmdSeq,
3631  section,
3632  tlmGroup,
3633  enable
3634  );
3635 
3636  break;
3637  }
3638 
3639  // Handle command CONFIGURE_GROUP_RATES
3640  case CMD_CONFIGURE_GROUP_RATES: {
3641  // Deserialize opcode
3642  FwOpcodeType _opCode = 0;
3643  _deserStatus = _msg.deserializeTo(_opCode);
3644  FW_ASSERT (
3645  _deserStatus == Fw::FW_SERIALIZE_OK,
3646  static_cast<FwAssertArgType>(_deserStatus)
3647  );
3648 
3649  // Deserialize command sequence
3650  U32 _cmdSeq = 0;
3651  _deserStatus = _msg.deserializeTo(_cmdSeq);
3652  FW_ASSERT (
3653  _deserStatus == Fw::FW_SERIALIZE_OK,
3654  static_cast<FwAssertArgType>(_deserStatus)
3655  );
3656 
3657  // Deserialize command argument buffer
3658  Fw::CmdArgBuffer args;
3659  _deserStatus = _msg.deserializeTo(args);
3660  FW_ASSERT (
3661  _deserStatus == Fw::FW_SERIALIZE_OK,
3662  static_cast<FwAssertArgType>(_deserStatus)
3663  );
3664 
3665  // Reset buffer
3666  args.resetDeser();
3667 
3668  // Deserialize argument section
3669  Svc::TelemetrySection section;
3670  _deserStatus = args.deserializeTo(section);
3671  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3673  this->cmdResponse_out(
3674  _opCode,
3675  _cmdSeq,
3677  );
3678  }
3679  // Don't crash the task if bad arguments were passed from the ground
3680  break;
3681  }
3682 
3683  // Deserialize argument tlmGroup
3684  FwChanIdType tlmGroup;
3685  _deserStatus = args.deserializeTo(tlmGroup);
3686  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3688  this->cmdResponse_out(
3689  _opCode,
3690  _cmdSeq,
3692  );
3693  }
3694  // Don't crash the task if bad arguments were passed from the ground
3695  break;
3696  }
3697 
3698  // Deserialize argument rateLogic
3699  Svc::RateLogic rateLogic;
3700  _deserStatus = args.deserializeTo(rateLogic);
3701  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3703  this->cmdResponse_out(
3704  _opCode,
3705  _cmdSeq,
3707  );
3708  }
3709  // Don't crash the task if bad arguments were passed from the ground
3710  break;
3711  }
3712 
3713  // Deserialize argument minDelta
3714  U32 minDelta;
3715  _deserStatus = args.deserializeTo(minDelta);
3716  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3718  this->cmdResponse_out(
3719  _opCode,
3720  _cmdSeq,
3722  );
3723  }
3724  // Don't crash the task if bad arguments were passed from the ground
3725  break;
3726  }
3727 
3728  // Deserialize argument maxDelta
3729  U32 maxDelta;
3730  _deserStatus = args.deserializeTo(maxDelta);
3731  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3733  this->cmdResponse_out(
3734  _opCode,
3735  _cmdSeq,
3737  );
3738  }
3739  // Don't crash the task if bad arguments were passed from the ground
3740  break;
3741  }
3742 
3743  // Make sure there was no data left over.
3744  // That means the argument buffer size was incorrect.
3745 #if FW_CMD_CHECK_RESIDUAL
3746  if (args.getDeserializeSizeLeft() != 0) {
3748  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3749  }
3750  // Don't crash the task if bad arguments were passed from the ground
3751  break;
3752  }
3753 #endif
3754 
3755  // Call handler function
3757  _opCode, _cmdSeq,
3758  section,
3759  tlmGroup,
3760  rateLogic,
3761  minDelta,
3762  maxDelta
3763  );
3764 
3765  break;
3766  }
3767 
3768  default:
3769  return MSG_DISPATCH_ERROR;
3770  }
3771 
3772  return MSG_DISPATCH_OK;
3773  }
3774 
3775  // ----------------------------------------------------------------------
3776  // Calls for messages received on special input ports
3777  // ----------------------------------------------------------------------
3778 
3779  void TlmPacketizerComponentBase ::
3780  m_p_cmdIn_in(
3781  Fw::PassiveComponentBase* callComp,
3782  FwIndexType portNum,
3783  FwOpcodeType opCode,
3784  U32 cmdSeq,
3785  Fw::CmdArgBuffer& args
3786  )
3787  {
3788  FW_ASSERT(callComp != nullptr);
3789  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
3790  compPtr->cmdIn_handlerBase(
3791  portNum,
3792  opCode,
3793  cmdSeq,
3794  args
3795  );
3796  }
3797 
3798  // ----------------------------------------------------------------------
3799  // Calls for messages received on typed input ports
3800  // ----------------------------------------------------------------------
3801 
3802  void TlmPacketizerComponentBase ::
3803  m_p_Run_in(
3804  Fw::PassiveComponentBase* callComp,
3805  FwIndexType portNum,
3806  U32 context
3807  )
3808  {
3809  FW_ASSERT(callComp != nullptr);
3810  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
3811  compPtr->Run_handlerBase(
3812  portNum,
3813  context
3814  );
3815  }
3816 
3817  Fw::TlmValid TlmPacketizerComponentBase ::
3818  m_p_TlmGet_in(
3819  Fw::PassiveComponentBase* callComp,
3820  FwIndexType portNum,
3821  FwChanIdType id,
3822  Fw::Time& timeTag,
3823  Fw::TlmBuffer& val
3824  )
3825  {
3826  FW_ASSERT(callComp != nullptr);
3827  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
3828  return compPtr->TlmGet_handlerBase(
3829  portNum,
3830  id,
3831  timeTag,
3832  val
3833  );
3834  }
3835 
3836  void TlmPacketizerComponentBase ::
3837  m_p_TlmRecv_in(
3838  Fw::PassiveComponentBase* callComp,
3839  FwIndexType portNum,
3840  FwChanIdType id,
3841  Fw::Time& timeTag,
3842  Fw::TlmBuffer& val
3843  )
3844  {
3845  FW_ASSERT(callComp != nullptr);
3846  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
3847  compPtr->TlmRecv_handlerBase(
3848  portNum,
3849  id,
3850  timeTag,
3851  val
3852  );
3853  }
3854 
3855  void TlmPacketizerComponentBase ::
3856  m_p_configureSectionGroupRate_in(
3857  Fw::PassiveComponentBase* callComp,
3858  FwIndexType portNum,
3859  const Svc::TelemetrySection& section,
3860  FwChanIdType tlmGroup,
3861  const Svc::RateLogic& rateLogic,
3862  U32 minDelta,
3863  U32 maxDelta
3864  )
3865  {
3866  FW_ASSERT(callComp != nullptr);
3867  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
3868  compPtr->configureSectionGroupRate_handlerBase(
3869  portNum,
3870  section,
3871  tlmGroup,
3872  rateLogic,
3873  minDelta,
3874  maxDelta
3875  );
3876  }
3877 
3878  void TlmPacketizerComponentBase ::
3879  m_p_controlIn_in(
3880  Fw::PassiveComponentBase* callComp,
3881  FwIndexType portNum,
3882  const Svc::TelemetrySection& section,
3883  const Fw::Enabled& enabled
3884  )
3885  {
3886  FW_ASSERT(callComp != nullptr);
3887  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
3888  compPtr->controlIn_handlerBase(
3889  portNum,
3890  section,
3891  enabled
3892  );
3893  }
3894 
3895  void TlmPacketizerComponentBase ::
3896  m_p_pingIn_in(
3897  Fw::PassiveComponentBase* callComp,
3898  FwIndexType portNum,
3899  U32 key
3900  )
3901  {
3902  FW_ASSERT(callComp != nullptr);
3903  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
3904  compPtr->pingIn_handlerBase(
3905  portNum,
3906  key
3907  );
3908  }
3909 
3910 #if !FW_DIRECT_PORT_CALLS
3911 
3912  // ----------------------------------------------------------------------
3913  // Invocation functions for special output ports
3914  // ----------------------------------------------------------------------
3915 
3916  void TlmPacketizerComponentBase ::
3917  cmdRegOut_out(
3918  FwIndexType portNum,
3919  FwOpcodeType opCode
3920  ) const
3921  {
3922  FW_ASSERT(
3923  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
3924  static_cast<FwAssertArgType>(portNum)
3925  );
3926 
3927  FW_ASSERT(
3928  this->m_cmdRegOut_OutputPort[portNum].isConnected(),
3929  static_cast<FwAssertArgType>(portNum)
3930  );
3931  this->m_cmdRegOut_OutputPort[portNum].invoke(
3932  opCode
3933  );
3934  }
3935 
3936  void TlmPacketizerComponentBase ::
3937  cmdResponseOut_out(
3938  FwIndexType portNum,
3939  FwOpcodeType opCode,
3940  U32 cmdSeq,
3941  const Fw::CmdResponse& response
3942  ) const
3943  {
3944  FW_ASSERT(
3945  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
3946  static_cast<FwAssertArgType>(portNum)
3947  );
3948 
3949  FW_ASSERT(
3950  this->m_cmdResponseOut_OutputPort[portNum].isConnected(),
3951  static_cast<FwAssertArgType>(portNum)
3952  );
3953  this->m_cmdResponseOut_OutputPort[portNum].invoke(
3954  opCode,
3955  cmdSeq,
3956  response
3957  );
3958  }
3959 
3960  void TlmPacketizerComponentBase ::
3961  eventOut_out(
3962  FwIndexType portNum,
3963  FwEventIdType id,
3964  Fw::Time& timeTag,
3965  const Fw::LogSeverity& severity,
3966  Fw::LogBuffer& args
3967  ) const
3968  {
3969  FW_ASSERT(
3970  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
3971  static_cast<FwAssertArgType>(portNum)
3972  );
3973 
3974  FW_ASSERT(
3975  this->m_eventOut_OutputPort[portNum].isConnected(),
3976  static_cast<FwAssertArgType>(portNum)
3977  );
3978  this->m_eventOut_OutputPort[portNum].invoke(
3979  id,
3980  timeTag,
3981  severity,
3982  args
3983  );
3984  }
3985 
3986  Fw::ParamValid TlmPacketizerComponentBase ::
3987  paramGetOut_out(
3988  FwIndexType portNum,
3989  FwPrmIdType id,
3990  Fw::ParamBuffer& val
3991  ) const
3992  {
3993  FW_ASSERT(
3994  (0 <= portNum) && (portNum < this->getNum_paramGetOut_OutputPorts()),
3995  static_cast<FwAssertArgType>(portNum)
3996  );
3997 
3998  FW_ASSERT(
3999  this->m_paramGetOut_OutputPort[portNum].isConnected(),
4000  static_cast<FwAssertArgType>(portNum)
4001  );
4002  return this->m_paramGetOut_OutputPort[portNum].invoke(
4003  id,
4004  val
4005  );
4006  }
4007 
4008  void TlmPacketizerComponentBase ::
4009  paramSetOut_out(
4010  FwIndexType portNum,
4011  FwPrmIdType id,
4012  Fw::ParamBuffer& val
4013  ) const
4014  {
4015  FW_ASSERT(
4016  (0 <= portNum) && (portNum < this->getNum_paramSetOut_OutputPorts()),
4017  static_cast<FwAssertArgType>(portNum)
4018  );
4019 
4020  FW_ASSERT(
4021  this->m_paramSetOut_OutputPort[portNum].isConnected(),
4022  static_cast<FwAssertArgType>(portNum)
4023  );
4024  this->m_paramSetOut_OutputPort[portNum].invoke(
4025  id,
4026  val
4027  );
4028  }
4029 
4030 #if FW_ENABLE_TEXT_LOGGING
4031 
4032  void TlmPacketizerComponentBase ::
4033  textEventOut_out(
4034  FwIndexType portNum,
4035  FwEventIdType id,
4036  Fw::Time& timeTag,
4037  const Fw::LogSeverity& severity,
4038  Fw::TextLogString& text
4039  ) const
4040  {
4041  FW_ASSERT(
4042  (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
4043  static_cast<FwAssertArgType>(portNum)
4044  );
4045 
4046  FW_ASSERT(
4047  this->m_textEventOut_OutputPort[portNum].isConnected(),
4048  static_cast<FwAssertArgType>(portNum)
4049  );
4050  this->m_textEventOut_OutputPort[portNum].invoke(
4051  id,
4052  timeTag,
4053  severity,
4054  text
4055  );
4056  }
4057 
4058 #endif
4059 
4060  void TlmPacketizerComponentBase ::
4061  timeGetOut_out(
4062  FwIndexType portNum,
4063  Fw::Time& time
4064  ) const
4065  {
4066  FW_ASSERT(
4067  (0 <= portNum) && (portNum < this->getNum_timeGetOut_OutputPorts()),
4068  static_cast<FwAssertArgType>(portNum)
4069  );
4070 
4071  FW_ASSERT(
4072  this->m_timeGetOut_OutputPort[portNum].isConnected(),
4073  static_cast<FwAssertArgType>(portNum)
4074  );
4075  this->m_timeGetOut_OutputPort[portNum].invoke(
4076  time
4077  );
4078  }
4079 
4080  void TlmPacketizerComponentBase ::
4081  tlmOut_out(
4082  FwIndexType portNum,
4083  FwChanIdType id,
4084  Fw::Time& timeTag,
4085  Fw::TlmBuffer& val
4086  ) const
4087  {
4088  FW_ASSERT(
4089  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
4090  static_cast<FwAssertArgType>(portNum)
4091  );
4092 
4093  FW_ASSERT(
4094  this->m_tlmOut_OutputPort[portNum].isConnected(),
4095  static_cast<FwAssertArgType>(portNum)
4096  );
4097  this->m_tlmOut_OutputPort[portNum].invoke(
4098  id,
4099  timeTag,
4100  val
4101  );
4102  }
4103 
4104 #endif
4105 
4106  // ----------------------------------------------------------------------
4107  // Parameter set functions
4108  // ----------------------------------------------------------------------
4109 
4110  Fw::CmdResponse TlmPacketizerComponentBase ::
4111  paramSet_SECTION_ENABLED(Fw::SerialBufferBase& val)
4112  {
4113  Fw::CmdResponse _response{};
4114 
4115  this->m_paramLock.lock();
4116  // Update the external parameter
4117  FW_ASSERT(this->paramDelegatePtr != nullptr);
4118  const Fw::SerializeStatus _stat = this->paramDelegatePtr->deserializeParam(
4119  static_cast<FwPrmIdType>(this->getIdBase()),
4122  val
4123  );
4124  // Set response and update component state
4125  if (_stat == Fw::FW_SERIALIZE_OK) {
4126  this->m_param_SECTION_ENABLED_valid = Fw::ParamValid::VALID;
4127  _response = Fw::CmdResponse::OK;
4128  }
4129  else {
4130  this->m_param_SECTION_ENABLED_valid = Fw::ParamValid::INVALID;
4132  }
4133  this->m_paramLock.unlock();
4134 
4135  // Call notifier
4136  if (_response == Fw::CmdResponse::OK) {
4138  }
4139  return _response;
4140  }
4141 
4142  Fw::CmdResponse TlmPacketizerComponentBase ::
4143  paramSet_SECTION_CONFIGS(Fw::SerialBufferBase& val)
4144  {
4145  Fw::CmdResponse _response{};
4146 
4147  this->m_paramLock.lock();
4148  // Update the external parameter
4149  FW_ASSERT(this->paramDelegatePtr != nullptr);
4150  const Fw::SerializeStatus _stat = this->paramDelegatePtr->deserializeParam(
4151  static_cast<FwPrmIdType>(this->getIdBase()),
4154  val
4155  );
4156  // Set response and update component state
4157  if (_stat == Fw::FW_SERIALIZE_OK) {
4158  this->m_param_SECTION_CONFIGS_valid = Fw::ParamValid::VALID;
4159  _response = Fw::CmdResponse::OK;
4160  }
4161  else {
4162  this->m_param_SECTION_CONFIGS_valid = Fw::ParamValid::INVALID;
4164  }
4165  this->m_paramLock.unlock();
4166 
4167  // Call notifier
4168  if (_response == Fw::CmdResponse::OK) {
4170  }
4171  return _response;
4172  }
4173 
4174  // ----------------------------------------------------------------------
4175  // Parameter save functions
4176  // ----------------------------------------------------------------------
4177 
4178  Fw::CmdResponse TlmPacketizerComponentBase ::
4179  paramSave_SECTION_ENABLED()
4180  {
4181  if (!this->isConnected_paramSetOut_OutputPort(0)) {
4183  }
4184  Fw::ParamBuffer _paramBuffer;
4185  const FwIdType idBase = this->getIdBase();
4187  // Serialize the parameter
4188  this->m_paramLock.lock();
4189  if ((this->m_param_SECTION_ENABLED_valid == Fw::ParamValid::VALID) || (this->m_param_SECTION_ENABLED_valid == Fw::ParamValid::DEFAULT)) {
4190  FW_ASSERT(this->paramDelegatePtr != nullptr);
4191  _stat = this->paramDelegatePtr->serializeParam(
4192  static_cast<FwPrmIdType>(idBase),
4194  _paramBuffer
4195  );
4196  }
4197  this->m_paramLock.unlock();
4198  if (_stat != Fw::FW_SERIALIZE_OK) {
4200  }
4201  // Save the parameter
4202  this->paramSetOut_out(
4203  0,
4204  static_cast<FwPrmIdType>(idBase + PARAMID_SECTION_ENABLED),
4205  _paramBuffer
4206  );
4207  // Return the command response
4208  return Fw::CmdResponse::OK;
4209  }
4210 
4211  Fw::CmdResponse TlmPacketizerComponentBase ::
4212  paramSave_SECTION_CONFIGS()
4213  {
4214  if (!this->isConnected_paramSetOut_OutputPort(0)) {
4216  }
4217  Fw::ParamBuffer _paramBuffer;
4218  const FwIdType idBase = this->getIdBase();
4220  // Serialize the parameter
4221  this->m_paramLock.lock();
4222  if ((this->m_param_SECTION_CONFIGS_valid == Fw::ParamValid::VALID) || (this->m_param_SECTION_CONFIGS_valid == Fw::ParamValid::DEFAULT)) {
4223  FW_ASSERT(this->paramDelegatePtr != nullptr);
4224  _stat = this->paramDelegatePtr->serializeParam(
4225  static_cast<FwPrmIdType>(idBase),
4227  _paramBuffer
4228  );
4229  }
4230  this->m_paramLock.unlock();
4231  if (_stat != Fw::FW_SERIALIZE_OK) {
4233  }
4234  // Save the parameter
4235  this->paramSetOut_out(
4236  0,
4237  static_cast<FwPrmIdType>(idBase + PARAMID_SECTION_CONFIGS),
4238  _paramBuffer
4239  );
4240  // Return the command response
4241  return Fw::CmdResponse::OK;
4242  }
4243 
4244 }
bool isConnected_PktSend_OutputPort(FwIndexType portNum) const
Force telemetering a group on a section, even if disabled.
static constexpr FwSizeType CAPACITY
Serialization/Deserialization operation was successful.
void SEND_PKT_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:157
Svc::InputEnableSectionPort * get_controlIn_InputPort(FwIndexType portNum)
void invoke(Fw::ComBuffer &data, U32 context) const
Invoke a port connection.
Definition: ComPortAc.cpp:181
void init()
Initialization function.
Definition: ComPortAc.cpp:162
static constexpr FwSizeType CAPACITY
Definition: CmdPortAc.hpp:36
void set_PktSend_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to PktSend[portNum].
FwIdType FwOpcodeType
The type of a command opcode.
bool isConnected_eventOut_OutputPort(FwIndexType portNum) const
Telemetry channel is not part of a telemetry packet.
Operation succeeded.
Definition: Os.hpp:27
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
#define FW_PARAM_OK(paramValid)
Definition: ParamValid.hpp:22
PlatformSizeType FwSizeType
void tlmWrite_GroupConfigs(const Svc::TlmPacketizer_SectionConfigs &arg, Fw::Time _tlmTime=Fw::Time()) const
bool isConnected_tlmOut_OutputPort(FwIndexType portNum) const
The size of the serial representation.
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()
bool isConnected_paramGetOut_OutputPort(FwIndexType portNum) const
Enabled state.
void log_ACTIVITY_HI_LevelSet(FwChanIdType level) const
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.
void log_ACTIVITY_LO_PacketSent(U32 packetId) const
virtual void parameterLoaded(FwPrmIdType id, Fw::ParamValid valid)
Called for each parameter when parameters are loaded.
Status
status returned from the queue send function
Definition: Queue.hpp:30
void init()
Initialization function.
Definition: SchedPortAc.cpp:73
static constexpr FwIndexType getNum_PktSend_OutputPorts()
Set Min and Max Deltas between successive packets.
BYTE pingInPortSize[Svc::PingPortBuffer::CAPACITY]
void init()
Initialization function.
Definition: CmdPortAc.cpp:89
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.
Definition: TlmPortAc.cpp:95
virtual SerializeStatus deserializeParam(const FwPrmIdType base_id, const FwPrmIdType local_id, const ParamValid prmStat, SerialBufferBase &buff)=0
FwIdType FwPrmIdType
The type of a parameter identifier.
void log_WARNING_LO_NoChan(FwChanIdType Id) const
static constexpr FwIndexType getNum_pingIn_InputPorts()
void addCallPort(InputPrmSetPort *callPort)
Register an input port.
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 SerializeStatus serializeParam(const FwPrmIdType base_id, const FwPrmIdType local_id, SerialBufferBase &buff) const =0
void invoke(U32 key) const
Invoke a port connection.
Definition: PingPortAc.cpp:170
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
virtual void SEND_PKT_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, U32 id, const Svc::TelemetrySection &section)=0
bool isConnected_pingOut_OutputPort(FwIndexType portNum) const
virtual void controlIn_handler(FwIndexType portNum, const Svc::TelemetrySection &section, const Fw::Enabled &enabled)=0
Handler for input port controlIn.
void init()
Initialization function.
Definition: TlmPortAc.cpp:171
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:89
No time base has been established (Required)
bool isConnected_paramSetOut_OutputPort(FwIndexType portNum) const
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
Send on updates after MIN ticks since last send.
void cmdIn_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Handler base-class function for input port cmdIn.
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
void log_WARNING_LO_PacketNotFound(U32 packetId) const
void init()
Initialization function.
Os::Queue m_queue
queue object for active component
void loadParameters()
Load the parameters from a parameter source.
void set_paramSetOut_OutputPort(FwIndexType portNum, Fw::InputPrmSetPort *port)
Connect port to paramSetOut[portNum].
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:177
virtual ~TlmPacketizerComponentBase()
Destroy TlmPacketizerComponentBase object.
void addCallPort(InputPrmGetPort *callPort)
Register an input port.
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
SerializeStatus
forward declaration for string
void registerExternalParameters(Fw::ParamExternalDelegate *paramExternalDelegatePtr)
Initialize the external parameter delegate.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: CmdPortAc.cpp:95
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.
FwIdType FwEventIdType
The type of an event identifier.
virtual void FORCE_GROUP_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command FORCE_GROUP.
void invoke(FwOpcodeType opCode) const
Invoke a port connection.
static constexpr FwSizeType CAPACITY
Definition: PingPortAc.hpp:34
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:40
virtual void ENABLE_SECTION_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Svc::TelemetrySection &section, const Fw::Enabled &enable)=0
The size of the serial representation.
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
void init()
Initialization function.
Definition: TimePortAc.cpp:151
static constexpr FwIndexType getNum_cmdRegOut_OutputPorts()
Data was the wrong format (e.g. wrong packet type)
Fw::InputTlmGetPort * get_TlmGet_InputPort(FwIndexType portNum)
void log_WARNING_LO_SectionUnconfigurable(const Svc::TelemetrySection &section, const Fw::Enabled &enable) const
Log event SectionUnconfigurable.
bool isConnected_timeGetOut_OutputPort(FwIndexType portNum) const
virtual void CONFIGURE_GROUP_RATES_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CONFIGURE_GROUP_RATES.
Less important informational events.
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
void log_WARNING_HI_OversizedChannel_ThrottleClear()
Reset throttle value for OversizedChannel.
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.
Fw::ParamValid invoke(FwPrmIdType id, Fw::ParamBuffer &val) const
void tlmWrite(FwChanIdType id, Fw::TlmBuffer &_tlmBuff, Fw::Time _tlmTime=Fw::Time()) const
void init()
Initialization function.
Definition: PingPortAc.cpp:151
bool isConnected_cmdResponseOut_OutputPort(FwIndexType portNum) const
static constexpr FwIndexType getNum_timeGetOut_OutputPorts()
void invoke(Fw::Time &time) const
Invoke a port connection.
Definition: TimePortAc.cpp:170
static constexpr FwIndexType getNum_paramGetOut_OutputPorts()
Serializable::SizeType getDeserializeSizeLeft() const override
Get remaining deserialization buffer size.
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke a port connection.
FwIdType FwChanIdType
The type of a telemetry channel identifier.
Enable / disable telemetry of a group on a section.
void addCallPort(InputPingPort *callPort)
Register an input port.
Definition: PingPortAc.cpp:157
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
Definition: Queue.cpp:54
void resetDeser() override
Reset deserialization pointer to beginning of buffer.
void resetSer() override
Reset serialization 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.
A serious but recoverable event.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port connection.
Definition: TlmPortAc.cpp:190
const char * toChar() const
Convert to a C-style char*.
void set_eventOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to eventOut[portNum].
bool isConnected() const
Definition: PortBase.cpp:38
Enum representing event severity.
static constexpr FwIndexType getNum_tlmOut_OutputPorts()
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:58
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:180
Command successfully executed.
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:54
BlockingType
message type
Definition: Queue.hpp:46
static constexpr FwIndexType getNum_eventOut_OutputPorts()
Telemetry value larger than the configured channel size.
void ENABLE_GROUP_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
virtual void ENABLE_GROUP_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Svc::TelemetrySection &section, FwChanIdType tlmGroup, const Fw::Enabled &enable)=0
Command failed to deserialize.
void lock()
lock the mutex and assert success
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
Command had execution error.
Important informational events.
Svc::TlmPacketizer_SectionEnabled paramGet_SECTION_ENABLED(Fw::ParamValid &valid)
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: SchedPortAc.cpp:79
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port connection.
Definition: LogPortAc.cpp:199
void PktSend_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context) const
Invoke output port PktSend.
static constexpr FwIndexType getNum_paramSetOut_OutputPorts()
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
message to exit active component task
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()
virtual void parametersLoaded()
Called whenever parameters are loaded.
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:186
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void log_WARNING_HI_OversizedChannel(FwChanIdType Id, FwSizeType valSize, FwSizeType expected)
void ENABLE_SECTION_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void init()
Initialization function.
virtual void SEND_PKT_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command SEND_PKT.
void incNumMsgDropped()
increment the number of messages dropped
void init()
Initialization function.
Definition: PingPortAc.cpp:73
void unlock()
alias for unLock to meet BasicLockable requirements
void init()
Initialization function.
Command failed validation.
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.
virtual void parameterUpdated(FwPrmIdType id)
Called whenever a parameter is updated.
message sent/received okay
Definition: Queue.hpp:31
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Enum representing parameter validity.
bool isConnected_cmdRegOut_OutputPort(FwIndexType portNum) const
U8 BYTE
byte type
Definition: BasicTypes.h:57
Svc::InputSchedPort * get_Run_InputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_TlmGet_InputPorts()
void invoke(FwPrmIdType id, Fw::ParamBuffer &val) const
Invoke a port connection.
void addCallPort(InputComPort *callPort)
Register an input port.
Definition: ComPortAc.cpp:168
Fw::InputTlmPort * get_TlmRecv_InputPort(FwIndexType portNum)
virtual void CONFIGURE_GROUP_RATES_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Svc::TelemetrySection &section, FwChanIdType tlmGroup, const Svc::RateLogic &rateLogic, U32 minDelta, U32 maxDelta)=0
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: PingPortAc.cpp:79
Svc::TlmPacketizer_SectionConfigs paramGet_SECTION_CONFIGS(Fw::ParamValid &valid)
static constexpr FwIndexType getNum_controlIn_InputPorts()
virtual void ENABLE_SECTION_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command ENABLE_SECTION.
void regCommands()
Register commands with the Command Dispatcher.
Message will return with status when space is unavailable.
Definition: Queue.hpp:48
Implementation of malloc based allocator.
void init()
Initialization function.
void init()
Initialization function.
void pingOut_out(FwIndexType portNum, U32 key) const
Invoke output port pingOut.
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 FORCE_GROUP_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Svc::TelemetrySection &section, FwChanIdType tlmGroup, const Fw::Enabled &enable)=0
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
Disabled state.
static constexpr FwSizeType CAPACITY
Definition: SchedPortAc.hpp:34
void set_paramGetOut_OutputPort(FwIndexType portNum, Fw::InputPrmGetPort *port)
Connect port to paramGetOut[portNum].
static constexpr FwIndexType getNum_Run_InputPorts()
void set_cmdResponseOut_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
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()
U32 FwIdType
The id type.
BYTE cmdPortSize[Fw::CmdPortBuffer::CAPACITY]
void set_cmdRegOut_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to cmdRegOut[portNum].
static constexpr FwIndexType getNum_cmdIn_InputPorts()