F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
TlmPacketizerComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title TlmPacketizerComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for TlmPacketizer component base class
5 // ======================================================================
6 
7 #include "Fw/Prm/ParamValid.hpp"
8 #include "Fw/Types/Assert.hpp"
10 #if FW_ENABLE_TEXT_LOGGING
11 #include "Fw/Types/String.hpp"
12 #endif
14 
15 namespace Svc {
16 
17  namespace {
18  enum MsgTypeEnum {
19  TLMPACKETIZER_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT,
20  RUN_SCHED,
21  CONFIGURESECTIONGROUPRATE_CONFIGUREGROUPRATE,
22  CONTROLIN_ENABLESECTION,
23  PACKETOVERRIDEIN_BUFFERSEND,
24  PINGIN_PING,
25  CMD_SET_LEVEL,
26  CMD_SEND_PKT,
27  CMD_ENABLE_SECTION,
28  CMD_CONFIGURE_GROUP_SEND,
29  CMD_CONFIGURE_GROUP_RATES,
30  CMD_GET_PACKET_CONFIG,
31  CMD_OVERRIDE_PACKET_SEND,
32  CMD_OVERRIDE_PACKET_RATES,
33  CMD_CLEAR_PACKET_OVERRIDE,
34  };
35 
36  // Get the max size by constructing a union of the async input, command, and
37  // internal port serialization sizes
38  union BuffUnion {
40  BYTE configureSectionGroupRatePortSize[Svc::ConfigureGroupRatePortBuffer::CAPACITY];
42  BYTE packetOverrideInPortSize[Fw::BufferSendPortBuffer::CAPACITY];
45  };
46 
47  // Define a message buffer class large enough to handle all the
48  // asynchronous inputs to the component
49  class ComponentIpcSerializableBuffer :
51  {
52 
53  public:
54 
55  enum {
56  // Offset into data in buffer: Size of message ID and port number
57  DATA_OFFSET = sizeof(FwEnumStoreType) + sizeof(FwIndexType),
58  // Max data size
59  MAX_DATA_SIZE = sizeof(BuffUnion),
60  // Max message size: Size of message id + size of port + max data size
61  SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
62  };
63 
64  ComponentIpcSerializableBuffer() : Fw::LinearBufferBase(m_buff, sizeof(m_buff)) {
65 
66  }
67 
68  private:
69  // Should be the max of all the input ports serialized sizes...
70  U8 m_buff[SERIALIZATION_SIZE];
71 
72  };
73  }
74 
75  // ----------------------------------------------------------------------
76  // Component initialization
77  // ----------------------------------------------------------------------
78 
81  FwSizeType queueDepth,
82  FwEnumStoreType instance
83  )
84  {
85  // Initialize base class
87 
88 #if !FW_DIRECT_PORT_CALLS
89  // Connect input port cmdIn
90  for (
91  FwIndexType port = 0;
92  port < static_cast<FwIndexType>(this->getNum_cmdIn_InputPorts());
93  port++
94  ) {
95  this->m_cmdIn_InputPort[port].init();
96  this->m_cmdIn_InputPort[port].addCallComp(
97  this,
98  m_p_cmdIn_in
99  );
100  this->m_cmdIn_InputPort[port].setPortNum(port);
101 
102 #if FW_OBJECT_NAMES == 1
103  Fw::ObjectName portName;
104  portName.format(
105  "%s_cmdIn_InputPort[%" PRI_FwIndexType "]",
106  this->m_objName.toChar(),
107  port
108  );
109  this->m_cmdIn_InputPort[port].setObjName(portName.toChar());
110 #endif
111  }
112 #endif
113 
114 #if !FW_DIRECT_PORT_CALLS
115  // Connect input port Run
116  for (
117  FwIndexType port = 0;
118  port < static_cast<FwIndexType>(this->getNum_Run_InputPorts());
119  port++
120  ) {
121  this->m_Run_InputPort[port].init();
122  this->m_Run_InputPort[port].addCallComp(
123  this,
124  m_p_Run_in
125  );
126  this->m_Run_InputPort[port].setPortNum(port);
127 
128 #if FW_OBJECT_NAMES == 1
129  Fw::ObjectName portName;
130  portName.format(
131  "%s_Run_InputPort[%" PRI_FwIndexType "]",
132  this->m_objName.toChar(),
133  port
134  );
135  this->m_Run_InputPort[port].setObjName(portName.toChar());
136 #endif
137  }
138 #endif
139 
140 #if !FW_DIRECT_PORT_CALLS
141  // Connect input port TlmGet
142  for (
143  FwIndexType port = 0;
144  port < static_cast<FwIndexType>(this->getNum_TlmGet_InputPorts());
145  port++
146  ) {
147  this->m_TlmGet_InputPort[port].init();
148  this->m_TlmGet_InputPort[port].addCallComp(
149  this,
150  m_p_TlmGet_in
151  );
152  this->m_TlmGet_InputPort[port].setPortNum(port);
153 
154 #if FW_OBJECT_NAMES == 1
155  Fw::ObjectName portName;
156  portName.format(
157  "%s_TlmGet_InputPort[%" PRI_FwIndexType "]",
158  this->m_objName.toChar(),
159  port
160  );
161  this->m_TlmGet_InputPort[port].setObjName(portName.toChar());
162 #endif
163  }
164 #endif
165 
166 #if !FW_DIRECT_PORT_CALLS
167  // Connect input port TlmRecv
168  for (
169  FwIndexType port = 0;
170  port < static_cast<FwIndexType>(this->getNum_TlmRecv_InputPorts());
171  port++
172  ) {
173  this->m_TlmRecv_InputPort[port].init();
174  this->m_TlmRecv_InputPort[port].addCallComp(
175  this,
176  m_p_TlmRecv_in
177  );
178  this->m_TlmRecv_InputPort[port].setPortNum(port);
179 
180 #if FW_OBJECT_NAMES == 1
181  Fw::ObjectName portName;
182  portName.format(
183  "%s_TlmRecv_InputPort[%" PRI_FwIndexType "]",
184  this->m_objName.toChar(),
185  port
186  );
187  this->m_TlmRecv_InputPort[port].setObjName(portName.toChar());
188 #endif
189  }
190 #endif
191 
192 #if !FW_DIRECT_PORT_CALLS
193  // Connect input port configureSectionGroupRate
194  for (
195  FwIndexType port = 0;
196  port < static_cast<FwIndexType>(this->getNum_configureSectionGroupRate_InputPorts());
197  port++
198  ) {
199  this->m_configureSectionGroupRate_InputPort[port].init();
200  this->m_configureSectionGroupRate_InputPort[port].addCallComp(
201  this,
202  m_p_configureSectionGroupRate_in
203  );
204  this->m_configureSectionGroupRate_InputPort[port].setPortNum(port);
205 
206 #if FW_OBJECT_NAMES == 1
207  Fw::ObjectName portName;
208  portName.format(
209  "%s_configureSectionGroupRate_InputPort[%" PRI_FwIndexType "]",
210  this->m_objName.toChar(),
211  port
212  );
213  this->m_configureSectionGroupRate_InputPort[port].setObjName(portName.toChar());
214 #endif
215  }
216 #endif
217 
218 #if !FW_DIRECT_PORT_CALLS
219  // Connect input port controlIn
220  for (
221  FwIndexType port = 0;
222  port < static_cast<FwIndexType>(this->getNum_controlIn_InputPorts());
223  port++
224  ) {
225  this->m_controlIn_InputPort[port].init();
226  this->m_controlIn_InputPort[port].addCallComp(
227  this,
228  m_p_controlIn_in
229  );
230  this->m_controlIn_InputPort[port].setPortNum(port);
231 
232 #if FW_OBJECT_NAMES == 1
233  Fw::ObjectName portName;
234  portName.format(
235  "%s_controlIn_InputPort[%" PRI_FwIndexType "]",
236  this->m_objName.toChar(),
237  port
238  );
239  this->m_controlIn_InputPort[port].setObjName(portName.toChar());
240 #endif
241  }
242 #endif
243 
244 #if !FW_DIRECT_PORT_CALLS
245  // Connect input port packetOverrideIn
246  for (
247  FwIndexType port = 0;
248  port < static_cast<FwIndexType>(this->getNum_packetOverrideIn_InputPorts());
249  port++
250  ) {
251  this->m_packetOverrideIn_InputPort[port].init();
252  this->m_packetOverrideIn_InputPort[port].addCallComp(
253  this,
254  m_p_packetOverrideIn_in
255  );
256  this->m_packetOverrideIn_InputPort[port].setPortNum(port);
257 
258 #if FW_OBJECT_NAMES == 1
259  Fw::ObjectName portName;
260  portName.format(
261  "%s_packetOverrideIn_InputPort[%" PRI_FwIndexType "]",
262  this->m_objName.toChar(),
263  port
264  );
265  this->m_packetOverrideIn_InputPort[port].setObjName(portName.toChar());
266 #endif
267  }
268 #endif
269 
270 #if !FW_DIRECT_PORT_CALLS
271  // Connect input port packetOverrideReturnIn
272  for (
273  FwIndexType port = 0;
274  port < static_cast<FwIndexType>(this->getNum_packetOverrideReturnIn_InputPorts());
275  port++
276  ) {
277  this->m_packetOverrideReturnIn_InputPort[port].init();
278  this->m_packetOverrideReturnIn_InputPort[port].addCallComp(
279  this,
280  m_p_packetOverrideReturnIn_in
281  );
282  this->m_packetOverrideReturnIn_InputPort[port].setPortNum(port);
283 
284 #if FW_OBJECT_NAMES == 1
285  Fw::ObjectName portName;
286  portName.format(
287  "%s_packetOverrideReturnIn_InputPort[%" PRI_FwIndexType "]",
288  this->m_objName.toChar(),
289  port
290  );
291  this->m_packetOverrideReturnIn_InputPort[port].setObjName(portName.toChar());
292 #endif
293  }
294 #endif
295 
296 #if !FW_DIRECT_PORT_CALLS
297  // Connect input port pingIn
298  for (
299  FwIndexType port = 0;
300  port < static_cast<FwIndexType>(this->getNum_pingIn_InputPorts());
301  port++
302  ) {
303  this->m_pingIn_InputPort[port].init();
304  this->m_pingIn_InputPort[port].addCallComp(
305  this,
306  m_p_pingIn_in
307  );
308  this->m_pingIn_InputPort[port].setPortNum(port);
309 
310 #if FW_OBJECT_NAMES == 1
311  Fw::ObjectName portName;
312  portName.format(
313  "%s_pingIn_InputPort[%" PRI_FwIndexType "]",
314  this->m_objName.toChar(),
315  port
316  );
317  this->m_pingIn_InputPort[port].setObjName(portName.toChar());
318 #endif
319  }
320 #endif
321 
322 #if !FW_DIRECT_PORT_CALLS
323  // Connect output port cmdRegOut
324  for (
325  FwIndexType port = 0;
326  port < static_cast<FwIndexType>(this->getNum_cmdRegOut_OutputPorts());
327  port++
328  ) {
329  this->m_cmdRegOut_OutputPort[port].init();
330 
331 #if FW_OBJECT_NAMES == 1
332  Fw::ObjectName portName;
333  portName.format(
334  "%s_cmdRegOut_OutputPort[%" PRI_FwIndexType "]",
335  this->m_objName.toChar(),
336  port
337  );
338  this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar());
339 #endif
340  }
341 #endif
342 
343 #if !FW_DIRECT_PORT_CALLS
344  // Connect output port cmdResponseOut
345  for (
346  FwIndexType port = 0;
347  port < static_cast<FwIndexType>(this->getNum_cmdResponseOut_OutputPorts());
348  port++
349  ) {
350  this->m_cmdResponseOut_OutputPort[port].init();
351 
352 #if FW_OBJECT_NAMES == 1
353  Fw::ObjectName portName;
354  portName.format(
355  "%s_cmdResponseOut_OutputPort[%" PRI_FwIndexType "]",
356  this->m_objName.toChar(),
357  port
358  );
359  this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar());
360 #endif
361  }
362 #endif
363 
364 #if !FW_DIRECT_PORT_CALLS
365  // Connect output port eventOut
366  for (
367  FwIndexType port = 0;
368  port < static_cast<FwIndexType>(this->getNum_eventOut_OutputPorts());
369  port++
370  ) {
371  this->m_eventOut_OutputPort[port].init();
372 
373 #if FW_OBJECT_NAMES == 1
374  Fw::ObjectName portName;
375  portName.format(
376  "%s_eventOut_OutputPort[%" PRI_FwIndexType "]",
377  this->m_objName.toChar(),
378  port
379  );
380  this->m_eventOut_OutputPort[port].setObjName(portName.toChar());
381 #endif
382  }
383 #endif
384 
385 #if !FW_DIRECT_PORT_CALLS
386  // Connect output port paramGetOut
387  for (
388  FwIndexType port = 0;
389  port < static_cast<FwIndexType>(this->getNum_paramGetOut_OutputPorts());
390  port++
391  ) {
392  this->m_paramGetOut_OutputPort[port].init();
393 
394 #if FW_OBJECT_NAMES == 1
395  Fw::ObjectName portName;
396  portName.format(
397  "%s_paramGetOut_OutputPort[%" PRI_FwIndexType "]",
398  this->m_objName.toChar(),
399  port
400  );
401  this->m_paramGetOut_OutputPort[port].setObjName(portName.toChar());
402 #endif
403  }
404 #endif
405 
406 #if !FW_DIRECT_PORT_CALLS
407  // Connect output port paramSetOut
408  for (
409  FwIndexType port = 0;
410  port < static_cast<FwIndexType>(this->getNum_paramSetOut_OutputPorts());
411  port++
412  ) {
413  this->m_paramSetOut_OutputPort[port].init();
414 
415 #if FW_OBJECT_NAMES == 1
416  Fw::ObjectName portName;
417  portName.format(
418  "%s_paramSetOut_OutputPort[%" PRI_FwIndexType "]",
419  this->m_objName.toChar(),
420  port
421  );
422  this->m_paramSetOut_OutputPort[port].setObjName(portName.toChar());
423 #endif
424  }
425 #endif
426 
427 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING
428  // Connect output port textEventOut
429  for (
430  FwIndexType port = 0;
431  port < static_cast<FwIndexType>(this->getNum_textEventOut_OutputPorts());
432  port++
433  ) {
434  this->m_textEventOut_OutputPort[port].init();
435 
436 #if FW_OBJECT_NAMES == 1
437  Fw::ObjectName portName;
438  portName.format(
439  "%s_textEventOut_OutputPort[%" PRI_FwIndexType "]",
440  this->m_objName.toChar(),
441  port
442  );
443  this->m_textEventOut_OutputPort[port].setObjName(portName.toChar());
444 #endif
445  }
446 #endif
447 
448 #if !FW_DIRECT_PORT_CALLS
449  // Connect output port timeGetOut
450  for (
451  FwIndexType port = 0;
452  port < static_cast<FwIndexType>(this->getNum_timeGetOut_OutputPorts());
453  port++
454  ) {
455  this->m_timeGetOut_OutputPort[port].init();
456 
457 #if FW_OBJECT_NAMES == 1
458  Fw::ObjectName portName;
459  portName.format(
460  "%s_timeGetOut_OutputPort[%" PRI_FwIndexType "]",
461  this->m_objName.toChar(),
462  port
463  );
464  this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar());
465 #endif
466  }
467 #endif
468 
469 #if !FW_DIRECT_PORT_CALLS
470  // Connect output port tlmOut
471  for (
472  FwIndexType port = 0;
473  port < static_cast<FwIndexType>(this->getNum_tlmOut_OutputPorts());
474  port++
475  ) {
476  this->m_tlmOut_OutputPort[port].init();
477 
478 #if FW_OBJECT_NAMES == 1
479  Fw::ObjectName portName;
480  portName.format(
481  "%s_tlmOut_OutputPort[%" PRI_FwIndexType "]",
482  this->m_objName.toChar(),
483  port
484  );
485  this->m_tlmOut_OutputPort[port].setObjName(portName.toChar());
486 #endif
487  }
488 #endif
489 
490 #if !FW_DIRECT_PORT_CALLS
491  // Connect output port PktSend
492  for (
493  FwIndexType port = 0;
494  port < static_cast<FwIndexType>(this->getNum_PktSend_OutputPorts());
495  port++
496  ) {
497  this->m_PktSend_OutputPort[port].init();
498 
499 #if FW_OBJECT_NAMES == 1
500  Fw::ObjectName portName;
501  portName.format(
502  "%s_PktSend_OutputPort[%" PRI_FwIndexType "]",
503  this->m_objName.toChar(),
504  port
505  );
506  this->m_PktSend_OutputPort[port].setObjName(portName.toChar());
507 #endif
508  }
509 #endif
510 
511 #if !FW_DIRECT_PORT_CALLS
512  // Connect output port allocate
513  for (
514  FwIndexType port = 0;
515  port < static_cast<FwIndexType>(this->getNum_allocate_OutputPorts());
516  port++
517  ) {
518  this->m_allocate_OutputPort[port].init();
519 
520 #if FW_OBJECT_NAMES == 1
521  Fw::ObjectName portName;
522  portName.format(
523  "%s_allocate_OutputPort[%" PRI_FwIndexType "]",
524  this->m_objName.toChar(),
525  port
526  );
527  this->m_allocate_OutputPort[port].setObjName(portName.toChar());
528 #endif
529  }
530 #endif
531 
532 #if !FW_DIRECT_PORT_CALLS
533  // Connect output port deallocate
534  for (
535  FwIndexType port = 0;
536  port < static_cast<FwIndexType>(this->getNum_deallocate_OutputPorts());
537  port++
538  ) {
539  this->m_deallocate_OutputPort[port].init();
540 
541 #if FW_OBJECT_NAMES == 1
542  Fw::ObjectName portName;
543  portName.format(
544  "%s_deallocate_OutputPort[%" PRI_FwIndexType "]",
545  this->m_objName.toChar(),
546  port
547  );
548  this->m_deallocate_OutputPort[port].setObjName(portName.toChar());
549 #endif
550  }
551 #endif
552 
553 #if !FW_DIRECT_PORT_CALLS
554  // Connect output port packetOverrideOut
555  for (
556  FwIndexType port = 0;
557  port < static_cast<FwIndexType>(this->getNum_packetOverrideOut_OutputPorts());
558  port++
559  ) {
560  this->m_packetOverrideOut_OutputPort[port].init();
561 
562 #if FW_OBJECT_NAMES == 1
563  Fw::ObjectName portName;
564  portName.format(
565  "%s_packetOverrideOut_OutputPort[%" PRI_FwIndexType "]",
566  this->m_objName.toChar(),
567  port
568  );
569  this->m_packetOverrideOut_OutputPort[port].setObjName(portName.toChar());
570 #endif
571  }
572 #endif
573 
574 #if !FW_DIRECT_PORT_CALLS
575  // Connect output port packetOverrideReturnOut
576  for (
577  FwIndexType port = 0;
578  port < static_cast<FwIndexType>(this->getNum_packetOverrideReturnOut_OutputPorts());
579  port++
580  ) {
581  this->m_packetOverrideReturnOut_OutputPort[port].init();
582 
583 #if FW_OBJECT_NAMES == 1
584  Fw::ObjectName portName;
585  portName.format(
586  "%s_packetOverrideReturnOut_OutputPort[%" PRI_FwIndexType "]",
587  this->m_objName.toChar(),
588  port
589  );
590  this->m_packetOverrideReturnOut_OutputPort[port].setObjName(portName.toChar());
591 #endif
592  }
593 #endif
594 
595 #if !FW_DIRECT_PORT_CALLS
596  // Connect output port pingOut
597  for (
598  FwIndexType port = 0;
599  port < static_cast<FwIndexType>(this->getNum_pingOut_OutputPorts());
600  port++
601  ) {
602  this->m_pingOut_OutputPort[port].init();
603 
604 #if FW_OBJECT_NAMES == 1
605  Fw::ObjectName portName;
606  portName.format(
607  "%s_pingOut_OutputPort[%" PRI_FwIndexType "]",
608  this->m_objName.toChar(),
609  port
610  );
611  this->m_pingOut_OutputPort[port].setObjName(portName.toChar());
612 #endif
613  }
614 #endif
615 
616  // Create the queue
617  Os::Queue::Status qStat = this->createQueue(
618  queueDepth,
619  static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
620  );
621  FW_ASSERT(
622  Os::Queue::Status::OP_OK == qStat,
623  static_cast<FwAssertArgType>(qStat)
624  );
625  }
626 
627 #if !FW_DIRECT_PORT_CALLS
628 
629  // ----------------------------------------------------------------------
630  // Getters for special input ports
631  // ----------------------------------------------------------------------
632 
635  {
636  FW_ASSERT(
637  (0 <= portNum) && (portNum < this->getNum_cmdIn_InputPorts()),
638  static_cast<FwAssertArgType>(portNum)
639  );
640 
641  return &this->m_cmdIn_InputPort[portNum];
642  }
643 
644 #endif
645 
646 #if !FW_DIRECT_PORT_CALLS
647 
648  // ----------------------------------------------------------------------
649  // Getters for typed input ports
650  // ----------------------------------------------------------------------
651 
654  {
655  FW_ASSERT(
656  (0 <= portNum) && (portNum < this->getNum_Run_InputPorts()),
657  static_cast<FwAssertArgType>(portNum)
658  );
659 
660  return &this->m_Run_InputPort[portNum];
661  }
662 
665  {
666  FW_ASSERT(
667  (0 <= portNum) && (portNum < this->getNum_TlmGet_InputPorts()),
668  static_cast<FwAssertArgType>(portNum)
669  );
670 
671  return &this->m_TlmGet_InputPort[portNum];
672  }
673 
676  {
677  FW_ASSERT(
678  (0 <= portNum) && (portNum < this->getNum_TlmRecv_InputPorts()),
679  static_cast<FwAssertArgType>(portNum)
680  );
681 
682  return &this->m_TlmRecv_InputPort[portNum];
683  }
684 
687  {
688  FW_ASSERT(
689  (0 <= portNum) && (portNum < this->getNum_configureSectionGroupRate_InputPorts()),
690  static_cast<FwAssertArgType>(portNum)
691  );
692 
693  return &this->m_configureSectionGroupRate_InputPort[portNum];
694  }
695 
698  {
699  FW_ASSERT(
700  (0 <= portNum) && (portNum < this->getNum_controlIn_InputPorts()),
701  static_cast<FwAssertArgType>(portNum)
702  );
703 
704  return &this->m_controlIn_InputPort[portNum];
705  }
706 
709  {
710  FW_ASSERT(
711  (0 <= portNum) && (portNum < this->getNum_packetOverrideIn_InputPorts()),
712  static_cast<FwAssertArgType>(portNum)
713  );
714 
715  return &this->m_packetOverrideIn_InputPort[portNum];
716  }
717 
720  {
721  FW_ASSERT(
722  (0 <= portNum) && (portNum < this->getNum_packetOverrideReturnIn_InputPorts()),
723  static_cast<FwAssertArgType>(portNum)
724  );
725 
726  return &this->m_packetOverrideReturnIn_InputPort[portNum];
727  }
728 
731  {
732  FW_ASSERT(
733  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
734  static_cast<FwAssertArgType>(portNum)
735  );
736 
737  return &this->m_pingIn_InputPort[portNum];
738  }
739 
740 #endif
741 
742 #if !FW_DIRECT_PORT_CALLS
743 
744  // ----------------------------------------------------------------------
745  // Connect input ports to special output ports
746  // ----------------------------------------------------------------------
747 
750  FwIndexType portNum,
751  Fw::InputCmdRegPort* port
752  )
753  {
754  FW_ASSERT(
755  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
756  static_cast<FwAssertArgType>(portNum)
757  );
758 
759  this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
760  }
761 
764  FwIndexType portNum,
766  )
767  {
768  FW_ASSERT(
769  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
770  static_cast<FwAssertArgType>(portNum)
771  );
772 
773  this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
774  }
775 
778  FwIndexType portNum,
779  Fw::InputLogPort* port
780  )
781  {
782  FW_ASSERT(
783  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
784  static_cast<FwAssertArgType>(portNum)
785  );
786 
787  this->m_eventOut_OutputPort[portNum].addCallPort(port);
788  }
789 
792  FwIndexType portNum,
793  Fw::InputPrmGetPort* port
794  )
795  {
796  FW_ASSERT(
797  (0 <= portNum) && (portNum < this->getNum_paramGetOut_OutputPorts()),
798  static_cast<FwAssertArgType>(portNum)
799  );
800 
801  this->m_paramGetOut_OutputPort[portNum].addCallPort(port);
802  }
803 
806  FwIndexType portNum,
807  Fw::InputPrmSetPort* port
808  )
809  {
810  FW_ASSERT(
811  (0 <= portNum) && (portNum < this->getNum_paramSetOut_OutputPorts()),
812  static_cast<FwAssertArgType>(portNum)
813  );
814 
815  this->m_paramSetOut_OutputPort[portNum].addCallPort(port);
816  }
817 
818 #if FW_ENABLE_TEXT_LOGGING == 1
819 
820  void TlmPacketizerComponentBase ::
821  set_textEventOut_OutputPort(
822  FwIndexType portNum,
824  )
825  {
826  FW_ASSERT(
827  (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
828  static_cast<FwAssertArgType>(portNum)
829  );
830 
831  this->m_textEventOut_OutputPort[portNum].addCallPort(port);
832  }
833 
834 #endif
835 
838  FwIndexType portNum,
839  Fw::InputTimePort* port
840  )
841  {
842  FW_ASSERT(
843  (0 <= portNum) && (portNum < this->getNum_timeGetOut_OutputPorts()),
844  static_cast<FwAssertArgType>(portNum)
845  );
846 
847  this->m_timeGetOut_OutputPort[portNum].addCallPort(port);
848  }
849 
852  FwIndexType portNum,
853  Fw::InputTlmPort* port
854  )
855  {
856  FW_ASSERT(
857  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
858  static_cast<FwAssertArgType>(portNum)
859  );
860 
861  this->m_tlmOut_OutputPort[portNum].addCallPort(port);
862  }
863 
864 #endif
865 
866 #if !FW_DIRECT_PORT_CALLS
867 
868  // ----------------------------------------------------------------------
869  // Connect typed input ports to typed output ports
870  // ----------------------------------------------------------------------
871 
874  FwIndexType portNum,
875  Fw::InputComPort* port
876  )
877  {
878  FW_ASSERT(
879  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
880  static_cast<FwAssertArgType>(portNum)
881  );
882 
883  this->m_PktSend_OutputPort[portNum].addCallPort(port);
884  }
885 
888  FwIndexType portNum,
890  )
891  {
892  FW_ASSERT(
893  (0 <= portNum) && (portNum < this->getNum_allocate_OutputPorts()),
894  static_cast<FwAssertArgType>(portNum)
895  );
896 
897  this->m_allocate_OutputPort[portNum].addCallPort(port);
898  }
899 
902  FwIndexType portNum,
904  )
905  {
906  FW_ASSERT(
907  (0 <= portNum) && (portNum < this->getNum_deallocate_OutputPorts()),
908  static_cast<FwAssertArgType>(portNum)
909  );
910 
911  this->m_deallocate_OutputPort[portNum].addCallPort(port);
912  }
913 
916  FwIndexType portNum,
918  )
919  {
920  FW_ASSERT(
921  (0 <= portNum) && (portNum < this->getNum_packetOverrideOut_OutputPorts()),
922  static_cast<FwAssertArgType>(portNum)
923  );
924 
925  this->m_packetOverrideOut_OutputPort[portNum].addCallPort(port);
926  }
927 
930  FwIndexType portNum,
932  )
933  {
934  FW_ASSERT(
935  (0 <= portNum) && (portNum < this->getNum_packetOverrideReturnOut_OutputPorts()),
936  static_cast<FwAssertArgType>(portNum)
937  );
938 
939  this->m_packetOverrideReturnOut_OutputPort[portNum].addCallPort(port);
940  }
941 
944  FwIndexType portNum,
945  Svc::InputPingPort* port
946  )
947  {
948  FW_ASSERT(
949  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
950  static_cast<FwAssertArgType>(portNum)
951  );
952 
953  this->m_pingOut_OutputPort[portNum].addCallPort(port);
954  }
955 
956 #endif
957 
958 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
959 
960  // ----------------------------------------------------------------------
961  // Connect serial input ports to special output ports
962  // ----------------------------------------------------------------------
963 
966  FwIndexType portNum,
967  Fw::InputSerializePort* port
968  )
969  {
970  FW_ASSERT(
971  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
972  static_cast<FwAssertArgType>(portNum)
973  );
974 
975  this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
976  }
977 
980  FwIndexType portNum,
981  Fw::InputSerializePort* port
982  )
983  {
984  FW_ASSERT(
985  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
986  static_cast<FwAssertArgType>(portNum)
987  );
988 
989  this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
990  }
991 
994  FwIndexType portNum,
995  Fw::InputSerializePort* port
996  )
997  {
998  FW_ASSERT(
999  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
1000  static_cast<FwAssertArgType>(portNum)
1001  );
1002 
1003  this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
1004  }
1005 
1008  FwIndexType portNum,
1009  Fw::InputSerializePort* port
1010  )
1011  {
1012  FW_ASSERT(
1013  (0 <= portNum) && (portNum < this->getNum_paramSetOut_OutputPorts()),
1014  static_cast<FwAssertArgType>(portNum)
1015  );
1016 
1017  this->m_paramSetOut_OutputPort[portNum].registerSerialPort(port);
1018  }
1019 
1020 #if FW_ENABLE_TEXT_LOGGING == 1
1021 
1022  void TlmPacketizerComponentBase ::
1023  set_textEventOut_OutputPort(
1024  FwIndexType portNum,
1025  Fw::InputSerializePort* port
1026  )
1027  {
1028  FW_ASSERT(
1029  (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
1030  static_cast<FwAssertArgType>(portNum)
1031  );
1032 
1033  this->m_textEventOut_OutputPort[portNum].registerSerialPort(port);
1034  }
1035 
1036 #endif
1037 
1040  FwIndexType portNum,
1041  Fw::InputSerializePort* port
1042  )
1043  {
1044  FW_ASSERT(
1045  (0 <= portNum) && (portNum < this->getNum_timeGetOut_OutputPorts()),
1046  static_cast<FwAssertArgType>(portNum)
1047  );
1048 
1049  this->m_timeGetOut_OutputPort[portNum].registerSerialPort(port);
1050  }
1051 
1054  FwIndexType portNum,
1055  Fw::InputSerializePort* port
1056  )
1057  {
1058  FW_ASSERT(
1059  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
1060  static_cast<FwAssertArgType>(portNum)
1061  );
1062 
1063  this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
1064  }
1065 
1066 #endif
1067 
1068 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
1069 
1070  // ----------------------------------------------------------------------
1071  // Connect serial input ports to typed output ports
1072  // ----------------------------------------------------------------------
1073 
1076  FwIndexType portNum,
1077  Fw::InputSerializePort* port
1078  )
1079  {
1080  FW_ASSERT(
1081  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
1082  static_cast<FwAssertArgType>(portNum)
1083  );
1084 
1085  this->m_PktSend_OutputPort[portNum].registerSerialPort(port);
1086  }
1087 
1090  FwIndexType portNum,
1091  Fw::InputSerializePort* port
1092  )
1093  {
1094  FW_ASSERT(
1095  (0 <= portNum) && (portNum < this->getNum_deallocate_OutputPorts()),
1096  static_cast<FwAssertArgType>(portNum)
1097  );
1098 
1099  this->m_deallocate_OutputPort[portNum].registerSerialPort(port);
1100  }
1101 
1104  FwIndexType portNum,
1105  Fw::InputSerializePort* port
1106  )
1107  {
1108  FW_ASSERT(
1109  (0 <= portNum) && (portNum < this->getNum_packetOverrideOut_OutputPorts()),
1110  static_cast<FwAssertArgType>(portNum)
1111  );
1112 
1113  this->m_packetOverrideOut_OutputPort[portNum].registerSerialPort(port);
1114  }
1115 
1118  FwIndexType portNum,
1119  Fw::InputSerializePort* port
1120  )
1121  {
1122  FW_ASSERT(
1123  (0 <= portNum) && (portNum < this->getNum_packetOverrideReturnOut_OutputPorts()),
1124  static_cast<FwAssertArgType>(portNum)
1125  );
1126 
1127  this->m_packetOverrideReturnOut_OutputPort[portNum].registerSerialPort(port);
1128  }
1129 
1132  FwIndexType portNum,
1133  Fw::InputSerializePort* port
1134  )
1135  {
1136  FW_ASSERT(
1137  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
1138  static_cast<FwAssertArgType>(portNum)
1139  );
1140 
1141  this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
1142  }
1143 
1144 #endif
1145 
1146  // ----------------------------------------------------------------------
1147  // Command registration
1148  // ----------------------------------------------------------------------
1149 
1152  {
1154 
1155  this->cmdRegOut_out(
1156  0,
1157  this->getIdBase() + OPCODE_SET_LEVEL
1158  );
1159 
1160  this->cmdRegOut_out(
1161  0,
1162  this->getIdBase() + OPCODE_SEND_PKT
1163  );
1164 
1165  this->cmdRegOut_out(
1166  0,
1168  );
1169 
1170  this->cmdRegOut_out(
1171  0,
1173  );
1174 
1175  this->cmdRegOut_out(
1176  0,
1178  );
1179 
1180  this->cmdRegOut_out(
1181  0,
1183  );
1184 
1185  this->cmdRegOut_out(
1186  0,
1188  );
1189 
1190  this->cmdRegOut_out(
1191  0,
1193  );
1194 
1195  this->cmdRegOut_out(
1196  0,
1198  );
1199 
1200  this->cmdRegOut_out(
1201  0,
1203  );
1204 
1205  this->cmdRegOut_out(
1206  0,
1208  );
1209 
1210  this->cmdRegOut_out(
1211  0,
1213  );
1214 
1215  this->cmdRegOut_out(
1216  0,
1218  );
1219  }
1220 
1221  // ----------------------------------------------------------------------
1222  // Parameter loading
1223  // ----------------------------------------------------------------------
1224 
1227  {
1229  const FwPrmIdType _baseId = static_cast<FwPrmIdType>(this->getIdBase());
1231 
1232  FwPrmIdType _id{};
1233  Fw::ParamBuffer _paramBuffer;
1234 
1235  _id = _baseId + PARAMID_SECTION_ENABLED;
1236 
1237  // Get serialized parameter SECTION_ENABLED
1238  this->m_param_SECTION_ENABLED_valid = this->paramGetOut_out(
1239  0,
1240  _id,
1241  _paramBuffer
1242  );
1243 
1244  this->m_paramLock.lock();
1245 
1246  // Deserialize parameter or use default value
1247  if (this->m_param_SECTION_ENABLED_valid == Fw::ParamValid::VALID) {
1248  FW_ASSERT(this->paramDelegatePtr != nullptr);
1249  _stat = this->paramDelegatePtr->deserializeParam(
1250  _baseId,
1252  this->m_param_SECTION_ENABLED_valid,
1253  _paramBuffer
1254  );
1255  if (_stat != Fw::FW_SERIALIZE_OK) {
1256  this->m_param_SECTION_ENABLED_valid = Fw::ParamValid::DEFAULT;
1257  }
1258  }
1259  else {
1260  this->m_param_SECTION_ENABLED_valid = Fw::ParamValid::DEFAULT;
1261  }
1262  if (this->m_param_SECTION_ENABLED_valid == Fw::ParamValid::DEFAULT) {
1264  _paramBuffer.resetSer();
1265  _stat = _paramBuffer.serializeFrom(_val);
1266  FW_ASSERT(_stat == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(_stat));
1267  FW_ASSERT(this->paramDelegatePtr != nullptr);
1268  _stat = this->paramDelegatePtr->deserializeParam(
1269  _baseId,
1271  this->m_param_SECTION_ENABLED_valid,
1272  _paramBuffer
1273  );
1274  if (_stat != Fw::FW_SERIALIZE_OK) {
1275  this->m_param_SECTION_ENABLED_valid = Fw::ParamValid::INVALID;
1276  }
1277  }
1278 
1279  this->m_paramLock.unlock();
1280  this->parameterLoaded(PARAMID_SECTION_ENABLED, this->m_param_SECTION_ENABLED_valid);
1281 
1282  _id = _baseId + PARAMID_SECTION_CONFIGS;
1283 
1284  // Get serialized parameter SECTION_CONFIGS
1285  this->m_param_SECTION_CONFIGS_valid = this->paramGetOut_out(
1286  0,
1287  _id,
1288  _paramBuffer
1289  );
1290 
1291  this->m_paramLock.lock();
1292 
1293  // Deserialize parameter or use default value
1294  if (this->m_param_SECTION_CONFIGS_valid == Fw::ParamValid::VALID) {
1295  FW_ASSERT(this->paramDelegatePtr != nullptr);
1296  _stat = this->paramDelegatePtr->deserializeParam(
1297  _baseId,
1299  this->m_param_SECTION_CONFIGS_valid,
1300  _paramBuffer
1301  );
1302  if (_stat != Fw::FW_SERIALIZE_OK) {
1303  this->m_param_SECTION_CONFIGS_valid = Fw::ParamValid::DEFAULT;
1304  }
1305  }
1306  else {
1307  this->m_param_SECTION_CONFIGS_valid = Fw::ParamValid::DEFAULT;
1308  }
1309  if (this->m_param_SECTION_CONFIGS_valid == Fw::ParamValid::DEFAULT) {
1311  _paramBuffer.resetSer();
1312  _stat = _paramBuffer.serializeFrom(_val);
1313  FW_ASSERT(_stat == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(_stat));
1314  FW_ASSERT(this->paramDelegatePtr != nullptr);
1315  _stat = this->paramDelegatePtr->deserializeParam(
1316  _baseId,
1318  this->m_param_SECTION_CONFIGS_valid,
1319  _paramBuffer
1320  );
1321  if (_stat != Fw::FW_SERIALIZE_OK) {
1322  this->m_param_SECTION_CONFIGS_valid = Fw::ParamValid::INVALID;
1323  }
1324  }
1325 
1326  this->m_paramLock.unlock();
1327  this->parameterLoaded(PARAMID_SECTION_CONFIGS, this->m_param_SECTION_CONFIGS_valid);
1328 
1329  // Call notifier
1330  this->parametersLoaded();
1331  }
1332 
1333  // ----------------------------------------------------------------------
1334  // Component construction and destruction
1335  // ----------------------------------------------------------------------
1336 
1338  TlmPacketizerComponentBase(const char* compName) :
1339  Fw::ActiveComponentBase(compName)
1340  {
1341  this->m_OversizedChannelThrottle = 0;
1342  this->m_ConfigMirrorAllocFailedThrottle = 0;
1343  }
1344 
1347  {
1348 
1349  }
1350 
1351 #if !FW_DIRECT_PORT_CALLS
1352 
1353  // ----------------------------------------------------------------------
1354  // Connection status queries for special output ports
1355  // ----------------------------------------------------------------------
1356 
1359  {
1360  FW_ASSERT(
1361  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
1362  static_cast<FwAssertArgType>(portNum)
1363  );
1364 
1365  return this->m_cmdRegOut_OutputPort[portNum].isConnected();
1366  }
1367 
1370  {
1371  FW_ASSERT(
1372  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
1373  static_cast<FwAssertArgType>(portNum)
1374  );
1375 
1376  return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
1377  }
1378 
1381  {
1382  FW_ASSERT(
1383  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
1384  static_cast<FwAssertArgType>(portNum)
1385  );
1386 
1387  return this->m_eventOut_OutputPort[portNum].isConnected();
1388  }
1389 
1392  {
1393  FW_ASSERT(
1394  (0 <= portNum) && (portNum < this->getNum_paramGetOut_OutputPorts()),
1395  static_cast<FwAssertArgType>(portNum)
1396  );
1397 
1398  return this->m_paramGetOut_OutputPort[portNum].isConnected();
1399  }
1400 
1403  {
1404  FW_ASSERT(
1405  (0 <= portNum) && (portNum < this->getNum_paramSetOut_OutputPorts()),
1406  static_cast<FwAssertArgType>(portNum)
1407  );
1408 
1409  return this->m_paramSetOut_OutputPort[portNum].isConnected();
1410  }
1411 
1412 #if FW_ENABLE_TEXT_LOGGING == 1
1413 
1414  bool TlmPacketizerComponentBase ::
1415  isConnected_textEventOut_OutputPort(FwIndexType portNum) const
1416  {
1417  FW_ASSERT(
1418  (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
1419  static_cast<FwAssertArgType>(portNum)
1420  );
1421 
1422  return this->m_textEventOut_OutputPort[portNum].isConnected();
1423  }
1424 
1425 #endif
1426 
1429  {
1430  FW_ASSERT(
1431  (0 <= portNum) && (portNum < this->getNum_timeGetOut_OutputPorts()),
1432  static_cast<FwAssertArgType>(portNum)
1433  );
1434 
1435  return this->m_timeGetOut_OutputPort[portNum].isConnected();
1436  }
1437 
1440  {
1441  FW_ASSERT(
1442  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
1443  static_cast<FwAssertArgType>(portNum)
1444  );
1445 
1446  return this->m_tlmOut_OutputPort[portNum].isConnected();
1447  }
1448 
1449 #endif
1450 
1451 #if !FW_DIRECT_PORT_CALLS
1452 
1453  // ----------------------------------------------------------------------
1454  // Connection status queries for typed output ports
1455  // ----------------------------------------------------------------------
1456 
1459  {
1460  FW_ASSERT(
1461  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
1462  static_cast<FwAssertArgType>(portNum)
1463  );
1464 
1465  return this->m_PktSend_OutputPort[portNum].isConnected();
1466  }
1467 
1470  {
1471  FW_ASSERT(
1472  (0 <= portNum) && (portNum < this->getNum_allocate_OutputPorts()),
1473  static_cast<FwAssertArgType>(portNum)
1474  );
1475 
1476  return this->m_allocate_OutputPort[portNum].isConnected();
1477  }
1478 
1481  {
1482  FW_ASSERT(
1483  (0 <= portNum) && (portNum < this->getNum_deallocate_OutputPorts()),
1484  static_cast<FwAssertArgType>(portNum)
1485  );
1486 
1487  return this->m_deallocate_OutputPort[portNum].isConnected();
1488  }
1489 
1492  {
1493  FW_ASSERT(
1494  (0 <= portNum) && (portNum < this->getNum_packetOverrideOut_OutputPorts()),
1495  static_cast<FwAssertArgType>(portNum)
1496  );
1497 
1498  return this->m_packetOverrideOut_OutputPort[portNum].isConnected();
1499  }
1500 
1503  {
1504  FW_ASSERT(
1505  (0 <= portNum) && (portNum < this->getNum_packetOverrideReturnOut_OutputPorts()),
1506  static_cast<FwAssertArgType>(portNum)
1507  );
1508 
1509  return this->m_packetOverrideReturnOut_OutputPort[portNum].isConnected();
1510  }
1511 
1514  {
1515  FW_ASSERT(
1516  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
1517  static_cast<FwAssertArgType>(portNum)
1518  );
1519 
1520  return this->m_pingOut_OutputPort[portNum].isConnected();
1521  }
1522 
1523 #endif
1524 
1525  // ----------------------------------------------------------------------
1526  // Port handler base-class functions for special input ports
1527  //
1528  // Call these functions directly to bypass the corresponding ports
1529  // ----------------------------------------------------------------------
1530 
1533  FwIndexType portNum,
1534  FwOpcodeType opCode,
1535  U32 cmdSeq,
1536  Fw::CmdArgBuffer& args
1537  )
1538  {
1539 
1540  const U32 idBase = this->getIdBase();
1541  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
1542 
1543  // Select base class function based on opcode
1544  switch (opCode - idBase) {
1545  case OPCODE_SET_LEVEL: {
1547  opCode,
1548  cmdSeq,
1549  args
1550  );
1551  break;
1552  }
1553 
1554  case OPCODE_SEND_PKT: {
1556  opCode,
1557  cmdSeq,
1558  args
1559  );
1560  break;
1561  }
1562 
1563  case OPCODE_ENABLE_SECTION: {
1565  opCode,
1566  cmdSeq,
1567  args
1568  );
1569  break;
1570  }
1571 
1574  opCode,
1575  cmdSeq,
1576  args
1577  );
1578  break;
1579  }
1580 
1583  opCode,
1584  cmdSeq,
1585  args
1586  );
1587  break;
1588  }
1589 
1590  case OPCODE_GET_PACKET_CONFIG: {
1592  opCode,
1593  cmdSeq,
1594  args
1595  );
1596  break;
1597  }
1598 
1601  opCode,
1602  cmdSeq,
1603  args
1604  );
1605  break;
1606  }
1607 
1610  opCode,
1611  cmdSeq,
1612  args
1613  );
1614  break;
1615  }
1616 
1619  opCode,
1620  cmdSeq,
1621  args
1622  );
1623  break;
1624  }
1625 
1627  Fw::CmdResponse _cstat = this->paramSet_SECTION_ENABLED(args);
1628  this->cmdResponse_out(
1629  opCode,
1630  cmdSeq,
1631  _cstat
1632  );
1633  break;
1634  }
1635 
1637  Fw::CmdResponse _cstat = this->paramSave_SECTION_ENABLED();
1638  this->cmdResponse_out(
1639  opCode,
1640  cmdSeq,
1641  _cstat
1642  );
1643  break;
1644  }
1645 
1647  Fw::CmdResponse _cstat = this->paramSet_SECTION_CONFIGS(args);
1648  this->cmdResponse_out(
1649  opCode,
1650  cmdSeq,
1651  _cstat
1652  );
1653  break;
1654  }
1655 
1657  Fw::CmdResponse _cstat = this->paramSave_SECTION_CONFIGS();
1658  this->cmdResponse_out(
1659  opCode,
1660  cmdSeq,
1661  _cstat
1662  );
1663  break;
1664  }
1665  default:
1666  // Unknown opcode: ignore it
1667  break;
1668  }
1669  }
1670 
1671  // ----------------------------------------------------------------------
1672  // Port handler base-class functions for typed input ports
1673  //
1674  // Call these functions directly to bypass the corresponding ports
1675  // ----------------------------------------------------------------------
1676 
1679  FwIndexType portNum,
1680  U32 context
1681  )
1682  {
1683  // Make sure port number is valid
1684  FW_ASSERT(
1685  (0 <= portNum) && (portNum < this->getNum_Run_InputPorts()),
1686  static_cast<FwAssertArgType>(portNum)
1687  );
1688 
1689  // Call pre-message hook
1691  portNum,
1692  context
1693  );
1694  ComponentIpcSerializableBuffer msg;
1696 
1697  // Serialize message ID
1698  _status = msg.serializeFrom(
1699  static_cast<FwEnumStoreType>(RUN_SCHED)
1700  );
1701  FW_ASSERT(
1702  _status == Fw::FW_SERIALIZE_OK,
1703  static_cast<FwAssertArgType>(_status)
1704  );
1705 
1706  // Serialize port number
1707  _status = msg.serializeFrom(portNum);
1708  FW_ASSERT(
1709  _status == Fw::FW_SERIALIZE_OK,
1710  static_cast<FwAssertArgType>(_status)
1711  );
1712 
1713  // Serialize argument context
1714  _status = msg.serializeFrom(context);
1715  FW_ASSERT(
1716  _status == Fw::FW_SERIALIZE_OK,
1717  static_cast<FwAssertArgType>(_status)
1718  );
1719 
1720  // Send message
1722  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1723 
1724  FW_ASSERT(
1725  qStatus == Os::Queue::OP_OK,
1726  static_cast<FwAssertArgType>(qStatus)
1727  );
1728  }
1729 
1732  FwIndexType portNum,
1733  FwChanIdType id,
1734  Fw::Time& timeTag,
1735  Fw::TlmBuffer& val
1736  )
1737  {
1738  // Make sure port number is valid
1739  FW_ASSERT(
1740  (0 <= portNum) && (portNum < this->getNum_TlmGet_InputPorts()),
1741  static_cast<FwAssertArgType>(portNum)
1742  );
1743 
1744  Fw::TlmValid retVal;
1745 
1746  // Call handler function
1747  retVal = this->TlmGet_handler(
1748  portNum,
1749  id,
1750  timeTag,
1751  val
1752  );
1753 
1754  return retVal;
1755  }
1756 
1759  FwIndexType portNum,
1760  FwChanIdType id,
1761  Fw::Time& timeTag,
1762  Fw::TlmBuffer& val
1763  )
1764  {
1765  // Make sure port number is valid
1766  FW_ASSERT(
1767  (0 <= portNum) && (portNum < this->getNum_TlmRecv_InputPorts()),
1768  static_cast<FwAssertArgType>(portNum)
1769  );
1770 
1771  // Call handler function
1772  this->TlmRecv_handler(
1773  portNum,
1774  id,
1775  timeTag,
1776  val
1777  );
1778  }
1779 
1782  FwIndexType portNum,
1783  const Svc::TelemetrySection& section,
1784  FwChanIdType tlmGroup,
1785  const Svc::RateLogic& rateLogic,
1786  U32 minDelta,
1787  U32 maxDelta
1788  )
1789  {
1790  // Make sure port number is valid
1791  FW_ASSERT(
1792  (0 <= portNum) && (portNum < this->getNum_configureSectionGroupRate_InputPorts()),
1793  static_cast<FwAssertArgType>(portNum)
1794  );
1795 
1796  // Call pre-message hook
1798  portNum,
1799  section,
1800  tlmGroup,
1801  rateLogic,
1802  minDelta,
1803  maxDelta
1804  );
1805  ComponentIpcSerializableBuffer msg;
1807 
1808  // Serialize message ID
1809  _status = msg.serializeFrom(
1810  static_cast<FwEnumStoreType>(CONFIGURESECTIONGROUPRATE_CONFIGUREGROUPRATE)
1811  );
1812  FW_ASSERT(
1813  _status == Fw::FW_SERIALIZE_OK,
1814  static_cast<FwAssertArgType>(_status)
1815  );
1816 
1817  // Serialize port number
1818  _status = msg.serializeFrom(portNum);
1819  FW_ASSERT(
1820  _status == Fw::FW_SERIALIZE_OK,
1821  static_cast<FwAssertArgType>(_status)
1822  );
1823 
1824  // Serialize argument section
1825  _status = msg.serializeFrom(section);
1826  FW_ASSERT(
1827  _status == Fw::FW_SERIALIZE_OK,
1828  static_cast<FwAssertArgType>(_status)
1829  );
1830 
1831  // Serialize argument tlmGroup
1832  _status = msg.serializeFrom(tlmGroup);
1833  FW_ASSERT(
1834  _status == Fw::FW_SERIALIZE_OK,
1835  static_cast<FwAssertArgType>(_status)
1836  );
1837 
1838  // Serialize argument rateLogic
1839  _status = msg.serializeFrom(rateLogic);
1840  FW_ASSERT(
1841  _status == Fw::FW_SERIALIZE_OK,
1842  static_cast<FwAssertArgType>(_status)
1843  );
1844 
1845  // Serialize argument minDelta
1846  _status = msg.serializeFrom(minDelta);
1847  FW_ASSERT(
1848  _status == Fw::FW_SERIALIZE_OK,
1849  static_cast<FwAssertArgType>(_status)
1850  );
1851 
1852  // Serialize argument maxDelta
1853  _status = msg.serializeFrom(maxDelta);
1854  FW_ASSERT(
1855  _status == Fw::FW_SERIALIZE_OK,
1856  static_cast<FwAssertArgType>(_status)
1857  );
1858 
1859  // Send message
1861  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1862 
1863  FW_ASSERT(
1864  qStatus == Os::Queue::OP_OK,
1865  static_cast<FwAssertArgType>(qStatus)
1866  );
1867  }
1868 
1871  FwIndexType portNum,
1872  const Svc::TelemetrySection& section,
1873  const Fw::Enabled& enabled
1874  )
1875  {
1876  // Make sure port number is valid
1877  FW_ASSERT(
1878  (0 <= portNum) && (portNum < this->getNum_controlIn_InputPorts()),
1879  static_cast<FwAssertArgType>(portNum)
1880  );
1881 
1882  // Call pre-message hook
1884  portNum,
1885  section,
1886  enabled
1887  );
1888  ComponentIpcSerializableBuffer msg;
1890 
1891  // Serialize message ID
1892  _status = msg.serializeFrom(
1893  static_cast<FwEnumStoreType>(CONTROLIN_ENABLESECTION)
1894  );
1895  FW_ASSERT(
1896  _status == Fw::FW_SERIALIZE_OK,
1897  static_cast<FwAssertArgType>(_status)
1898  );
1899 
1900  // Serialize port number
1901  _status = msg.serializeFrom(portNum);
1902  FW_ASSERT(
1903  _status == Fw::FW_SERIALIZE_OK,
1904  static_cast<FwAssertArgType>(_status)
1905  );
1906 
1907  // Serialize argument section
1908  _status = msg.serializeFrom(section);
1909  FW_ASSERT(
1910  _status == Fw::FW_SERIALIZE_OK,
1911  static_cast<FwAssertArgType>(_status)
1912  );
1913 
1914  // Serialize argument enabled
1915  _status = msg.serializeFrom(enabled);
1916  FW_ASSERT(
1917  _status == Fw::FW_SERIALIZE_OK,
1918  static_cast<FwAssertArgType>(_status)
1919  );
1920 
1921  // Send message
1923  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1924 
1925  FW_ASSERT(
1926  qStatus == Os::Queue::OP_OK,
1927  static_cast<FwAssertArgType>(qStatus)
1928  );
1929  }
1930 
1933  FwIndexType portNum,
1934  Fw::Buffer& fwBuffer
1935  )
1936  {
1937  // Make sure port number is valid
1938  FW_ASSERT(
1939  (0 <= portNum) && (portNum < this->getNum_packetOverrideIn_InputPorts()),
1940  static_cast<FwAssertArgType>(portNum)
1941  );
1942 
1943  // Call pre-message hook
1945  portNum,
1946  fwBuffer
1947  );
1948  ComponentIpcSerializableBuffer msg;
1950 
1951  // Serialize message ID
1952  _status = msg.serializeFrom(
1953  static_cast<FwEnumStoreType>(PACKETOVERRIDEIN_BUFFERSEND)
1954  );
1955  FW_ASSERT(
1956  _status == Fw::FW_SERIALIZE_OK,
1957  static_cast<FwAssertArgType>(_status)
1958  );
1959 
1960  // Serialize port number
1961  _status = msg.serializeFrom(portNum);
1962  FW_ASSERT(
1963  _status == Fw::FW_SERIALIZE_OK,
1964  static_cast<FwAssertArgType>(_status)
1965  );
1966 
1967  // Serialize argument fwBuffer
1968  _status = msg.serializeFrom(fwBuffer);
1969  FW_ASSERT(
1970  _status == Fw::FW_SERIALIZE_OK,
1971  static_cast<FwAssertArgType>(_status)
1972  );
1973 
1974  // Send message
1976  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1977 
1978  FW_ASSERT(
1979  qStatus == Os::Queue::OP_OK,
1980  static_cast<FwAssertArgType>(qStatus)
1981  );
1982  }
1983 
1986  FwIndexType portNum,
1987  Fw::Buffer& fwBuffer
1988  )
1989  {
1990  // Make sure port number is valid
1991  FW_ASSERT(
1992  (0 <= portNum) && (portNum < this->getNum_packetOverrideReturnIn_InputPorts()),
1993  static_cast<FwAssertArgType>(portNum)
1994  );
1995 
1996  // Call handler function
1998  portNum,
1999  fwBuffer
2000  );
2001  }
2002 
2005  FwIndexType portNum,
2006  U32 key
2007  )
2008  {
2009  // Make sure port number is valid
2010  FW_ASSERT(
2011  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
2012  static_cast<FwAssertArgType>(portNum)
2013  );
2014 
2015  // Call pre-message hook
2017  portNum,
2018  key
2019  );
2020  ComponentIpcSerializableBuffer msg;
2022 
2023  // Serialize message ID
2024  _status = msg.serializeFrom(
2025  static_cast<FwEnumStoreType>(PINGIN_PING)
2026  );
2027  FW_ASSERT(
2028  _status == Fw::FW_SERIALIZE_OK,
2029  static_cast<FwAssertArgType>(_status)
2030  );
2031 
2032  // Serialize port number
2033  _status = msg.serializeFrom(portNum);
2034  FW_ASSERT(
2035  _status == Fw::FW_SERIALIZE_OK,
2036  static_cast<FwAssertArgType>(_status)
2037  );
2038 
2039  // Serialize argument key
2040  _status = msg.serializeFrom(key);
2041  FW_ASSERT(
2042  _status == Fw::FW_SERIALIZE_OK,
2043  static_cast<FwAssertArgType>(_status)
2044  );
2045 
2046  // Send message
2048  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
2049 
2050  if (qStatus == Os::Queue::Status::FULL) {
2051  this->incNumMsgDropped();
2052  return;
2053  }
2054 
2055  FW_ASSERT(
2056  qStatus == Os::Queue::OP_OK,
2057  static_cast<FwAssertArgType>(qStatus)
2058  );
2059  }
2060 
2061  // ----------------------------------------------------------------------
2062  // Pre-message hooks for typed async input ports
2063  //
2064  // Each of these functions is invoked just before processing a message
2065  // on the corresponding port. By default, they do nothing. You can
2066  // override them to provide specific pre-message behavior.
2067  // ----------------------------------------------------------------------
2068 
2071  FwIndexType portNum,
2072  U32 context
2073  )
2074  {
2075  // Default: no-op
2076  }
2077 
2080  FwIndexType portNum,
2081  const Svc::TelemetrySection& section,
2082  FwChanIdType tlmGroup,
2083  const Svc::RateLogic& rateLogic,
2084  U32 minDelta,
2085  U32 maxDelta
2086  )
2087  {
2088  // Default: no-op
2089  }
2090 
2093  FwIndexType portNum,
2094  const Svc::TelemetrySection& section,
2095  const Fw::Enabled& enabled
2096  )
2097  {
2098  // Default: no-op
2099  }
2100 
2103  FwIndexType portNum,
2104  Fw::Buffer& fwBuffer
2105  )
2106  {
2107  // Default: no-op
2108  }
2109 
2112  FwIndexType portNum,
2113  U32 key
2114  )
2115  {
2116  // Default: no-op
2117  }
2118 
2119 #if !FW_DIRECT_PORT_CALLS
2120 
2121  // ----------------------------------------------------------------------
2122  // Invocation functions for typed output ports
2123  // ----------------------------------------------------------------------
2124 
2127  FwIndexType portNum,
2128  Fw::ComBuffer& data,
2129  U32 context
2130  ) const
2131  {
2132  FW_ASSERT(
2133  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
2134  static_cast<FwAssertArgType>(portNum)
2135  );
2136 
2137  FW_ASSERT(
2138  this->m_PktSend_OutputPort[portNum].isConnected(),
2139  static_cast<FwAssertArgType>(portNum)
2140  );
2141  this->m_PktSend_OutputPort[portNum].invoke(
2142  data,
2143  context
2144  );
2145  }
2146 
2149  FwIndexType portNum,
2150  FwSizeType size
2151  ) const
2152  {
2153  FW_ASSERT(
2154  (0 <= portNum) && (portNum < this->getNum_allocate_OutputPorts()),
2155  static_cast<FwAssertArgType>(portNum)
2156  );
2157 
2158  FW_ASSERT(
2159  this->m_allocate_OutputPort[portNum].isConnected(),
2160  static_cast<FwAssertArgType>(portNum)
2161  );
2162  return this->m_allocate_OutputPort[portNum].invoke(
2163  size
2164  );
2165  }
2166 
2169  FwIndexType portNum,
2170  Fw::Buffer& fwBuffer
2171  ) const
2172  {
2173  FW_ASSERT(
2174  (0 <= portNum) && (portNum < this->getNum_deallocate_OutputPorts()),
2175  static_cast<FwAssertArgType>(portNum)
2176  );
2177 
2178  FW_ASSERT(
2179  this->m_deallocate_OutputPort[portNum].isConnected(),
2180  static_cast<FwAssertArgType>(portNum)
2181  );
2182  this->m_deallocate_OutputPort[portNum].invoke(
2183  fwBuffer
2184  );
2185  }
2186 
2189  FwIndexType portNum,
2190  Fw::Buffer& fwBuffer
2191  ) const
2192  {
2193  FW_ASSERT(
2194  (0 <= portNum) && (portNum < this->getNum_packetOverrideOut_OutputPorts()),
2195  static_cast<FwAssertArgType>(portNum)
2196  );
2197 
2198  FW_ASSERT(
2199  this->m_packetOverrideOut_OutputPort[portNum].isConnected(),
2200  static_cast<FwAssertArgType>(portNum)
2201  );
2202  this->m_packetOverrideOut_OutputPort[portNum].invoke(
2203  fwBuffer
2204  );
2205  }
2206 
2209  FwIndexType portNum,
2210  Fw::Buffer& fwBuffer
2211  ) const
2212  {
2213  FW_ASSERT(
2214  (0 <= portNum) && (portNum < this->getNum_packetOverrideReturnOut_OutputPorts()),
2215  static_cast<FwAssertArgType>(portNum)
2216  );
2217 
2218  FW_ASSERT(
2219  this->m_packetOverrideReturnOut_OutputPort[portNum].isConnected(),
2220  static_cast<FwAssertArgType>(portNum)
2221  );
2222  this->m_packetOverrideReturnOut_OutputPort[portNum].invoke(
2223  fwBuffer
2224  );
2225  }
2226 
2229  FwIndexType portNum,
2230  U32 key
2231  ) const
2232  {
2233  FW_ASSERT(
2234  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
2235  static_cast<FwAssertArgType>(portNum)
2236  );
2237 
2238  FW_ASSERT(
2239  this->m_pingOut_OutputPort[portNum].isConnected(),
2240  static_cast<FwAssertArgType>(portNum)
2241  );
2242  this->m_pingOut_OutputPort[portNum].invoke(
2243  key
2244  );
2245  }
2246 
2247 #endif
2248 
2249  // ----------------------------------------------------------------------
2250  // Command response
2251  // ----------------------------------------------------------------------
2252 
2255  FwOpcodeType opCode,
2256  U32 cmdSeq,
2257  Fw::CmdResponse response
2258  )
2259  {
2261  this->cmdResponseOut_out(0, opCode, cmdSeq, response);
2262  }
2263 
2264  // ----------------------------------------------------------------------
2265  // Command handler base-class functions
2266  //
2267  // Call these functions directly to bypass the command input port
2268  // ----------------------------------------------------------------------
2269 
2272  FwOpcodeType opCode,
2273  U32 cmdSeq,
2274  Fw::CmdArgBuffer& args
2275  )
2276  {
2277  // Call pre-message hook
2278  this->SET_LEVEL_preMsgHook(opCode,cmdSeq);
2279 
2280  // Defer deserializing arguments to the message dispatcher
2281  // to avoid deserializing and reserializing just for IPC
2282  ComponentIpcSerializableBuffer msg;
2284 
2285  // Serialize for IPC
2286  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_SET_LEVEL));
2287  FW_ASSERT (
2288  _status == Fw::FW_SERIALIZE_OK,
2289  static_cast<FwAssertArgType>(_status)
2290  );
2291 
2292  // Fake port number to make message dequeue work
2293  FwIndexType port = 0;
2294 
2295  _status = msg.serializeFrom(port);
2296  FW_ASSERT (
2297  _status == Fw::FW_SERIALIZE_OK,
2298  static_cast<FwAssertArgType>(_status)
2299  );
2300 
2301  _status = msg.serializeFrom(opCode);
2302  FW_ASSERT (
2303  _status == Fw::FW_SERIALIZE_OK,
2304  static_cast<FwAssertArgType>(_status)
2305  );
2306 
2307  _status = msg.serializeFrom(cmdSeq);
2308  FW_ASSERT (
2309  _status == Fw::FW_SERIALIZE_OK,
2310  static_cast<FwAssertArgType>(_status)
2311  );
2312 
2313  _status = msg.serializeFrom(args);
2314  FW_ASSERT (
2315  _status == Fw::FW_SERIALIZE_OK,
2316  static_cast<FwAssertArgType>(_status)
2317  );
2318 
2319  // Send message
2321  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
2322 
2323  FW_ASSERT(
2324  qStatus == Os::Queue::OP_OK,
2325  static_cast<FwAssertArgType>(qStatus)
2326  );
2327  }
2328 
2331  FwOpcodeType opCode,
2332  U32 cmdSeq,
2333  Fw::CmdArgBuffer& args
2334  )
2335  {
2336  // Call pre-message hook
2337  this->SEND_PKT_preMsgHook(opCode,cmdSeq);
2338 
2339  // Defer deserializing arguments to the message dispatcher
2340  // to avoid deserializing and reserializing just for IPC
2341  ComponentIpcSerializableBuffer msg;
2343 
2344  // Serialize for IPC
2345  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_SEND_PKT));
2346  FW_ASSERT (
2347  _status == Fw::FW_SERIALIZE_OK,
2348  static_cast<FwAssertArgType>(_status)
2349  );
2350 
2351  // Fake port number to make message dequeue work
2352  FwIndexType port = 0;
2353 
2354  _status = msg.serializeFrom(port);
2355  FW_ASSERT (
2356  _status == Fw::FW_SERIALIZE_OK,
2357  static_cast<FwAssertArgType>(_status)
2358  );
2359 
2360  _status = msg.serializeFrom(opCode);
2361  FW_ASSERT (
2362  _status == Fw::FW_SERIALIZE_OK,
2363  static_cast<FwAssertArgType>(_status)
2364  );
2365 
2366  _status = msg.serializeFrom(cmdSeq);
2367  FW_ASSERT (
2368  _status == Fw::FW_SERIALIZE_OK,
2369  static_cast<FwAssertArgType>(_status)
2370  );
2371 
2372  _status = msg.serializeFrom(args);
2373  FW_ASSERT (
2374  _status == Fw::FW_SERIALIZE_OK,
2375  static_cast<FwAssertArgType>(_status)
2376  );
2377 
2378  // Send message
2380  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
2381 
2382  FW_ASSERT(
2383  qStatus == Os::Queue::OP_OK,
2384  static_cast<FwAssertArgType>(qStatus)
2385  );
2386  }
2387 
2390  FwOpcodeType opCode,
2391  U32 cmdSeq,
2392  Fw::CmdArgBuffer& args
2393  )
2394  {
2395  // Call pre-message hook
2396  this->ENABLE_SECTION_preMsgHook(opCode,cmdSeq);
2397 
2398  // Defer deserializing arguments to the message dispatcher
2399  // to avoid deserializing and reserializing just for IPC
2400  ComponentIpcSerializableBuffer msg;
2402 
2403  // Serialize for IPC
2404  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_ENABLE_SECTION));
2405  FW_ASSERT (
2406  _status == Fw::FW_SERIALIZE_OK,
2407  static_cast<FwAssertArgType>(_status)
2408  );
2409 
2410  // Fake port number to make message dequeue work
2411  FwIndexType port = 0;
2412 
2413  _status = msg.serializeFrom(port);
2414  FW_ASSERT (
2415  _status == Fw::FW_SERIALIZE_OK,
2416  static_cast<FwAssertArgType>(_status)
2417  );
2418 
2419  _status = msg.serializeFrom(opCode);
2420  FW_ASSERT (
2421  _status == Fw::FW_SERIALIZE_OK,
2422  static_cast<FwAssertArgType>(_status)
2423  );
2424 
2425  _status = msg.serializeFrom(cmdSeq);
2426  FW_ASSERT (
2427  _status == Fw::FW_SERIALIZE_OK,
2428  static_cast<FwAssertArgType>(_status)
2429  );
2430 
2431  _status = msg.serializeFrom(args);
2432  FW_ASSERT (
2433  _status == Fw::FW_SERIALIZE_OK,
2434  static_cast<FwAssertArgType>(_status)
2435  );
2436 
2437  // Send message
2439  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
2440 
2441  FW_ASSERT(
2442  qStatus == Os::Queue::OP_OK,
2443  static_cast<FwAssertArgType>(qStatus)
2444  );
2445  }
2446 
2449  FwOpcodeType opCode,
2450  U32 cmdSeq,
2451  Fw::CmdArgBuffer& args
2452  )
2453  {
2454  // Call pre-message hook
2455  this->CONFIGURE_GROUP_SEND_preMsgHook(opCode,cmdSeq);
2456 
2457  // Defer deserializing arguments to the message dispatcher
2458  // to avoid deserializing and reserializing just for IPC
2459  ComponentIpcSerializableBuffer msg;
2461 
2462  // Serialize for IPC
2463  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CONFIGURE_GROUP_SEND));
2464  FW_ASSERT (
2465  _status == Fw::FW_SERIALIZE_OK,
2466  static_cast<FwAssertArgType>(_status)
2467  );
2468 
2469  // Fake port number to make message dequeue work
2470  FwIndexType port = 0;
2471 
2472  _status = msg.serializeFrom(port);
2473  FW_ASSERT (
2474  _status == Fw::FW_SERIALIZE_OK,
2475  static_cast<FwAssertArgType>(_status)
2476  );
2477 
2478  _status = msg.serializeFrom(opCode);
2479  FW_ASSERT (
2480  _status == Fw::FW_SERIALIZE_OK,
2481  static_cast<FwAssertArgType>(_status)
2482  );
2483 
2484  _status = msg.serializeFrom(cmdSeq);
2485  FW_ASSERT (
2486  _status == Fw::FW_SERIALIZE_OK,
2487  static_cast<FwAssertArgType>(_status)
2488  );
2489 
2490  _status = msg.serializeFrom(args);
2491  FW_ASSERT (
2492  _status == Fw::FW_SERIALIZE_OK,
2493  static_cast<FwAssertArgType>(_status)
2494  );
2495 
2496  // Send message
2498  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
2499 
2500  FW_ASSERT(
2501  qStatus == Os::Queue::OP_OK,
2502  static_cast<FwAssertArgType>(qStatus)
2503  );
2504  }
2505 
2508  FwOpcodeType opCode,
2509  U32 cmdSeq,
2510  Fw::CmdArgBuffer& args
2511  )
2512  {
2513  // Call pre-message hook
2514  this->CONFIGURE_GROUP_RATES_preMsgHook(opCode,cmdSeq);
2515 
2516  // Defer deserializing arguments to the message dispatcher
2517  // to avoid deserializing and reserializing just for IPC
2518  ComponentIpcSerializableBuffer msg;
2520 
2521  // Serialize for IPC
2522  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CONFIGURE_GROUP_RATES));
2523  FW_ASSERT (
2524  _status == Fw::FW_SERIALIZE_OK,
2525  static_cast<FwAssertArgType>(_status)
2526  );
2527 
2528  // Fake port number to make message dequeue work
2529  FwIndexType port = 0;
2530 
2531  _status = msg.serializeFrom(port);
2532  FW_ASSERT (
2533  _status == Fw::FW_SERIALIZE_OK,
2534  static_cast<FwAssertArgType>(_status)
2535  );
2536 
2537  _status = msg.serializeFrom(opCode);
2538  FW_ASSERT (
2539  _status == Fw::FW_SERIALIZE_OK,
2540  static_cast<FwAssertArgType>(_status)
2541  );
2542 
2543  _status = msg.serializeFrom(cmdSeq);
2544  FW_ASSERT (
2545  _status == Fw::FW_SERIALIZE_OK,
2546  static_cast<FwAssertArgType>(_status)
2547  );
2548 
2549  _status = msg.serializeFrom(args);
2550  FW_ASSERT (
2551  _status == Fw::FW_SERIALIZE_OK,
2552  static_cast<FwAssertArgType>(_status)
2553  );
2554 
2555  // Send message
2557  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
2558 
2559  FW_ASSERT(
2560  qStatus == Os::Queue::OP_OK,
2561  static_cast<FwAssertArgType>(qStatus)
2562  );
2563  }
2564 
2567  FwOpcodeType opCode,
2568  U32 cmdSeq,
2569  Fw::CmdArgBuffer& args
2570  )
2571  {
2572  // Call pre-message hook
2573  this->GET_PACKET_CONFIG_preMsgHook(opCode,cmdSeq);
2574 
2575  // Defer deserializing arguments to the message dispatcher
2576  // to avoid deserializing and reserializing just for IPC
2577  ComponentIpcSerializableBuffer msg;
2579 
2580  // Serialize for IPC
2581  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_GET_PACKET_CONFIG));
2582  FW_ASSERT (
2583  _status == Fw::FW_SERIALIZE_OK,
2584  static_cast<FwAssertArgType>(_status)
2585  );
2586 
2587  // Fake port number to make message dequeue work
2588  FwIndexType port = 0;
2589 
2590  _status = msg.serializeFrom(port);
2591  FW_ASSERT (
2592  _status == Fw::FW_SERIALIZE_OK,
2593  static_cast<FwAssertArgType>(_status)
2594  );
2595 
2596  _status = msg.serializeFrom(opCode);
2597  FW_ASSERT (
2598  _status == Fw::FW_SERIALIZE_OK,
2599  static_cast<FwAssertArgType>(_status)
2600  );
2601 
2602  _status = msg.serializeFrom(cmdSeq);
2603  FW_ASSERT (
2604  _status == Fw::FW_SERIALIZE_OK,
2605  static_cast<FwAssertArgType>(_status)
2606  );
2607 
2608  _status = msg.serializeFrom(args);
2609  FW_ASSERT (
2610  _status == Fw::FW_SERIALIZE_OK,
2611  static_cast<FwAssertArgType>(_status)
2612  );
2613 
2614  // Send message
2616  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
2617 
2618  FW_ASSERT(
2619  qStatus == Os::Queue::OP_OK,
2620  static_cast<FwAssertArgType>(qStatus)
2621  );
2622  }
2623 
2626  FwOpcodeType opCode,
2627  U32 cmdSeq,
2628  Fw::CmdArgBuffer& args
2629  )
2630  {
2631  // Call pre-message hook
2632  this->OVERRIDE_PACKET_SEND_preMsgHook(opCode,cmdSeq);
2633 
2634  // Defer deserializing arguments to the message dispatcher
2635  // to avoid deserializing and reserializing just for IPC
2636  ComponentIpcSerializableBuffer msg;
2638 
2639  // Serialize for IPC
2640  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_OVERRIDE_PACKET_SEND));
2641  FW_ASSERT (
2642  _status == Fw::FW_SERIALIZE_OK,
2643  static_cast<FwAssertArgType>(_status)
2644  );
2645 
2646  // Fake port number to make message dequeue work
2647  FwIndexType port = 0;
2648 
2649  _status = msg.serializeFrom(port);
2650  FW_ASSERT (
2651  _status == Fw::FW_SERIALIZE_OK,
2652  static_cast<FwAssertArgType>(_status)
2653  );
2654 
2655  _status = msg.serializeFrom(opCode);
2656  FW_ASSERT (
2657  _status == Fw::FW_SERIALIZE_OK,
2658  static_cast<FwAssertArgType>(_status)
2659  );
2660 
2661  _status = msg.serializeFrom(cmdSeq);
2662  FW_ASSERT (
2663  _status == Fw::FW_SERIALIZE_OK,
2664  static_cast<FwAssertArgType>(_status)
2665  );
2666 
2667  _status = msg.serializeFrom(args);
2668  FW_ASSERT (
2669  _status == Fw::FW_SERIALIZE_OK,
2670  static_cast<FwAssertArgType>(_status)
2671  );
2672 
2673  // Send message
2675  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
2676 
2677  FW_ASSERT(
2678  qStatus == Os::Queue::OP_OK,
2679  static_cast<FwAssertArgType>(qStatus)
2680  );
2681  }
2682 
2685  FwOpcodeType opCode,
2686  U32 cmdSeq,
2687  Fw::CmdArgBuffer& args
2688  )
2689  {
2690  // Call pre-message hook
2691  this->OVERRIDE_PACKET_RATES_preMsgHook(opCode,cmdSeq);
2692 
2693  // Defer deserializing arguments to the message dispatcher
2694  // to avoid deserializing and reserializing just for IPC
2695  ComponentIpcSerializableBuffer msg;
2697 
2698  // Serialize for IPC
2699  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_OVERRIDE_PACKET_RATES));
2700  FW_ASSERT (
2701  _status == Fw::FW_SERIALIZE_OK,
2702  static_cast<FwAssertArgType>(_status)
2703  );
2704 
2705  // Fake port number to make message dequeue work
2706  FwIndexType port = 0;
2707 
2708  _status = msg.serializeFrom(port);
2709  FW_ASSERT (
2710  _status == Fw::FW_SERIALIZE_OK,
2711  static_cast<FwAssertArgType>(_status)
2712  );
2713 
2714  _status = msg.serializeFrom(opCode);
2715  FW_ASSERT (
2716  _status == Fw::FW_SERIALIZE_OK,
2717  static_cast<FwAssertArgType>(_status)
2718  );
2719 
2720  _status = msg.serializeFrom(cmdSeq);
2721  FW_ASSERT (
2722  _status == Fw::FW_SERIALIZE_OK,
2723  static_cast<FwAssertArgType>(_status)
2724  );
2725 
2726  _status = msg.serializeFrom(args);
2727  FW_ASSERT (
2728  _status == Fw::FW_SERIALIZE_OK,
2729  static_cast<FwAssertArgType>(_status)
2730  );
2731 
2732  // Send message
2734  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
2735 
2736  FW_ASSERT(
2737  qStatus == Os::Queue::OP_OK,
2738  static_cast<FwAssertArgType>(qStatus)
2739  );
2740  }
2741 
2744  FwOpcodeType opCode,
2745  U32 cmdSeq,
2746  Fw::CmdArgBuffer& args
2747  )
2748  {
2749  // Call pre-message hook
2750  this->CLEAR_PACKET_OVERRIDE_preMsgHook(opCode,cmdSeq);
2751 
2752  // Defer deserializing arguments to the message dispatcher
2753  // to avoid deserializing and reserializing just for IPC
2754  ComponentIpcSerializableBuffer msg;
2756 
2757  // Serialize for IPC
2758  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CLEAR_PACKET_OVERRIDE));
2759  FW_ASSERT (
2760  _status == Fw::FW_SERIALIZE_OK,
2761  static_cast<FwAssertArgType>(_status)
2762  );
2763 
2764  // Fake port number to make message dequeue work
2765  FwIndexType port = 0;
2766 
2767  _status = msg.serializeFrom(port);
2768  FW_ASSERT (
2769  _status == Fw::FW_SERIALIZE_OK,
2770  static_cast<FwAssertArgType>(_status)
2771  );
2772 
2773  _status = msg.serializeFrom(opCode);
2774  FW_ASSERT (
2775  _status == Fw::FW_SERIALIZE_OK,
2776  static_cast<FwAssertArgType>(_status)
2777  );
2778 
2779  _status = msg.serializeFrom(cmdSeq);
2780  FW_ASSERT (
2781  _status == Fw::FW_SERIALIZE_OK,
2782  static_cast<FwAssertArgType>(_status)
2783  );
2784 
2785  _status = msg.serializeFrom(args);
2786  FW_ASSERT (
2787  _status == Fw::FW_SERIALIZE_OK,
2788  static_cast<FwAssertArgType>(_status)
2789  );
2790 
2791  // Send message
2793  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
2794 
2795  FW_ASSERT(
2796  qStatus == Os::Queue::OP_OK,
2797  static_cast<FwAssertArgType>(qStatus)
2798  );
2799  }
2800 
2801  // ----------------------------------------------------------------------
2802  // Pre-message hooks for async commands
2803  //
2804  // Each of these functions is invoked just before processing the
2805  // corresponding command. By default they do nothing. You can
2806  // override them to provide specific pre-command behavior.
2807  // ----------------------------------------------------------------------
2808 
2811  FwOpcodeType opCode,
2812  U32 cmdSeq
2813  )
2814  {
2815  // Defaults to no-op; can be overridden
2816  (void) opCode;
2817  (void) cmdSeq;
2818  }
2819 
2822  FwOpcodeType opCode,
2823  U32 cmdSeq
2824  )
2825  {
2826  // Defaults to no-op; can be overridden
2827  (void) opCode;
2828  (void) cmdSeq;
2829  }
2830 
2833  FwOpcodeType opCode,
2834  U32 cmdSeq
2835  )
2836  {
2837  // Defaults to no-op; can be overridden
2838  (void) opCode;
2839  (void) cmdSeq;
2840  }
2841 
2844  FwOpcodeType opCode,
2845  U32 cmdSeq
2846  )
2847  {
2848  // Defaults to no-op; can be overridden
2849  (void) opCode;
2850  (void) cmdSeq;
2851  }
2852 
2855  FwOpcodeType opCode,
2856  U32 cmdSeq
2857  )
2858  {
2859  // Defaults to no-op; can be overridden
2860  (void) opCode;
2861  (void) cmdSeq;
2862  }
2863 
2866  FwOpcodeType opCode,
2867  U32 cmdSeq
2868  )
2869  {
2870  // Defaults to no-op; can be overridden
2871  (void) opCode;
2872  (void) cmdSeq;
2873  }
2874 
2877  FwOpcodeType opCode,
2878  U32 cmdSeq
2879  )
2880  {
2881  // Defaults to no-op; can be overridden
2882  (void) opCode;
2883  (void) cmdSeq;
2884  }
2885 
2888  FwOpcodeType opCode,
2889  U32 cmdSeq
2890  )
2891  {
2892  // Defaults to no-op; can be overridden
2893  (void) opCode;
2894  (void) cmdSeq;
2895  }
2896 
2899  FwOpcodeType opCode,
2900  U32 cmdSeq
2901  )
2902  {
2903  // Defaults to no-op; can be overridden
2904  (void) opCode;
2905  (void) cmdSeq;
2906  }
2907 
2908  // ----------------------------------------------------------------------
2909  // Event logging functions
2910  // ----------------------------------------------------------------------
2911 
2914  {
2915  // Get the time
2916  Fw::Time _logTime;
2917  if (this->isConnected_timeGetOut_OutputPort(0)) {
2918  this->timeGetOut_out(0, _logTime);
2919  }
2920 
2921  const FwEventIdType _id = this->getIdBase() + EVENTID_NOCHAN;
2922 
2923  // Emit the event on the log port
2924  if (this->isConnected_eventOut_OutputPort(0)) {
2925  Fw::LogBuffer _logBuff;
2927 
2928 #if FW_AMPCS_COMPATIBLE
2929  // Serialize the number of arguments
2930  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2931  FW_ASSERT(
2932  _status == Fw::FW_SERIALIZE_OK,
2933  static_cast<FwAssertArgType>(_status)
2934  );
2935 #endif
2936 
2937 #if FW_AMPCS_COMPATIBLE
2938  // Serialize the argument size
2939  _status = _logBuff.serializeFrom(
2940  static_cast<U8>(sizeof(FwChanIdType))
2941  );
2942  FW_ASSERT(
2943  _status == Fw::FW_SERIALIZE_OK,
2944  static_cast<FwAssertArgType>(_status)
2945  );
2946 #endif
2947  _status = _logBuff.serializeFrom(Id);
2948  FW_ASSERT(
2949  _status == Fw::FW_SERIALIZE_OK,
2950  static_cast<FwAssertArgType>(_status)
2951  );
2952 
2953  this->eventOut_out(
2954  0,
2955  _id,
2956  _logTime,
2958  _logBuff
2959  );
2960  }
2961 
2962  // Emit the event on the text log port
2963 #if FW_ENABLE_TEXT_LOGGING
2964  if (this->isConnected_textEventOut_OutputPort(0)) {
2965 #if FW_OBJECT_NAMES == 1
2966  const char* _formatString =
2967  "(%s) %s: Telemetry ID 0x%" PRIx32 " not packetized";
2968 #else
2969  const char* _formatString =
2970  "%s: Telemetry ID 0x%" PRIx32 " not packetized";
2971 #endif
2972 
2973  Fw::TextLogString _logString;
2974  (void) _logString.format(
2975  _formatString,
2976 #if FW_OBJECT_NAMES == 1
2977  this->m_objName.toChar(),
2978 #endif
2979  "NoChan ",
2980  Id
2981  );
2982 
2983  this->textEventOut_out(
2984  0,
2985  _id,
2986  _logTime,
2988  _logString
2989  );
2990  }
2991 #endif
2992  }
2993 
2996  {
2997  // Get the time
2998  Fw::Time _logTime;
2999  if (this->isConnected_timeGetOut_OutputPort(0)) {
3000  this->timeGetOut_out(0, _logTime);
3001  }
3002 
3003  const FwEventIdType _id = this->getIdBase() + EVENTID_LEVELSET;
3004 
3005  // Emit the event on the log port
3006  if (this->isConnected_eventOut_OutputPort(0)) {
3007  Fw::LogBuffer _logBuff;
3009 
3010 #if FW_AMPCS_COMPATIBLE
3011  // Serialize the number of arguments
3012  _status = _logBuff.serializeFrom(static_cast<U8>(1));
3013  FW_ASSERT(
3014  _status == Fw::FW_SERIALIZE_OK,
3015  static_cast<FwAssertArgType>(_status)
3016  );
3017 #endif
3018 
3019 #if FW_AMPCS_COMPATIBLE
3020  // Serialize the argument size
3021  _status = _logBuff.serializeFrom(
3022  static_cast<U8>(sizeof(FwChanIdType))
3023  );
3024  FW_ASSERT(
3025  _status == Fw::FW_SERIALIZE_OK,
3026  static_cast<FwAssertArgType>(_status)
3027  );
3028 #endif
3029  _status = _logBuff.serializeFrom(level);
3030  FW_ASSERT(
3031  _status == Fw::FW_SERIALIZE_OK,
3032  static_cast<FwAssertArgType>(_status)
3033  );
3034 
3035  this->eventOut_out(
3036  0,
3037  _id,
3038  _logTime,
3040  _logBuff
3041  );
3042  }
3043 
3044  // Emit the event on the text log port
3045 #if FW_ENABLE_TEXT_LOGGING
3046  if (this->isConnected_textEventOut_OutputPort(0)) {
3047 #if FW_OBJECT_NAMES == 1
3048  const char* _formatString =
3049  "(%s) %s: Telemetry send level to %" PRIu32 "";
3050 #else
3051  const char* _formatString =
3052  "%s: Telemetry send level to %" PRIu32 "";
3053 #endif
3054 
3055  Fw::TextLogString _logString;
3056  (void) _logString.format(
3057  _formatString,
3058 #if FW_OBJECT_NAMES == 1
3059  this->m_objName.toChar(),
3060 #endif
3061  "LevelSet ",
3062  level
3063  );
3064 
3065  this->textEventOut_out(
3066  0,
3067  _id,
3068  _logTime,
3070  _logString
3071  );
3072  }
3073 #endif
3074  }
3075 
3078  FwChanIdType level,
3079  FwChanIdType max
3080  ) const
3081  {
3082  // Get the time
3083  Fw::Time _logTime;
3084  if (this->isConnected_timeGetOut_OutputPort(0)) {
3085  this->timeGetOut_out(0, _logTime);
3086  }
3087 
3088  const FwEventIdType _id = this->getIdBase() + EVENTID_MAXLEVELEXCEED;
3089 
3090  // Emit the event on the log port
3091  if (this->isConnected_eventOut_OutputPort(0)) {
3092  Fw::LogBuffer _logBuff;
3094 
3095 #if FW_AMPCS_COMPATIBLE
3096  // Serialize the number of arguments
3097  _status = _logBuff.serializeFrom(static_cast<U8>(2));
3098  FW_ASSERT(
3099  _status == Fw::FW_SERIALIZE_OK,
3100  static_cast<FwAssertArgType>(_status)
3101  );
3102 #endif
3103 
3104 #if FW_AMPCS_COMPATIBLE
3105  // Serialize the argument size
3106  _status = _logBuff.serializeFrom(
3107  static_cast<U8>(sizeof(FwChanIdType))
3108  );
3109  FW_ASSERT(
3110  _status == Fw::FW_SERIALIZE_OK,
3111  static_cast<FwAssertArgType>(_status)
3112  );
3113 #endif
3114  _status = _logBuff.serializeFrom(level);
3115  FW_ASSERT(
3116  _status == Fw::FW_SERIALIZE_OK,
3117  static_cast<FwAssertArgType>(_status)
3118  );
3119 
3120 #if FW_AMPCS_COMPATIBLE
3121  // Serialize the argument size
3122  _status = _logBuff.serializeFrom(
3123  static_cast<U8>(sizeof(FwChanIdType))
3124  );
3125  FW_ASSERT(
3126  _status == Fw::FW_SERIALIZE_OK,
3127  static_cast<FwAssertArgType>(_status)
3128  );
3129 #endif
3130  _status = _logBuff.serializeFrom(max);
3131  FW_ASSERT(
3132  _status == Fw::FW_SERIALIZE_OK,
3133  static_cast<FwAssertArgType>(_status)
3134  );
3135 
3136  this->eventOut_out(
3137  0,
3138  _id,
3139  _logTime,
3141  _logBuff
3142  );
3143  }
3144 
3145  // Emit the event on the text log port
3146 #if FW_ENABLE_TEXT_LOGGING
3147  if (this->isConnected_textEventOut_OutputPort(0)) {
3148 #if FW_OBJECT_NAMES == 1
3149  const char* _formatString =
3150  "(%s) %s: Requested send level %" PRIu32 " higher than max packet level of %" PRIu32 "";
3151 #else
3152  const char* _formatString =
3153  "%s: Requested send level %" PRIu32 " higher than max packet level of %" PRIu32 "";
3154 #endif
3155 
3156  Fw::TextLogString _logString;
3157  (void) _logString.format(
3158  _formatString,
3159 #if FW_OBJECT_NAMES == 1
3160  this->m_objName.toChar(),
3161 #endif
3162  "MaxLevelExceed ",
3163  level,
3164  max
3165  );
3166 
3167  this->textEventOut_out(
3168  0,
3169  _id,
3170  _logTime,
3172  _logString
3173  );
3174  }
3175 #endif
3176  }
3177 
3179  log_ACTIVITY_HI_PacketSent(U32 packetId) const
3180  {
3181  // Get the time
3182  Fw::Time _logTime;
3183  if (this->isConnected_timeGetOut_OutputPort(0)) {
3184  this->timeGetOut_out(0, _logTime);
3185  }
3186 
3187  const FwEventIdType _id = this->getIdBase() + EVENTID_PACKETSENT;
3188 
3189  // Emit the event on the log port
3190  if (this->isConnected_eventOut_OutputPort(0)) {
3191  Fw::LogBuffer _logBuff;
3193 
3194 #if FW_AMPCS_COMPATIBLE
3195  // Serialize the number of arguments
3196  _status = _logBuff.serializeFrom(static_cast<U8>(1));
3197  FW_ASSERT(
3198  _status == Fw::FW_SERIALIZE_OK,
3199  static_cast<FwAssertArgType>(_status)
3200  );
3201 #endif
3202 
3203 #if FW_AMPCS_COMPATIBLE
3204  // Serialize the argument size
3205  _status = _logBuff.serializeFrom(
3206  static_cast<U8>(sizeof(U32))
3207  );
3208  FW_ASSERT(
3209  _status == Fw::FW_SERIALIZE_OK,
3210  static_cast<FwAssertArgType>(_status)
3211  );
3212 #endif
3213  _status = _logBuff.serializeFrom(packetId);
3214  FW_ASSERT(
3215  _status == Fw::FW_SERIALIZE_OK,
3216  static_cast<FwAssertArgType>(_status)
3217  );
3218 
3219  this->eventOut_out(
3220  0,
3221  _id,
3222  _logTime,
3224  _logBuff
3225  );
3226  }
3227 
3228  // Emit the event on the text log port
3229 #if FW_ENABLE_TEXT_LOGGING
3230  if (this->isConnected_textEventOut_OutputPort(0)) {
3231 #if FW_OBJECT_NAMES == 1
3232  const char* _formatString =
3233  "(%s) %s: Sent packet ID %" PRIu32 "";
3234 #else
3235  const char* _formatString =
3236  "%s: Sent packet ID %" PRIu32 "";
3237 #endif
3238 
3239  Fw::TextLogString _logString;
3240  (void) _logString.format(
3241  _formatString,
3242 #if FW_OBJECT_NAMES == 1
3243  this->m_objName.toChar(),
3244 #endif
3245  "PacketSent ",
3246  packetId
3247  );
3248 
3249  this->textEventOut_out(
3250  0,
3251  _id,
3252  _logTime,
3254  _logString
3255  );
3256  }
3257 #endif
3258  }
3259 
3262  {
3263  // Get the time
3264  Fw::Time _logTime;
3265  if (this->isConnected_timeGetOut_OutputPort(0)) {
3266  this->timeGetOut_out(0, _logTime);
3267  }
3268 
3269  const FwEventIdType _id = this->getIdBase() + EVENTID_PACKETNOTFOUND;
3270 
3271  // Emit the event on the log port
3272  if (this->isConnected_eventOut_OutputPort(0)) {
3273  Fw::LogBuffer _logBuff;
3275 
3276 #if FW_AMPCS_COMPATIBLE
3277  // Serialize the number of arguments
3278  _status = _logBuff.serializeFrom(static_cast<U8>(1));
3279  FW_ASSERT(
3280  _status == Fw::FW_SERIALIZE_OK,
3281  static_cast<FwAssertArgType>(_status)
3282  );
3283 #endif
3284 
3285 #if FW_AMPCS_COMPATIBLE
3286  // Serialize the argument size
3287  _status = _logBuff.serializeFrom(
3288  static_cast<U8>(sizeof(U32))
3289  );
3290  FW_ASSERT(
3291  _status == Fw::FW_SERIALIZE_OK,
3292  static_cast<FwAssertArgType>(_status)
3293  );
3294 #endif
3295  _status = _logBuff.serializeFrom(packetId);
3296  FW_ASSERT(
3297  _status == Fw::FW_SERIALIZE_OK,
3298  static_cast<FwAssertArgType>(_status)
3299  );
3300 
3301  this->eventOut_out(
3302  0,
3303  _id,
3304  _logTime,
3306  _logBuff
3307  );
3308  }
3309 
3310  // Emit the event on the text log port
3311 #if FW_ENABLE_TEXT_LOGGING
3312  if (this->isConnected_textEventOut_OutputPort(0)) {
3313 #if FW_OBJECT_NAMES == 1
3314  const char* _formatString =
3315  "(%s) %s: Could not find packet ID %" PRIu32 "";
3316 #else
3317  const char* _formatString =
3318  "%s: Could not find packet ID %" PRIu32 "";
3319 #endif
3320 
3321  Fw::TextLogString _logString;
3322  (void) _logString.format(
3323  _formatString,
3324 #if FW_OBJECT_NAMES == 1
3325  this->m_objName.toChar(),
3326 #endif
3327  "PacketNotFound ",
3328  packetId
3329  );
3330 
3331  this->textEventOut_out(
3332  0,
3333  _id,
3334  _logTime,
3336  _logString
3337  );
3338  }
3339 #endif
3340  }
3341 
3344  const Svc::TelemetrySection& section,
3345  const Fw::Enabled& enable
3346  ) const
3347  {
3348  // Get the time
3349  Fw::Time _logTime;
3350  if (this->isConnected_timeGetOut_OutputPort(0)) {
3351  this->timeGetOut_out(0, _logTime);
3352  }
3353 
3355 
3356  // Emit the event on the log port
3357  if (this->isConnected_eventOut_OutputPort(0)) {
3358  Fw::LogBuffer _logBuff;
3360 
3361 #if FW_AMPCS_COMPATIBLE
3362  // Serialize the number of arguments
3363  _status = _logBuff.serializeFrom(static_cast<U8>(2));
3364  FW_ASSERT(
3365  _status == Fw::FW_SERIALIZE_OK,
3366  static_cast<FwAssertArgType>(_status)
3367  );
3368 #endif
3369 
3370 #if FW_AMPCS_COMPATIBLE
3371  // Serialize the argument size
3372  _status = _logBuff.serializeFrom(
3374  );
3375  FW_ASSERT(
3376  _status == Fw::FW_SERIALIZE_OK,
3377  static_cast<FwAssertArgType>(_status)
3378  );
3379 #endif
3380  _status = _logBuff.serializeFrom(section);
3381  FW_ASSERT(
3382  _status == Fw::FW_SERIALIZE_OK,
3383  static_cast<FwAssertArgType>(_status)
3384  );
3385 
3386 #if FW_AMPCS_COMPATIBLE
3387  // Serialize the argument size
3388  _status = _logBuff.serializeFrom(
3389  static_cast<U8>(Fw::Enabled::SERIALIZED_SIZE)
3390  );
3391  FW_ASSERT(
3392  _status == Fw::FW_SERIALIZE_OK,
3393  static_cast<FwAssertArgType>(_status)
3394  );
3395 #endif
3396  _status = _logBuff.serializeFrom(enable);
3397  FW_ASSERT(
3398  _status == Fw::FW_SERIALIZE_OK,
3399  static_cast<FwAssertArgType>(_status)
3400  );
3401 
3402  this->eventOut_out(
3403  0,
3404  _id,
3405  _logTime,
3407  _logBuff
3408  );
3409  }
3410 
3411  // Emit the event on the text log port
3412 #if FW_ENABLE_TEXT_LOGGING
3413  if (this->isConnected_textEventOut_OutputPort(0)) {
3414 #if FW_OBJECT_NAMES == 1
3415  const char* _formatString =
3416  "(%s) %s: Section %s is unconfigurable and cannot be set to %s";
3417 #else
3418  const char* _formatString =
3419  "%s: Section %s is unconfigurable and cannot be set to %s";
3420 #endif
3421 
3422  Fw::String sectionStr;
3423  section.toString(sectionStr);
3424  Fw::String enableStr;
3425  enable.toString(enableStr);
3426 
3427  Fw::TextLogString _logString;
3428  (void) _logString.format(
3429  _formatString,
3430 #if FW_OBJECT_NAMES == 1
3431  this->m_objName.toChar(),
3432 #endif
3433  "SectionUnconfigurable ",
3434  sectionStr.toChar(),
3435  enableStr.toChar()
3436  );
3437 
3438  this->textEventOut_out(
3439  0,
3440  _id,
3441  _logTime,
3443  _logString
3444  );
3445  }
3446 #endif
3447  }
3448 
3451  FwChanIdType Id,
3452  FwSizeType valSize,
3453  FwSizeType expected
3454  )
3455  {
3456  // Check throttle value
3457  if (this->m_OversizedChannelThrottle >= EVENTID_OVERSIZEDCHANNEL_THROTTLE) {
3458  return;
3459  }
3460  else {
3461  this->m_OversizedChannelThrottle++;
3462  }
3463 
3464  // Get the time
3465  Fw::Time _logTime;
3466  if (this->isConnected_timeGetOut_OutputPort(0)) {
3467  this->timeGetOut_out(0, _logTime);
3468  }
3469 
3470  const FwEventIdType _id = this->getIdBase() + EVENTID_OVERSIZEDCHANNEL;
3471 
3472  // Emit the event on the log port
3473  if (this->isConnected_eventOut_OutputPort(0)) {
3474  Fw::LogBuffer _logBuff;
3476 
3477 #if FW_AMPCS_COMPATIBLE
3478  // Serialize the number of arguments
3479  _status = _logBuff.serializeFrom(static_cast<U8>(3));
3480  FW_ASSERT(
3481  _status == Fw::FW_SERIALIZE_OK,
3482  static_cast<FwAssertArgType>(_status)
3483  );
3484 #endif
3485 
3486 #if FW_AMPCS_COMPATIBLE
3487  // Serialize the argument size
3488  _status = _logBuff.serializeFrom(
3489  static_cast<U8>(sizeof(FwChanIdType))
3490  );
3491  FW_ASSERT(
3492  _status == Fw::FW_SERIALIZE_OK,
3493  static_cast<FwAssertArgType>(_status)
3494  );
3495 #endif
3496  _status = _logBuff.serializeFrom(Id);
3497  FW_ASSERT(
3498  _status == Fw::FW_SERIALIZE_OK,
3499  static_cast<FwAssertArgType>(_status)
3500  );
3501 
3502 #if FW_AMPCS_COMPATIBLE
3503  // Serialize the argument size
3504  _status = _logBuff.serializeFrom(
3505  static_cast<U8>(sizeof(FwSizeType))
3506  );
3507  FW_ASSERT(
3508  _status == Fw::FW_SERIALIZE_OK,
3509  static_cast<FwAssertArgType>(_status)
3510  );
3511 #endif
3512  _status = _logBuff.serializeFrom(valSize);
3513  FW_ASSERT(
3514  _status == Fw::FW_SERIALIZE_OK,
3515  static_cast<FwAssertArgType>(_status)
3516  );
3517 
3518 #if FW_AMPCS_COMPATIBLE
3519  // Serialize the argument size
3520  _status = _logBuff.serializeFrom(
3521  static_cast<U8>(sizeof(FwSizeType))
3522  );
3523  FW_ASSERT(
3524  _status == Fw::FW_SERIALIZE_OK,
3525  static_cast<FwAssertArgType>(_status)
3526  );
3527 #endif
3528  _status = _logBuff.serializeFrom(expected);
3529  FW_ASSERT(
3530  _status == Fw::FW_SERIALIZE_OK,
3531  static_cast<FwAssertArgType>(_status)
3532  );
3533 
3534  this->eventOut_out(
3535  0,
3536  _id,
3537  _logTime,
3539  _logBuff
3540  );
3541  }
3542 
3543  // Emit the event on the text log port
3544 #if FW_ENABLE_TEXT_LOGGING
3545  if (this->isConnected_textEventOut_OutputPort(0)) {
3546 #if FW_OBJECT_NAMES == 1
3547  const char* _formatString =
3548  "(%s) %s: Telemetry ID 0x%" PRIx32 " update of size %" PRIu64 " exceeds configured size %" PRIu64 "";
3549 #else
3550  const char* _formatString =
3551  "%s: Telemetry ID 0x%" PRIx32 " update of size %" PRIu64 " exceeds configured size %" PRIu64 "";
3552 #endif
3553 
3554  Fw::TextLogString _logString;
3555  (void) _logString.format(
3556  _formatString,
3557 #if FW_OBJECT_NAMES == 1
3558  this->m_objName.toChar(),
3559 #endif
3560  "OversizedChannel ",
3561  Id,
3562  valSize,
3563  expected
3564  );
3565 
3566  this->textEventOut_out(
3567  0,
3568  _id,
3569  _logTime,
3571  _logString
3572  );
3573  }
3574 #endif
3575  }
3576 
3579  {
3580  // Get the time
3581  Fw::Time _logTime;
3582  if (this->isConnected_timeGetOut_OutputPort(0)) {
3583  this->timeGetOut_out(0, _logTime);
3584  }
3585 
3587 
3588  // Emit the event on the log port
3589  if (this->isConnected_eventOut_OutputPort(0)) {
3590  Fw::LogBuffer _logBuff;
3592 
3593 #if FW_AMPCS_COMPATIBLE
3594  // Serialize the number of arguments
3595  _status = _logBuff.serializeFrom(static_cast<U8>(1));
3596  FW_ASSERT(
3597  _status == Fw::FW_SERIALIZE_OK,
3598  static_cast<FwAssertArgType>(_status)
3599  );
3600 #endif
3601 
3602 #if FW_AMPCS_COMPATIBLE
3603  // Serialize the argument size
3604  _status = _logBuff.serializeFrom(
3605  static_cast<U8>(sizeof(U32))
3606  );
3607  FW_ASSERT(
3608  _status == Fw::FW_SERIALIZE_OK,
3609  static_cast<FwAssertArgType>(_status)
3610  );
3611 #endif
3612  _status = _logBuff.serializeFrom(packetId);
3613  FW_ASSERT(
3614  _status == Fw::FW_SERIALIZE_OK,
3615  static_cast<FwAssertArgType>(_status)
3616  );
3617 
3618  this->eventOut_out(
3619  0,
3620  _id,
3621  _logTime,
3623  _logBuff
3624  );
3625  }
3626 
3627  // Emit the event on the text log port
3628 #if FW_ENABLE_TEXT_LOGGING
3629  if (this->isConnected_textEventOut_OutputPort(0)) {
3630 #if FW_OBJECT_NAMES == 1
3631  const char* _formatString =
3632  "(%s) %s: packetOverrideIn reload record for unknown packet id %" PRIu32 " skipped";
3633 #else
3634  const char* _formatString =
3635  "%s: packetOverrideIn reload record for unknown packet id %" PRIu32 " skipped";
3636 #endif
3637 
3638  Fw::TextLogString _logString;
3639  (void) _logString.format(
3640  _formatString,
3641 #if FW_OBJECT_NAMES == 1
3642  this->m_objName.toChar(),
3643 #endif
3644  "ReloadRecordUnknownPacket ",
3645  packetId
3646  );
3647 
3648  this->textEventOut_out(
3649  0,
3650  _id,
3651  _logTime,
3653  _logString
3654  );
3655  }
3656 #endif
3657  }
3658 
3661  {
3662  // Check throttle value
3663  if (this->m_ConfigMirrorAllocFailedThrottle >= EVENTID_CONFIGMIRRORALLOCFAILED_THROTTLE) {
3664  return;
3665  }
3666  else {
3667  this->m_ConfigMirrorAllocFailedThrottle++;
3668  }
3669 
3670  // Get the time
3671  Fw::Time _logTime;
3672  if (this->isConnected_timeGetOut_OutputPort(0)) {
3673  this->timeGetOut_out(0, _logTime);
3674  }
3675 
3677 
3678  // Emit the event on the log port
3679  if (this->isConnected_eventOut_OutputPort(0)) {
3680  Fw::LogBuffer _logBuff;
3681 
3682 #if FW_AMPCS_COMPATIBLE
3684  // Serialize the number of arguments
3685  _status = _logBuff.serializeFrom(static_cast<U8>(0));
3686  FW_ASSERT(
3687  _status == Fw::FW_SERIALIZE_OK,
3688  static_cast<FwAssertArgType>(_status)
3689  );
3690 #endif
3691 
3692  this->eventOut_out(
3693  0,
3694  _id,
3695  _logTime,
3697  _logBuff
3698  );
3699  }
3700 
3701  // Emit the event on the text log port
3702 #if FW_ENABLE_TEXT_LOGGING
3703  if (this->isConnected_textEventOut_OutputPort(0)) {
3704 #if FW_OBJECT_NAMES == 1
3705  const char* _formatString =
3706  "(%s) %s: Could not allocate buffer to mirror packet config";
3707 #else
3708  const char* _formatString =
3709  "%s: Could not allocate buffer to mirror packet config";
3710 #endif
3711 
3712  Fw::TextLogString _logString;
3713  (void) _logString.format(
3714  _formatString,
3715 #if FW_OBJECT_NAMES == 1
3716  this->m_objName.toChar(),
3717 #endif
3718  "ConfigMirrorAllocFailed "
3719  );
3720 
3721  this->textEventOut_out(
3722  0,
3723  _id,
3724  _logTime,
3726  _logString
3727  );
3728  }
3729 #endif
3730  }
3731 
3734  const Svc::TelemetrySection& section,
3735  U32 packetId,
3736  const Svc::PacketOverrideConfig& override,
3737  const Svc::TlmSendConfig& effective
3738  ) const
3739  {
3740  // Get the time
3741  Fw::Time _logTime;
3742  if (this->isConnected_timeGetOut_OutputPort(0)) {
3743  this->timeGetOut_out(0, _logTime);
3744  }
3745 
3746  const FwEventIdType _id = this->getIdBase() + EVENTID_PACKETCONFIGREPORT;
3747 
3748  // Emit the event on the log port
3749  if (this->isConnected_eventOut_OutputPort(0)) {
3750  Fw::LogBuffer _logBuff;
3752 
3753 #if FW_AMPCS_COMPATIBLE
3754  // Serialize the number of arguments
3755  _status = _logBuff.serializeFrom(static_cast<U8>(4));
3756  FW_ASSERT(
3757  _status == Fw::FW_SERIALIZE_OK,
3758  static_cast<FwAssertArgType>(_status)
3759  );
3760 #endif
3761 
3762 #if FW_AMPCS_COMPATIBLE
3763  // Serialize the argument size
3764  _status = _logBuff.serializeFrom(
3766  );
3767  FW_ASSERT(
3768  _status == Fw::FW_SERIALIZE_OK,
3769  static_cast<FwAssertArgType>(_status)
3770  );
3771 #endif
3772  _status = _logBuff.serializeFrom(section);
3773  FW_ASSERT(
3774  _status == Fw::FW_SERIALIZE_OK,
3775  static_cast<FwAssertArgType>(_status)
3776  );
3777 
3778 #if FW_AMPCS_COMPATIBLE
3779  // Serialize the argument size
3780  _status = _logBuff.serializeFrom(
3781  static_cast<U8>(sizeof(U32))
3782  );
3783  FW_ASSERT(
3784  _status == Fw::FW_SERIALIZE_OK,
3785  static_cast<FwAssertArgType>(_status)
3786  );
3787 #endif
3788  _status = _logBuff.serializeFrom(packetId);
3789  FW_ASSERT(
3790  _status == Fw::FW_SERIALIZE_OK,
3791  static_cast<FwAssertArgType>(_status)
3792  );
3793 
3794 #if FW_AMPCS_COMPATIBLE
3795  // Serialize the argument size
3796  _status = _logBuff.serializeFrom(
3798  );
3799  FW_ASSERT(
3800  _status == Fw::FW_SERIALIZE_OK,
3801  static_cast<FwAssertArgType>(_status)
3802  );
3803 #endif
3804  _status = _logBuff.serializeFrom(override);
3805  FW_ASSERT(
3806  _status == Fw::FW_SERIALIZE_OK,
3807  static_cast<FwAssertArgType>(_status)
3808  );
3809 
3810 #if FW_AMPCS_COMPATIBLE
3811  // Serialize the argument size
3812  _status = _logBuff.serializeFrom(
3813  static_cast<U8>(Svc::TlmSendConfig::SERIALIZED_SIZE)
3814  );
3815  FW_ASSERT(
3816  _status == Fw::FW_SERIALIZE_OK,
3817  static_cast<FwAssertArgType>(_status)
3818  );
3819 #endif
3820  _status = _logBuff.serializeFrom(effective);
3821  FW_ASSERT(
3822  _status == Fw::FW_SERIALIZE_OK,
3823  static_cast<FwAssertArgType>(_status)
3824  );
3825 
3826  this->eventOut_out(
3827  0,
3828  _id,
3829  _logTime,
3831  _logBuff
3832  );
3833  }
3834 
3835  // Emit the event on the text log port
3836 #if FW_ENABLE_TEXT_LOGGING
3837  if (this->isConnected_textEventOut_OutputPort(0)) {
3838 #if FW_OBJECT_NAMES == 1
3839  const char* _formatString =
3840  "(%s) %s: Packet config: section %s packet id %" PRIu32 " override %s effective %s";
3841 #else
3842  const char* _formatString =
3843  "%s: Packet config: section %s packet id %" PRIu32 " override %s effective %s";
3844 #endif
3845 
3846  Fw::String sectionStr;
3847  section.toString(sectionStr);
3848  Fw::String overrideStr;
3849  override.toString(overrideStr);
3850  Fw::String effectiveStr;
3851  effective.toString(effectiveStr);
3852 
3853  Fw::TextLogString _logString;
3854  (void) _logString.format(
3855  _formatString,
3856 #if FW_OBJECT_NAMES == 1
3857  this->m_objName.toChar(),
3858 #endif
3859  "PacketConfigReport ",
3860  sectionStr.toChar(),
3861  packetId,
3862  overrideStr.toChar(),
3863  effectiveStr.toChar()
3864  );
3865 
3866  this->textEventOut_out(
3867  0,
3868  _id,
3869  _logTime,
3871  _logString
3872  );
3873  }
3874 #endif
3875  }
3876 
3879  const Svc::TelemetrySection& section,
3880  U32 packetId,
3881  const Svc::PacketOverrideConfig& override
3882  ) const
3883  {
3884  // Get the time
3885  Fw::Time _logTime;
3886  if (this->isConnected_timeGetOut_OutputPort(0)) {
3887  this->timeGetOut_out(0, _logTime);
3888  }
3889 
3890  const FwEventIdType _id = this->getIdBase() + EVENTID_PACKETOVERRIDESET;
3891 
3892  // Emit the event on the log port
3893  if (this->isConnected_eventOut_OutputPort(0)) {
3894  Fw::LogBuffer _logBuff;
3896 
3897 #if FW_AMPCS_COMPATIBLE
3898  // Serialize the number of arguments
3899  _status = _logBuff.serializeFrom(static_cast<U8>(3));
3900  FW_ASSERT(
3901  _status == Fw::FW_SERIALIZE_OK,
3902  static_cast<FwAssertArgType>(_status)
3903  );
3904 #endif
3905 
3906 #if FW_AMPCS_COMPATIBLE
3907  // Serialize the argument size
3908  _status = _logBuff.serializeFrom(
3910  );
3911  FW_ASSERT(
3912  _status == Fw::FW_SERIALIZE_OK,
3913  static_cast<FwAssertArgType>(_status)
3914  );
3915 #endif
3916  _status = _logBuff.serializeFrom(section);
3917  FW_ASSERT(
3918  _status == Fw::FW_SERIALIZE_OK,
3919  static_cast<FwAssertArgType>(_status)
3920  );
3921 
3922 #if FW_AMPCS_COMPATIBLE
3923  // Serialize the argument size
3924  _status = _logBuff.serializeFrom(
3925  static_cast<U8>(sizeof(U32))
3926  );
3927  FW_ASSERT(
3928  _status == Fw::FW_SERIALIZE_OK,
3929  static_cast<FwAssertArgType>(_status)
3930  );
3931 #endif
3932  _status = _logBuff.serializeFrom(packetId);
3933  FW_ASSERT(
3934  _status == Fw::FW_SERIALIZE_OK,
3935  static_cast<FwAssertArgType>(_status)
3936  );
3937 
3938 #if FW_AMPCS_COMPATIBLE
3939  // Serialize the argument size
3940  _status = _logBuff.serializeFrom(
3942  );
3943  FW_ASSERT(
3944  _status == Fw::FW_SERIALIZE_OK,
3945  static_cast<FwAssertArgType>(_status)
3946  );
3947 #endif
3948  _status = _logBuff.serializeFrom(override);
3949  FW_ASSERT(
3950  _status == Fw::FW_SERIALIZE_OK,
3951  static_cast<FwAssertArgType>(_status)
3952  );
3953 
3954  this->eventOut_out(
3955  0,
3956  _id,
3957  _logTime,
3959  _logBuff
3960  );
3961  }
3962 
3963  // Emit the event on the text log port
3964 #if FW_ENABLE_TEXT_LOGGING
3965  if (this->isConnected_textEventOut_OutputPort(0)) {
3966 #if FW_OBJECT_NAMES == 1
3967  const char* _formatString =
3968  "(%s) %s: Packet override set: section %s packet id %" PRIu32 " override %s";
3969 #else
3970  const char* _formatString =
3971  "%s: Packet override set: section %s packet id %" PRIu32 " override %s";
3972 #endif
3973 
3974  Fw::String sectionStr;
3975  section.toString(sectionStr);
3976  Fw::String overrideStr;
3977  override.toString(overrideStr);
3978 
3979  Fw::TextLogString _logString;
3980  (void) _logString.format(
3981  _formatString,
3982 #if FW_OBJECT_NAMES == 1
3983  this->m_objName.toChar(),
3984 #endif
3985  "PacketOverrideSet ",
3986  sectionStr.toChar(),
3987  packetId,
3988  overrideStr.toChar()
3989  );
3990 
3991  this->textEventOut_out(
3992  0,
3993  _id,
3994  _logTime,
3996  _logString
3997  );
3998  }
3999 #endif
4000  }
4001 
4004  const Svc::TelemetrySection& section,
4005  U32 packetId
4006  ) const
4007  {
4008  // Get the time
4009  Fw::Time _logTime;
4010  if (this->isConnected_timeGetOut_OutputPort(0)) {
4011  this->timeGetOut_out(0, _logTime);
4012  }
4013 
4015 
4016  // Emit the event on the log port
4017  if (this->isConnected_eventOut_OutputPort(0)) {
4018  Fw::LogBuffer _logBuff;
4020 
4021 #if FW_AMPCS_COMPATIBLE
4022  // Serialize the number of arguments
4023  _status = _logBuff.serializeFrom(static_cast<U8>(2));
4024  FW_ASSERT(
4025  _status == Fw::FW_SERIALIZE_OK,
4026  static_cast<FwAssertArgType>(_status)
4027  );
4028 #endif
4029 
4030 #if FW_AMPCS_COMPATIBLE
4031  // Serialize the argument size
4032  _status = _logBuff.serializeFrom(
4034  );
4035  FW_ASSERT(
4036  _status == Fw::FW_SERIALIZE_OK,
4037  static_cast<FwAssertArgType>(_status)
4038  );
4039 #endif
4040  _status = _logBuff.serializeFrom(section);
4041  FW_ASSERT(
4042  _status == Fw::FW_SERIALIZE_OK,
4043  static_cast<FwAssertArgType>(_status)
4044  );
4045 
4046 #if FW_AMPCS_COMPATIBLE
4047  // Serialize the argument size
4048  _status = _logBuff.serializeFrom(
4049  static_cast<U8>(sizeof(U32))
4050  );
4051  FW_ASSERT(
4052  _status == Fw::FW_SERIALIZE_OK,
4053  static_cast<FwAssertArgType>(_status)
4054  );
4055 #endif
4056  _status = _logBuff.serializeFrom(packetId);
4057  FW_ASSERT(
4058  _status == Fw::FW_SERIALIZE_OK,
4059  static_cast<FwAssertArgType>(_status)
4060  );
4061 
4062  this->eventOut_out(
4063  0,
4064  _id,
4065  _logTime,
4067  _logBuff
4068  );
4069  }
4070 
4071  // Emit the event on the text log port
4072 #if FW_ENABLE_TEXT_LOGGING
4073  if (this->isConnected_textEventOut_OutputPort(0)) {
4074 #if FW_OBJECT_NAMES == 1
4075  const char* _formatString =
4076  "(%s) %s: Packet override cleared: section %s packet id %" PRIu32 " reverts to group policy";
4077 #else
4078  const char* _formatString =
4079  "%s: Packet override cleared: section %s packet id %" PRIu32 " reverts to group policy";
4080 #endif
4081 
4082  Fw::String sectionStr;
4083  section.toString(sectionStr);
4084 
4085  Fw::TextLogString _logString;
4086  (void) _logString.format(
4087  _formatString,
4088 #if FW_OBJECT_NAMES == 1
4089  this->m_objName.toChar(),
4090 #endif
4091  "PacketOverrideCleared ",
4092  sectionStr.toChar(),
4093  packetId
4094  );
4095 
4096  this->textEventOut_out(
4097  0,
4098  _id,
4099  _logTime,
4101  _logString
4102  );
4103  }
4104 #endif
4105  }
4106 
4109  {
4110  // Get the time
4111  Fw::Time _logTime;
4112  if (this->isConnected_timeGetOut_OutputPort(0)) {
4113  this->timeGetOut_out(0, _logTime);
4114  }
4115 
4116  const FwEventIdType _id = this->getIdBase() + EVENTID_CONFIGRELOADFAILED;
4117 
4118  // Emit the event on the log port
4119  if (this->isConnected_eventOut_OutputPort(0)) {
4120  Fw::LogBuffer _logBuff;
4122 
4123 #if FW_AMPCS_COMPATIBLE
4124  // Serialize the number of arguments
4125  _status = _logBuff.serializeFrom(static_cast<U8>(1));
4126  FW_ASSERT(
4127  _status == Fw::FW_SERIALIZE_OK,
4128  static_cast<FwAssertArgType>(_status)
4129  );
4130 #endif
4131 
4132 #if FW_AMPCS_COMPATIBLE
4133  // Serialize the argument size
4134  _status = _logBuff.serializeFrom(
4135  static_cast<U8>(Fw::DeserialStatus::SERIALIZED_SIZE)
4136  );
4137  FW_ASSERT(
4138  _status == Fw::FW_SERIALIZE_OK,
4139  static_cast<FwAssertArgType>(_status)
4140  );
4141 #endif
4142  _status = _logBuff.serializeFrom(status);
4143  FW_ASSERT(
4144  _status == Fw::FW_SERIALIZE_OK,
4145  static_cast<FwAssertArgType>(_status)
4146  );
4147 
4148  this->eventOut_out(
4149  0,
4150  _id,
4151  _logTime,
4153  _logBuff
4154  );
4155  }
4156 
4157  // Emit the event on the text log port
4158 #if FW_ENABLE_TEXT_LOGGING
4159  if (this->isConnected_textEventOut_OutputPort(0)) {
4160 #if FW_OBJECT_NAMES == 1
4161  const char* _formatString =
4162  "(%s) %s: packetOverrideIn reload failed with status %s";
4163 #else
4164  const char* _formatString =
4165  "%s: packetOverrideIn reload failed with status %s";
4166 #endif
4167 
4168  Fw::String statusStr;
4169  status.toString(statusStr);
4170 
4171  Fw::TextLogString _logString;
4172  (void) _logString.format(
4173  _formatString,
4174 #if FW_OBJECT_NAMES == 1
4175  this->m_objName.toChar(),
4176 #endif
4177  "ConfigReloadFailed ",
4178  statusStr.toChar()
4179  );
4180 
4181  this->textEventOut_out(
4182  0,
4183  _id,
4184  _logTime,
4186  _logString
4187  );
4188  }
4189 #endif
4190  }
4191 
4194  {
4195  // Get the time
4196  Fw::Time _logTime;
4197  if (this->isConnected_timeGetOut_OutputPort(0)) {
4198  this->timeGetOut_out(0, _logTime);
4199  }
4200 
4201  const FwEventIdType _id = this->getIdBase() + EVENTID_INVALIDPACKETCONFIG;
4202 
4203  // Emit the event on the log port
4204  if (this->isConnected_eventOut_OutputPort(0)) {
4205  Fw::LogBuffer _logBuff;
4207 
4208 #if FW_AMPCS_COMPATIBLE
4209  // Serialize the number of arguments
4210  _status = _logBuff.serializeFrom(static_cast<U8>(1));
4211  FW_ASSERT(
4212  _status == Fw::FW_SERIALIZE_OK,
4213  static_cast<FwAssertArgType>(_status)
4214  );
4215 #endif
4216 
4217 #if FW_AMPCS_COMPATIBLE
4218  // Serialize the argument size
4219  _status = _logBuff.serializeFrom(
4220  static_cast<U8>(sizeof(U32))
4221  );
4222  FW_ASSERT(
4223  _status == Fw::FW_SERIALIZE_OK,
4224  static_cast<FwAssertArgType>(_status)
4225  );
4226 #endif
4227  _status = _logBuff.serializeFrom(packetId);
4228  FW_ASSERT(
4229  _status == Fw::FW_SERIALIZE_OK,
4230  static_cast<FwAssertArgType>(_status)
4231  );
4232 
4233  this->eventOut_out(
4234  0,
4235  _id,
4236  _logTime,
4238  _logBuff
4239  );
4240  }
4241 
4242  // Emit the event on the text log port
4243 #if FW_ENABLE_TEXT_LOGGING
4244  if (this->isConnected_textEventOut_OutputPort(0)) {
4245 #if FW_OBJECT_NAMES == 1
4246  const char* _formatString =
4247  "(%s) %s: Packet config for packet id %" PRIu32 " rejected: invalid section";
4248 #else
4249  const char* _formatString =
4250  "%s: Packet config for packet id %" PRIu32 " rejected: invalid section";
4251 #endif
4252 
4253  Fw::TextLogString _logString;
4254  (void) _logString.format(
4255  _formatString,
4256 #if FW_OBJECT_NAMES == 1
4257  this->m_objName.toChar(),
4258 #endif
4259  "InvalidPacketConfig ",
4260  packetId
4261  );
4262 
4263  this->textEventOut_out(
4264  0,
4265  _id,
4266  _logTime,
4268  _logString
4269  );
4270  }
4271 #endif
4272  }
4273 
4276  {
4277  // Get the time
4278  Fw::Time _logTime;
4279  if (this->isConnected_timeGetOut_OutputPort(0)) {
4280  this->timeGetOut_out(0, _logTime);
4281  }
4282 
4283  const FwEventIdType _id = this->getIdBase() + EVENTID_RELOADRECORDINVALID;
4284 
4285  // Emit the event on the log port
4286  if (this->isConnected_eventOut_OutputPort(0)) {
4287  Fw::LogBuffer _logBuff;
4289 
4290 #if FW_AMPCS_COMPATIBLE
4291  // Serialize the number of arguments
4292  _status = _logBuff.serializeFrom(static_cast<U8>(1));
4293  FW_ASSERT(
4294  _status == Fw::FW_SERIALIZE_OK,
4295  static_cast<FwAssertArgType>(_status)
4296  );
4297 #endif
4298 
4299 #if FW_AMPCS_COMPATIBLE
4300  // Serialize the argument size
4301  _status = _logBuff.serializeFrom(
4302  static_cast<U8>(sizeof(U32))
4303  );
4304  FW_ASSERT(
4305  _status == Fw::FW_SERIALIZE_OK,
4306  static_cast<FwAssertArgType>(_status)
4307  );
4308 #endif
4309  _status = _logBuff.serializeFrom(packetId);
4310  FW_ASSERT(
4311  _status == Fw::FW_SERIALIZE_OK,
4312  static_cast<FwAssertArgType>(_status)
4313  );
4314 
4315  this->eventOut_out(
4316  0,
4317  _id,
4318  _logTime,
4320  _logBuff
4321  );
4322  }
4323 
4324  // Emit the event on the text log port
4325 #if FW_ENABLE_TEXT_LOGGING
4326  if (this->isConnected_textEventOut_OutputPort(0)) {
4327 #if FW_OBJECT_NAMES == 1
4328  const char* _formatString =
4329  "(%s) %s: packetOverrideIn reload record for packet id %" PRIu32 " skipped: section out of range";
4330 #else
4331  const char* _formatString =
4332  "%s: packetOverrideIn reload record for packet id %" PRIu32 " skipped: section out of range";
4333 #endif
4334 
4335  Fw::TextLogString _logString;
4336  (void) _logString.format(
4337  _formatString,
4338 #if FW_OBJECT_NAMES == 1
4339  this->m_objName.toChar(),
4340 #endif
4341  "ReloadRecordInvalid ",
4342  packetId
4343  );
4344 
4345  this->textEventOut_out(
4346  0,
4347  _id,
4348  _logTime,
4350  _logString
4351  );
4352  }
4353 #endif
4354  }
4355 
4358  const Svc::TelemetrySection& section,
4359  FwChanIdType tlmGroup,
4360  const Svc::TlmSendState& sendState
4361  ) const
4362  {
4363  // Get the time
4364  Fw::Time _logTime;
4365  if (this->isConnected_timeGetOut_OutputPort(0)) {
4366  this->timeGetOut_out(0, _logTime);
4367  }
4368 
4369  const FwEventIdType _id = this->getIdBase() + EVENTID_GROUPSENDSTATESET;
4370 
4371  // Emit the event on the log port
4372  if (this->isConnected_eventOut_OutputPort(0)) {
4373  Fw::LogBuffer _logBuff;
4375 
4376 #if FW_AMPCS_COMPATIBLE
4377  // Serialize the number of arguments
4378  _status = _logBuff.serializeFrom(static_cast<U8>(3));
4379  FW_ASSERT(
4380  _status == Fw::FW_SERIALIZE_OK,
4381  static_cast<FwAssertArgType>(_status)
4382  );
4383 #endif
4384 
4385 #if FW_AMPCS_COMPATIBLE
4386  // Serialize the argument size
4387  _status = _logBuff.serializeFrom(
4389  );
4390  FW_ASSERT(
4391  _status == Fw::FW_SERIALIZE_OK,
4392  static_cast<FwAssertArgType>(_status)
4393  );
4394 #endif
4395  _status = _logBuff.serializeFrom(section);
4396  FW_ASSERT(
4397  _status == Fw::FW_SERIALIZE_OK,
4398  static_cast<FwAssertArgType>(_status)
4399  );
4400 
4401 #if FW_AMPCS_COMPATIBLE
4402  // Serialize the argument size
4403  _status = _logBuff.serializeFrom(
4404  static_cast<U8>(sizeof(FwChanIdType))
4405  );
4406  FW_ASSERT(
4407  _status == Fw::FW_SERIALIZE_OK,
4408  static_cast<FwAssertArgType>(_status)
4409  );
4410 #endif
4411  _status = _logBuff.serializeFrom(tlmGroup);
4412  FW_ASSERT(
4413  _status == Fw::FW_SERIALIZE_OK,
4414  static_cast<FwAssertArgType>(_status)
4415  );
4416 
4417 #if FW_AMPCS_COMPATIBLE
4418  // Serialize the argument size
4419  _status = _logBuff.serializeFrom(
4420  static_cast<U8>(Svc::TlmSendState::SERIALIZED_SIZE)
4421  );
4422  FW_ASSERT(
4423  _status == Fw::FW_SERIALIZE_OK,
4424  static_cast<FwAssertArgType>(_status)
4425  );
4426 #endif
4427  _status = _logBuff.serializeFrom(sendState);
4428  FW_ASSERT(
4429  _status == Fw::FW_SERIALIZE_OK,
4430  static_cast<FwAssertArgType>(_status)
4431  );
4432 
4433  this->eventOut_out(
4434  0,
4435  _id,
4436  _logTime,
4438  _logBuff
4439  );
4440  }
4441 
4442  // Emit the event on the text log port
4443 #if FW_ENABLE_TEXT_LOGGING
4444  if (this->isConnected_textEventOut_OutputPort(0)) {
4445 #if FW_OBJECT_NAMES == 1
4446  const char* _formatString =
4447  "(%s) %s: Section %s group %" PRIu32 " send state set to %s";
4448 #else
4449  const char* _formatString =
4450  "%s: Section %s group %" PRIu32 " send state set to %s";
4451 #endif
4452 
4453  Fw::String sectionStr;
4454  section.toString(sectionStr);
4455  Fw::String sendStateStr;
4456  sendState.toString(sendStateStr);
4457 
4458  Fw::TextLogString _logString;
4459  (void) _logString.format(
4460  _formatString,
4461 #if FW_OBJECT_NAMES == 1
4462  this->m_objName.toChar(),
4463 #endif
4464  "GroupSendStateSet ",
4465  sectionStr.toChar(),
4466  tlmGroup,
4467  sendStateStr.toChar()
4468  );
4469 
4470  this->textEventOut_out(
4471  0,
4472  _id,
4473  _logTime,
4475  _logString
4476  );
4477  }
4478 #endif
4479  }
4480 
4481  // ----------------------------------------------------------------------
4482  // Event throttle reset functions
4483  // ----------------------------------------------------------------------
4484 
4487  {
4488  // Reset throttle counter
4489  this->m_OversizedChannelThrottle = 0;
4490  }
4491 
4494  {
4495  // Reset throttle counter
4496  this->m_ConfigMirrorAllocFailedThrottle = 0;
4497  }
4498 
4499  // ----------------------------------------------------------------------
4500  // Telemetry serialized write
4501  // ----------------------------------------------------------------------
4502 
4505  FwChanIdType id,
4506  Fw::TlmBuffer& _tlmBuff,
4507  Fw::Time _tlmTime
4508  ) const
4509  {
4510  if (this->isConnected_tlmOut_OutputPort(0)) {
4511  if (
4513  (_tlmTime == Fw::ZERO_TIME)
4514  ) {
4515  this->timeGetOut_out(0, _tlmTime);
4516  }
4517 
4518  FwChanIdType _id;
4519  _id = this->getIdBase() + id;
4520 
4521  this->tlmOut_out(
4522  0,
4523  _id,
4524  _tlmTime,
4525  _tlmBuff
4526  );
4527  }
4528  }
4529 
4530  // ----------------------------------------------------------------------
4531  // Telemetry write functions
4532  // ----------------------------------------------------------------------
4533 
4537  Fw::Time _tlmTime
4538  ) const
4539  {
4540  if (this->isConnected_tlmOut_OutputPort(0)) {
4541  Fw::TlmBuffer _tlmBuff;
4542  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
4543  FW_ASSERT(
4544  _stat == Fw::FW_SERIALIZE_OK,
4545  static_cast<FwAssertArgType>(_stat)
4546  );
4547 
4548  this->tlmWrite(
4550  _tlmBuff,
4551  _tlmTime
4552  );
4553  }
4554  }
4555 
4559  Fw::Time _tlmTime
4560  ) const
4561  {
4562  if (this->isConnected_tlmOut_OutputPort(0)) {
4563  Fw::TlmBuffer _tlmBuff;
4564  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
4565  FW_ASSERT(
4566  _stat == Fw::FW_SERIALIZE_OK,
4567  static_cast<FwAssertArgType>(_stat)
4568  );
4569 
4570  this->tlmWrite(
4572  _tlmBuff,
4573  _tlmTime
4574  );
4575  }
4576  }
4577 
4578  // ----------------------------------------------------------------------
4579  // Parameter hook functions
4580  // ----------------------------------------------------------------------
4581 
4584  {
4585  // Do nothing by default
4586  }
4587 
4590  {
4591  // Do nothing by default
4592  }
4593 
4596  FwPrmIdType id,
4597  Fw::ParamValid valid
4598  )
4599  {
4600  if (FW_PARAM_OK(valid)) {
4601  this->parameterUpdated(id);
4602  }
4603  }
4604 
4605  // ----------------------------------------------------------------------
4606  // Parameter get functions
4607  // ----------------------------------------------------------------------
4608 
4611  {
4613  this->m_paramLock.lock();
4614  valid = this->m_param_SECTION_ENABLED_valid;
4615  if ((valid == Fw::ParamValid::VALID) || (valid == Fw::ParamValid::DEFAULT)) {
4616  Fw::ParamBuffer _paramBuffer;
4617  FW_ASSERT(this->paramDelegatePtr != nullptr);
4618  Fw::SerializeStatus _stat = this->paramDelegatePtr->serializeParam(
4619  static_cast<FwPrmIdType>(this->getIdBase()),
4621  _paramBuffer
4622  );
4623  if(_stat == Fw::FW_SERIALIZE_OK) {
4624  _stat = _paramBuffer.deserializeTo(_local);
4625  FW_ASSERT(_stat == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(_stat));
4626  } else {
4627  valid = Fw::ParamValid::INVALID;
4628  }
4629  }
4630  this->m_paramLock.unlock();
4631  return _local;
4632  }
4633 
4636  {
4638  this->m_paramLock.lock();
4639  valid = this->m_param_SECTION_CONFIGS_valid;
4640  if ((valid == Fw::ParamValid::VALID) || (valid == Fw::ParamValid::DEFAULT)) {
4641  Fw::ParamBuffer _paramBuffer;
4642  FW_ASSERT(this->paramDelegatePtr != nullptr);
4643  Fw::SerializeStatus _stat = this->paramDelegatePtr->serializeParam(
4644  static_cast<FwPrmIdType>(this->getIdBase()),
4646  _paramBuffer
4647  );
4648  if(_stat == Fw::FW_SERIALIZE_OK) {
4649  _stat = _paramBuffer.deserializeTo(_local);
4650  FW_ASSERT(_stat == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(_stat));
4651  } else {
4652  valid = Fw::ParamValid::INVALID;
4653  }
4654  }
4655  this->m_paramLock.unlock();
4656  return _local;
4657  }
4658 
4659  // ----------------------------------------------------------------------
4660  // External parameter delegate initialization
4661  // ----------------------------------------------------------------------
4662 
4665  {
4666  FW_ASSERT(paramExternalDelegatePtr != nullptr);
4667  this->paramDelegatePtr = paramExternalDelegatePtr;
4668  }
4669 
4670  // ----------------------------------------------------------------------
4671  // Time
4672  // ----------------------------------------------------------------------
4673 
4675  getTime() const
4676  {
4677  if (this->isConnected_timeGetOut_OutputPort(0)) {
4678  Fw::Time _time;
4679  this->timeGetOut_out(0, _time);
4680  return _time;
4681  }
4682  else {
4683  return Fw::Time(TimeBase::TB_NONE, 0, 0);
4684  }
4685  }
4686 
4687  // ----------------------------------------------------------------------
4688  // Message dispatch functions
4689  // ----------------------------------------------------------------------
4690 
4691  Fw::QueuedComponentBase::MsgDispatchStatus TlmPacketizerComponentBase ::
4692  doDispatch()
4693  {
4694  ComponentIpcSerializableBuffer _msg;
4695  FwQueuePriorityType _priority = 0;
4696 
4697  Os::Queue::Status _msgStatus = this->m_queue.receive(
4698  _msg,
4700  _priority
4701  );
4702  FW_ASSERT(
4703  _msgStatus == Os::Queue::OP_OK,
4704  static_cast<FwAssertArgType>(_msgStatus)
4705  );
4706 
4707  // Reset to beginning of buffer
4708  _msg.resetDeser();
4709 
4710  FwEnumStoreType _desMsg = 0;
4711  Fw::SerializeStatus _deserStatus = _msg.deserializeTo(_desMsg);
4712  FW_ASSERT(
4713  _deserStatus == Fw::FW_SERIALIZE_OK,
4714  static_cast<FwAssertArgType>(_deserStatus)
4715  );
4716 
4717  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
4718 
4719  if (_msgType == TLMPACKETIZER_COMPONENT_EXIT) {
4720  return MSG_DISPATCH_EXIT;
4721  }
4722 
4723  FwIndexType portNum = 0;
4724  _deserStatus = _msg.deserializeTo(portNum);
4725  FW_ASSERT(
4726  _deserStatus == Fw::FW_SERIALIZE_OK,
4727  static_cast<FwAssertArgType>(_deserStatus)
4728  );
4729 
4730  switch (_msgType) {
4731  // Handle async input port Run
4732  case RUN_SCHED: {
4733  // Deserialize argument context
4734  U32 context;
4735  _deserStatus = _msg.deserializeTo(context);
4736  FW_ASSERT(
4737  _deserStatus == Fw::FW_SERIALIZE_OK,
4738  static_cast<FwAssertArgType>(_deserStatus)
4739  );
4740  // Call handler function
4741  this->Run_handler(
4742  portNum,
4743  context
4744  );
4745 
4746  break;
4747  }
4748 
4749  // Handle async input port configureSectionGroupRate
4750  case CONFIGURESECTIONGROUPRATE_CONFIGUREGROUPRATE: {
4751  // Deserialize argument section
4752  Svc::TelemetrySection section;
4753  _deserStatus = _msg.deserializeTo(section);
4754  FW_ASSERT(
4755  _deserStatus == Fw::FW_SERIALIZE_OK,
4756  static_cast<FwAssertArgType>(_deserStatus)
4757  );
4758 
4759  // Deserialize argument tlmGroup
4760  FwChanIdType tlmGroup;
4761  _deserStatus = _msg.deserializeTo(tlmGroup);
4762  FW_ASSERT(
4763  _deserStatus == Fw::FW_SERIALIZE_OK,
4764  static_cast<FwAssertArgType>(_deserStatus)
4765  );
4766 
4767  // Deserialize argument rateLogic
4768  Svc::RateLogic rateLogic;
4769  _deserStatus = _msg.deserializeTo(rateLogic);
4770  FW_ASSERT(
4771  _deserStatus == Fw::FW_SERIALIZE_OK,
4772  static_cast<FwAssertArgType>(_deserStatus)
4773  );
4774 
4775  // Deserialize argument minDelta
4776  U32 minDelta;
4777  _deserStatus = _msg.deserializeTo(minDelta);
4778  FW_ASSERT(
4779  _deserStatus == Fw::FW_SERIALIZE_OK,
4780  static_cast<FwAssertArgType>(_deserStatus)
4781  );
4782 
4783  // Deserialize argument maxDelta
4784  U32 maxDelta;
4785  _deserStatus = _msg.deserializeTo(maxDelta);
4786  FW_ASSERT(
4787  _deserStatus == Fw::FW_SERIALIZE_OK,
4788  static_cast<FwAssertArgType>(_deserStatus)
4789  );
4790  // Call handler function
4792  portNum,
4793  section,
4794  tlmGroup,
4795  rateLogic,
4796  minDelta,
4797  maxDelta
4798  );
4799 
4800  break;
4801  }
4802 
4803  // Handle async input port controlIn
4804  case CONTROLIN_ENABLESECTION: {
4805  // Deserialize argument section
4806  Svc::TelemetrySection section;
4807  _deserStatus = _msg.deserializeTo(section);
4808  FW_ASSERT(
4809  _deserStatus == Fw::FW_SERIALIZE_OK,
4810  static_cast<FwAssertArgType>(_deserStatus)
4811  );
4812 
4813  // Deserialize argument enabled
4814  Fw::Enabled enabled;
4815  _deserStatus = _msg.deserializeTo(enabled);
4816  FW_ASSERT(
4817  _deserStatus == Fw::FW_SERIALIZE_OK,
4818  static_cast<FwAssertArgType>(_deserStatus)
4819  );
4820  // Call handler function
4821  this->controlIn_handler(
4822  portNum,
4823  section,
4824  enabled
4825  );
4826 
4827  break;
4828  }
4829 
4830  // Handle async input port packetOverrideIn
4831  case PACKETOVERRIDEIN_BUFFERSEND: {
4832  // Deserialize argument fwBuffer
4833  Fw::Buffer fwBuffer;
4834  _deserStatus = _msg.deserializeTo(fwBuffer);
4835  FW_ASSERT(
4836  _deserStatus == Fw::FW_SERIALIZE_OK,
4837  static_cast<FwAssertArgType>(_deserStatus)
4838  );
4839  // Call handler function
4841  portNum,
4842  fwBuffer
4843  );
4844 
4845  break;
4846  }
4847 
4848  // Handle async input port pingIn
4849  case PINGIN_PING: {
4850  // Deserialize argument key
4851  U32 key;
4852  _deserStatus = _msg.deserializeTo(key);
4853  FW_ASSERT(
4854  _deserStatus == Fw::FW_SERIALIZE_OK,
4855  static_cast<FwAssertArgType>(_deserStatus)
4856  );
4857  // Call handler function
4858  this->pingIn_handler(
4859  portNum,
4860  key
4861  );
4862 
4863  break;
4864  }
4865 
4866  // Handle command SET_LEVEL
4867  case CMD_SET_LEVEL: {
4868  // Deserialize opcode
4869  FwOpcodeType _opCode = 0;
4870  _deserStatus = _msg.deserializeTo(_opCode);
4871  FW_ASSERT (
4872  _deserStatus == Fw::FW_SERIALIZE_OK,
4873  static_cast<FwAssertArgType>(_deserStatus)
4874  );
4875 
4876  // Deserialize command sequence
4877  U32 _cmdSeq = 0;
4878  _deserStatus = _msg.deserializeTo(_cmdSeq);
4879  FW_ASSERT (
4880  _deserStatus == Fw::FW_SERIALIZE_OK,
4881  static_cast<FwAssertArgType>(_deserStatus)
4882  );
4883 
4884  // Deserialize command argument buffer
4885  Fw::CmdArgBuffer args;
4886  _deserStatus = _msg.deserializeTo(args);
4887  FW_ASSERT (
4888  _deserStatus == Fw::FW_SERIALIZE_OK,
4889  static_cast<FwAssertArgType>(_deserStatus)
4890  );
4891 
4892  // Reset buffer
4893  args.resetDeser();
4894 
4895  // Deserialize argument level
4896  FwChanIdType level;
4897  _deserStatus = args.deserializeTo(level);
4898  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
4900  this->cmdResponse_out(
4901  _opCode,
4902  _cmdSeq,
4904  );
4905  }
4906  // Don't crash the task if bad arguments were passed from the ground
4907  break;
4908  }
4909 
4910  // Make sure there was no data left over.
4911  // That means the argument buffer size was incorrect.
4912 #if FW_CMD_CHECK_RESIDUAL
4913  if (args.getDeserializeSizeLeft() != 0) {
4915  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4916  }
4917  // Don't crash the task if bad arguments were passed from the ground
4918  break;
4919  }
4920 #endif
4921 
4922  // Call handler function
4923  this->SET_LEVEL_cmdHandler(
4924  _opCode, _cmdSeq,
4925  level
4926  );
4927 
4928  break;
4929  }
4930 
4931  // Handle command SEND_PKT
4932  case CMD_SEND_PKT: {
4933  // Deserialize opcode
4934  FwOpcodeType _opCode = 0;
4935  _deserStatus = _msg.deserializeTo(_opCode);
4936  FW_ASSERT (
4937  _deserStatus == Fw::FW_SERIALIZE_OK,
4938  static_cast<FwAssertArgType>(_deserStatus)
4939  );
4940 
4941  // Deserialize command sequence
4942  U32 _cmdSeq = 0;
4943  _deserStatus = _msg.deserializeTo(_cmdSeq);
4944  FW_ASSERT (
4945  _deserStatus == Fw::FW_SERIALIZE_OK,
4946  static_cast<FwAssertArgType>(_deserStatus)
4947  );
4948 
4949  // Deserialize command argument buffer
4950  Fw::CmdArgBuffer args;
4951  _deserStatus = _msg.deserializeTo(args);
4952  FW_ASSERT (
4953  _deserStatus == Fw::FW_SERIALIZE_OK,
4954  static_cast<FwAssertArgType>(_deserStatus)
4955  );
4956 
4957  // Reset buffer
4958  args.resetDeser();
4959 
4960  // Deserialize argument id
4961  U32 id;
4962  _deserStatus = args.deserializeTo(id);
4963  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
4965  this->cmdResponse_out(
4966  _opCode,
4967  _cmdSeq,
4969  );
4970  }
4971  // Don't crash the task if bad arguments were passed from the ground
4972  break;
4973  }
4974 
4975  // Deserialize argument section
4976  Svc::TelemetrySection section;
4977  _deserStatus = args.deserializeTo(section);
4978  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
4980  this->cmdResponse_out(
4981  _opCode,
4982  _cmdSeq,
4984  );
4985  }
4986  // Don't crash the task if bad arguments were passed from the ground
4987  break;
4988  }
4989 
4990  // Make sure there was no data left over.
4991  // That means the argument buffer size was incorrect.
4992 #if FW_CMD_CHECK_RESIDUAL
4993  if (args.getDeserializeSizeLeft() != 0) {
4995  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
4996  }
4997  // Don't crash the task if bad arguments were passed from the ground
4998  break;
4999  }
5000 #endif
5001 
5002  // Call handler function
5003  this->SEND_PKT_cmdHandler(
5004  _opCode, _cmdSeq,
5005  id,
5006  section
5007  );
5008 
5009  break;
5010  }
5011 
5012  // Handle command ENABLE_SECTION
5013  case CMD_ENABLE_SECTION: {
5014  // Deserialize opcode
5015  FwOpcodeType _opCode = 0;
5016  _deserStatus = _msg.deserializeTo(_opCode);
5017  FW_ASSERT (
5018  _deserStatus == Fw::FW_SERIALIZE_OK,
5019  static_cast<FwAssertArgType>(_deserStatus)
5020  );
5021 
5022  // Deserialize command sequence
5023  U32 _cmdSeq = 0;
5024  _deserStatus = _msg.deserializeTo(_cmdSeq);
5025  FW_ASSERT (
5026  _deserStatus == Fw::FW_SERIALIZE_OK,
5027  static_cast<FwAssertArgType>(_deserStatus)
5028  );
5029 
5030  // Deserialize command argument buffer
5031  Fw::CmdArgBuffer args;
5032  _deserStatus = _msg.deserializeTo(args);
5033  FW_ASSERT (
5034  _deserStatus == Fw::FW_SERIALIZE_OK,
5035  static_cast<FwAssertArgType>(_deserStatus)
5036  );
5037 
5038  // Reset buffer
5039  args.resetDeser();
5040 
5041  // Deserialize argument section
5042  Svc::TelemetrySection section;
5043  _deserStatus = args.deserializeTo(section);
5044  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5046  this->cmdResponse_out(
5047  _opCode,
5048  _cmdSeq,
5050  );
5051  }
5052  // Don't crash the task if bad arguments were passed from the ground
5053  break;
5054  }
5055 
5056  // Deserialize argument enable
5057  Fw::Enabled enable;
5058  _deserStatus = args.deserializeTo(enable);
5059  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5061  this->cmdResponse_out(
5062  _opCode,
5063  _cmdSeq,
5065  );
5066  }
5067  // Don't crash the task if bad arguments were passed from the ground
5068  break;
5069  }
5070 
5071  // Make sure there was no data left over.
5072  // That means the argument buffer size was incorrect.
5073 #if FW_CMD_CHECK_RESIDUAL
5074  if (args.getDeserializeSizeLeft() != 0) {
5076  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5077  }
5078  // Don't crash the task if bad arguments were passed from the ground
5079  break;
5080  }
5081 #endif
5082 
5083  // Call handler function
5085  _opCode, _cmdSeq,
5086  section,
5087  enable
5088  );
5089 
5090  break;
5091  }
5092 
5093  // Handle command CONFIGURE_GROUP_SEND
5094  case CMD_CONFIGURE_GROUP_SEND: {
5095  // Deserialize opcode
5096  FwOpcodeType _opCode = 0;
5097  _deserStatus = _msg.deserializeTo(_opCode);
5098  FW_ASSERT (
5099  _deserStatus == Fw::FW_SERIALIZE_OK,
5100  static_cast<FwAssertArgType>(_deserStatus)
5101  );
5102 
5103  // Deserialize command sequence
5104  U32 _cmdSeq = 0;
5105  _deserStatus = _msg.deserializeTo(_cmdSeq);
5106  FW_ASSERT (
5107  _deserStatus == Fw::FW_SERIALIZE_OK,
5108  static_cast<FwAssertArgType>(_deserStatus)
5109  );
5110 
5111  // Deserialize command argument buffer
5112  Fw::CmdArgBuffer args;
5113  _deserStatus = _msg.deserializeTo(args);
5114  FW_ASSERT (
5115  _deserStatus == Fw::FW_SERIALIZE_OK,
5116  static_cast<FwAssertArgType>(_deserStatus)
5117  );
5118 
5119  // Reset buffer
5120  args.resetDeser();
5121 
5122  // Deserialize argument section
5123  Svc::TelemetrySection section;
5124  _deserStatus = args.deserializeTo(section);
5125  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5127  this->cmdResponse_out(
5128  _opCode,
5129  _cmdSeq,
5131  );
5132  }
5133  // Don't crash the task if bad arguments were passed from the ground
5134  break;
5135  }
5136 
5137  // Deserialize argument tlmGroup
5138  FwChanIdType tlmGroup;
5139  _deserStatus = args.deserializeTo(tlmGroup);
5140  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5142  this->cmdResponse_out(
5143  _opCode,
5144  _cmdSeq,
5146  );
5147  }
5148  // Don't crash the task if bad arguments were passed from the ground
5149  break;
5150  }
5151 
5152  // Deserialize argument sendState
5153  Svc::TlmSendState sendState;
5154  _deserStatus = args.deserializeTo(sendState);
5155  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5157  this->cmdResponse_out(
5158  _opCode,
5159  _cmdSeq,
5161  );
5162  }
5163  // Don't crash the task if bad arguments were passed from the ground
5164  break;
5165  }
5166 
5167  // Make sure there was no data left over.
5168  // That means the argument buffer size was incorrect.
5169 #if FW_CMD_CHECK_RESIDUAL
5170  if (args.getDeserializeSizeLeft() != 0) {
5172  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5173  }
5174  // Don't crash the task if bad arguments were passed from the ground
5175  break;
5176  }
5177 #endif
5178 
5179  // Call handler function
5181  _opCode, _cmdSeq,
5182  section,
5183  tlmGroup,
5184  sendState
5185  );
5186 
5187  break;
5188  }
5189 
5190  // Handle command CONFIGURE_GROUP_RATES
5191  case CMD_CONFIGURE_GROUP_RATES: {
5192  // Deserialize opcode
5193  FwOpcodeType _opCode = 0;
5194  _deserStatus = _msg.deserializeTo(_opCode);
5195  FW_ASSERT (
5196  _deserStatus == Fw::FW_SERIALIZE_OK,
5197  static_cast<FwAssertArgType>(_deserStatus)
5198  );
5199 
5200  // Deserialize command sequence
5201  U32 _cmdSeq = 0;
5202  _deserStatus = _msg.deserializeTo(_cmdSeq);
5203  FW_ASSERT (
5204  _deserStatus == Fw::FW_SERIALIZE_OK,
5205  static_cast<FwAssertArgType>(_deserStatus)
5206  );
5207 
5208  // Deserialize command argument buffer
5209  Fw::CmdArgBuffer args;
5210  _deserStatus = _msg.deserializeTo(args);
5211  FW_ASSERT (
5212  _deserStatus == Fw::FW_SERIALIZE_OK,
5213  static_cast<FwAssertArgType>(_deserStatus)
5214  );
5215 
5216  // Reset buffer
5217  args.resetDeser();
5218 
5219  // Deserialize argument section
5220  Svc::TelemetrySection section;
5221  _deserStatus = args.deserializeTo(section);
5222  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5224  this->cmdResponse_out(
5225  _opCode,
5226  _cmdSeq,
5228  );
5229  }
5230  // Don't crash the task if bad arguments were passed from the ground
5231  break;
5232  }
5233 
5234  // Deserialize argument tlmGroup
5235  FwChanIdType tlmGroup;
5236  _deserStatus = args.deserializeTo(tlmGroup);
5237  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5239  this->cmdResponse_out(
5240  _opCode,
5241  _cmdSeq,
5243  );
5244  }
5245  // Don't crash the task if bad arguments were passed from the ground
5246  break;
5247  }
5248 
5249  // Deserialize argument rateLogic
5250  Svc::RateLogic rateLogic;
5251  _deserStatus = args.deserializeTo(rateLogic);
5252  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5254  this->cmdResponse_out(
5255  _opCode,
5256  _cmdSeq,
5258  );
5259  }
5260  // Don't crash the task if bad arguments were passed from the ground
5261  break;
5262  }
5263 
5264  // Deserialize argument minDelta
5265  U32 minDelta;
5266  _deserStatus = args.deserializeTo(minDelta);
5267  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5269  this->cmdResponse_out(
5270  _opCode,
5271  _cmdSeq,
5273  );
5274  }
5275  // Don't crash the task if bad arguments were passed from the ground
5276  break;
5277  }
5278 
5279  // Deserialize argument maxDelta
5280  U32 maxDelta;
5281  _deserStatus = args.deserializeTo(maxDelta);
5282  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5284  this->cmdResponse_out(
5285  _opCode,
5286  _cmdSeq,
5288  );
5289  }
5290  // Don't crash the task if bad arguments were passed from the ground
5291  break;
5292  }
5293 
5294  // Make sure there was no data left over.
5295  // That means the argument buffer size was incorrect.
5296 #if FW_CMD_CHECK_RESIDUAL
5297  if (args.getDeserializeSizeLeft() != 0) {
5299  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5300  }
5301  // Don't crash the task if bad arguments were passed from the ground
5302  break;
5303  }
5304 #endif
5305 
5306  // Call handler function
5308  _opCode, _cmdSeq,
5309  section,
5310  tlmGroup,
5311  rateLogic,
5312  minDelta,
5313  maxDelta
5314  );
5315 
5316  break;
5317  }
5318 
5319  // Handle command GET_PACKET_CONFIG
5320  case CMD_GET_PACKET_CONFIG: {
5321  // Deserialize opcode
5322  FwOpcodeType _opCode = 0;
5323  _deserStatus = _msg.deserializeTo(_opCode);
5324  FW_ASSERT (
5325  _deserStatus == Fw::FW_SERIALIZE_OK,
5326  static_cast<FwAssertArgType>(_deserStatus)
5327  );
5328 
5329  // Deserialize command sequence
5330  U32 _cmdSeq = 0;
5331  _deserStatus = _msg.deserializeTo(_cmdSeq);
5332  FW_ASSERT (
5333  _deserStatus == Fw::FW_SERIALIZE_OK,
5334  static_cast<FwAssertArgType>(_deserStatus)
5335  );
5336 
5337  // Deserialize command argument buffer
5338  Fw::CmdArgBuffer args;
5339  _deserStatus = _msg.deserializeTo(args);
5340  FW_ASSERT (
5341  _deserStatus == Fw::FW_SERIALIZE_OK,
5342  static_cast<FwAssertArgType>(_deserStatus)
5343  );
5344 
5345  // Reset buffer
5346  args.resetDeser();
5347 
5348  // Deserialize argument section
5349  Svc::TelemetrySection section;
5350  _deserStatus = args.deserializeTo(section);
5351  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5353  this->cmdResponse_out(
5354  _opCode,
5355  _cmdSeq,
5357  );
5358  }
5359  // Don't crash the task if bad arguments were passed from the ground
5360  break;
5361  }
5362 
5363  // Deserialize argument packetId
5364  U32 packetId;
5365  _deserStatus = args.deserializeTo(packetId);
5366  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5368  this->cmdResponse_out(
5369  _opCode,
5370  _cmdSeq,
5372  );
5373  }
5374  // Don't crash the task if bad arguments were passed from the ground
5375  break;
5376  }
5377 
5378  // Make sure there was no data left over.
5379  // That means the argument buffer size was incorrect.
5380 #if FW_CMD_CHECK_RESIDUAL
5381  if (args.getDeserializeSizeLeft() != 0) {
5383  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5384  }
5385  // Don't crash the task if bad arguments were passed from the ground
5386  break;
5387  }
5388 #endif
5389 
5390  // Call handler function
5392  _opCode, _cmdSeq,
5393  section,
5394  packetId
5395  );
5396 
5397  break;
5398  }
5399 
5400  // Handle command OVERRIDE_PACKET_SEND
5401  case CMD_OVERRIDE_PACKET_SEND: {
5402  // Deserialize opcode
5403  FwOpcodeType _opCode = 0;
5404  _deserStatus = _msg.deserializeTo(_opCode);
5405  FW_ASSERT (
5406  _deserStatus == Fw::FW_SERIALIZE_OK,
5407  static_cast<FwAssertArgType>(_deserStatus)
5408  );
5409 
5410  // Deserialize command sequence
5411  U32 _cmdSeq = 0;
5412  _deserStatus = _msg.deserializeTo(_cmdSeq);
5413  FW_ASSERT (
5414  _deserStatus == Fw::FW_SERIALIZE_OK,
5415  static_cast<FwAssertArgType>(_deserStatus)
5416  );
5417 
5418  // Deserialize command argument buffer
5419  Fw::CmdArgBuffer args;
5420  _deserStatus = _msg.deserializeTo(args);
5421  FW_ASSERT (
5422  _deserStatus == Fw::FW_SERIALIZE_OK,
5423  static_cast<FwAssertArgType>(_deserStatus)
5424  );
5425 
5426  // Reset buffer
5427  args.resetDeser();
5428 
5429  // Deserialize argument section
5430  Svc::TelemetrySection section;
5431  _deserStatus = args.deserializeTo(section);
5432  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5434  this->cmdResponse_out(
5435  _opCode,
5436  _cmdSeq,
5438  );
5439  }
5440  // Don't crash the task if bad arguments were passed from the ground
5441  break;
5442  }
5443 
5444  // Deserialize argument packetId
5445  U32 packetId;
5446  _deserStatus = args.deserializeTo(packetId);
5447  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5449  this->cmdResponse_out(
5450  _opCode,
5451  _cmdSeq,
5453  );
5454  }
5455  // Don't crash the task if bad arguments were passed from the ground
5456  break;
5457  }
5458 
5459  // Deserialize argument sendState
5460  Svc::TlmSendState sendState;
5461  _deserStatus = args.deserializeTo(sendState);
5462  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5464  this->cmdResponse_out(
5465  _opCode,
5466  _cmdSeq,
5468  );
5469  }
5470  // Don't crash the task if bad arguments were passed from the ground
5471  break;
5472  }
5473 
5474  // Make sure there was no data left over.
5475  // That means the argument buffer size was incorrect.
5476 #if FW_CMD_CHECK_RESIDUAL
5477  if (args.getDeserializeSizeLeft() != 0) {
5479  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5480  }
5481  // Don't crash the task if bad arguments were passed from the ground
5482  break;
5483  }
5484 #endif
5485 
5486  // Call handler function
5488  _opCode, _cmdSeq,
5489  section,
5490  packetId,
5491  sendState
5492  );
5493 
5494  break;
5495  }
5496 
5497  // Handle command OVERRIDE_PACKET_RATES
5498  case CMD_OVERRIDE_PACKET_RATES: {
5499  // Deserialize opcode
5500  FwOpcodeType _opCode = 0;
5501  _deserStatus = _msg.deserializeTo(_opCode);
5502  FW_ASSERT (
5503  _deserStatus == Fw::FW_SERIALIZE_OK,
5504  static_cast<FwAssertArgType>(_deserStatus)
5505  );
5506 
5507  // Deserialize command sequence
5508  U32 _cmdSeq = 0;
5509  _deserStatus = _msg.deserializeTo(_cmdSeq);
5510  FW_ASSERT (
5511  _deserStatus == Fw::FW_SERIALIZE_OK,
5512  static_cast<FwAssertArgType>(_deserStatus)
5513  );
5514 
5515  // Deserialize command argument buffer
5516  Fw::CmdArgBuffer args;
5517  _deserStatus = _msg.deserializeTo(args);
5518  FW_ASSERT (
5519  _deserStatus == Fw::FW_SERIALIZE_OK,
5520  static_cast<FwAssertArgType>(_deserStatus)
5521  );
5522 
5523  // Reset buffer
5524  args.resetDeser();
5525 
5526  // Deserialize argument section
5527  Svc::TelemetrySection section;
5528  _deserStatus = args.deserializeTo(section);
5529  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5531  this->cmdResponse_out(
5532  _opCode,
5533  _cmdSeq,
5535  );
5536  }
5537  // Don't crash the task if bad arguments were passed from the ground
5538  break;
5539  }
5540 
5541  // Deserialize argument packetId
5542  U32 packetId;
5543  _deserStatus = args.deserializeTo(packetId);
5544  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5546  this->cmdResponse_out(
5547  _opCode,
5548  _cmdSeq,
5550  );
5551  }
5552  // Don't crash the task if bad arguments were passed from the ground
5553  break;
5554  }
5555 
5556  // Deserialize argument rateLogic
5557  Svc::RateLogic rateLogic;
5558  _deserStatus = args.deserializeTo(rateLogic);
5559  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5561  this->cmdResponse_out(
5562  _opCode,
5563  _cmdSeq,
5565  );
5566  }
5567  // Don't crash the task if bad arguments were passed from the ground
5568  break;
5569  }
5570 
5571  // Deserialize argument minDelta
5572  U32 minDelta;
5573  _deserStatus = args.deserializeTo(minDelta);
5574  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5576  this->cmdResponse_out(
5577  _opCode,
5578  _cmdSeq,
5580  );
5581  }
5582  // Don't crash the task if bad arguments were passed from the ground
5583  break;
5584  }
5585 
5586  // Deserialize argument maxDelta
5587  U32 maxDelta;
5588  _deserStatus = args.deserializeTo(maxDelta);
5589  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5591  this->cmdResponse_out(
5592  _opCode,
5593  _cmdSeq,
5595  );
5596  }
5597  // Don't crash the task if bad arguments were passed from the ground
5598  break;
5599  }
5600 
5601  // Make sure there was no data left over.
5602  // That means the argument buffer size was incorrect.
5603 #if FW_CMD_CHECK_RESIDUAL
5604  if (args.getDeserializeSizeLeft() != 0) {
5606  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5607  }
5608  // Don't crash the task if bad arguments were passed from the ground
5609  break;
5610  }
5611 #endif
5612 
5613  // Call handler function
5615  _opCode, _cmdSeq,
5616  section,
5617  packetId,
5618  rateLogic,
5619  minDelta,
5620  maxDelta
5621  );
5622 
5623  break;
5624  }
5625 
5626  // Handle command CLEAR_PACKET_OVERRIDE
5627  case CMD_CLEAR_PACKET_OVERRIDE: {
5628  // Deserialize opcode
5629  FwOpcodeType _opCode = 0;
5630  _deserStatus = _msg.deserializeTo(_opCode);
5631  FW_ASSERT (
5632  _deserStatus == Fw::FW_SERIALIZE_OK,
5633  static_cast<FwAssertArgType>(_deserStatus)
5634  );
5635 
5636  // Deserialize command sequence
5637  U32 _cmdSeq = 0;
5638  _deserStatus = _msg.deserializeTo(_cmdSeq);
5639  FW_ASSERT (
5640  _deserStatus == Fw::FW_SERIALIZE_OK,
5641  static_cast<FwAssertArgType>(_deserStatus)
5642  );
5643 
5644  // Deserialize command argument buffer
5645  Fw::CmdArgBuffer args;
5646  _deserStatus = _msg.deserializeTo(args);
5647  FW_ASSERT (
5648  _deserStatus == Fw::FW_SERIALIZE_OK,
5649  static_cast<FwAssertArgType>(_deserStatus)
5650  );
5651 
5652  // Reset buffer
5653  args.resetDeser();
5654 
5655  // Deserialize argument section
5656  Svc::TelemetrySection section;
5657  _deserStatus = args.deserializeTo(section);
5658  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5660  this->cmdResponse_out(
5661  _opCode,
5662  _cmdSeq,
5664  );
5665  }
5666  // Don't crash the task if bad arguments were passed from the ground
5667  break;
5668  }
5669 
5670  // Deserialize argument packetId
5671  U32 packetId;
5672  _deserStatus = args.deserializeTo(packetId);
5673  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
5675  this->cmdResponse_out(
5676  _opCode,
5677  _cmdSeq,
5679  );
5680  }
5681  // Don't crash the task if bad arguments were passed from the ground
5682  break;
5683  }
5684 
5685  // Make sure there was no data left over.
5686  // That means the argument buffer size was incorrect.
5687 #if FW_CMD_CHECK_RESIDUAL
5688  if (args.getDeserializeSizeLeft() != 0) {
5690  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
5691  }
5692  // Don't crash the task if bad arguments were passed from the ground
5693  break;
5694  }
5695 #endif
5696 
5697  // Call handler function
5699  _opCode, _cmdSeq,
5700  section,
5701  packetId
5702  );
5703 
5704  break;
5705  }
5706 
5707  default:
5708  return MSG_DISPATCH_ERROR;
5709  }
5710 
5711  return MSG_DISPATCH_OK;
5712  }
5713 
5714  // ----------------------------------------------------------------------
5715  // Calls for messages received on special input ports
5716  // ----------------------------------------------------------------------
5717 
5718  void TlmPacketizerComponentBase ::
5719  m_p_cmdIn_in(
5720  Fw::PassiveComponentBase* callComp,
5721  FwIndexType portNum,
5722  FwOpcodeType opCode,
5723  U32 cmdSeq,
5724  Fw::CmdArgBuffer& args
5725  )
5726  {
5727  FW_ASSERT(callComp != nullptr);
5728  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
5729  compPtr->cmdIn_handlerBase(
5730  portNum,
5731  opCode,
5732  cmdSeq,
5733  args
5734  );
5735  }
5736 
5737  // ----------------------------------------------------------------------
5738  // Calls for messages received on typed input ports
5739  // ----------------------------------------------------------------------
5740 
5741  void TlmPacketizerComponentBase ::
5742  m_p_Run_in(
5743  Fw::PassiveComponentBase* callComp,
5744  FwIndexType portNum,
5745  U32 context
5746  )
5747  {
5748  FW_ASSERT(callComp != nullptr);
5749  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
5750  compPtr->Run_handlerBase(
5751  portNum,
5752  context
5753  );
5754  }
5755 
5756  Fw::TlmValid TlmPacketizerComponentBase ::
5757  m_p_TlmGet_in(
5758  Fw::PassiveComponentBase* callComp,
5759  FwIndexType portNum,
5760  FwChanIdType id,
5761  Fw::Time& timeTag,
5762  Fw::TlmBuffer& val
5763  )
5764  {
5765  FW_ASSERT(callComp != nullptr);
5766  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
5767  return compPtr->TlmGet_handlerBase(
5768  portNum,
5769  id,
5770  timeTag,
5771  val
5772  );
5773  }
5774 
5775  void TlmPacketizerComponentBase ::
5776  m_p_TlmRecv_in(
5777  Fw::PassiveComponentBase* callComp,
5778  FwIndexType portNum,
5779  FwChanIdType id,
5780  Fw::Time& timeTag,
5781  Fw::TlmBuffer& val
5782  )
5783  {
5784  FW_ASSERT(callComp != nullptr);
5785  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
5786  compPtr->TlmRecv_handlerBase(
5787  portNum,
5788  id,
5789  timeTag,
5790  val
5791  );
5792  }
5793 
5794  void TlmPacketizerComponentBase ::
5795  m_p_configureSectionGroupRate_in(
5796  Fw::PassiveComponentBase* callComp,
5797  FwIndexType portNum,
5798  const Svc::TelemetrySection& section,
5799  FwChanIdType tlmGroup,
5800  const Svc::RateLogic& rateLogic,
5801  U32 minDelta,
5802  U32 maxDelta
5803  )
5804  {
5805  FW_ASSERT(callComp != nullptr);
5806  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
5807  compPtr->configureSectionGroupRate_handlerBase(
5808  portNum,
5809  section,
5810  tlmGroup,
5811  rateLogic,
5812  minDelta,
5813  maxDelta
5814  );
5815  }
5816 
5817  void TlmPacketizerComponentBase ::
5818  m_p_controlIn_in(
5819  Fw::PassiveComponentBase* callComp,
5820  FwIndexType portNum,
5821  const Svc::TelemetrySection& section,
5822  const Fw::Enabled& enabled
5823  )
5824  {
5825  FW_ASSERT(callComp != nullptr);
5826  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
5827  compPtr->controlIn_handlerBase(
5828  portNum,
5829  section,
5830  enabled
5831  );
5832  }
5833 
5834  void TlmPacketizerComponentBase ::
5835  m_p_packetOverrideIn_in(
5836  Fw::PassiveComponentBase* callComp,
5837  FwIndexType portNum,
5838  Fw::Buffer& fwBuffer
5839  )
5840  {
5841  FW_ASSERT(callComp != nullptr);
5842  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
5843  compPtr->packetOverrideIn_handlerBase(
5844  portNum,
5845  fwBuffer
5846  );
5847  }
5848 
5849  void TlmPacketizerComponentBase ::
5850  m_p_packetOverrideReturnIn_in(
5851  Fw::PassiveComponentBase* callComp,
5852  FwIndexType portNum,
5853  Fw::Buffer& fwBuffer
5854  )
5855  {
5856  FW_ASSERT(callComp != nullptr);
5857  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
5858  compPtr->packetOverrideReturnIn_handlerBase(
5859  portNum,
5860  fwBuffer
5861  );
5862  }
5863 
5864  void TlmPacketizerComponentBase ::
5865  m_p_pingIn_in(
5866  Fw::PassiveComponentBase* callComp,
5867  FwIndexType portNum,
5868  U32 key
5869  )
5870  {
5871  FW_ASSERT(callComp != nullptr);
5872  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
5873  compPtr->pingIn_handlerBase(
5874  portNum,
5875  key
5876  );
5877  }
5878 
5879 #if !FW_DIRECT_PORT_CALLS
5880 
5881  // ----------------------------------------------------------------------
5882  // Invocation functions for special output ports
5883  // ----------------------------------------------------------------------
5884 
5885  void TlmPacketizerComponentBase ::
5886  cmdRegOut_out(
5887  FwIndexType portNum,
5888  FwOpcodeType opCode
5889  ) const
5890  {
5891  FW_ASSERT(
5892  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
5893  static_cast<FwAssertArgType>(portNum)
5894  );
5895 
5896  FW_ASSERT(
5897  this->m_cmdRegOut_OutputPort[portNum].isConnected(),
5898  static_cast<FwAssertArgType>(portNum)
5899  );
5900  this->m_cmdRegOut_OutputPort[portNum].invoke(
5901  opCode
5902  );
5903  }
5904 
5905  void TlmPacketizerComponentBase ::
5906  cmdResponseOut_out(
5907  FwIndexType portNum,
5908  FwOpcodeType opCode,
5909  U32 cmdSeq,
5910  const Fw::CmdResponse& response
5911  ) const
5912  {
5913  FW_ASSERT(
5914  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
5915  static_cast<FwAssertArgType>(portNum)
5916  );
5917 
5918  FW_ASSERT(
5919  this->m_cmdResponseOut_OutputPort[portNum].isConnected(),
5920  static_cast<FwAssertArgType>(portNum)
5921  );
5922  this->m_cmdResponseOut_OutputPort[portNum].invoke(
5923  opCode,
5924  cmdSeq,
5925  response
5926  );
5927  }
5928 
5929  void TlmPacketizerComponentBase ::
5930  eventOut_out(
5931  FwIndexType portNum,
5932  FwEventIdType id,
5933  Fw::Time& timeTag,
5934  const Fw::LogSeverity& severity,
5935  Fw::LogBuffer& args
5936  ) const
5937  {
5938  FW_ASSERT(
5939  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
5940  static_cast<FwAssertArgType>(portNum)
5941  );
5942 
5943  FW_ASSERT(
5944  this->m_eventOut_OutputPort[portNum].isConnected(),
5945  static_cast<FwAssertArgType>(portNum)
5946  );
5947  this->m_eventOut_OutputPort[portNum].invoke(
5948  id,
5949  timeTag,
5950  severity,
5951  args
5952  );
5953  }
5954 
5955  Fw::ParamValid TlmPacketizerComponentBase ::
5956  paramGetOut_out(
5957  FwIndexType portNum,
5958  FwPrmIdType id,
5959  Fw::ParamBuffer& val
5960  ) const
5961  {
5962  FW_ASSERT(
5963  (0 <= portNum) && (portNum < this->getNum_paramGetOut_OutputPorts()),
5964  static_cast<FwAssertArgType>(portNum)
5965  );
5966 
5967  FW_ASSERT(
5968  this->m_paramGetOut_OutputPort[portNum].isConnected(),
5969  static_cast<FwAssertArgType>(portNum)
5970  );
5971  return this->m_paramGetOut_OutputPort[portNum].invoke(
5972  id,
5973  val
5974  );
5975  }
5976 
5977  void TlmPacketizerComponentBase ::
5978  paramSetOut_out(
5979  FwIndexType portNum,
5980  FwPrmIdType id,
5981  Fw::ParamBuffer& val
5982  ) const
5983  {
5984  FW_ASSERT(
5985  (0 <= portNum) && (portNum < this->getNum_paramSetOut_OutputPorts()),
5986  static_cast<FwAssertArgType>(portNum)
5987  );
5988 
5989  FW_ASSERT(
5990  this->m_paramSetOut_OutputPort[portNum].isConnected(),
5991  static_cast<FwAssertArgType>(portNum)
5992  );
5993  this->m_paramSetOut_OutputPort[portNum].invoke(
5994  id,
5995  val
5996  );
5997  }
5998 
5999 #if FW_ENABLE_TEXT_LOGGING
6000 
6001  void TlmPacketizerComponentBase ::
6002  textEventOut_out(
6003  FwIndexType portNum,
6004  FwEventIdType id,
6005  Fw::Time& timeTag,
6006  const Fw::LogSeverity& severity,
6007  Fw::TextLogString& text
6008  ) const
6009  {
6010  FW_ASSERT(
6011  (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
6012  static_cast<FwAssertArgType>(portNum)
6013  );
6014 
6015  FW_ASSERT(
6016  this->m_textEventOut_OutputPort[portNum].isConnected(),
6017  static_cast<FwAssertArgType>(portNum)
6018  );
6019  this->m_textEventOut_OutputPort[portNum].invoke(
6020  id,
6021  timeTag,
6022  severity,
6023  text
6024  );
6025  }
6026 
6027 #endif
6028 
6029  void TlmPacketizerComponentBase ::
6030  timeGetOut_out(
6031  FwIndexType portNum,
6032  Fw::Time& time
6033  ) const
6034  {
6035  FW_ASSERT(
6036  (0 <= portNum) && (portNum < this->getNum_timeGetOut_OutputPorts()),
6037  static_cast<FwAssertArgType>(portNum)
6038  );
6039 
6040  FW_ASSERT(
6041  this->m_timeGetOut_OutputPort[portNum].isConnected(),
6042  static_cast<FwAssertArgType>(portNum)
6043  );
6044  this->m_timeGetOut_OutputPort[portNum].invoke(
6045  time
6046  );
6047  }
6048 
6049  void TlmPacketizerComponentBase ::
6050  tlmOut_out(
6051  FwIndexType portNum,
6052  FwChanIdType id,
6053  Fw::Time& timeTag,
6054  Fw::TlmBuffer& val
6055  ) const
6056  {
6057  FW_ASSERT(
6058  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
6059  static_cast<FwAssertArgType>(portNum)
6060  );
6061 
6062  FW_ASSERT(
6063  this->m_tlmOut_OutputPort[portNum].isConnected(),
6064  static_cast<FwAssertArgType>(portNum)
6065  );
6066  this->m_tlmOut_OutputPort[portNum].invoke(
6067  id,
6068  timeTag,
6069  val
6070  );
6071  }
6072 
6073 #endif
6074 
6075  // ----------------------------------------------------------------------
6076  // Parameter set functions
6077  // ----------------------------------------------------------------------
6078 
6079  Fw::CmdResponse TlmPacketizerComponentBase ::
6080  paramSet_SECTION_ENABLED(Fw::SerialBufferBase& val)
6081  {
6082  Fw::CmdResponse _response{};
6083 
6084  this->m_paramLock.lock();
6085  // Update the external parameter
6086  FW_ASSERT(this->paramDelegatePtr != nullptr);
6087  const Fw::SerializeStatus _stat = this->paramDelegatePtr->deserializeParam(
6088  static_cast<FwPrmIdType>(this->getIdBase()),
6091  val
6092  );
6093  // Set response and update component state
6094  if (_stat == Fw::FW_SERIALIZE_OK) {
6095  this->m_param_SECTION_ENABLED_valid = Fw::ParamValid::VALID;
6096  _response = Fw::CmdResponse::OK;
6097  }
6098  else {
6099  this->m_param_SECTION_ENABLED_valid = Fw::ParamValid::INVALID;
6101  }
6102  this->m_paramLock.unlock();
6103 
6104  // Call notifier
6105  if (_response == Fw::CmdResponse::OK) {
6107  }
6108  return _response;
6109  }
6110 
6111  Fw::CmdResponse TlmPacketizerComponentBase ::
6112  paramSet_SECTION_CONFIGS(Fw::SerialBufferBase& val)
6113  {
6114  Fw::CmdResponse _response{};
6115 
6116  this->m_paramLock.lock();
6117  // Update the external parameter
6118  FW_ASSERT(this->paramDelegatePtr != nullptr);
6119  const Fw::SerializeStatus _stat = this->paramDelegatePtr->deserializeParam(
6120  static_cast<FwPrmIdType>(this->getIdBase()),
6123  val
6124  );
6125  // Set response and update component state
6126  if (_stat == Fw::FW_SERIALIZE_OK) {
6127  this->m_param_SECTION_CONFIGS_valid = Fw::ParamValid::VALID;
6128  _response = Fw::CmdResponse::OK;
6129  }
6130  else {
6131  this->m_param_SECTION_CONFIGS_valid = Fw::ParamValid::INVALID;
6133  }
6134  this->m_paramLock.unlock();
6135 
6136  // Call notifier
6137  if (_response == Fw::CmdResponse::OK) {
6139  }
6140  return _response;
6141  }
6142 
6143  // ----------------------------------------------------------------------
6144  // Parameter save functions
6145  // ----------------------------------------------------------------------
6146 
6147  Fw::CmdResponse TlmPacketizerComponentBase ::
6148  paramSave_SECTION_ENABLED()
6149  {
6150  if (!this->isConnected_paramSetOut_OutputPort(0)) {
6152  }
6153  Fw::ParamBuffer _paramBuffer;
6154  const FwIdType idBase = this->getIdBase();
6156  // Serialize the parameter
6157  this->m_paramLock.lock();
6158  if ((this->m_param_SECTION_ENABLED_valid == Fw::ParamValid::VALID) || (this->m_param_SECTION_ENABLED_valid == Fw::ParamValid::DEFAULT)) {
6159  FW_ASSERT(this->paramDelegatePtr != nullptr);
6160  _stat = this->paramDelegatePtr->serializeParam(
6161  static_cast<FwPrmIdType>(idBase),
6163  _paramBuffer
6164  );
6165  }
6166  this->m_paramLock.unlock();
6167  if (_stat != Fw::FW_SERIALIZE_OK) {
6169  }
6170  // Save the parameter
6171  this->paramSetOut_out(
6172  0,
6173  static_cast<FwPrmIdType>(idBase + PARAMID_SECTION_ENABLED),
6174  _paramBuffer
6175  );
6176  // Return the command response
6177  return Fw::CmdResponse::OK;
6178  }
6179 
6180  Fw::CmdResponse TlmPacketizerComponentBase ::
6181  paramSave_SECTION_CONFIGS()
6182  {
6183  if (!this->isConnected_paramSetOut_OutputPort(0)) {
6185  }
6186  Fw::ParamBuffer _paramBuffer;
6187  const FwIdType idBase = this->getIdBase();
6189  // Serialize the parameter
6190  this->m_paramLock.lock();
6191  if ((this->m_param_SECTION_CONFIGS_valid == Fw::ParamValid::VALID) || (this->m_param_SECTION_CONFIGS_valid == Fw::ParamValid::DEFAULT)) {
6192  FW_ASSERT(this->paramDelegatePtr != nullptr);
6193  _stat = this->paramDelegatePtr->serializeParam(
6194  static_cast<FwPrmIdType>(idBase),
6196  _paramBuffer
6197  );
6198  }
6199  this->m_paramLock.unlock();
6200  if (_stat != Fw::FW_SERIALIZE_OK) {
6202  }
6203  // Save the parameter
6204  this->paramSetOut_out(
6205  0,
6206  static_cast<FwPrmIdType>(idBase + PARAMID_SECTION_CONFIGS),
6207  _paramBuffer
6208  );
6209  // Return the command response
6210  return Fw::CmdResponse::OK;
6211  }
6212 
6213 }
bool isConnected_PktSend_OutputPort(FwIndexType portNum) const
static constexpr FwIndexType getNum_packetOverrideIn_InputPorts()
static constexpr FwSizeType CAPACITY
Serialization/Deserialization operation was successful.
void CLEAR_PACKET_OVERRIDE_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void SEND_PKT_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:157
Svc::InputEnableSectionPort * get_controlIn_InputPort(FwIndexType portNum)
void invoke(Fw::ComBuffer &data, U32 context) const
Invoke a port connection.
Definition: ComPortAc.cpp:181
bool isConnected_packetOverrideOut_OutputPort(FwIndexType portNum) const
void init()
Initialization function.
Definition: ComPortAc.cpp:162
static constexpr FwSizeType CAPACITY
Definition: CmdPortAc.hpp:36
void set_PktSend_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to PktSend[portNum].
virtual void packetOverrideIn_preMsgHook(FwIndexType portNum, Fw::Buffer &fwBuffer)
Pre-message hook for async input port packetOverrideIn.
void OVERRIDE_PACKET_SEND_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
A packetOverrideIn reload record carried a section out of range; the record was skipped.
FwIdType FwOpcodeType
The type of a command opcode.
bool isConnected_eventOut_OutputPort(FwIndexType portNum) const
Operation succeeded.
Definition: Os.hpp:27
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
#define FW_PARAM_OK(paramValid)
Definition: ParamValid.hpp:22
PlatformSizeType FwSizeType
void tlmWrite_GroupConfigs(const Svc::TlmPacketizer_SectionConfigs &arg, Fw::Time _tlmTime=Fw::Time()) const
bool isConnected_tlmOut_OutputPort(FwIndexType portNum) const
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
Definition: Queue.cpp:71
Fw::InputCmdPort * get_cmdIn_InputPort(FwIndexType portNum)
I32 FwEnumStoreType
static constexpr FwIndexType getNum_cmdResponseOut_OutputPorts()
bool isConnected_paramGetOut_OutputPort(FwIndexType portNum) const
Send policy of a group or packet. Resolution: packet -> group -> section enable.
Enabled state.
void log_ACTIVITY_HI_LevelSet(FwChanIdType level) const
void init()
Initialization function.
Svc::InputConfigureGroupRatePort * get_configureSectionGroupRate_InputPort(FwIndexType portNum)
virtual void TlmRecv_handler(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)=0
Handler for input port TlmRecv.
void Run_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port Run.
virtual void parameterLoaded(FwPrmIdType id, Fw::ParamValid valid)
Called for each parameter when parameters are loaded.
Status
status returned from the queue send function
Definition: Queue.hpp:30
Telemetry send policy (send state + rates), shared by the per-group config and per-packet override...
Set the rate logic and Min / Max deltas between successive packets of a group on a section...
void set_allocate_OutputPort(FwIndexType portNum, Fw::InputBufferGetPort *port)
Connect port to allocate[portNum].
void log_ACTIVITY_HI_GroupSendStateSet(const Svc::TelemetrySection &section, FwChanIdType tlmGroup, const Svc::TlmSendState &sendState) const
void init()
Initialization function.
Definition: SchedPortAc.cpp:73
Deserialization status.
static constexpr FwIndexType getNum_PktSend_OutputPorts()
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
BYTE pingInPortSize[Svc::PingPortBuffer::CAPACITY]
void init()
Initialization function.
Definition: CmdPortAc.cpp:89
SerializeStatus deserializeTo(U8 &val, Endianness mode=Endianness::BIG) override
Deserialize an 8-bit unsigned integer value.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: TlmPortAc.cpp:95
virtual SerializeStatus deserializeParam(const FwPrmIdType base_id, const FwPrmIdType local_id, const ParamValid prmStat, SerialBufferBase &buff)=0
FwIdType FwPrmIdType
The type of a parameter identifier.
static constexpr FwSizeType CAPACITY
void log_WARNING_LO_NoChan(FwChanIdType Id) const
The size of the serial representation.
static constexpr FwIndexType getNum_pingIn_InputPorts()
void log_ACTIVITY_HI_PacketSent(U32 packetId) const
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.
bool isConnected_allocate_OutputPort(FwIndexType portNum) const
virtual SerializeStatus serializeParam(const FwPrmIdType base_id, const FwPrmIdType local_id, SerialBufferBase &buff) const =0
void invoke(U32 key) const
Invoke a port connection.
Definition: PingPortAc.cpp:170
void TlmRecv_handlerBase(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Handler base-class function for input port TlmRecv.
void controlIn_handlerBase(FwIndexType portNum, const Svc::TelemetrySection &section, const Fw::Enabled &enabled)
Handler base-class function for input port controlIn.
Per-packet override: which fields apply and their values.
void set_packetOverrideReturnOut_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to packetOverrideReturnOut[portNum].
const Time ZERO_TIME
Definition: Time.cpp:5
virtual void SEND_PKT_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, U32 id, const Svc::TelemetrySection &section)=0
bool isConnected_pingOut_OutputPort(FwIndexType portNum) const
void log_ACTIVITY_HI_PacketOverrideCleared(const Svc::TelemetrySection &section, U32 packetId) const
void packetOverrideIn_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port packetOverrideIn.
virtual void controlIn_handler(FwIndexType portNum, const Svc::TelemetrySection &section, const Fw::Enabled &enabled)=0
Handler for input port controlIn.
virtual void packetOverrideIn_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port packetOverrideIn.
virtual void OVERRIDE_PACKET_SEND_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Svc::TelemetrySection &section, U32 packetId, const Svc::TlmSendState &sendState)=0
void log_WARNING_LO_ReloadRecordInvalid(U32 packetId) const
void init()
Initialization function.
Definition: TlmPortAc.cpp:171
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
Enum representing a command response.
void init()
Initialization function.
Definition: TlmPortAc.cpp:89
No time base has been established (Required)
bool isConnected_paramSetOut_OutputPort(FwIndexType portNum) const
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
void log_ACTIVITY_HI_PacketOverrideSet(const Svc::TelemetrySection &section, U32 packetId, const Svc::PacketOverrideConfig &override) const
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
Send on updates after MIN ticks since last send.
void cmdIn_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Handler base-class function for input port cmdIn.
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
The size of the serial representation.
Fw::InputBufferSendPort * get_packetOverrideReturnIn_InputPort(FwIndexType portNum)
virtual void SET_LEVEL_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, FwChanIdType level)=0
void log_WARNING_LO_PacketNotFound(U32 packetId) const
void init()
Initialization function.
void CONFIGURE_GROUP_SEND_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
virtual void packetOverrideReturnIn_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port packetOverrideReturnIn.
Os::Queue m_queue
queue object for active component
void log_WARNING_LO_InvalidPacketConfig(U32 packetId) const
void loadParameters()
Load the parameters from a parameter source.
void set_paramSetOut_OutputPort(FwIndexType portNum, Fw::InputPrmSetPort *port)
Connect port to paramSetOut[portNum].
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:177
virtual ~TlmPacketizerComponentBase()
Destroy TlmPacketizerComponentBase object.
void addCallPort(InputPrmGetPort *callPort)
Register an input port.
void tlmWrite_SectionEnabled(const Svc::TlmPacketizer_SectionEnabled &arg, Fw::Time _tlmTime=Fw::Time()) const
Write telemetry channel SectionEnabled.
static constexpr FwIndexType getNum_deallocate_OutputPorts()
void set_pingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
void init()
Object initializer.
Definition: ObjBase.cpp:24
void set_deallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to deallocate[portNum].
SerializeStatus
forward declaration for string
void registerExternalParameters(Fw::ParamExternalDelegate *paramExternalDelegatePtr)
Initialize the external parameter delegate.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: CmdPortAc.cpp:95
void addCallPort(InputBufferGetPort *callPort)
Register an input port.
void OVERRIDE_PACKET_RATES_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
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.
bool isConnected_deallocate_OutputPort(FwIndexType portNum) const
A command carried an invalid section for a per-packet operation.
FwIdType FwEventIdType
The type of an event identifier.
A packetOverrideIn reload buffer was malformed: a record failed to deserialize; later records were no...
virtual void OVERRIDE_PACKET_RATES_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command OVERRIDE_PACKET_RATES.
virtual void CLEAR_PACKET_OVERRIDE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Svc::TelemetrySection &section, U32 packetId)=0
void invoke(FwOpcodeType opCode) const
Invoke a port connection.
static constexpr FwSizeType CAPACITY
Definition: PingPortAc.hpp:34
static constexpr FwIndexType getNum_packetOverrideOut_OutputPorts()
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:40
virtual void ENABLE_SECTION_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Svc::TelemetrySection &section, const Fw::Enabled &enable)=0
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
void init()
Initialization function.
Definition: TimePortAc.cpp:151
static constexpr FwIndexType getNum_cmdRegOut_OutputPorts()
Data was the wrong format (e.g. wrong packet type)
Fw::InputTlmGetPort * get_TlmGet_InputPort(FwIndexType portNum)
void log_WARNING_LO_SectionUnconfigurable(const Svc::TelemetrySection &section, const Fw::Enabled &enable) const
Log event SectionUnconfigurable.
The size of the serial representation.
bool isConnected_timeGetOut_OutputPort(FwIndexType portNum) const
virtual void CONFIGURE_GROUP_RATES_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CONFIGURE_GROUP_RATES.
void GET_PACKET_CONFIG_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
void log_WARNING_HI_OversizedChannel_ThrottleClear()
Reset throttle value for OversizedChannel.
virtual void Run_preMsgHook(FwIndexType portNum, U32 context)
Pre-message hook for async input port Run.
Enumeration for rate logic types for telemetry groups.
A less serious but recoverable event.
void invoke(Fw::Buffer &fwBuffer) const
Invoke a port connection.
Fw::ParamValid invoke(FwPrmIdType id, Fw::ParamBuffer &val) const
Telemetry value larger than the configured channel size.
void tlmWrite(FwChanIdType id, Fw::TlmBuffer &_tlmBuff, Fw::Time _tlmTime=Fw::Time()) const
void init()
Initialization function.
Definition: PingPortAc.cpp:151
void init()
Initialization function.
void addCallPort(InputBufferSendPort *callPort)
Register an input port.
bool isConnected_cmdResponseOut_OutputPort(FwIndexType portNum) const
Packet: use the group&#39;s state; group: use the section enable (default)
static constexpr FwIndexType getNum_timeGetOut_OutputPorts()
void deallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer) const
Invoke output port deallocate.
void invoke(Fw::Time &time) const
Invoke a port connection.
Definition: TimePortAc.cpp:170
static constexpr FwIndexType getNum_paramGetOut_OutputPorts()
Could not allocate a buffer to mirror a per-packet override out packetOverrideOut.
Serializable::SizeType getDeserializeSizeLeft() const override
Get remaining deserialization buffer size.
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke a port connection.
FwIdType FwChanIdType
The type of a telemetry channel identifier.
void addCallPort(InputPingPort *callPort)
Register an input port.
Definition: PingPortAc.cpp:157
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
Definition: Queue.cpp:54
void resetDeser() override
Reset deserialization pointer to beginning of buffer.
void resetSer() override
Reset serialization pointer to beginning of buffer.
virtual void CLEAR_PACKET_OVERRIDE_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CLEAR_PACKET_OVERRIDE.
static constexpr FwIndexType getNum_packetOverrideReturnOut_OutputPorts()
virtual void pingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port pingIn.
A serious but recoverable event.
Fw::Buffer allocate_out(FwIndexType portNum, FwSizeType size) const
Invoke output port allocate.
static constexpr FwIndexType getNum_packetOverrideReturnIn_InputPorts()
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port connection.
Definition: TlmPortAc.cpp:190
virtual void OVERRIDE_PACKET_RATES_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Svc::TelemetrySection &section, U32 packetId, const Svc::RateLogic &rateLogic, U32 minDelta, U32 maxDelta)=0
const char * toChar() const
Convert to a C-style char*.
void set_eventOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to eventOut[portNum].
bool isConnected() const
Definition: PortBase.cpp:38
virtual void GET_PACKET_CONFIG_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command GET_PACKET_CONFIG.
Enum representing event severity.
static constexpr FwIndexType getNum_tlmOut_OutputPorts()
Clear a single packet&#39;s override. The packet follows its group again.
The size of the serial representation.
void log_WARNING_HI_ConfigReloadFailed(const Fw::DeserialStatus &status) const
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
#define PRI_FwIndexType
A per-packet override was applied by command; carries the stored override.
Enabled and disabled states.
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:58
Fw::TlmValid TlmGet_handlerBase(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Handler base-class function for input port TlmGet.
void init()
Initialization function.
Definition: LogPortAc.cpp:180
Command successfully executed.
virtual void Run_handler(FwIndexType portNum, U32 context)=0
Handler for input port Run.
A packet&#39;s override and effective configuration, emitted in response to GET_PACKET_CONFIG.
void setPortNum(FwIndexType portNum)
void init()
Initialization function.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
bool isConnected_packetOverrideReturnOut_OutputPort(FwIndexType portNum) const
BlockingType
message type
Definition: Queue.hpp:46
static constexpr FwIndexType getNum_eventOut_OutputPorts()
Fw::Buffer invoke(FwSizeType size) const
A packetOverrideIn reload record referenced a packet id not in this deployment; the record was skippe...
void log_ACTIVITY_HI_PacketConfigReport(const Svc::TelemetrySection &section, U32 packetId, const Svc::PacketOverrideConfig &override, const Svc::TlmSendConfig &effective) const
Command failed to deserialize.
Telemetry channel is not part of a telemetry packet.
void lock()
lock the mutex and assert success
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
Command had execution error.
Important informational events.
void init()
Initialization function.
message to exit active component task
Svc::TlmPacketizer_SectionEnabled paramGet_SECTION_ENABLED(Fw::ParamValid &valid)
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: SchedPortAc.cpp:79
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port connection.
Definition: LogPortAc.cpp:199
void PktSend_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context) const
Invoke output port PktSend.
static constexpr FwIndexType getNum_paramSetOut_OutputPorts()
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
A per-packet override was cleared by command; the packet reverts to its group policy.
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.
Fw::InputBufferSendPort * get_packetOverrideIn_InputPort(FwIndexType portNum)
void log_WARNING_LO_ReloadRecordUnknownPacket(U32 packetId) const
A message was sent requesting an exit of the loop.
Override the rate logic and thresholds of a single packet (send state follows the group unless also o...
static constexpr FwIndexType getNum_allocate_OutputPorts()
PlatformIndexType FwIndexType
TlmPacketizerComponentBase(const char *compName="")
Construct TlmPacketizerComponentBase object.
static constexpr FwIndexType getNum_configureSectionGroupRate_InputPorts()
void packetOverrideOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer) const
Invoke output port packetOverrideOut.
virtual void parametersLoaded()
Called whenever parameters are loaded.
void set_timeGetOut_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeGetOut[portNum].
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:186
virtual void OVERRIDE_PACKET_SEND_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command OVERRIDE_PACKET_SEND.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void log_WARNING_HI_OversizedChannel(FwChanIdType Id, FwSizeType valSize, FwSizeType expected)
void ENABLE_SECTION_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void init()
Initialization function.
virtual void SEND_PKT_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command SEND_PKT.
void incNumMsgDropped()
increment the number of messages dropped
void init()
Initialization function.
Definition: PingPortAc.cpp:73
void unlock()
alias for unLock to meet BasicLockable requirements
void init()
Initialization function.
void init()
Initialization function.
Report a packet&#39;s override and effective configuration (PacketConfigReport event) ...
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.
void packetOverrideReturnOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer) const
Invoke output port packetOverrideReturnOut.
virtual void parameterUpdated(FwPrmIdType id)
Called whenever a parameter is updated.
message sent/received okay
Definition: Queue.hpp:31
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Enum representing parameter validity.
bool isConnected_cmdRegOut_OutputPort(FwIndexType portNum) const
U8 BYTE
byte type
Definition: BasicTypes.h:57
Svc::InputSchedPort * get_Run_InputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_TlmGet_InputPorts()
void invoke(FwPrmIdType id, Fw::ParamBuffer &val) const
Invoke a port connection.
The size of the serial representation.
Override the send state of a single packet in a section (rates follow the group unless also overridde...
void addCallPort(InputComPort *callPort)
Register an input port.
Definition: ComPortAc.cpp:168
void packetOverrideReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port packetOverrideReturnIn.
Fw::InputTlmPort * get_TlmRecv_InputPort(FwIndexType portNum)
virtual void CONFIGURE_GROUP_RATES_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Svc::TelemetrySection &section, FwChanIdType tlmGroup, const Svc::RateLogic &rateLogic, U32 minDelta, U32 maxDelta)=0
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: PingPortAc.cpp:79
Svc::TlmPacketizer_SectionConfigs paramGet_SECTION_CONFIGS(Fw::ParamValid &valid)
static constexpr FwIndexType getNum_controlIn_InputPorts()
virtual void ENABLE_SECTION_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command ENABLE_SECTION.
void regCommands()
Register commands with the Command Dispatcher.
Message will return with status when space is unavailable.
Definition: Queue.hpp:48
Implementation of malloc based allocator.
void set_packetOverrideOut_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to packetOverrideOut[portNum].
void init()
Initialization function.
void init()
Initialization function.
void pingOut_out(FwIndexType portNum, U32 key) const
Invoke output port pingOut.
void CONFIGURE_GROUP_RATES_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void SET_LEVEL_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
virtual void SET_LEVEL_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command SET_LEVEL.
static constexpr FwIndexType getNum_pingOut_OutputPorts()
#define FW_ASSERT(...)
Definition: Assert.hpp:14
void log_WARNING_HI_ConfigMirrorAllocFailed_ThrottleClear()
Reset throttle value for ConfigMirrorAllocFailed.
static constexpr FwSizeType CAPACITY
Definition: SchedPortAc.hpp:34
void set_paramGetOut_OutputPort(FwIndexType portNum, Fw::InputPrmGetPort *port)
Connect port to paramGetOut[portNum].
virtual void CONFIGURE_GROUP_SEND_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CONFIGURE_GROUP_SEND.
static constexpr FwIndexType getNum_Run_InputPorts()
A group&#39;s send state was set by CONFIGURE_GROUP_SEND.
void set_cmdResponseOut_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
virtual void GET_PACKET_CONFIG_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Svc::TelemetrySection &section, U32 packetId)=0
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.
virtual void CONFIGURE_GROUP_SEND_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Svc::TelemetrySection &section, FwChanIdType tlmGroup, const Svc::TlmSendState &sendState)=0
static constexpr FwIndexType getNum_TlmRecv_InputPorts()
U32 FwIdType
The id type.
BYTE cmdPortSize[Fw::CmdPortBuffer::CAPACITY]
void set_cmdRegOut_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to cmdRegOut[portNum].
static constexpr FwIndexType getNum_cmdIn_InputPorts()