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