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