F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
TlmPacketizerComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title TlmPacketizerComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for TlmPacketizer component base class
5 // ======================================================================
6 
7 #include "Fw/Types/Assert.hpp"
9 #if FW_ENABLE_TEXT_LOGGING
10 #include "Fw/Types/String.hpp"
11 #endif
13 
14 namespace Svc {
15 
16  namespace {
17  enum MsgTypeEnum {
18  TLMPACKETIZER_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT,
19  RUN_SCHED,
20  CONFIGURESECTIONGROUPRATE_CONFIGUREGROUPRATE,
21  CONTROLIN_ENABLESECTION,
22  PINGIN_PING,
23  CMD_SET_LEVEL,
24  CMD_SEND_PKT,
25  CMD_ENABLE_SECTION,
26  CMD_ENABLE_GROUP,
27  CMD_FORCE_GROUP,
28  CMD_CONFIGURE_GROUP_RATES,
29  };
30 
31  // Get the max size by constructing a union of the async input, command, and
32  // internal port serialization sizes
33  union BuffUnion {
35  BYTE configureSectionGroupRatePortSize[Svc::InputConfigureGroupRatePort::SERIALIZED_SIZE];
39  };
40 
41  // Define a message buffer class large enough to handle all the
42  // asynchronous inputs to the component
43  class ComponentIpcSerializableBuffer :
45  {
46 
47  public:
48 
49  enum {
50  // Offset into data in buffer: Size of message ID and port number
51  DATA_OFFSET = sizeof(FwEnumStoreType) + sizeof(FwIndexType),
52  // Max data size
53  MAX_DATA_SIZE = sizeof(BuffUnion),
54  // Max message size: Size of message id + size of port + max data size
55  SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
56  };
57 
58  Fw::Serializable::SizeType getCapacity() const {
59  return sizeof(m_buff);
60  }
61 
62  U8* getBuffAddr() {
63  return m_buff;
64  }
65 
66  const U8* getBuffAddr() const {
67  return m_buff;
68  }
69 
70  private:
71  // Should be the max of all the input ports serialized sizes...
72  U8 m_buff[SERIALIZATION_SIZE];
73 
74  };
75  }
76 
77  // ----------------------------------------------------------------------
78  // Component initialization
79  // ----------------------------------------------------------------------
80 
83  FwSizeType queueDepth,
84  FwEnumStoreType instance
85  )
86  {
87  // Initialize base class
89 
90  // Connect input port cmdIn
91  for (
92  FwIndexType port = 0;
93  port < static_cast<FwIndexType>(this->getNum_cmdIn_InputPorts());
94  port++
95  ) {
96  this->m_cmdIn_InputPort[port].init();
97  this->m_cmdIn_InputPort[port].addCallComp(
98  this,
99  m_p_cmdIn_in
100  );
101  this->m_cmdIn_InputPort[port].setPortNum(port);
102 
103 #if FW_OBJECT_NAMES == 1
104  Fw::ObjectName portName;
105  portName.format(
106  "%s_cmdIn_InputPort[%" PRI_FwIndexType "]",
107  this->m_objName.toChar(),
108  port
109  );
110  this->m_cmdIn_InputPort[port].setObjName(portName.toChar());
111 #endif
112  }
113 
114  // Connect input port Run
115  for (
116  FwIndexType port = 0;
117  port < static_cast<FwIndexType>(this->getNum_Run_InputPorts());
118  port++
119  ) {
120  this->m_Run_InputPort[port].init();
121  this->m_Run_InputPort[port].addCallComp(
122  this,
123  m_p_Run_in
124  );
125  this->m_Run_InputPort[port].setPortNum(port);
126 
127 #if FW_OBJECT_NAMES == 1
128  Fw::ObjectName portName;
129  portName.format(
130  "%s_Run_InputPort[%" PRI_FwIndexType "]",
131  this->m_objName.toChar(),
132  port
133  );
134  this->m_Run_InputPort[port].setObjName(portName.toChar());
135 #endif
136  }
137 
138  // Connect input port TlmGet
139  for (
140  FwIndexType port = 0;
141  port < static_cast<FwIndexType>(this->getNum_TlmGet_InputPorts());
142  port++
143  ) {
144  this->m_TlmGet_InputPort[port].init();
145  this->m_TlmGet_InputPort[port].addCallComp(
146  this,
147  m_p_TlmGet_in
148  );
149  this->m_TlmGet_InputPort[port].setPortNum(port);
150 
151 #if FW_OBJECT_NAMES == 1
152  Fw::ObjectName portName;
153  portName.format(
154  "%s_TlmGet_InputPort[%" PRI_FwIndexType "]",
155  this->m_objName.toChar(),
156  port
157  );
158  this->m_TlmGet_InputPort[port].setObjName(portName.toChar());
159 #endif
160  }
161 
162  // Connect input port TlmRecv
163  for (
164  FwIndexType port = 0;
165  port < static_cast<FwIndexType>(this->getNum_TlmRecv_InputPorts());
166  port++
167  ) {
168  this->m_TlmRecv_InputPort[port].init();
169  this->m_TlmRecv_InputPort[port].addCallComp(
170  this,
171  m_p_TlmRecv_in
172  );
173  this->m_TlmRecv_InputPort[port].setPortNum(port);
174 
175 #if FW_OBJECT_NAMES == 1
176  Fw::ObjectName portName;
177  portName.format(
178  "%s_TlmRecv_InputPort[%" PRI_FwIndexType "]",
179  this->m_objName.toChar(),
180  port
181  );
182  this->m_TlmRecv_InputPort[port].setObjName(portName.toChar());
183 #endif
184  }
185 
186  // Connect input port configureSectionGroupRate
187  for (
188  FwIndexType port = 0;
189  port < static_cast<FwIndexType>(this->getNum_configureSectionGroupRate_InputPorts());
190  port++
191  ) {
192  this->m_configureSectionGroupRate_InputPort[port].init();
193  this->m_configureSectionGroupRate_InputPort[port].addCallComp(
194  this,
195  m_p_configureSectionGroupRate_in
196  );
197  this->m_configureSectionGroupRate_InputPort[port].setPortNum(port);
198 
199 #if FW_OBJECT_NAMES == 1
200  Fw::ObjectName portName;
201  portName.format(
202  "%s_configureSectionGroupRate_InputPort[%" PRI_FwIndexType "]",
203  this->m_objName.toChar(),
204  port
205  );
206  this->m_configureSectionGroupRate_InputPort[port].setObjName(portName.toChar());
207 #endif
208  }
209 
210  // Connect input port controlIn
211  for (
212  FwIndexType port = 0;
213  port < static_cast<FwIndexType>(this->getNum_controlIn_InputPorts());
214  port++
215  ) {
216  this->m_controlIn_InputPort[port].init();
217  this->m_controlIn_InputPort[port].addCallComp(
218  this,
219  m_p_controlIn_in
220  );
221  this->m_controlIn_InputPort[port].setPortNum(port);
222 
223 #if FW_OBJECT_NAMES == 1
224  Fw::ObjectName portName;
225  portName.format(
226  "%s_controlIn_InputPort[%" PRI_FwIndexType "]",
227  this->m_objName.toChar(),
228  port
229  );
230  this->m_controlIn_InputPort[port].setObjName(portName.toChar());
231 #endif
232  }
233 
234  // Connect input port pingIn
235  for (
236  FwIndexType port = 0;
237  port < static_cast<FwIndexType>(this->getNum_pingIn_InputPorts());
238  port++
239  ) {
240  this->m_pingIn_InputPort[port].init();
241  this->m_pingIn_InputPort[port].addCallComp(
242  this,
243  m_p_pingIn_in
244  );
245  this->m_pingIn_InputPort[port].setPortNum(port);
246 
247 #if FW_OBJECT_NAMES == 1
248  Fw::ObjectName portName;
249  portName.format(
250  "%s_pingIn_InputPort[%" PRI_FwIndexType "]",
251  this->m_objName.toChar(),
252  port
253  );
254  this->m_pingIn_InputPort[port].setObjName(portName.toChar());
255 #endif
256  }
257 
258  // Connect output port cmdRegOut
259  for (
260  FwIndexType port = 0;
261  port < static_cast<FwIndexType>(this->getNum_cmdRegOut_OutputPorts());
262  port++
263  ) {
264  this->m_cmdRegOut_OutputPort[port].init();
265 
266 #if FW_OBJECT_NAMES == 1
267  Fw::ObjectName portName;
268  portName.format(
269  "%s_cmdRegOut_OutputPort[%" PRI_FwIndexType "]",
270  this->m_objName.toChar(),
271  port
272  );
273  this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar());
274 #endif
275  }
276 
277  // Connect output port cmdResponseOut
278  for (
279  FwIndexType port = 0;
280  port < static_cast<FwIndexType>(this->getNum_cmdResponseOut_OutputPorts());
281  port++
282  ) {
283  this->m_cmdResponseOut_OutputPort[port].init();
284 
285 #if FW_OBJECT_NAMES == 1
286  Fw::ObjectName portName;
287  portName.format(
288  "%s_cmdResponseOut_OutputPort[%" PRI_FwIndexType "]",
289  this->m_objName.toChar(),
290  port
291  );
292  this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar());
293 #endif
294  }
295 
296  // Connect output port eventOut
297  for (
298  FwIndexType port = 0;
299  port < static_cast<FwIndexType>(this->getNum_eventOut_OutputPorts());
300  port++
301  ) {
302  this->m_eventOut_OutputPort[port].init();
303 
304 #if FW_OBJECT_NAMES == 1
305  Fw::ObjectName portName;
306  portName.format(
307  "%s_eventOut_OutputPort[%" PRI_FwIndexType "]",
308  this->m_objName.toChar(),
309  port
310  );
311  this->m_eventOut_OutputPort[port].setObjName(portName.toChar());
312 #endif
313  }
314 
315  // Connect output port paramGetOut
316  for (
317  FwIndexType port = 0;
318  port < static_cast<FwIndexType>(this->getNum_paramGetOut_OutputPorts());
319  port++
320  ) {
321  this->m_paramGetOut_OutputPort[port].init();
322 
323 #if FW_OBJECT_NAMES == 1
324  Fw::ObjectName portName;
325  portName.format(
326  "%s_paramGetOut_OutputPort[%" PRI_FwIndexType "]",
327  this->m_objName.toChar(),
328  port
329  );
330  this->m_paramGetOut_OutputPort[port].setObjName(portName.toChar());
331 #endif
332  }
333 
334  // Connect output port paramSetOut
335  for (
336  FwIndexType port = 0;
337  port < static_cast<FwIndexType>(this->getNum_paramSetOut_OutputPorts());
338  port++
339  ) {
340  this->m_paramSetOut_OutputPort[port].init();
341 
342 #if FW_OBJECT_NAMES == 1
343  Fw::ObjectName portName;
344  portName.format(
345  "%s_paramSetOut_OutputPort[%" PRI_FwIndexType "]",
346  this->m_objName.toChar(),
347  port
348  );
349  this->m_paramSetOut_OutputPort[port].setObjName(portName.toChar());
350 #endif
351  }
352 
353 #if FW_ENABLE_TEXT_LOGGING == 1
354  // Connect output port textEventOut
355  for (
356  FwIndexType port = 0;
357  port < static_cast<FwIndexType>(this->getNum_textEventOut_OutputPorts());
358  port++
359  ) {
360  this->m_textEventOut_OutputPort[port].init();
361 
362 #if FW_OBJECT_NAMES == 1
363  Fw::ObjectName portName;
364  portName.format(
365  "%s_textEventOut_OutputPort[%" PRI_FwIndexType "]",
366  this->m_objName.toChar(),
367  port
368  );
369  this->m_textEventOut_OutputPort[port].setObjName(portName.toChar());
370 #endif
371  }
372 #endif
373 
374  // Connect output port timeGetOut
375  for (
376  FwIndexType port = 0;
377  port < static_cast<FwIndexType>(this->getNum_timeGetOut_OutputPorts());
378  port++
379  ) {
380  this->m_timeGetOut_OutputPort[port].init();
381 
382 #if FW_OBJECT_NAMES == 1
383  Fw::ObjectName portName;
384  portName.format(
385  "%s_timeGetOut_OutputPort[%" PRI_FwIndexType "]",
386  this->m_objName.toChar(),
387  port
388  );
389  this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar());
390 #endif
391  }
392 
393  // Connect output port tlmOut
394  for (
395  FwIndexType port = 0;
396  port < static_cast<FwIndexType>(this->getNum_tlmOut_OutputPorts());
397  port++
398  ) {
399  this->m_tlmOut_OutputPort[port].init();
400 
401 #if FW_OBJECT_NAMES == 1
402  Fw::ObjectName portName;
403  portName.format(
404  "%s_tlmOut_OutputPort[%" PRI_FwIndexType "]",
405  this->m_objName.toChar(),
406  port
407  );
408  this->m_tlmOut_OutputPort[port].setObjName(portName.toChar());
409 #endif
410  }
411 
412  // Connect output port PktSend
413  for (
414  FwIndexType port = 0;
415  port < static_cast<FwIndexType>(this->getNum_PktSend_OutputPorts());
416  port++
417  ) {
418  this->m_PktSend_OutputPort[port].init();
419 
420 #if FW_OBJECT_NAMES == 1
421  Fw::ObjectName portName;
422  portName.format(
423  "%s_PktSend_OutputPort[%" PRI_FwIndexType "]",
424  this->m_objName.toChar(),
425  port
426  );
427  this->m_PktSend_OutputPort[port].setObjName(portName.toChar());
428 #endif
429  }
430 
431  // Connect output port pingOut
432  for (
433  FwIndexType port = 0;
434  port < static_cast<FwIndexType>(this->getNum_pingOut_OutputPorts());
435  port++
436  ) {
437  this->m_pingOut_OutputPort[port].init();
438 
439 #if FW_OBJECT_NAMES == 1
440  Fw::ObjectName portName;
441  portName.format(
442  "%s_pingOut_OutputPort[%" PRI_FwIndexType "]",
443  this->m_objName.toChar(),
444  port
445  );
446  this->m_pingOut_OutputPort[port].setObjName(portName.toChar());
447 #endif
448  }
449 
450  // Create the queue
451  Os::Queue::Status qStat = this->createQueue(
452  queueDepth,
453  static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
454  );
455  FW_ASSERT(
456  Os::Queue::Status::OP_OK == qStat,
457  static_cast<FwAssertArgType>(qStat)
458  );
459  }
460 
461  // ----------------------------------------------------------------------
462  // Getters for special input ports
463  // ----------------------------------------------------------------------
464 
467  {
468  FW_ASSERT(
469  (0 <= portNum) && (portNum < this->getNum_cmdIn_InputPorts()),
470  static_cast<FwAssertArgType>(portNum)
471  );
472 
473  return &this->m_cmdIn_InputPort[portNum];
474  }
475 
476  // ----------------------------------------------------------------------
477  // Getters for typed input ports
478  // ----------------------------------------------------------------------
479 
482  {
483  FW_ASSERT(
484  (0 <= portNum) && (portNum < this->getNum_Run_InputPorts()),
485  static_cast<FwAssertArgType>(portNum)
486  );
487 
488  return &this->m_Run_InputPort[portNum];
489  }
490 
493  {
494  FW_ASSERT(
495  (0 <= portNum) && (portNum < this->getNum_TlmGet_InputPorts()),
496  static_cast<FwAssertArgType>(portNum)
497  );
498 
499  return &this->m_TlmGet_InputPort[portNum];
500  }
501 
504  {
505  FW_ASSERT(
506  (0 <= portNum) && (portNum < this->getNum_TlmRecv_InputPorts()),
507  static_cast<FwAssertArgType>(portNum)
508  );
509 
510  return &this->m_TlmRecv_InputPort[portNum];
511  }
512 
515  {
516  FW_ASSERT(
517  (0 <= portNum) && (portNum < this->getNum_configureSectionGroupRate_InputPorts()),
518  static_cast<FwAssertArgType>(portNum)
519  );
520 
521  return &this->m_configureSectionGroupRate_InputPort[portNum];
522  }
523 
526  {
527  FW_ASSERT(
528  (0 <= portNum) && (portNum < this->getNum_controlIn_InputPorts()),
529  static_cast<FwAssertArgType>(portNum)
530  );
531 
532  return &this->m_controlIn_InputPort[portNum];
533  }
534 
537  {
538  FW_ASSERT(
539  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
540  static_cast<FwAssertArgType>(portNum)
541  );
542 
543  return &this->m_pingIn_InputPort[portNum];
544  }
545 
546  // ----------------------------------------------------------------------
547  // Connect input ports to special output ports
548  // ----------------------------------------------------------------------
549 
552  FwIndexType portNum,
553  Fw::InputCmdRegPort* port
554  )
555  {
556  FW_ASSERT(
557  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
558  static_cast<FwAssertArgType>(portNum)
559  );
560 
561  this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
562  }
563 
566  FwIndexType portNum,
568  )
569  {
570  FW_ASSERT(
571  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
572  static_cast<FwAssertArgType>(portNum)
573  );
574 
575  this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
576  }
577 
580  FwIndexType portNum,
581  Fw::InputLogPort* port
582  )
583  {
584  FW_ASSERT(
585  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
586  static_cast<FwAssertArgType>(portNum)
587  );
588 
589  this->m_eventOut_OutputPort[portNum].addCallPort(port);
590  }
591 
594  FwIndexType portNum,
595  Fw::InputPrmGetPort* port
596  )
597  {
598  FW_ASSERT(
599  (0 <= portNum) && (portNum < this->getNum_paramGetOut_OutputPorts()),
600  static_cast<FwAssertArgType>(portNum)
601  );
602 
603  this->m_paramGetOut_OutputPort[portNum].addCallPort(port);
604  }
605 
608  FwIndexType portNum,
609  Fw::InputPrmSetPort* port
610  )
611  {
612  FW_ASSERT(
613  (0 <= portNum) && (portNum < this->getNum_paramSetOut_OutputPorts()),
614  static_cast<FwAssertArgType>(portNum)
615  );
616 
617  this->m_paramSetOut_OutputPort[portNum].addCallPort(port);
618  }
619 
620 #if FW_ENABLE_TEXT_LOGGING == 1
621 
622  void TlmPacketizerComponentBase ::
623  set_textEventOut_OutputPort(
624  FwIndexType portNum,
626  )
627  {
628  FW_ASSERT(
629  (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
630  static_cast<FwAssertArgType>(portNum)
631  );
632 
633  this->m_textEventOut_OutputPort[portNum].addCallPort(port);
634  }
635 
636 #endif
637 
640  FwIndexType portNum,
641  Fw::InputTimePort* port
642  )
643  {
644  FW_ASSERT(
645  (0 <= portNum) && (portNum < this->getNum_timeGetOut_OutputPorts()),
646  static_cast<FwAssertArgType>(portNum)
647  );
648 
649  this->m_timeGetOut_OutputPort[portNum].addCallPort(port);
650  }
651 
654  FwIndexType portNum,
655  Fw::InputTlmPort* port
656  )
657  {
658  FW_ASSERT(
659  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
660  static_cast<FwAssertArgType>(portNum)
661  );
662 
663  this->m_tlmOut_OutputPort[portNum].addCallPort(port);
664  }
665 
666  // ----------------------------------------------------------------------
667  // Connect typed input ports to typed output ports
668  // ----------------------------------------------------------------------
669 
672  FwIndexType portNum,
673  Fw::InputComPort* port
674  )
675  {
676  FW_ASSERT(
677  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
678  static_cast<FwAssertArgType>(portNum)
679  );
680 
681  this->m_PktSend_OutputPort[portNum].addCallPort(port);
682  }
683 
686  FwIndexType portNum,
687  Svc::InputPingPort* port
688  )
689  {
690  FW_ASSERT(
691  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
692  static_cast<FwAssertArgType>(portNum)
693  );
694 
695  this->m_pingOut_OutputPort[portNum].addCallPort(port);
696  }
697 
698 #if FW_PORT_SERIALIZATION
699 
700  // ----------------------------------------------------------------------
701  // Connect serial input ports to special output ports
702  // ----------------------------------------------------------------------
703 
706  FwIndexType portNum,
707  Fw::InputSerializePort* port
708  )
709  {
710  FW_ASSERT(
711  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
712  static_cast<FwAssertArgType>(portNum)
713  );
714 
715  this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
716  }
717 
720  FwIndexType portNum,
721  Fw::InputSerializePort* port
722  )
723  {
724  FW_ASSERT(
725  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
726  static_cast<FwAssertArgType>(portNum)
727  );
728 
729  this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
730  }
731 
734  FwIndexType portNum,
735  Fw::InputSerializePort* port
736  )
737  {
738  FW_ASSERT(
739  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
740  static_cast<FwAssertArgType>(portNum)
741  );
742 
743  this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
744  }
745 
748  FwIndexType portNum,
749  Fw::InputSerializePort* port
750  )
751  {
752  FW_ASSERT(
753  (0 <= portNum) && (portNum < this->getNum_paramSetOut_OutputPorts()),
754  static_cast<FwAssertArgType>(portNum)
755  );
756 
757  this->m_paramSetOut_OutputPort[portNum].registerSerialPort(port);
758  }
759 
760 #if FW_ENABLE_TEXT_LOGGING == 1
761 
762  void TlmPacketizerComponentBase ::
763  set_textEventOut_OutputPort(
764  FwIndexType portNum,
765  Fw::InputSerializePort* port
766  )
767  {
768  FW_ASSERT(
769  (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
770  static_cast<FwAssertArgType>(portNum)
771  );
772 
773  this->m_textEventOut_OutputPort[portNum].registerSerialPort(port);
774  }
775 
776 #endif
777 
780  FwIndexType portNum,
781  Fw::InputSerializePort* port
782  )
783  {
784  FW_ASSERT(
785  (0 <= portNum) && (portNum < this->getNum_timeGetOut_OutputPorts()),
786  static_cast<FwAssertArgType>(portNum)
787  );
788 
789  this->m_timeGetOut_OutputPort[portNum].registerSerialPort(port);
790  }
791 
794  FwIndexType portNum,
795  Fw::InputSerializePort* port
796  )
797  {
798  FW_ASSERT(
799  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
800  static_cast<FwAssertArgType>(portNum)
801  );
802 
803  this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
804  }
805 
806 #endif
807 
808 #if FW_PORT_SERIALIZATION
809 
810  // ----------------------------------------------------------------------
811  // Connect serial input ports to typed output ports
812  // ----------------------------------------------------------------------
813 
816  FwIndexType portNum,
817  Fw::InputSerializePort* port
818  )
819  {
820  FW_ASSERT(
821  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
822  static_cast<FwAssertArgType>(portNum)
823  );
824 
825  this->m_PktSend_OutputPort[portNum].registerSerialPort(port);
826  }
827 
830  FwIndexType portNum,
831  Fw::InputSerializePort* port
832  )
833  {
834  FW_ASSERT(
835  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
836  static_cast<FwAssertArgType>(portNum)
837  );
838 
839  this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
840  }
841 
842 #endif
843 
844  // ----------------------------------------------------------------------
845  // Command registration
846  // ----------------------------------------------------------------------
847 
850  {
851  FW_ASSERT(this->m_cmdRegOut_OutputPort[0].isConnected());
852 
853  this->m_cmdRegOut_OutputPort[0].invoke(
854  this->getIdBase() + OPCODE_SET_LEVEL
855  );
856 
857  this->m_cmdRegOut_OutputPort[0].invoke(
858  this->getIdBase() + OPCODE_SEND_PKT
859  );
860 
861  this->m_cmdRegOut_OutputPort[0].invoke(
863  );
864 
865  this->m_cmdRegOut_OutputPort[0].invoke(
867  );
868 
869  this->m_cmdRegOut_OutputPort[0].invoke(
870  this->getIdBase() + OPCODE_FORCE_GROUP
871  );
872 
873  this->m_cmdRegOut_OutputPort[0].invoke(
875  );
876 
877  this->m_cmdRegOut_OutputPort[0].invoke(
879  );
880 
881  this->m_cmdRegOut_OutputPort[0].invoke(
883  );
884 
885  this->m_cmdRegOut_OutputPort[0].invoke(
887  );
888 
889  this->m_cmdRegOut_OutputPort[0].invoke(
891  );
892  }
893 
894  // ----------------------------------------------------------------------
895  // Parameter loading
896  // ----------------------------------------------------------------------
897 
900  {
901  Fw::ParamBuffer _buff;
903  const FwPrmIdType _baseId = static_cast<FwPrmIdType>(this->getIdBase());
904  FW_ASSERT(this->m_paramGetOut_OutputPort[0].isConnected());
905 
906  FwPrmIdType _id{};
907 
908  Fw::ParamValid param_valid;
909 
910  _id = _baseId + PARAMID_SECTION_ENABLED;
911 
912  // Get parameter SECTION_ENABLED
913  param_valid = this->m_paramGetOut_OutputPort[0].invoke(
914  _id,
915  _buff
916  );
917 
918  // If there was a deserialization issue, mark it invalid
919  if (param_valid == Fw::ParamValid::VALID) {
920  // Pass the local ID to the delegate
921  constexpr FwPrmIdType _localId = PARAMID_SECTION_ENABLED;
922 
923  FW_ASSERT(this->paramDelegatePtr != nullptr);
924  // Call the delegate deserialize function for m_SECTION_ENABLED
925  _stat = this->paramDelegatePtr->deserializeParam(_baseId, _localId, param_valid, _buff);
926  if (_stat != Fw::FW_SERIALIZE_OK) {
927  param_valid = Fw::ParamValid::INVALID;
928  }
929  }
930  else {
931  param_valid = Fw::ParamValid::INVALID;
932  }
933 
934  _id = _baseId + PARAMID_SECTION_CONFIGS;
935 
936  // Get parameter SECTION_CONFIGS
937  param_valid = this->m_paramGetOut_OutputPort[0].invoke(
938  _id,
939  _buff
940  );
941 
942  // If there was a deserialization issue, mark it invalid
943  if (param_valid == Fw::ParamValid::VALID) {
944  // Pass the local ID to the delegate
945  constexpr FwPrmIdType _localId = PARAMID_SECTION_CONFIGS;
946 
947  FW_ASSERT(this->paramDelegatePtr != nullptr);
948  // Call the delegate deserialize function for m_SECTION_CONFIGS
949  _stat = this->paramDelegatePtr->deserializeParam(_baseId, _localId, param_valid, _buff);
950  if (_stat != Fw::FW_SERIALIZE_OK) {
951  param_valid = Fw::ParamValid::INVALID;
952  }
953  }
954  else {
955  param_valid = Fw::ParamValid::INVALID;
956  }
957 
958  // Call notifier
959  this->parametersLoaded();
960  }
961 
962  // ----------------------------------------------------------------------
963  // Component construction and destruction
964  // ----------------------------------------------------------------------
965 
967  TlmPacketizerComponentBase(const char* compName) :
968  Fw::ActiveComponentBase(compName),
969  paramDelegatePtr(nullptr)
970  {
971 
972  }
973 
976  {
977 
978  }
979 
980  // ----------------------------------------------------------------------
981  // Connection status queries for special output ports
982  // ----------------------------------------------------------------------
983 
986  {
987  FW_ASSERT(
988  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
989  static_cast<FwAssertArgType>(portNum)
990  );
991 
992  return this->m_cmdRegOut_OutputPort[portNum].isConnected();
993  }
994 
997  {
998  FW_ASSERT(
999  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
1000  static_cast<FwAssertArgType>(portNum)
1001  );
1002 
1003  return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
1004  }
1005 
1008  {
1009  FW_ASSERT(
1010  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
1011  static_cast<FwAssertArgType>(portNum)
1012  );
1013 
1014  return this->m_eventOut_OutputPort[portNum].isConnected();
1015  }
1016 
1019  {
1020  FW_ASSERT(
1021  (0 <= portNum) && (portNum < this->getNum_paramGetOut_OutputPorts()),
1022  static_cast<FwAssertArgType>(portNum)
1023  );
1024 
1025  return this->m_paramGetOut_OutputPort[portNum].isConnected();
1026  }
1027 
1030  {
1031  FW_ASSERT(
1032  (0 <= portNum) && (portNum < this->getNum_paramSetOut_OutputPorts()),
1033  static_cast<FwAssertArgType>(portNum)
1034  );
1035 
1036  return this->m_paramSetOut_OutputPort[portNum].isConnected();
1037  }
1038 
1039 #if FW_ENABLE_TEXT_LOGGING == 1
1040 
1041  bool TlmPacketizerComponentBase ::
1042  isConnected_textEventOut_OutputPort(FwIndexType portNum)
1043  {
1044  FW_ASSERT(
1045  (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
1046  static_cast<FwAssertArgType>(portNum)
1047  );
1048 
1049  return this->m_textEventOut_OutputPort[portNum].isConnected();
1050  }
1051 
1052 #endif
1053 
1056  {
1057  FW_ASSERT(
1058  (0 <= portNum) && (portNum < this->getNum_timeGetOut_OutputPorts()),
1059  static_cast<FwAssertArgType>(portNum)
1060  );
1061 
1062  return this->m_timeGetOut_OutputPort[portNum].isConnected();
1063  }
1064 
1067  {
1068  FW_ASSERT(
1069  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
1070  static_cast<FwAssertArgType>(portNum)
1071  );
1072 
1073  return this->m_tlmOut_OutputPort[portNum].isConnected();
1074  }
1075 
1076  // ----------------------------------------------------------------------
1077  // Connection status queries for typed output ports
1078  // ----------------------------------------------------------------------
1079 
1082  {
1083  FW_ASSERT(
1084  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
1085  static_cast<FwAssertArgType>(portNum)
1086  );
1087 
1088  return this->m_PktSend_OutputPort[portNum].isConnected();
1089  }
1090 
1093  {
1094  FW_ASSERT(
1095  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
1096  static_cast<FwAssertArgType>(portNum)
1097  );
1098 
1099  return this->m_pingOut_OutputPort[portNum].isConnected();
1100  }
1101 
1102  // ----------------------------------------------------------------------
1103  // Port handler base-class functions for typed input ports
1104  //
1105  // Call these functions directly to bypass the corresponding ports
1106  // ----------------------------------------------------------------------
1107 
1110  FwIndexType portNum,
1111  U32 context
1112  )
1113  {
1114  // Make sure port number is valid
1115  FW_ASSERT(
1116  (0 <= portNum) && (portNum < this->getNum_Run_InputPorts()),
1117  static_cast<FwAssertArgType>(portNum)
1118  );
1119 
1120  // Call pre-message hook
1122  portNum,
1123  context
1124  );
1125  ComponentIpcSerializableBuffer msg;
1127 
1128  // Serialize message ID
1129  _status = msg.serializeFrom(
1130  static_cast<FwEnumStoreType>(RUN_SCHED)
1131  );
1132  FW_ASSERT(
1133  _status == Fw::FW_SERIALIZE_OK,
1134  static_cast<FwAssertArgType>(_status)
1135  );
1136 
1137  // Serialize port number
1138  _status = msg.serializeFrom(portNum);
1139  FW_ASSERT(
1140  _status == Fw::FW_SERIALIZE_OK,
1141  static_cast<FwAssertArgType>(_status)
1142  );
1143 
1144  // Serialize argument context
1145  _status = msg.serializeFrom(context);
1146  FW_ASSERT(
1147  _status == Fw::FW_SERIALIZE_OK,
1148  static_cast<FwAssertArgType>(_status)
1149  );
1150 
1151  // Send message
1153  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1154 
1155  FW_ASSERT(
1156  qStatus == Os::Queue::OP_OK,
1157  static_cast<FwAssertArgType>(qStatus)
1158  );
1159  }
1160 
1163  FwIndexType portNum,
1164  FwChanIdType id,
1165  Fw::Time& timeTag,
1166  Fw::TlmBuffer& val
1167  )
1168  {
1169  // Make sure port number is valid
1170  FW_ASSERT(
1171  (0 <= portNum) && (portNum < this->getNum_TlmGet_InputPorts()),
1172  static_cast<FwAssertArgType>(portNum)
1173  );
1174 
1175  Fw::TlmValid retVal;
1176 
1177  // Call handler function
1178  retVal = this->TlmGet_handler(
1179  portNum,
1180  id,
1181  timeTag,
1182  val
1183  );
1184 
1185  return retVal;
1186  }
1187 
1190  FwIndexType portNum,
1191  FwChanIdType id,
1192  Fw::Time& timeTag,
1193  Fw::TlmBuffer& val
1194  )
1195  {
1196  // Make sure port number is valid
1197  FW_ASSERT(
1198  (0 <= portNum) && (portNum < this->getNum_TlmRecv_InputPorts()),
1199  static_cast<FwAssertArgType>(portNum)
1200  );
1201 
1202  // Call handler function
1203  this->TlmRecv_handler(
1204  portNum,
1205  id,
1206  timeTag,
1207  val
1208  );
1209  }
1210 
1213  FwIndexType portNum,
1214  const Svc::TelemetrySection& section,
1215  FwChanIdType tlmGroup,
1216  const Svc::RateLogic& rateLogic,
1217  U32 minDelta,
1218  U32 maxDelta
1219  )
1220  {
1221  // Make sure port number is valid
1222  FW_ASSERT(
1223  (0 <= portNum) && (portNum < this->getNum_configureSectionGroupRate_InputPorts()),
1224  static_cast<FwAssertArgType>(portNum)
1225  );
1226 
1227  // Call pre-message hook
1229  portNum,
1230  section,
1231  tlmGroup,
1232  rateLogic,
1233  minDelta,
1234  maxDelta
1235  );
1236  ComponentIpcSerializableBuffer msg;
1238 
1239  // Serialize message ID
1240  _status = msg.serializeFrom(
1241  static_cast<FwEnumStoreType>(CONFIGURESECTIONGROUPRATE_CONFIGUREGROUPRATE)
1242  );
1243  FW_ASSERT(
1244  _status == Fw::FW_SERIALIZE_OK,
1245  static_cast<FwAssertArgType>(_status)
1246  );
1247 
1248  // Serialize port number
1249  _status = msg.serializeFrom(portNum);
1250  FW_ASSERT(
1251  _status == Fw::FW_SERIALIZE_OK,
1252  static_cast<FwAssertArgType>(_status)
1253  );
1254 
1255  // Serialize argument section
1256  _status = msg.serializeFrom(section);
1257  FW_ASSERT(
1258  _status == Fw::FW_SERIALIZE_OK,
1259  static_cast<FwAssertArgType>(_status)
1260  );
1261 
1262  // Serialize argument tlmGroup
1263  _status = msg.serializeFrom(tlmGroup);
1264  FW_ASSERT(
1265  _status == Fw::FW_SERIALIZE_OK,
1266  static_cast<FwAssertArgType>(_status)
1267  );
1268 
1269  // Serialize argument rateLogic
1270  _status = msg.serializeFrom(rateLogic);
1271  FW_ASSERT(
1272  _status == Fw::FW_SERIALIZE_OK,
1273  static_cast<FwAssertArgType>(_status)
1274  );
1275 
1276  // Serialize argument minDelta
1277  _status = msg.serializeFrom(minDelta);
1278  FW_ASSERT(
1279  _status == Fw::FW_SERIALIZE_OK,
1280  static_cast<FwAssertArgType>(_status)
1281  );
1282 
1283  // Serialize argument maxDelta
1284  _status = msg.serializeFrom(maxDelta);
1285  FW_ASSERT(
1286  _status == Fw::FW_SERIALIZE_OK,
1287  static_cast<FwAssertArgType>(_status)
1288  );
1289 
1290  // Send message
1292  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1293 
1294  FW_ASSERT(
1295  qStatus == Os::Queue::OP_OK,
1296  static_cast<FwAssertArgType>(qStatus)
1297  );
1298  }
1299 
1302  FwIndexType portNum,
1303  const Svc::TelemetrySection& section,
1304  const Fw::Enabled& enabled
1305  )
1306  {
1307  // Make sure port number is valid
1308  FW_ASSERT(
1309  (0 <= portNum) && (portNum < this->getNum_controlIn_InputPorts()),
1310  static_cast<FwAssertArgType>(portNum)
1311  );
1312 
1313  // Call pre-message hook
1315  portNum,
1316  section,
1317  enabled
1318  );
1319  ComponentIpcSerializableBuffer msg;
1321 
1322  // Serialize message ID
1323  _status = msg.serializeFrom(
1324  static_cast<FwEnumStoreType>(CONTROLIN_ENABLESECTION)
1325  );
1326  FW_ASSERT(
1327  _status == Fw::FW_SERIALIZE_OK,
1328  static_cast<FwAssertArgType>(_status)
1329  );
1330 
1331  // Serialize port number
1332  _status = msg.serializeFrom(portNum);
1333  FW_ASSERT(
1334  _status == Fw::FW_SERIALIZE_OK,
1335  static_cast<FwAssertArgType>(_status)
1336  );
1337 
1338  // Serialize argument section
1339  _status = msg.serializeFrom(section);
1340  FW_ASSERT(
1341  _status == Fw::FW_SERIALIZE_OK,
1342  static_cast<FwAssertArgType>(_status)
1343  );
1344 
1345  // Serialize argument enabled
1346  _status = msg.serializeFrom(enabled);
1347  FW_ASSERT(
1348  _status == Fw::FW_SERIALIZE_OK,
1349  static_cast<FwAssertArgType>(_status)
1350  );
1351 
1352  // Send message
1354  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1355 
1356  FW_ASSERT(
1357  qStatus == Os::Queue::OP_OK,
1358  static_cast<FwAssertArgType>(qStatus)
1359  );
1360  }
1361 
1364  FwIndexType portNum,
1365  U32 key
1366  )
1367  {
1368  // Make sure port number is valid
1369  FW_ASSERT(
1370  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
1371  static_cast<FwAssertArgType>(portNum)
1372  );
1373 
1374  // Call pre-message hook
1376  portNum,
1377  key
1378  );
1379  ComponentIpcSerializableBuffer msg;
1381 
1382  // Serialize message ID
1383  _status = msg.serializeFrom(
1384  static_cast<FwEnumStoreType>(PINGIN_PING)
1385  );
1386  FW_ASSERT(
1387  _status == Fw::FW_SERIALIZE_OK,
1388  static_cast<FwAssertArgType>(_status)
1389  );
1390 
1391  // Serialize port number
1392  _status = msg.serializeFrom(portNum);
1393  FW_ASSERT(
1394  _status == Fw::FW_SERIALIZE_OK,
1395  static_cast<FwAssertArgType>(_status)
1396  );
1397 
1398  // Serialize argument key
1399  _status = msg.serializeFrom(key);
1400  FW_ASSERT(
1401  _status == Fw::FW_SERIALIZE_OK,
1402  static_cast<FwAssertArgType>(_status)
1403  );
1404 
1405  // Send message
1407  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1408 
1409  FW_ASSERT(
1410  qStatus == Os::Queue::OP_OK,
1411  static_cast<FwAssertArgType>(qStatus)
1412  );
1413  }
1414 
1415  // ----------------------------------------------------------------------
1416  // Pre-message hooks for typed async input ports
1417  //
1418  // Each of these functions is invoked just before processing a message
1419  // on the corresponding port. By default, they do nothing. You can
1420  // override them to provide specific pre-message behavior.
1421  // ----------------------------------------------------------------------
1422 
1425  FwIndexType portNum,
1426  U32 context
1427  )
1428  {
1429  // Default: no-op
1430  }
1431 
1434  FwIndexType portNum,
1435  const Svc::TelemetrySection& section,
1436  FwChanIdType tlmGroup,
1437  const Svc::RateLogic& rateLogic,
1438  U32 minDelta,
1439  U32 maxDelta
1440  )
1441  {
1442  // Default: no-op
1443  }
1444 
1447  FwIndexType portNum,
1448  const Svc::TelemetrySection& section,
1449  const Fw::Enabled& enabled
1450  )
1451  {
1452  // Default: no-op
1453  }
1454 
1457  FwIndexType portNum,
1458  U32 key
1459  )
1460  {
1461  // Default: no-op
1462  }
1463 
1464  // ----------------------------------------------------------------------
1465  // Invocation functions for typed output ports
1466  // ----------------------------------------------------------------------
1467 
1470  FwIndexType portNum,
1471  Fw::ComBuffer& data,
1472  U32 context
1473  )
1474  {
1475  FW_ASSERT(
1476  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
1477  static_cast<FwAssertArgType>(portNum)
1478  );
1479 
1480  FW_ASSERT(
1481  this->m_PktSend_OutputPort[portNum].isConnected(),
1482  static_cast<FwAssertArgType>(portNum)
1483  );
1484  this->m_PktSend_OutputPort[portNum].invoke(
1485  data,
1486  context
1487  );
1488  }
1489 
1492  FwIndexType portNum,
1493  U32 key
1494  )
1495  {
1496  FW_ASSERT(
1497  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
1498  static_cast<FwAssertArgType>(portNum)
1499  );
1500 
1501  FW_ASSERT(
1502  this->m_pingOut_OutputPort[portNum].isConnected(),
1503  static_cast<FwAssertArgType>(portNum)
1504  );
1505  this->m_pingOut_OutputPort[portNum].invoke(
1506  key
1507  );
1508  }
1509 
1510  // ----------------------------------------------------------------------
1511  // Command response
1512  // ----------------------------------------------------------------------
1513 
1516  FwOpcodeType opCode,
1517  U32 cmdSeq,
1518  Fw::CmdResponse response
1519  )
1520  {
1521  FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
1522  this->m_cmdResponseOut_OutputPort[0].invoke(opCode, cmdSeq, response);
1523  }
1524 
1525  // ----------------------------------------------------------------------
1526  // Command handler base-class functions
1527  //
1528  // Call these functions directly to bypass the command input port
1529  // ----------------------------------------------------------------------
1530 
1533  FwOpcodeType opCode,
1534  U32 cmdSeq,
1535  Fw::CmdArgBuffer& args
1536  )
1537  {
1538  // Call pre-message hook
1539  this->SET_LEVEL_preMsgHook(opCode,cmdSeq);
1540 
1541  // Defer deserializing arguments to the message dispatcher
1542  // to avoid deserializing and reserializing just for IPC
1543  ComponentIpcSerializableBuffer msg;
1545 
1546  // Serialize for IPC
1547  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_SET_LEVEL));
1548  FW_ASSERT (
1549  _status == Fw::FW_SERIALIZE_OK,
1550  static_cast<FwAssertArgType>(_status)
1551  );
1552 
1553  // Fake port number to make message dequeue work
1554  FwIndexType port = 0;
1555 
1556  _status = msg.serializeFrom(port);
1557  FW_ASSERT (
1558  _status == Fw::FW_SERIALIZE_OK,
1559  static_cast<FwAssertArgType>(_status)
1560  );
1561 
1562  _status = msg.serializeFrom(opCode);
1563  FW_ASSERT (
1564  _status == Fw::FW_SERIALIZE_OK,
1565  static_cast<FwAssertArgType>(_status)
1566  );
1567 
1568  _status = msg.serializeFrom(cmdSeq);
1569  FW_ASSERT (
1570  _status == Fw::FW_SERIALIZE_OK,
1571  static_cast<FwAssertArgType>(_status)
1572  );
1573 
1574  _status = msg.serializeFrom(args);
1575  FW_ASSERT (
1576  _status == Fw::FW_SERIALIZE_OK,
1577  static_cast<FwAssertArgType>(_status)
1578  );
1579 
1580  // Send message
1582  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1583 
1584  FW_ASSERT(
1585  qStatus == Os::Queue::OP_OK,
1586  static_cast<FwAssertArgType>(qStatus)
1587  );
1588  }
1589 
1592  FwOpcodeType opCode,
1593  U32 cmdSeq,
1594  Fw::CmdArgBuffer& args
1595  )
1596  {
1597  // Call pre-message hook
1598  this->SEND_PKT_preMsgHook(opCode,cmdSeq);
1599 
1600  // Defer deserializing arguments to the message dispatcher
1601  // to avoid deserializing and reserializing just for IPC
1602  ComponentIpcSerializableBuffer msg;
1604 
1605  // Serialize for IPC
1606  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_SEND_PKT));
1607  FW_ASSERT (
1608  _status == Fw::FW_SERIALIZE_OK,
1609  static_cast<FwAssertArgType>(_status)
1610  );
1611 
1612  // Fake port number to make message dequeue work
1613  FwIndexType port = 0;
1614 
1615  _status = msg.serializeFrom(port);
1616  FW_ASSERT (
1617  _status == Fw::FW_SERIALIZE_OK,
1618  static_cast<FwAssertArgType>(_status)
1619  );
1620 
1621  _status = msg.serializeFrom(opCode);
1622  FW_ASSERT (
1623  _status == Fw::FW_SERIALIZE_OK,
1624  static_cast<FwAssertArgType>(_status)
1625  );
1626 
1627  _status = msg.serializeFrom(cmdSeq);
1628  FW_ASSERT (
1629  _status == Fw::FW_SERIALIZE_OK,
1630  static_cast<FwAssertArgType>(_status)
1631  );
1632 
1633  _status = msg.serializeFrom(args);
1634  FW_ASSERT (
1635  _status == Fw::FW_SERIALIZE_OK,
1636  static_cast<FwAssertArgType>(_status)
1637  );
1638 
1639  // Send message
1641  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1642 
1643  FW_ASSERT(
1644  qStatus == Os::Queue::OP_OK,
1645  static_cast<FwAssertArgType>(qStatus)
1646  );
1647  }
1648 
1651  FwOpcodeType opCode,
1652  U32 cmdSeq,
1653  Fw::CmdArgBuffer& args
1654  )
1655  {
1656  // Call pre-message hook
1657  this->ENABLE_SECTION_preMsgHook(opCode,cmdSeq);
1658 
1659  // Defer deserializing arguments to the message dispatcher
1660  // to avoid deserializing and reserializing just for IPC
1661  ComponentIpcSerializableBuffer msg;
1663 
1664  // Serialize for IPC
1665  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_ENABLE_SECTION));
1666  FW_ASSERT (
1667  _status == Fw::FW_SERIALIZE_OK,
1668  static_cast<FwAssertArgType>(_status)
1669  );
1670 
1671  // Fake port number to make message dequeue work
1672  FwIndexType port = 0;
1673 
1674  _status = msg.serializeFrom(port);
1675  FW_ASSERT (
1676  _status == Fw::FW_SERIALIZE_OK,
1677  static_cast<FwAssertArgType>(_status)
1678  );
1679 
1680  _status = msg.serializeFrom(opCode);
1681  FW_ASSERT (
1682  _status == Fw::FW_SERIALIZE_OK,
1683  static_cast<FwAssertArgType>(_status)
1684  );
1685 
1686  _status = msg.serializeFrom(cmdSeq);
1687  FW_ASSERT (
1688  _status == Fw::FW_SERIALIZE_OK,
1689  static_cast<FwAssertArgType>(_status)
1690  );
1691 
1692  _status = msg.serializeFrom(args);
1693  FW_ASSERT (
1694  _status == Fw::FW_SERIALIZE_OK,
1695  static_cast<FwAssertArgType>(_status)
1696  );
1697 
1698  // Send message
1700  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1701 
1702  FW_ASSERT(
1703  qStatus == Os::Queue::OP_OK,
1704  static_cast<FwAssertArgType>(qStatus)
1705  );
1706  }
1707 
1710  FwOpcodeType opCode,
1711  U32 cmdSeq,
1712  Fw::CmdArgBuffer& args
1713  )
1714  {
1715  // Call pre-message hook
1716  this->ENABLE_GROUP_preMsgHook(opCode,cmdSeq);
1717 
1718  // Defer deserializing arguments to the message dispatcher
1719  // to avoid deserializing and reserializing just for IPC
1720  ComponentIpcSerializableBuffer msg;
1722 
1723  // Serialize for IPC
1724  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_ENABLE_GROUP));
1725  FW_ASSERT (
1726  _status == Fw::FW_SERIALIZE_OK,
1727  static_cast<FwAssertArgType>(_status)
1728  );
1729 
1730  // Fake port number to make message dequeue work
1731  FwIndexType port = 0;
1732 
1733  _status = msg.serializeFrom(port);
1734  FW_ASSERT (
1735  _status == Fw::FW_SERIALIZE_OK,
1736  static_cast<FwAssertArgType>(_status)
1737  );
1738 
1739  _status = msg.serializeFrom(opCode);
1740  FW_ASSERT (
1741  _status == Fw::FW_SERIALIZE_OK,
1742  static_cast<FwAssertArgType>(_status)
1743  );
1744 
1745  _status = msg.serializeFrom(cmdSeq);
1746  FW_ASSERT (
1747  _status == Fw::FW_SERIALIZE_OK,
1748  static_cast<FwAssertArgType>(_status)
1749  );
1750 
1751  _status = msg.serializeFrom(args);
1752  FW_ASSERT (
1753  _status == Fw::FW_SERIALIZE_OK,
1754  static_cast<FwAssertArgType>(_status)
1755  );
1756 
1757  // Send message
1759  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1760 
1761  FW_ASSERT(
1762  qStatus == Os::Queue::OP_OK,
1763  static_cast<FwAssertArgType>(qStatus)
1764  );
1765  }
1766 
1769  FwOpcodeType opCode,
1770  U32 cmdSeq,
1771  Fw::CmdArgBuffer& args
1772  )
1773  {
1774  // Call pre-message hook
1775  this->FORCE_GROUP_preMsgHook(opCode,cmdSeq);
1776 
1777  // Defer deserializing arguments to the message dispatcher
1778  // to avoid deserializing and reserializing just for IPC
1779  ComponentIpcSerializableBuffer msg;
1781 
1782  // Serialize for IPC
1783  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_FORCE_GROUP));
1784  FW_ASSERT (
1785  _status == Fw::FW_SERIALIZE_OK,
1786  static_cast<FwAssertArgType>(_status)
1787  );
1788 
1789  // Fake port number to make message dequeue work
1790  FwIndexType port = 0;
1791 
1792  _status = msg.serializeFrom(port);
1793  FW_ASSERT (
1794  _status == Fw::FW_SERIALIZE_OK,
1795  static_cast<FwAssertArgType>(_status)
1796  );
1797 
1798  _status = msg.serializeFrom(opCode);
1799  FW_ASSERT (
1800  _status == Fw::FW_SERIALIZE_OK,
1801  static_cast<FwAssertArgType>(_status)
1802  );
1803 
1804  _status = msg.serializeFrom(cmdSeq);
1805  FW_ASSERT (
1806  _status == Fw::FW_SERIALIZE_OK,
1807  static_cast<FwAssertArgType>(_status)
1808  );
1809 
1810  _status = msg.serializeFrom(args);
1811  FW_ASSERT (
1812  _status == Fw::FW_SERIALIZE_OK,
1813  static_cast<FwAssertArgType>(_status)
1814  );
1815 
1816  // Send message
1818  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1819 
1820  FW_ASSERT(
1821  qStatus == Os::Queue::OP_OK,
1822  static_cast<FwAssertArgType>(qStatus)
1823  );
1824  }
1825 
1828  FwOpcodeType opCode,
1829  U32 cmdSeq,
1830  Fw::CmdArgBuffer& args
1831  )
1832  {
1833  // Call pre-message hook
1834  this->CONFIGURE_GROUP_RATES_preMsgHook(opCode,cmdSeq);
1835 
1836  // Defer deserializing arguments to the message dispatcher
1837  // to avoid deserializing and reserializing just for IPC
1838  ComponentIpcSerializableBuffer msg;
1840 
1841  // Serialize for IPC
1842  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CONFIGURE_GROUP_RATES));
1843  FW_ASSERT (
1844  _status == Fw::FW_SERIALIZE_OK,
1845  static_cast<FwAssertArgType>(_status)
1846  );
1847 
1848  // Fake port number to make message dequeue work
1849  FwIndexType port = 0;
1850 
1851  _status = msg.serializeFrom(port);
1852  FW_ASSERT (
1853  _status == Fw::FW_SERIALIZE_OK,
1854  static_cast<FwAssertArgType>(_status)
1855  );
1856 
1857  _status = msg.serializeFrom(opCode);
1858  FW_ASSERT (
1859  _status == Fw::FW_SERIALIZE_OK,
1860  static_cast<FwAssertArgType>(_status)
1861  );
1862 
1863  _status = msg.serializeFrom(cmdSeq);
1864  FW_ASSERT (
1865  _status == Fw::FW_SERIALIZE_OK,
1866  static_cast<FwAssertArgType>(_status)
1867  );
1868 
1869  _status = msg.serializeFrom(args);
1870  FW_ASSERT (
1871  _status == Fw::FW_SERIALIZE_OK,
1872  static_cast<FwAssertArgType>(_status)
1873  );
1874 
1875  // Send message
1877  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1878 
1879  FW_ASSERT(
1880  qStatus == Os::Queue::OP_OK,
1881  static_cast<FwAssertArgType>(qStatus)
1882  );
1883  }
1884 
1885  // ----------------------------------------------------------------------
1886  // Pre-message hooks for async commands
1887  //
1888  // Each of these functions is invoked just before processing the
1889  // corresponding command. By default they do nothing. You can
1890  // override them to provide specific pre-command behavior.
1891  // ----------------------------------------------------------------------
1892 
1895  FwOpcodeType opCode,
1896  U32 cmdSeq
1897  )
1898  {
1899  // Defaults to no-op; can be overridden
1900  (void) opCode;
1901  (void) cmdSeq;
1902  }
1903 
1906  FwOpcodeType opCode,
1907  U32 cmdSeq
1908  )
1909  {
1910  // Defaults to no-op; can be overridden
1911  (void) opCode;
1912  (void) cmdSeq;
1913  }
1914 
1917  FwOpcodeType opCode,
1918  U32 cmdSeq
1919  )
1920  {
1921  // Defaults to no-op; can be overridden
1922  (void) opCode;
1923  (void) cmdSeq;
1924  }
1925 
1928  FwOpcodeType opCode,
1929  U32 cmdSeq
1930  )
1931  {
1932  // Defaults to no-op; can be overridden
1933  (void) opCode;
1934  (void) cmdSeq;
1935  }
1936 
1939  FwOpcodeType opCode,
1940  U32 cmdSeq
1941  )
1942  {
1943  // Defaults to no-op; can be overridden
1944  (void) opCode;
1945  (void) cmdSeq;
1946  }
1947 
1950  FwOpcodeType opCode,
1951  U32 cmdSeq
1952  )
1953  {
1954  // Defaults to no-op; can be overridden
1955  (void) opCode;
1956  (void) cmdSeq;
1957  }
1958 
1959  // ----------------------------------------------------------------------
1960  // Event logging functions
1961  // ----------------------------------------------------------------------
1962 
1965  {
1966  // Get the time
1967  Fw::Time _logTime;
1968  if (this->m_timeGetOut_OutputPort[0].isConnected()) {
1969  this->m_timeGetOut_OutputPort[0].invoke(_logTime);
1970  }
1971 
1972  FwEventIdType _id = static_cast<FwEventIdType>(0);
1973 
1974  _id = this->getIdBase() + EVENTID_NOCHAN;
1975 
1976  // Emit the event on the log port
1977  if (this->m_eventOut_OutputPort[0].isConnected()) {
1978  Fw::LogBuffer _logBuff;
1980 
1981 #if FW_AMPCS_COMPATIBLE
1982  // Serialize the number of arguments
1983  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1984  FW_ASSERT(
1985  _status == Fw::FW_SERIALIZE_OK,
1986  static_cast<FwAssertArgType>(_status)
1987  );
1988 #endif
1989 
1990 #if FW_AMPCS_COMPATIBLE
1991  // Serialize the argument size
1992  _status = _logBuff.serializeFrom(
1993  static_cast<U8>(sizeof(FwChanIdType))
1994  );
1995  FW_ASSERT(
1996  _status == Fw::FW_SERIALIZE_OK,
1997  static_cast<FwAssertArgType>(_status)
1998  );
1999 #endif
2000  _status = _logBuff.serializeFrom(Id);
2001  FW_ASSERT(
2002  _status == Fw::FW_SERIALIZE_OK,
2003  static_cast<FwAssertArgType>(_status)
2004  );
2005 
2006  this->m_eventOut_OutputPort[0].invoke(
2007  _id,
2008  _logTime,
2010  _logBuff
2011  );
2012  }
2013 
2014  // Emit the event on the text log port
2015 #if FW_ENABLE_TEXT_LOGGING
2016  if (this->m_textEventOut_OutputPort[0].isConnected()) {
2017 #if FW_OBJECT_NAMES == 1
2018  const char* _formatString =
2019  "(%s) %s: Telemetry ID 0x%" PRIx32 " not packetized";
2020 #else
2021  const char* _formatString =
2022  "%s: Telemetry ID 0x%" PRIx32 " not packetized";
2023 #endif
2024 
2025  Fw::TextLogString _logString;
2026  _logString.format(
2027  _formatString,
2028 #if FW_OBJECT_NAMES == 1
2029  this->m_objName.toChar(),
2030 #endif
2031  "NoChan ",
2032  Id
2033  );
2034 
2035  this->m_textEventOut_OutputPort[0].invoke(
2036  _id,
2037  _logTime,
2039  _logString
2040  );
2041  }
2042 #endif
2043  }
2044 
2047  {
2048  // Get the time
2049  Fw::Time _logTime;
2050  if (this->m_timeGetOut_OutputPort[0].isConnected()) {
2051  this->m_timeGetOut_OutputPort[0].invoke(_logTime);
2052  }
2053 
2054  FwEventIdType _id = static_cast<FwEventIdType>(0);
2055 
2056  _id = this->getIdBase() + EVENTID_LEVELSET;
2057 
2058  // Emit the event on the log port
2059  if (this->m_eventOut_OutputPort[0].isConnected()) {
2060  Fw::LogBuffer _logBuff;
2062 
2063 #if FW_AMPCS_COMPATIBLE
2064  // Serialize the number of arguments
2065  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2066  FW_ASSERT(
2067  _status == Fw::FW_SERIALIZE_OK,
2068  static_cast<FwAssertArgType>(_status)
2069  );
2070 #endif
2071 
2072 #if FW_AMPCS_COMPATIBLE
2073  // Serialize the argument size
2074  _status = _logBuff.serializeFrom(
2075  static_cast<U8>(sizeof(FwChanIdType))
2076  );
2077  FW_ASSERT(
2078  _status == Fw::FW_SERIALIZE_OK,
2079  static_cast<FwAssertArgType>(_status)
2080  );
2081 #endif
2082  _status = _logBuff.serializeFrom(id);
2083  FW_ASSERT(
2084  _status == Fw::FW_SERIALIZE_OK,
2085  static_cast<FwAssertArgType>(_status)
2086  );
2087 
2088  this->m_eventOut_OutputPort[0].invoke(
2089  _id,
2090  _logTime,
2092  _logBuff
2093  );
2094  }
2095 
2096  // Emit the event on the text log port
2097 #if FW_ENABLE_TEXT_LOGGING
2098  if (this->m_textEventOut_OutputPort[0].isConnected()) {
2099 #if FW_OBJECT_NAMES == 1
2100  const char* _formatString =
2101  "(%s) %s: Telemetry send level to %" PRIu32 "";
2102 #else
2103  const char* _formatString =
2104  "%s: Telemetry send level to %" PRIu32 "";
2105 #endif
2106 
2107  Fw::TextLogString _logString;
2108  _logString.format(
2109  _formatString,
2110 #if FW_OBJECT_NAMES == 1
2111  this->m_objName.toChar(),
2112 #endif
2113  "LevelSet ",
2114  id
2115  );
2116 
2117  this->m_textEventOut_OutputPort[0].invoke(
2118  _id,
2119  _logTime,
2121  _logString
2122  );
2123  }
2124 #endif
2125  }
2126 
2129  FwChanIdType level,
2130  FwChanIdType max
2131  ) const
2132  {
2133  // Get the time
2134  Fw::Time _logTime;
2135  if (this->m_timeGetOut_OutputPort[0].isConnected()) {
2136  this->m_timeGetOut_OutputPort[0].invoke(_logTime);
2137  }
2138 
2139  FwEventIdType _id = static_cast<FwEventIdType>(0);
2140 
2141  _id = this->getIdBase() + EVENTID_MAXLEVELEXCEED;
2142 
2143  // Emit the event on the log port
2144  if (this->m_eventOut_OutputPort[0].isConnected()) {
2145  Fw::LogBuffer _logBuff;
2147 
2148 #if FW_AMPCS_COMPATIBLE
2149  // Serialize the number of arguments
2150  _status = _logBuff.serializeFrom(static_cast<U8>(2));
2151  FW_ASSERT(
2152  _status == Fw::FW_SERIALIZE_OK,
2153  static_cast<FwAssertArgType>(_status)
2154  );
2155 #endif
2156 
2157 #if FW_AMPCS_COMPATIBLE
2158  // Serialize the argument size
2159  _status = _logBuff.serializeFrom(
2160  static_cast<U8>(sizeof(FwChanIdType))
2161  );
2162  FW_ASSERT(
2163  _status == Fw::FW_SERIALIZE_OK,
2164  static_cast<FwAssertArgType>(_status)
2165  );
2166 #endif
2167  _status = _logBuff.serializeFrom(level);
2168  FW_ASSERT(
2169  _status == Fw::FW_SERIALIZE_OK,
2170  static_cast<FwAssertArgType>(_status)
2171  );
2172 
2173 #if FW_AMPCS_COMPATIBLE
2174  // Serialize the argument size
2175  _status = _logBuff.serializeFrom(
2176  static_cast<U8>(sizeof(FwChanIdType))
2177  );
2178  FW_ASSERT(
2179  _status == Fw::FW_SERIALIZE_OK,
2180  static_cast<FwAssertArgType>(_status)
2181  );
2182 #endif
2183  _status = _logBuff.serializeFrom(max);
2184  FW_ASSERT(
2185  _status == Fw::FW_SERIALIZE_OK,
2186  static_cast<FwAssertArgType>(_status)
2187  );
2188 
2189  this->m_eventOut_OutputPort[0].invoke(
2190  _id,
2191  _logTime,
2193  _logBuff
2194  );
2195  }
2196 
2197  // Emit the event on the text log port
2198 #if FW_ENABLE_TEXT_LOGGING
2199  if (this->m_textEventOut_OutputPort[0].isConnected()) {
2200 #if FW_OBJECT_NAMES == 1
2201  const char* _formatString =
2202  "(%s) %s: Requested send level %" PRIu32 " higher than max packet level of %" PRIu32 "";
2203 #else
2204  const char* _formatString =
2205  "%s: Requested send level %" PRIu32 " higher than max packet level of %" PRIu32 "";
2206 #endif
2207 
2208  Fw::TextLogString _logString;
2209  _logString.format(
2210  _formatString,
2211 #if FW_OBJECT_NAMES == 1
2212  this->m_objName.toChar(),
2213 #endif
2214  "MaxLevelExceed ",
2215  level,
2216  max
2217  );
2218 
2219  this->m_textEventOut_OutputPort[0].invoke(
2220  _id,
2221  _logTime,
2223  _logString
2224  );
2225  }
2226 #endif
2227  }
2228 
2231  {
2232  // Get the time
2233  Fw::Time _logTime;
2234  if (this->m_timeGetOut_OutputPort[0].isConnected()) {
2235  this->m_timeGetOut_OutputPort[0].invoke(_logTime);
2236  }
2237 
2238  FwEventIdType _id = static_cast<FwEventIdType>(0);
2239 
2240  _id = this->getIdBase() + EVENTID_PACKETSENT;
2241 
2242  // Emit the event on the log port
2243  if (this->m_eventOut_OutputPort[0].isConnected()) {
2244  Fw::LogBuffer _logBuff;
2246 
2247 #if FW_AMPCS_COMPATIBLE
2248  // Serialize the number of arguments
2249  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2250  FW_ASSERT(
2251  _status == Fw::FW_SERIALIZE_OK,
2252  static_cast<FwAssertArgType>(_status)
2253  );
2254 #endif
2255 
2256 #if FW_AMPCS_COMPATIBLE
2257  // Serialize the argument size
2258  _status = _logBuff.serializeFrom(
2259  static_cast<U8>(sizeof(U32))
2260  );
2261  FW_ASSERT(
2262  _status == Fw::FW_SERIALIZE_OK,
2263  static_cast<FwAssertArgType>(_status)
2264  );
2265 #endif
2266  _status = _logBuff.serializeFrom(id);
2267  FW_ASSERT(
2268  _status == Fw::FW_SERIALIZE_OK,
2269  static_cast<FwAssertArgType>(_status)
2270  );
2271 
2272  this->m_eventOut_OutputPort[0].invoke(
2273  _id,
2274  _logTime,
2276  _logBuff
2277  );
2278  }
2279 
2280  // Emit the event on the text log port
2281 #if FW_ENABLE_TEXT_LOGGING
2282  if (this->m_textEventOut_OutputPort[0].isConnected()) {
2283 #if FW_OBJECT_NAMES == 1
2284  const char* _formatString =
2285  "(%s) %s: Sent packet ID %" PRIu32 "";
2286 #else
2287  const char* _formatString =
2288  "%s: Sent packet ID %" PRIu32 "";
2289 #endif
2290 
2291  Fw::TextLogString _logString;
2292  _logString.format(
2293  _formatString,
2294 #if FW_OBJECT_NAMES == 1
2295  this->m_objName.toChar(),
2296 #endif
2297  "PacketSent ",
2298  id
2299  );
2300 
2301  this->m_textEventOut_OutputPort[0].invoke(
2302  _id,
2303  _logTime,
2305  _logString
2306  );
2307  }
2308 #endif
2309  }
2310 
2313  {
2314  // Get the time
2315  Fw::Time _logTime;
2316  if (this->m_timeGetOut_OutputPort[0].isConnected()) {
2317  this->m_timeGetOut_OutputPort[0].invoke(_logTime);
2318  }
2319 
2320  FwEventIdType _id = static_cast<FwEventIdType>(0);
2321 
2322  _id = this->getIdBase() + EVENTID_PACKETNOTFOUND;
2323 
2324  // Emit the event on the log port
2325  if (this->m_eventOut_OutputPort[0].isConnected()) {
2326  Fw::LogBuffer _logBuff;
2328 
2329 #if FW_AMPCS_COMPATIBLE
2330  // Serialize the number of arguments
2331  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2332  FW_ASSERT(
2333  _status == Fw::FW_SERIALIZE_OK,
2334  static_cast<FwAssertArgType>(_status)
2335  );
2336 #endif
2337 
2338 #if FW_AMPCS_COMPATIBLE
2339  // Serialize the argument size
2340  _status = _logBuff.serializeFrom(
2341  static_cast<U8>(sizeof(U32))
2342  );
2343  FW_ASSERT(
2344  _status == Fw::FW_SERIALIZE_OK,
2345  static_cast<FwAssertArgType>(_status)
2346  );
2347 #endif
2348  _status = _logBuff.serializeFrom(id);
2349  FW_ASSERT(
2350  _status == Fw::FW_SERIALIZE_OK,
2351  static_cast<FwAssertArgType>(_status)
2352  );
2353 
2354  this->m_eventOut_OutputPort[0].invoke(
2355  _id,
2356  _logTime,
2358  _logBuff
2359  );
2360  }
2361 
2362  // Emit the event on the text log port
2363 #if FW_ENABLE_TEXT_LOGGING
2364  if (this->m_textEventOut_OutputPort[0].isConnected()) {
2365 #if FW_OBJECT_NAMES == 1
2366  const char* _formatString =
2367  "(%s) %s: Could not find packet ID %" PRIu32 "";
2368 #else
2369  const char* _formatString =
2370  "%s: Could not find packet ID %" PRIu32 "";
2371 #endif
2372 
2373  Fw::TextLogString _logString;
2374  _logString.format(
2375  _formatString,
2376 #if FW_OBJECT_NAMES == 1
2377  this->m_objName.toChar(),
2378 #endif
2379  "PacketNotFound ",
2380  id
2381  );
2382 
2383  this->m_textEventOut_OutputPort[0].invoke(
2384  _id,
2385  _logTime,
2387  _logString
2388  );
2389  }
2390 #endif
2391  }
2392 
2395  Svc::TelemetrySection section,
2396  Fw::Enabled enable
2397  ) const
2398  {
2399  // Get the time
2400  Fw::Time _logTime;
2401  if (this->m_timeGetOut_OutputPort[0].isConnected()) {
2402  this->m_timeGetOut_OutputPort[0].invoke(_logTime);
2403  }
2404 
2405  FwEventIdType _id = static_cast<FwEventIdType>(0);
2406 
2407  _id = this->getIdBase() + EVENTID_SECTIONUNCONFIGURABLE;
2408 
2409  // Emit the event on the log port
2410  if (this->m_eventOut_OutputPort[0].isConnected()) {
2411  Fw::LogBuffer _logBuff;
2413 
2414 #if FW_AMPCS_COMPATIBLE
2415  // Serialize the number of arguments
2416  _status = _logBuff.serializeFrom(static_cast<U8>(2));
2417  FW_ASSERT(
2418  _status == Fw::FW_SERIALIZE_OK,
2419  static_cast<FwAssertArgType>(_status)
2420  );
2421 #endif
2422 
2423 #if FW_AMPCS_COMPATIBLE
2424  // Serialize the argument size
2425  _status = _logBuff.serializeFrom(
2427  );
2428  FW_ASSERT(
2429  _status == Fw::FW_SERIALIZE_OK,
2430  static_cast<FwAssertArgType>(_status)
2431  );
2432 #endif
2433  _status = _logBuff.serializeFrom(section);
2434  FW_ASSERT(
2435  _status == Fw::FW_SERIALIZE_OK,
2436  static_cast<FwAssertArgType>(_status)
2437  );
2438 
2439 #if FW_AMPCS_COMPATIBLE
2440  // Serialize the argument size
2441  _status = _logBuff.serializeFrom(
2442  static_cast<U8>(Fw::Enabled::SERIALIZED_SIZE)
2443  );
2444  FW_ASSERT(
2445  _status == Fw::FW_SERIALIZE_OK,
2446  static_cast<FwAssertArgType>(_status)
2447  );
2448 #endif
2449  _status = _logBuff.serializeFrom(enable);
2450  FW_ASSERT(
2451  _status == Fw::FW_SERIALIZE_OK,
2452  static_cast<FwAssertArgType>(_status)
2453  );
2454 
2455  this->m_eventOut_OutputPort[0].invoke(
2456  _id,
2457  _logTime,
2459  _logBuff
2460  );
2461  }
2462 
2463  // Emit the event on the text log port
2464 #if FW_ENABLE_TEXT_LOGGING
2465  if (this->m_textEventOut_OutputPort[0].isConnected()) {
2466 #if FW_OBJECT_NAMES == 1
2467  const char* _formatString =
2468  "(%s) %s: Section %s is unconfigurable and cannot be set to %s";
2469 #else
2470  const char* _formatString =
2471  "%s: Section %s is unconfigurable and cannot be set to %s";
2472 #endif
2473 
2474  Fw::String sectionStr;
2475  section.toString(sectionStr);
2476  Fw::String enableStr;
2477  enable.toString(enableStr);
2478 
2479  Fw::TextLogString _logString;
2480  _logString.format(
2481  _formatString,
2482 #if FW_OBJECT_NAMES == 1
2483  this->m_objName.toChar(),
2484 #endif
2485  "SectionUnconfigurable ",
2486  sectionStr.toChar(),
2487  enableStr.toChar()
2488  );
2489 
2490  this->m_textEventOut_OutputPort[0].invoke(
2491  _id,
2492  _logTime,
2494  _logString
2495  );
2496  }
2497 #endif
2498  }
2499 
2500  // ----------------------------------------------------------------------
2501  // Telemetry write functions
2502  // ----------------------------------------------------------------------
2503 
2507  Fw::Time _tlmTime
2508  ) const
2509  {
2510  if (this->m_tlmOut_OutputPort[0].isConnected()) {
2511  if (
2512  this->m_timeGetOut_OutputPort[0].isConnected() &&
2513  (_tlmTime == Fw::ZERO_TIME)
2514  ) {
2515  this->m_timeGetOut_OutputPort[0].invoke(_tlmTime);
2516  }
2517 
2518  Fw::TlmBuffer _tlmBuff;
2519  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
2520  FW_ASSERT(
2521  _stat == Fw::FW_SERIALIZE_OK,
2522  static_cast<FwAssertArgType>(_stat)
2523  );
2524 
2525  FwChanIdType _id;
2526 
2527  _id = this->getIdBase() + CHANNELID_GROUPCONFIGS;
2528 
2529  this->m_tlmOut_OutputPort[0].invoke(
2530  _id,
2531  _tlmTime,
2532  _tlmBuff
2533  );
2534  }
2535  }
2536 
2540  Fw::Time _tlmTime
2541  ) const
2542  {
2543  if (this->m_tlmOut_OutputPort[0].isConnected()) {
2544  if (
2545  this->m_timeGetOut_OutputPort[0].isConnected() &&
2546  (_tlmTime == Fw::ZERO_TIME)
2547  ) {
2548  this->m_timeGetOut_OutputPort[0].invoke(_tlmTime);
2549  }
2550 
2551  Fw::TlmBuffer _tlmBuff;
2552  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
2553  FW_ASSERT(
2554  _stat == Fw::FW_SERIALIZE_OK,
2555  static_cast<FwAssertArgType>(_stat)
2556  );
2557 
2558  FwChanIdType _id;
2559 
2560  _id = this->getIdBase() + CHANNELID_SECTIONENABLED;
2561 
2562  this->m_tlmOut_OutputPort[0].invoke(
2563  _id,
2564  _tlmTime,
2565  _tlmBuff
2566  );
2567  }
2568  }
2569 
2570  // ----------------------------------------------------------------------
2571  // Parameter update hook
2572  // ----------------------------------------------------------------------
2573 
2576  {
2577  // Do nothing by default
2578  }
2579 
2582  {
2583  // Do nothing by default
2584  }
2585 
2586  // ----------------------------------------------------------------------
2587  // Parameter get functions
2588  // ----------------------------------------------------------------------
2589 
2592  {
2594  Fw::ParamBuffer _getBuff;
2595  // Get the base ID
2596  const FwPrmIdType _baseId = static_cast<FwPrmIdType>(this->getIdBase());
2597  // Get the local ID to pass to the delegate
2598  const FwPrmIdType _localId = PARAMID_SECTION_ENABLED;
2599 
2600  FW_ASSERT(this->paramDelegatePtr != nullptr);
2601  // Get the external parameter from the delegate
2602  Fw::SerializeStatus _stat = this->paramDelegatePtr->serializeParam(_baseId, _localId, _getBuff);
2603  if(_stat == Fw::FW_SERIALIZE_OK) {
2604  _stat = _getBuff.deserializeTo(_local);
2605  FW_ASSERT(_stat == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(_stat));
2606  valid = Fw::ParamValid::VALID;
2607  } else {
2608  valid = Fw::ParamValid::INVALID;
2609  }
2610  return _local;
2611  }
2612 
2615  {
2617  Fw::ParamBuffer _getBuff;
2618  // Get the base ID
2619  const FwPrmIdType _baseId = static_cast<FwPrmIdType>(this->getIdBase());
2620  // Get the local ID to pass to the delegate
2621  const FwPrmIdType _localId = PARAMID_SECTION_CONFIGS;
2622 
2623  FW_ASSERT(this->paramDelegatePtr != nullptr);
2624  // Get the external parameter from the delegate
2625  Fw::SerializeStatus _stat = this->paramDelegatePtr->serializeParam(_baseId, _localId, _getBuff);
2626  if(_stat == Fw::FW_SERIALIZE_OK) {
2627  _stat = _getBuff.deserializeTo(_local);
2628  FW_ASSERT(_stat == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(_stat));
2629  valid = Fw::ParamValid::VALID;
2630  } else {
2631  valid = Fw::ParamValid::INVALID;
2632  }
2633  return _local;
2634  }
2635 
2636  // ----------------------------------------------------------------------
2637  // External parameter delegate initialization
2638  // ----------------------------------------------------------------------
2639 
2642  {
2643  FW_ASSERT(paramExternalDelegatePtr != nullptr);
2644  this->paramDelegatePtr = paramExternalDelegatePtr;
2645  }
2646 
2647  // ----------------------------------------------------------------------
2648  // Time
2649  // ----------------------------------------------------------------------
2650 
2652  getTime() const
2653  {
2654  if (this->m_timeGetOut_OutputPort[0].isConnected()) {
2655  Fw::Time _time;
2656  this->m_timeGetOut_OutputPort[0].invoke(_time);
2657  return _time;
2658  }
2659  else {
2660  return Fw::Time(TimeBase::TB_NONE, 0, 0);
2661  }
2662  }
2663 
2664  // ----------------------------------------------------------------------
2665  // Message dispatch functions
2666  // ----------------------------------------------------------------------
2667 
2668  Fw::QueuedComponentBase::MsgDispatchStatus TlmPacketizerComponentBase ::
2669  doDispatch()
2670  {
2671  ComponentIpcSerializableBuffer _msg;
2672  FwQueuePriorityType _priority = 0;
2673 
2674  Os::Queue::Status _msgStatus = this->m_queue.receive(
2675  _msg,
2677  _priority
2678  );
2679  FW_ASSERT(
2680  _msgStatus == Os::Queue::OP_OK,
2681  static_cast<FwAssertArgType>(_msgStatus)
2682  );
2683 
2684  // Reset to beginning of buffer
2685  _msg.resetDeser();
2686 
2687  FwEnumStoreType _desMsg = 0;
2688  Fw::SerializeStatus _deserStatus = _msg.deserializeTo(_desMsg);
2689  FW_ASSERT(
2690  _deserStatus == Fw::FW_SERIALIZE_OK,
2691  static_cast<FwAssertArgType>(_deserStatus)
2692  );
2693 
2694  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
2695 
2696  if (_msgType == TLMPACKETIZER_COMPONENT_EXIT) {
2697  return MSG_DISPATCH_EXIT;
2698  }
2699 
2700  FwIndexType portNum = 0;
2701  _deserStatus = _msg.deserializeTo(portNum);
2702  FW_ASSERT(
2703  _deserStatus == Fw::FW_SERIALIZE_OK,
2704  static_cast<FwAssertArgType>(_deserStatus)
2705  );
2706 
2707  switch (_msgType) {
2708  // Handle async input port Run
2709  case RUN_SCHED: {
2710  // Deserialize argument context
2711  U32 context;
2712  _deserStatus = _msg.deserializeTo(context);
2713  FW_ASSERT(
2714  _deserStatus == Fw::FW_SERIALIZE_OK,
2715  static_cast<FwAssertArgType>(_deserStatus)
2716  );
2717  // Call handler function
2718  this->Run_handler(
2719  portNum,
2720  context
2721  );
2722 
2723  break;
2724  }
2725 
2726  // Handle async input port configureSectionGroupRate
2727  case CONFIGURESECTIONGROUPRATE_CONFIGUREGROUPRATE: {
2728  // Deserialize argument section
2729  Svc::TelemetrySection section;
2730  _deserStatus = _msg.deserializeTo(section);
2731  FW_ASSERT(
2732  _deserStatus == Fw::FW_SERIALIZE_OK,
2733  static_cast<FwAssertArgType>(_deserStatus)
2734  );
2735 
2736  // Deserialize argument tlmGroup
2737  FwChanIdType tlmGroup;
2738  _deserStatus = _msg.deserializeTo(tlmGroup);
2739  FW_ASSERT(
2740  _deserStatus == Fw::FW_SERIALIZE_OK,
2741  static_cast<FwAssertArgType>(_deserStatus)
2742  );
2743 
2744  // Deserialize argument rateLogic
2745  Svc::RateLogic rateLogic;
2746  _deserStatus = _msg.deserializeTo(rateLogic);
2747  FW_ASSERT(
2748  _deserStatus == Fw::FW_SERIALIZE_OK,
2749  static_cast<FwAssertArgType>(_deserStatus)
2750  );
2751 
2752  // Deserialize argument minDelta
2753  U32 minDelta;
2754  _deserStatus = _msg.deserializeTo(minDelta);
2755  FW_ASSERT(
2756  _deserStatus == Fw::FW_SERIALIZE_OK,
2757  static_cast<FwAssertArgType>(_deserStatus)
2758  );
2759 
2760  // Deserialize argument maxDelta
2761  U32 maxDelta;
2762  _deserStatus = _msg.deserializeTo(maxDelta);
2763  FW_ASSERT(
2764  _deserStatus == Fw::FW_SERIALIZE_OK,
2765  static_cast<FwAssertArgType>(_deserStatus)
2766  );
2767  // Call handler function
2769  portNum,
2770  section,
2771  tlmGroup,
2772  rateLogic,
2773  minDelta,
2774  maxDelta
2775  );
2776 
2777  break;
2778  }
2779 
2780  // Handle async input port controlIn
2781  case CONTROLIN_ENABLESECTION: {
2782  // Deserialize argument section
2783  Svc::TelemetrySection section;
2784  _deserStatus = _msg.deserializeTo(section);
2785  FW_ASSERT(
2786  _deserStatus == Fw::FW_SERIALIZE_OK,
2787  static_cast<FwAssertArgType>(_deserStatus)
2788  );
2789 
2790  // Deserialize argument enabled
2791  Fw::Enabled enabled;
2792  _deserStatus = _msg.deserializeTo(enabled);
2793  FW_ASSERT(
2794  _deserStatus == Fw::FW_SERIALIZE_OK,
2795  static_cast<FwAssertArgType>(_deserStatus)
2796  );
2797  // Call handler function
2798  this->controlIn_handler(
2799  portNum,
2800  section,
2801  enabled
2802  );
2803 
2804  break;
2805  }
2806 
2807  // Handle async input port pingIn
2808  case PINGIN_PING: {
2809  // Deserialize argument key
2810  U32 key;
2811  _deserStatus = _msg.deserializeTo(key);
2812  FW_ASSERT(
2813  _deserStatus == Fw::FW_SERIALIZE_OK,
2814  static_cast<FwAssertArgType>(_deserStatus)
2815  );
2816  // Call handler function
2817  this->pingIn_handler(
2818  portNum,
2819  key
2820  );
2821 
2822  break;
2823  }
2824 
2825  // Handle command SET_LEVEL
2826  case CMD_SET_LEVEL: {
2827  // Deserialize opcode
2828  FwOpcodeType _opCode = 0;
2829  _deserStatus = _msg.deserializeTo(_opCode);
2830  FW_ASSERT (
2831  _deserStatus == Fw::FW_SERIALIZE_OK,
2832  static_cast<FwAssertArgType>(_deserStatus)
2833  );
2834 
2835  // Deserialize command sequence
2836  U32 _cmdSeq = 0;
2837  _deserStatus = _msg.deserializeTo(_cmdSeq);
2838  FW_ASSERT (
2839  _deserStatus == Fw::FW_SERIALIZE_OK,
2840  static_cast<FwAssertArgType>(_deserStatus)
2841  );
2842 
2843  // Deserialize command argument buffer
2844  Fw::CmdArgBuffer args;
2845  _deserStatus = _msg.deserializeTo(args);
2846  FW_ASSERT (
2847  _deserStatus == Fw::FW_SERIALIZE_OK,
2848  static_cast<FwAssertArgType>(_deserStatus)
2849  );
2850 
2851  // Reset buffer
2852  args.resetDeser();
2853 
2854  // Deserialize argument level
2855  FwChanIdType level;
2856  _deserStatus = args.deserializeTo(level);
2857  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2858  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2859  this->cmdResponse_out(
2860  _opCode,
2861  _cmdSeq,
2863  );
2864  }
2865  // Don't crash the task if bad arguments were passed from the ground
2866  break;
2867  }
2868 
2869  // Make sure there was no data left over.
2870  // That means the argument buffer size was incorrect.
2871 #if FW_CMD_CHECK_RESIDUAL
2872  if (args.getDeserializeSizeLeft() != 0) {
2873  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2874  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2875  }
2876  // Don't crash the task if bad arguments were passed from the ground
2877  break;
2878  }
2879 #endif
2880 
2881  // Call handler function
2882  this->SET_LEVEL_cmdHandler(
2883  _opCode, _cmdSeq,
2884  level
2885  );
2886 
2887  break;
2888  }
2889 
2890  // Handle command SEND_PKT
2891  case CMD_SEND_PKT: {
2892  // Deserialize opcode
2893  FwOpcodeType _opCode = 0;
2894  _deserStatus = _msg.deserializeTo(_opCode);
2895  FW_ASSERT (
2896  _deserStatus == Fw::FW_SERIALIZE_OK,
2897  static_cast<FwAssertArgType>(_deserStatus)
2898  );
2899 
2900  // Deserialize command sequence
2901  U32 _cmdSeq = 0;
2902  _deserStatus = _msg.deserializeTo(_cmdSeq);
2903  FW_ASSERT (
2904  _deserStatus == Fw::FW_SERIALIZE_OK,
2905  static_cast<FwAssertArgType>(_deserStatus)
2906  );
2907 
2908  // Deserialize command argument buffer
2909  Fw::CmdArgBuffer args;
2910  _deserStatus = _msg.deserializeTo(args);
2911  FW_ASSERT (
2912  _deserStatus == Fw::FW_SERIALIZE_OK,
2913  static_cast<FwAssertArgType>(_deserStatus)
2914  );
2915 
2916  // Reset buffer
2917  args.resetDeser();
2918 
2919  // Deserialize argument id
2920  U32 id;
2921  _deserStatus = args.deserializeTo(id);
2922  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2923  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2924  this->cmdResponse_out(
2925  _opCode,
2926  _cmdSeq,
2928  );
2929  }
2930  // Don't crash the task if bad arguments were passed from the ground
2931  break;
2932  }
2933 
2934  // Deserialize argument section
2935  Svc::TelemetrySection section;
2936  _deserStatus = args.deserializeTo(section);
2937  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2938  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2939  this->cmdResponse_out(
2940  _opCode,
2941  _cmdSeq,
2943  );
2944  }
2945  // Don't crash the task if bad arguments were passed from the ground
2946  break;
2947  }
2948 
2949  // Make sure there was no data left over.
2950  // That means the argument buffer size was incorrect.
2951 #if FW_CMD_CHECK_RESIDUAL
2952  if (args.getDeserializeSizeLeft() != 0) {
2953  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2954  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2955  }
2956  // Don't crash the task if bad arguments were passed from the ground
2957  break;
2958  }
2959 #endif
2960 
2961  // Call handler function
2962  this->SEND_PKT_cmdHandler(
2963  _opCode, _cmdSeq,
2964  id,
2965  section
2966  );
2967 
2968  break;
2969  }
2970 
2971  // Handle command ENABLE_SECTION
2972  case CMD_ENABLE_SECTION: {
2973  // Deserialize opcode
2974  FwOpcodeType _opCode = 0;
2975  _deserStatus = _msg.deserializeTo(_opCode);
2976  FW_ASSERT (
2977  _deserStatus == Fw::FW_SERIALIZE_OK,
2978  static_cast<FwAssertArgType>(_deserStatus)
2979  );
2980 
2981  // Deserialize command sequence
2982  U32 _cmdSeq = 0;
2983  _deserStatus = _msg.deserializeTo(_cmdSeq);
2984  FW_ASSERT (
2985  _deserStatus == Fw::FW_SERIALIZE_OK,
2986  static_cast<FwAssertArgType>(_deserStatus)
2987  );
2988 
2989  // Deserialize command argument buffer
2990  Fw::CmdArgBuffer args;
2991  _deserStatus = _msg.deserializeTo(args);
2992  FW_ASSERT (
2993  _deserStatus == Fw::FW_SERIALIZE_OK,
2994  static_cast<FwAssertArgType>(_deserStatus)
2995  );
2996 
2997  // Reset buffer
2998  args.resetDeser();
2999 
3000  // Deserialize argument section
3001  Svc::TelemetrySection section;
3002  _deserStatus = args.deserializeTo(section);
3003  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3004  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3005  this->cmdResponse_out(
3006  _opCode,
3007  _cmdSeq,
3009  );
3010  }
3011  // Don't crash the task if bad arguments were passed from the ground
3012  break;
3013  }
3014 
3015  // Deserialize argument enable
3016  Fw::Enabled enable;
3017  _deserStatus = args.deserializeTo(enable);
3018  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3019  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3020  this->cmdResponse_out(
3021  _opCode,
3022  _cmdSeq,
3024  );
3025  }
3026  // Don't crash the task if bad arguments were passed from the ground
3027  break;
3028  }
3029 
3030  // Make sure there was no data left over.
3031  // That means the argument buffer size was incorrect.
3032 #if FW_CMD_CHECK_RESIDUAL
3033  if (args.getDeserializeSizeLeft() != 0) {
3034  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3035  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3036  }
3037  // Don't crash the task if bad arguments were passed from the ground
3038  break;
3039  }
3040 #endif
3041 
3042  // Call handler function
3044  _opCode, _cmdSeq,
3045  section,
3046  enable
3047  );
3048 
3049  break;
3050  }
3051 
3052  // Handle command ENABLE_GROUP
3053  case CMD_ENABLE_GROUP: {
3054  // Deserialize opcode
3055  FwOpcodeType _opCode = 0;
3056  _deserStatus = _msg.deserializeTo(_opCode);
3057  FW_ASSERT (
3058  _deserStatus == Fw::FW_SERIALIZE_OK,
3059  static_cast<FwAssertArgType>(_deserStatus)
3060  );
3061 
3062  // Deserialize command sequence
3063  U32 _cmdSeq = 0;
3064  _deserStatus = _msg.deserializeTo(_cmdSeq);
3065  FW_ASSERT (
3066  _deserStatus == Fw::FW_SERIALIZE_OK,
3067  static_cast<FwAssertArgType>(_deserStatus)
3068  );
3069 
3070  // Deserialize command argument buffer
3071  Fw::CmdArgBuffer args;
3072  _deserStatus = _msg.deserializeTo(args);
3073  FW_ASSERT (
3074  _deserStatus == Fw::FW_SERIALIZE_OK,
3075  static_cast<FwAssertArgType>(_deserStatus)
3076  );
3077 
3078  // Reset buffer
3079  args.resetDeser();
3080 
3081  // Deserialize argument section
3082  Svc::TelemetrySection section;
3083  _deserStatus = args.deserializeTo(section);
3084  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3085  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3086  this->cmdResponse_out(
3087  _opCode,
3088  _cmdSeq,
3090  );
3091  }
3092  // Don't crash the task if bad arguments were passed from the ground
3093  break;
3094  }
3095 
3096  // Deserialize argument tlmGroup
3097  FwChanIdType tlmGroup;
3098  _deserStatus = args.deserializeTo(tlmGroup);
3099  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3100  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3101  this->cmdResponse_out(
3102  _opCode,
3103  _cmdSeq,
3105  );
3106  }
3107  // Don't crash the task if bad arguments were passed from the ground
3108  break;
3109  }
3110 
3111  // Deserialize argument enable
3112  Fw::Enabled enable;
3113  _deserStatus = args.deserializeTo(enable);
3114  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3115  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3116  this->cmdResponse_out(
3117  _opCode,
3118  _cmdSeq,
3120  );
3121  }
3122  // Don't crash the task if bad arguments were passed from the ground
3123  break;
3124  }
3125 
3126  // Make sure there was no data left over.
3127  // That means the argument buffer size was incorrect.
3128 #if FW_CMD_CHECK_RESIDUAL
3129  if (args.getDeserializeSizeLeft() != 0) {
3130  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3131  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3132  }
3133  // Don't crash the task if bad arguments were passed from the ground
3134  break;
3135  }
3136 #endif
3137 
3138  // Call handler function
3140  _opCode, _cmdSeq,
3141  section,
3142  tlmGroup,
3143  enable
3144  );
3145 
3146  break;
3147  }
3148 
3149  // Handle command FORCE_GROUP
3150  case CMD_FORCE_GROUP: {
3151  // Deserialize opcode
3152  FwOpcodeType _opCode = 0;
3153  _deserStatus = _msg.deserializeTo(_opCode);
3154  FW_ASSERT (
3155  _deserStatus == Fw::FW_SERIALIZE_OK,
3156  static_cast<FwAssertArgType>(_deserStatus)
3157  );
3158 
3159  // Deserialize command sequence
3160  U32 _cmdSeq = 0;
3161  _deserStatus = _msg.deserializeTo(_cmdSeq);
3162  FW_ASSERT (
3163  _deserStatus == Fw::FW_SERIALIZE_OK,
3164  static_cast<FwAssertArgType>(_deserStatus)
3165  );
3166 
3167  // Deserialize command argument buffer
3168  Fw::CmdArgBuffer args;
3169  _deserStatus = _msg.deserializeTo(args);
3170  FW_ASSERT (
3171  _deserStatus == Fw::FW_SERIALIZE_OK,
3172  static_cast<FwAssertArgType>(_deserStatus)
3173  );
3174 
3175  // Reset buffer
3176  args.resetDeser();
3177 
3178  // Deserialize argument section
3179  Svc::TelemetrySection section;
3180  _deserStatus = args.deserializeTo(section);
3181  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3182  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3183  this->cmdResponse_out(
3184  _opCode,
3185  _cmdSeq,
3187  );
3188  }
3189  // Don't crash the task if bad arguments were passed from the ground
3190  break;
3191  }
3192 
3193  // Deserialize argument tlmGroup
3194  FwChanIdType tlmGroup;
3195  _deserStatus = args.deserializeTo(tlmGroup);
3196  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3197  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3198  this->cmdResponse_out(
3199  _opCode,
3200  _cmdSeq,
3202  );
3203  }
3204  // Don't crash the task if bad arguments were passed from the ground
3205  break;
3206  }
3207 
3208  // Deserialize argument enable
3209  Fw::Enabled enable;
3210  _deserStatus = args.deserializeTo(enable);
3211  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3212  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3213  this->cmdResponse_out(
3214  _opCode,
3215  _cmdSeq,
3217  );
3218  }
3219  // Don't crash the task if bad arguments were passed from the ground
3220  break;
3221  }
3222 
3223  // Make sure there was no data left over.
3224  // That means the argument buffer size was incorrect.
3225 #if FW_CMD_CHECK_RESIDUAL
3226  if (args.getDeserializeSizeLeft() != 0) {
3227  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3228  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3229  }
3230  // Don't crash the task if bad arguments were passed from the ground
3231  break;
3232  }
3233 #endif
3234 
3235  // Call handler function
3236  this->FORCE_GROUP_cmdHandler(
3237  _opCode, _cmdSeq,
3238  section,
3239  tlmGroup,
3240  enable
3241  );
3242 
3243  break;
3244  }
3245 
3246  // Handle command CONFIGURE_GROUP_RATES
3247  case CMD_CONFIGURE_GROUP_RATES: {
3248  // Deserialize opcode
3249  FwOpcodeType _opCode = 0;
3250  _deserStatus = _msg.deserializeTo(_opCode);
3251  FW_ASSERT (
3252  _deserStatus == Fw::FW_SERIALIZE_OK,
3253  static_cast<FwAssertArgType>(_deserStatus)
3254  );
3255 
3256  // Deserialize command sequence
3257  U32 _cmdSeq = 0;
3258  _deserStatus = _msg.deserializeTo(_cmdSeq);
3259  FW_ASSERT (
3260  _deserStatus == Fw::FW_SERIALIZE_OK,
3261  static_cast<FwAssertArgType>(_deserStatus)
3262  );
3263 
3264  // Deserialize command argument buffer
3265  Fw::CmdArgBuffer args;
3266  _deserStatus = _msg.deserializeTo(args);
3267  FW_ASSERT (
3268  _deserStatus == Fw::FW_SERIALIZE_OK,
3269  static_cast<FwAssertArgType>(_deserStatus)
3270  );
3271 
3272  // Reset buffer
3273  args.resetDeser();
3274 
3275  // Deserialize argument section
3276  Svc::TelemetrySection section;
3277  _deserStatus = args.deserializeTo(section);
3278  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3279  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3280  this->cmdResponse_out(
3281  _opCode,
3282  _cmdSeq,
3284  );
3285  }
3286  // Don't crash the task if bad arguments were passed from the ground
3287  break;
3288  }
3289 
3290  // Deserialize argument tlmGroup
3291  FwChanIdType tlmGroup;
3292  _deserStatus = args.deserializeTo(tlmGroup);
3293  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3294  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3295  this->cmdResponse_out(
3296  _opCode,
3297  _cmdSeq,
3299  );
3300  }
3301  // Don't crash the task if bad arguments were passed from the ground
3302  break;
3303  }
3304 
3305  // Deserialize argument rateLogic
3306  Svc::RateLogic rateLogic;
3307  _deserStatus = args.deserializeTo(rateLogic);
3308  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3309  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3310  this->cmdResponse_out(
3311  _opCode,
3312  _cmdSeq,
3314  );
3315  }
3316  // Don't crash the task if bad arguments were passed from the ground
3317  break;
3318  }
3319 
3320  // Deserialize argument minDelta
3321  U32 minDelta;
3322  _deserStatus = args.deserializeTo(minDelta);
3323  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3324  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3325  this->cmdResponse_out(
3326  _opCode,
3327  _cmdSeq,
3329  );
3330  }
3331  // Don't crash the task if bad arguments were passed from the ground
3332  break;
3333  }
3334 
3335  // Deserialize argument maxDelta
3336  U32 maxDelta;
3337  _deserStatus = args.deserializeTo(maxDelta);
3338  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
3339  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3340  this->cmdResponse_out(
3341  _opCode,
3342  _cmdSeq,
3344  );
3345  }
3346  // Don't crash the task if bad arguments were passed from the ground
3347  break;
3348  }
3349 
3350  // Make sure there was no data left over.
3351  // That means the argument buffer size was incorrect.
3352 #if FW_CMD_CHECK_RESIDUAL
3353  if (args.getDeserializeSizeLeft() != 0) {
3354  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
3355  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
3356  }
3357  // Don't crash the task if bad arguments were passed from the ground
3358  break;
3359  }
3360 #endif
3361 
3362  // Call handler function
3364  _opCode, _cmdSeq,
3365  section,
3366  tlmGroup,
3367  rateLogic,
3368  minDelta,
3369  maxDelta
3370  );
3371 
3372  break;
3373  }
3374 
3375  default:
3376  return MSG_DISPATCH_ERROR;
3377  }
3378 
3379  return MSG_DISPATCH_OK;
3380  }
3381 
3382  // ----------------------------------------------------------------------
3383  // Calls for messages received on special input ports
3384  // ----------------------------------------------------------------------
3385 
3386  void TlmPacketizerComponentBase ::
3387  m_p_cmdIn_in(
3388  Fw::PassiveComponentBase* callComp,
3389  FwIndexType portNum,
3390  FwOpcodeType opCode,
3391  U32 cmdSeq,
3392  Fw::CmdArgBuffer& args
3393  )
3394  {
3395  FW_ASSERT(callComp);
3396  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
3397 
3398  const U32 idBase = callComp->getIdBase();
3399  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
3400 
3401  // Select base class function based on opcode
3402  switch (opCode - idBase) {
3403  case OPCODE_SET_LEVEL: {
3404  compPtr->SET_LEVEL_cmdHandlerBase(
3405  opCode,
3406  cmdSeq,
3407  args
3408  );
3409  break;
3410  }
3411 
3412  case OPCODE_SEND_PKT: {
3413  compPtr->SEND_PKT_cmdHandlerBase(
3414  opCode,
3415  cmdSeq,
3416  args
3417  );
3418  break;
3419  }
3420 
3421  case OPCODE_ENABLE_SECTION: {
3422  compPtr->ENABLE_SECTION_cmdHandlerBase(
3423  opCode,
3424  cmdSeq,
3425  args
3426  );
3427  break;
3428  }
3429 
3430  case OPCODE_ENABLE_GROUP: {
3431  compPtr->ENABLE_GROUP_cmdHandlerBase(
3432  opCode,
3433  cmdSeq,
3434  args
3435  );
3436  break;
3437  }
3438 
3439  case OPCODE_FORCE_GROUP: {
3440  compPtr->FORCE_GROUP_cmdHandlerBase(
3441  opCode,
3442  cmdSeq,
3443  args
3444  );
3445  break;
3446  }
3447 
3449  compPtr->CONFIGURE_GROUP_RATES_cmdHandlerBase(
3450  opCode,
3451  cmdSeq,
3452  args
3453  );
3454  break;
3455  }
3456 
3458  Fw::CmdResponse _cstat = compPtr->paramSet_SECTION_ENABLED(args);
3459  compPtr->cmdResponse_out(
3460  opCode,
3461  cmdSeq,
3462  _cstat
3463  );
3464  break;
3465  }
3466 
3468  Fw::CmdResponse _cstat = compPtr->paramSave_SECTION_ENABLED();
3469  compPtr->cmdResponse_out(
3470  opCode,
3471  cmdSeq,
3472  _cstat
3473  );
3474  break;
3475  }
3476 
3478  Fw::CmdResponse _cstat = compPtr->paramSet_SECTION_CONFIGS(args);
3479  compPtr->cmdResponse_out(
3480  opCode,
3481  cmdSeq,
3482  _cstat
3483  );
3484  break;
3485  }
3486 
3488  Fw::CmdResponse _cstat = compPtr->paramSave_SECTION_CONFIGS();
3489  compPtr->cmdResponse_out(
3490  opCode,
3491  cmdSeq,
3492  _cstat
3493  );
3494  break;
3495  }
3496  }
3497  }
3498 
3499  // ----------------------------------------------------------------------
3500  // Calls for messages received on typed input ports
3501  // ----------------------------------------------------------------------
3502 
3503  void TlmPacketizerComponentBase ::
3504  m_p_Run_in(
3505  Fw::PassiveComponentBase* callComp,
3506  FwIndexType portNum,
3507  U32 context
3508  )
3509  {
3510  FW_ASSERT(callComp);
3511  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
3512  compPtr->Run_handlerBase(
3513  portNum,
3514  context
3515  );
3516  }
3517 
3518  Fw::TlmValid TlmPacketizerComponentBase ::
3519  m_p_TlmGet_in(
3520  Fw::PassiveComponentBase* callComp,
3521  FwIndexType portNum,
3522  FwChanIdType id,
3523  Fw::Time& timeTag,
3524  Fw::TlmBuffer& val
3525  )
3526  {
3527  FW_ASSERT(callComp);
3528  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
3529  return compPtr->TlmGet_handlerBase(
3530  portNum,
3531  id,
3532  timeTag,
3533  val
3534  );
3535  }
3536 
3537  void TlmPacketizerComponentBase ::
3538  m_p_TlmRecv_in(
3539  Fw::PassiveComponentBase* callComp,
3540  FwIndexType portNum,
3541  FwChanIdType id,
3542  Fw::Time& timeTag,
3543  Fw::TlmBuffer& val
3544  )
3545  {
3546  FW_ASSERT(callComp);
3547  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
3548  compPtr->TlmRecv_handlerBase(
3549  portNum,
3550  id,
3551  timeTag,
3552  val
3553  );
3554  }
3555 
3556  void TlmPacketizerComponentBase ::
3557  m_p_configureSectionGroupRate_in(
3558  Fw::PassiveComponentBase* callComp,
3559  FwIndexType portNum,
3560  const Svc::TelemetrySection& section,
3561  FwChanIdType tlmGroup,
3562  const Svc::RateLogic& rateLogic,
3563  U32 minDelta,
3564  U32 maxDelta
3565  )
3566  {
3567  FW_ASSERT(callComp);
3568  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
3569  compPtr->configureSectionGroupRate_handlerBase(
3570  portNum,
3571  section,
3572  tlmGroup,
3573  rateLogic,
3574  minDelta,
3575  maxDelta
3576  );
3577  }
3578 
3579  void TlmPacketizerComponentBase ::
3580  m_p_controlIn_in(
3581  Fw::PassiveComponentBase* callComp,
3582  FwIndexType portNum,
3583  const Svc::TelemetrySection& section,
3584  const Fw::Enabled& enabled
3585  )
3586  {
3587  FW_ASSERT(callComp);
3588  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
3589  compPtr->controlIn_handlerBase(
3590  portNum,
3591  section,
3592  enabled
3593  );
3594  }
3595 
3596  void TlmPacketizerComponentBase ::
3597  m_p_pingIn_in(
3598  Fw::PassiveComponentBase* callComp,
3599  FwIndexType portNum,
3600  U32 key
3601  )
3602  {
3603  FW_ASSERT(callComp);
3604  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
3605  compPtr->pingIn_handlerBase(
3606  portNum,
3607  key
3608  );
3609  }
3610 
3611  // ----------------------------------------------------------------------
3612  // Parameter set functions
3613  // ----------------------------------------------------------------------
3614 
3615  Fw::CmdResponse TlmPacketizerComponentBase ::
3616  paramSet_SECTION_ENABLED(Fw::SerialBufferBase& val)
3617  {
3618  const FwPrmIdType _localId = PARAMID_SECTION_ENABLED;
3619  const FwPrmIdType _baseId = static_cast<FwPrmIdType>(this->getIdBase());
3620 
3621  FW_ASSERT(this->paramDelegatePtr != nullptr);
3622  // Call the delegate serialize function for m_SECTION_ENABLED
3623  const Fw::SerializeStatus _stat = this->paramDelegatePtr->deserializeParam(
3624  _baseId,
3625  _localId,
3627  val
3628  );
3629  if (_stat != Fw::FW_SERIALIZE_OK) {
3631  }
3632 
3633  // Call notifier
3635  return Fw::CmdResponse::OK;
3636  }
3637 
3638  Fw::CmdResponse TlmPacketizerComponentBase ::
3639  paramSet_SECTION_CONFIGS(Fw::SerialBufferBase& val)
3640  {
3641  const FwPrmIdType _localId = PARAMID_SECTION_CONFIGS;
3642  const FwPrmIdType _baseId = static_cast<FwPrmIdType>(this->getIdBase());
3643 
3644  FW_ASSERT(this->paramDelegatePtr != nullptr);
3645  // Call the delegate serialize function for m_SECTION_CONFIGS
3646  const Fw::SerializeStatus _stat = this->paramDelegatePtr->deserializeParam(
3647  _baseId,
3648  _localId,
3650  val
3651  );
3652  if (_stat != Fw::FW_SERIALIZE_OK) {
3654  }
3655 
3656  // Call notifier
3658  return Fw::CmdResponse::OK;
3659  }
3660 
3661  // ----------------------------------------------------------------------
3662  // Parameter save functions
3663  // ----------------------------------------------------------------------
3664 
3665  Fw::CmdResponse TlmPacketizerComponentBase ::
3666  paramSave_SECTION_ENABLED()
3667  {
3668  Fw::ParamBuffer _saveBuff;
3669  FwPrmIdType _id;
3670  Fw::SerializeStatus _stat;
3671  if (this->m_paramSetOut_OutputPort[0].isConnected()) {
3672  // Get the local and base ID to pass to the delegate
3674  const FwPrmIdType _baseId = static_cast<FwPrmIdType>(this->getIdBase());
3675 
3676  FW_ASSERT(this->paramDelegatePtr != nullptr);
3677  _stat = this->paramDelegatePtr->serializeParam(_baseId, _id, _saveBuff);
3678  if (_stat != Fw::FW_SERIALIZE_OK) {
3680  }
3681 
3682  _id = static_cast<FwPrmIdType>(this->getIdBase() + PARAMID_SECTION_ENABLED);
3683 
3684  // Save the parameter
3685  this->m_paramSetOut_OutputPort[0].invoke(
3686  _id,
3687  _saveBuff
3688  );
3689 
3690  return Fw::CmdResponse::OK;
3691  }
3692 
3694  }
3695 
3696  Fw::CmdResponse TlmPacketizerComponentBase ::
3697  paramSave_SECTION_CONFIGS()
3698  {
3699  Fw::ParamBuffer _saveBuff;
3700  FwPrmIdType _id;
3701  Fw::SerializeStatus _stat;
3702  if (this->m_paramSetOut_OutputPort[0].isConnected()) {
3703  // Get the local and base ID to pass to the delegate
3705  const FwPrmIdType _baseId = static_cast<FwPrmIdType>(this->getIdBase());
3706 
3707  FW_ASSERT(this->paramDelegatePtr != nullptr);
3708  _stat = this->paramDelegatePtr->serializeParam(_baseId, _id, _saveBuff);
3709  if (_stat != Fw::FW_SERIALIZE_OK) {
3711  }
3712 
3713  _id = static_cast<FwPrmIdType>(this->getIdBase() + PARAMID_SECTION_CONFIGS);
3714 
3715  // Save the parameter
3716  this->m_paramSetOut_OutputPort[0].invoke(
3717  _id,
3718  _saveBuff
3719  );
3720 
3721  return Fw::CmdResponse::OK;
3722  }
3723 
3725  }
3726 
3727  // ----------------------------------------------------------------------
3728  // Parameter delegates
3729  // ----------------------------------------------------------------------
3730 
3731 }
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:134
Svc::InputEnableSectionPort * get_controlIn_InputPort(FwIndexType portNum)
void invoke(Fw::ComBuffer &data, U32 context) const
Invoke a port interface.
Definition: ComPortAc.cpp:156
void init()
Initialization function.
Definition: ComPortAc.cpp:137
void set_PktSend_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to PktSend[portNum].
Set Min and Max Deltas between successive packets.
Force telemetering a group on a section, even if disabled.
FwIdType FwOpcodeType
The type of a command opcode.
Operation succeeded.
Definition: Os.hpp:26
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
PlatformSizeType FwSizeType
void tlmWrite_GroupConfigs(const Svc::TlmPacketizer_SectionConfigs &arg, Fw::Time _tlmTime=Fw::Time()) const
The size of the serial representations of the port arguments.
void FORCE_GROUP_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
Definition: Queue.cpp:71
Fw::InputCmdPort * get_cmdIn_InputPort(FwIndexType portNum)
I32 FwEnumStoreType
static constexpr FwIndexType getNum_cmdResponseOut_OutputPorts()
void init()
Initialization function.
Svc::InputConfigureGroupRatePort * get_configureSectionGroupRate_InputPort(FwIndexType portNum)
virtual void TlmRecv_handler(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)=0
Handler for input port TlmRecv.
void Run_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port Run.
Status
status returned from the queue send function
Definition: Queue.hpp:30
void init()
Initialization function.
Definition: SchedPortAc.cpp:56
static constexpr FwIndexType getNum_PktSend_OutputPorts()
const char * toChar() const
Convert to a C-style char*.
Definition: String.hpp:50
void init()
Initialization function.
Definition: CmdPortAc.cpp:56
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: TlmPortAc.cpp:62
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 interface.
Definition: PingPortAc.cpp:147
void TlmRecv_handlerBase(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Handler base-class function for input port TlmRecv.
void controlIn_handlerBase(FwIndexType portNum, const Svc::TelemetrySection &section, const Fw::Enabled &enabled)
Handler base-class function for input port controlIn.
const Time ZERO_TIME
Definition: Time.cpp:5
void PktSend_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Invoke output port PktSend.
virtual void controlIn_handler(FwIndexType portNum, const Svc::TelemetrySection &section, const Fw::Enabled &enabled)=0
Handler for input port controlIn.
bool isConnected_tlmOut_OutputPort(FwIndexType portNum)
virtual void SEND_PKT_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, U32 id, Svc::TelemetrySection section)=0
void init()
Initialization function.
Definition: TlmPortAc.cpp:144
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
The size of the serial representations of the port arguments.
Definition: CmdPortAc.hpp:38
Enum representing a command response.
void init()
Initialization function.
Definition: TlmPortAc.cpp:56
No time base has been established (Required)
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
virtual void SET_LEVEL_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, FwChanIdType level)=0
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:150
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.
The size of the serial representations of the port arguments.
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:62
Message will block until space is available.
Definition: Queue.hpp:47
virtual void configureSectionGroupRate_preMsgHook(FwIndexType portNum, const Svc::TelemetrySection &section, FwChanIdType tlmGroup, const Svc::RateLogic &rateLogic, U32 minDelta, U32 maxDelta)
Pre-message hook for async input port configureSectionGroupRate.
The size of the serial representations of the port arguments.
Definition: PingPortAc.hpp:36
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 interface.
Enable / disable telemetry of a group on a section.
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:31
The size of the serial representation.
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
Enable / disable telemetry of a group on a section.
void init()
Initialization function.
Definition: TimePortAc.cpp:128
static constexpr FwIndexType getNum_cmdRegOut_OutputPorts()
Fw::InputTlmGetPort * get_TlmGet_InputPort(FwIndexType portNum)
The size of the serial representations of the port arguments.
Definition: SchedPortAc.hpp:36
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.
bool isConnected_paramSetOut_OutputPort(FwIndexType portNum)
Enumeration for rate logic types for telemetry groups.
A less serious but recoverable event.
Fw::ParamValid invoke(FwPrmIdType id, Fw::ParamBuffer &val) const
Invoke a port interface.
void init()
Initialization function.
Definition: PingPortAc.cpp:128
static constexpr FwIndexType getNum_timeGetOut_OutputPorts()
void invoke(Fw::Time &time) const
Invoke a port interface.
Definition: TimePortAc.cpp:147
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 interface.
virtual void ENABLE_GROUP_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, Svc::TelemetrySection section, FwChanIdType tlmGroup, Fw::Enabled enable)=0
FwIdType FwChanIdType
The type of a telemetry channel identifier.
FwSizeType SizeType
void addCallPort(InputPingPort *callPort)
Register an input port.
Definition: PingPortAc.cpp:134
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
Definition: Queue.cpp:54
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 interface.
Definition: TlmPortAc.cpp:163
bool isConnected_cmdRegOut_OutputPort(FwIndexType portNum)
void set_eventOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to eventOut[portNum].
bool isConnected() const
Definition: PortBase.cpp:38
static constexpr FwIndexType getNum_tlmOut_OutputPorts()
virtual void ENABLE_SECTION_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, Svc::TelemetrySection section, Fw::Enabled enable)=0
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
#define PRI_FwIndexType
Enabled and disabled states.
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:39
Fw::TlmValid TlmGet_handlerBase(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Handler base-class function for input port TlmGet.
void init()
Initialization function.
Definition: LogPortAc.cpp:151
Command successfully executed.
virtual void Run_handler(FwIndexType portNum, U32 context)=0
Handler for input port Run.
void setPortNum(FwIndexType portNum)
void init()
Initialization function.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:53
BlockingType
message type
Definition: Queue.hpp:46
static constexpr FwIndexType getNum_eventOut_OutputPorts()
void ENABLE_GROUP_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Command failed to deserialize.
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
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:62
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port interface.
Definition: LogPortAc.cpp:170
void log_WARNING_LO_SectionUnconfigurable(Svc::TelemetrySection section, Fw::Enabled enable) const
Log event SectionUnconfigurable.
static constexpr FwIndexType getNum_paramSetOut_OutputPorts()
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void log_WARNING_LO_MaxLevelExceed(FwChanIdType level, FwChanIdType max) const
virtual void controlIn_preMsgHook(FwIndexType portNum, const Svc::TelemetrySection &section, const Fw::Enabled &enabled)
Pre-message hook for async input port controlIn.
A message was sent requesting an exit of the loop.
PlatformIndexType FwIndexType
TlmPacketizerComponentBase(const char *compName="")
Construct TlmPacketizerComponentBase object.
static constexpr FwIndexType getNum_configureSectionGroupRate_InputPorts()
virtual void parametersLoaded()
Called whenever parameters are loaded.
void log_ACTIVITY_HI_LevelSet(FwChanIdType id) const
void set_timeGetOut_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeGetOut[portNum].
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:157
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void ENABLE_SECTION_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void init()
Initialization function.
virtual void SEND_PKT_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command SEND_PKT.
void init()
Initialization function.
Definition: PingPortAc.cpp:56
void init()
Initialization function.
Command failed validation.
void configureSectionGroupRate_handlerBase(FwIndexType portNum, const Svc::TelemetrySection &section, FwChanIdType tlmGroup, const Svc::RateLogic &rateLogic, U32 minDelta, U32 maxDelta)
Handler base-class function for input port configureSectionGroupRate.
RateGroupDivider component implementation.
virtual void parameterUpdated(FwPrmIdType id)
Called whenever a parameter is updated.
message sent/received okay
Definition: Queue.hpp:31
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.
U8 BYTE
byte type
Definition: BasicTypes.h:56
bool isConnected_PktSend_OutputPort(FwIndexType portNum)
Svc::InputSchedPort * get_Run_InputPort(FwIndexType portNum)
bool isConnected_pingOut_OutputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_TlmGet_InputPorts()
void invoke(FwPrmIdType id, Fw::ParamBuffer &val) const
Invoke a port interface.
void addCallPort(InputComPort *callPort)
Register an input port.
Definition: ComPortAc.cpp:143
Fw::InputTlmPort * get_TlmRecv_InputPort(FwIndexType portNum)
Telemetry channel is not part of a telemetry packet.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: PingPortAc.cpp:62
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.
The size of the serial representation.
bool isConnected_timeGetOut_OutputPort(FwIndexType portNum)
void regCommands()
Register commands with the Command Dispatcher.
bool isConnected_eventOut_OutputPort(FwIndexType portNum)
Message will return with status when space is unavailable.
Definition: Queue.hpp:48
Implementation of malloc based allocator.
void init()
Initialization function.
bool isConnected_cmdResponseOut_OutputPort(FwIndexType portNum)
void init()
Initialization function.
bool isConnected_paramGetOut_OutputPort(FwIndexType portNum)
void CONFIGURE_GROUP_RATES_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void SET_LEVEL_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
message to exit active component task
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
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 pingOut_out(FwIndexType portNum, U32 key)
Invoke output port pingOut.
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
virtual Fw::TlmValid TlmGet_handler(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)=0
Handler for input port TlmGet.
static constexpr FwIndexType getNum_TlmRecv_InputPorts()
void set_cmdRegOut_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to cmdRegOut[portNum].
static constexpr FwIndexType getNum_cmdIn_InputPorts()