F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
TlmPacketizerComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title TlmPacketizerComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for TlmPacketizer component base class
5 // ======================================================================
6 
7 #include "Fw/Types/Assert.hpp"
9 #if FW_ENABLE_TEXT_LOGGING
10 #include "Fw/Types/String.hpp"
11 #endif
13 
14 namespace Svc {
15 
16  namespace {
17  enum MsgTypeEnum {
18  TLMPACKETIZER_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT,
19  RUN_SCHED,
20  PINGIN_PING,
21  CMD_SET_LEVEL,
22  CMD_SEND_PKT,
23  };
24 
25  // Get the max size by constructing a union of the async input, command, and
26  // internal port serialization sizes
27  union BuffUnion {
31  };
32 
33  // Define a message buffer class large enough to handle all the
34  // asynchronous inputs to the component
35  class ComponentIpcSerializableBuffer :
37  {
38 
39  public:
40 
41  enum {
42  // Offset into data in buffer: Size of message ID and port number
43  DATA_OFFSET = sizeof(FwEnumStoreType) + sizeof(FwIndexType),
44  // Max data size
45  MAX_DATA_SIZE = sizeof(BuffUnion),
46  // Max message size: Size of message id + size of port + max data size
47  SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
48  };
49 
50  Fw::Serializable::SizeType getBuffCapacity() const {
51  return sizeof(m_buff);
52  }
53 
54  U8* getBuffAddr() {
55  return m_buff;
56  }
57 
58  const U8* getBuffAddr() const {
59  return m_buff;
60  }
61 
62  private:
63  // Should be the max of all the input ports serialized sizes...
64  U8 m_buff[SERIALIZATION_SIZE];
65 
66  };
67  }
68 
69  // ----------------------------------------------------------------------
70  // Component initialization
71  // ----------------------------------------------------------------------
72 
75  FwSizeType queueDepth,
76  FwEnumStoreType instance
77  )
78  {
79  // Initialize base class
81 
82  // Connect input port cmdIn
83  for (
84  FwIndexType port = 0;
85  port < static_cast<FwIndexType>(this->getNum_cmdIn_InputPorts());
86  port++
87  ) {
88  this->m_cmdIn_InputPort[port].init();
89  this->m_cmdIn_InputPort[port].addCallComp(
90  this,
91  m_p_cmdIn_in
92  );
93  this->m_cmdIn_InputPort[port].setPortNum(port);
94 
95 #if FW_OBJECT_NAMES == 1
96  Fw::ObjectName portName;
97  portName.format(
98  "%s_cmdIn_InputPort[%" PRI_FwIndexType "]",
99  this->m_objName.toChar(),
100  port
101  );
102  this->m_cmdIn_InputPort[port].setObjName(portName.toChar());
103 #endif
104  }
105 
106  // Connect input port Run
107  for (
108  FwIndexType port = 0;
109  port < static_cast<FwIndexType>(this->getNum_Run_InputPorts());
110  port++
111  ) {
112  this->m_Run_InputPort[port].init();
113  this->m_Run_InputPort[port].addCallComp(
114  this,
115  m_p_Run_in
116  );
117  this->m_Run_InputPort[port].setPortNum(port);
118 
119 #if FW_OBJECT_NAMES == 1
120  Fw::ObjectName portName;
121  portName.format(
122  "%s_Run_InputPort[%" PRI_FwIndexType "]",
123  this->m_objName.toChar(),
124  port
125  );
126  this->m_Run_InputPort[port].setObjName(portName.toChar());
127 #endif
128  }
129 
130  // Connect input port TlmGet
131  for (
132  FwIndexType port = 0;
133  port < static_cast<FwIndexType>(this->getNum_TlmGet_InputPorts());
134  port++
135  ) {
136  this->m_TlmGet_InputPort[port].init();
137  this->m_TlmGet_InputPort[port].addCallComp(
138  this,
139  m_p_TlmGet_in
140  );
141  this->m_TlmGet_InputPort[port].setPortNum(port);
142 
143 #if FW_OBJECT_NAMES == 1
144  Fw::ObjectName portName;
145  portName.format(
146  "%s_TlmGet_InputPort[%" PRI_FwIndexType "]",
147  this->m_objName.toChar(),
148  port
149  );
150  this->m_TlmGet_InputPort[port].setObjName(portName.toChar());
151 #endif
152  }
153 
154  // Connect input port TlmRecv
155  for (
156  FwIndexType port = 0;
157  port < static_cast<FwIndexType>(this->getNum_TlmRecv_InputPorts());
158  port++
159  ) {
160  this->m_TlmRecv_InputPort[port].init();
161  this->m_TlmRecv_InputPort[port].addCallComp(
162  this,
163  m_p_TlmRecv_in
164  );
165  this->m_TlmRecv_InputPort[port].setPortNum(port);
166 
167 #if FW_OBJECT_NAMES == 1
168  Fw::ObjectName portName;
169  portName.format(
170  "%s_TlmRecv_InputPort[%" PRI_FwIndexType "]",
171  this->m_objName.toChar(),
172  port
173  );
174  this->m_TlmRecv_InputPort[port].setObjName(portName.toChar());
175 #endif
176  }
177 
178  // Connect input port pingIn
179  for (
180  FwIndexType port = 0;
181  port < static_cast<FwIndexType>(this->getNum_pingIn_InputPorts());
182  port++
183  ) {
184  this->m_pingIn_InputPort[port].init();
185  this->m_pingIn_InputPort[port].addCallComp(
186  this,
187  m_p_pingIn_in
188  );
189  this->m_pingIn_InputPort[port].setPortNum(port);
190 
191 #if FW_OBJECT_NAMES == 1
192  Fw::ObjectName portName;
193  portName.format(
194  "%s_pingIn_InputPort[%" PRI_FwIndexType "]",
195  this->m_objName.toChar(),
196  port
197  );
198  this->m_pingIn_InputPort[port].setObjName(portName.toChar());
199 #endif
200  }
201 
202  // Connect output port cmdRegOut
203  for (
204  FwIndexType port = 0;
205  port < static_cast<FwIndexType>(this->getNum_cmdRegOut_OutputPorts());
206  port++
207  ) {
208  this->m_cmdRegOut_OutputPort[port].init();
209 
210 #if FW_OBJECT_NAMES == 1
211  Fw::ObjectName portName;
212  portName.format(
213  "%s_cmdRegOut_OutputPort[%" PRI_FwIndexType "]",
214  this->m_objName.toChar(),
215  port
216  );
217  this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar());
218 #endif
219  }
220 
221  // Connect output port cmdResponseOut
222  for (
223  FwIndexType port = 0;
224  port < static_cast<FwIndexType>(this->getNum_cmdResponseOut_OutputPorts());
225  port++
226  ) {
227  this->m_cmdResponseOut_OutputPort[port].init();
228 
229 #if FW_OBJECT_NAMES == 1
230  Fw::ObjectName portName;
231  portName.format(
232  "%s_cmdResponseOut_OutputPort[%" PRI_FwIndexType "]",
233  this->m_objName.toChar(),
234  port
235  );
236  this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar());
237 #endif
238  }
239 
240  // Connect output port eventOut
241  for (
242  FwIndexType port = 0;
243  port < static_cast<FwIndexType>(this->getNum_eventOut_OutputPorts());
244  port++
245  ) {
246  this->m_eventOut_OutputPort[port].init();
247 
248 #if FW_OBJECT_NAMES == 1
249  Fw::ObjectName portName;
250  portName.format(
251  "%s_eventOut_OutputPort[%" PRI_FwIndexType "]",
252  this->m_objName.toChar(),
253  port
254  );
255  this->m_eventOut_OutputPort[port].setObjName(portName.toChar());
256 #endif
257  }
258 
259 #if FW_ENABLE_TEXT_LOGGING == 1
260  // Connect output port textEventOut
261  for (
262  FwIndexType port = 0;
263  port < static_cast<FwIndexType>(this->getNum_textEventOut_OutputPorts());
264  port++
265  ) {
266  this->m_textEventOut_OutputPort[port].init();
267 
268 #if FW_OBJECT_NAMES == 1
269  Fw::ObjectName portName;
270  portName.format(
271  "%s_textEventOut_OutputPort[%" PRI_FwIndexType "]",
272  this->m_objName.toChar(),
273  port
274  );
275  this->m_textEventOut_OutputPort[port].setObjName(portName.toChar());
276 #endif
277  }
278 #endif
279 
280  // Connect output port timeGetOut
281  for (
282  FwIndexType port = 0;
283  port < static_cast<FwIndexType>(this->getNum_timeGetOut_OutputPorts());
284  port++
285  ) {
286  this->m_timeGetOut_OutputPort[port].init();
287 
288 #if FW_OBJECT_NAMES == 1
289  Fw::ObjectName portName;
290  portName.format(
291  "%s_timeGetOut_OutputPort[%" PRI_FwIndexType "]",
292  this->m_objName.toChar(),
293  port
294  );
295  this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar());
296 #endif
297  }
298 
299  // Connect output port tlmOut
300  for (
301  FwIndexType port = 0;
302  port < static_cast<FwIndexType>(this->getNum_tlmOut_OutputPorts());
303  port++
304  ) {
305  this->m_tlmOut_OutputPort[port].init();
306 
307 #if FW_OBJECT_NAMES == 1
308  Fw::ObjectName portName;
309  portName.format(
310  "%s_tlmOut_OutputPort[%" PRI_FwIndexType "]",
311  this->m_objName.toChar(),
312  port
313  );
314  this->m_tlmOut_OutputPort[port].setObjName(portName.toChar());
315 #endif
316  }
317 
318  // Connect output port PktSend
319  for (
320  FwIndexType port = 0;
321  port < static_cast<FwIndexType>(this->getNum_PktSend_OutputPorts());
322  port++
323  ) {
324  this->m_PktSend_OutputPort[port].init();
325 
326 #if FW_OBJECT_NAMES == 1
327  Fw::ObjectName portName;
328  portName.format(
329  "%s_PktSend_OutputPort[%" PRI_FwIndexType "]",
330  this->m_objName.toChar(),
331  port
332  );
333  this->m_PktSend_OutputPort[port].setObjName(portName.toChar());
334 #endif
335  }
336 
337  // Connect output port pingOut
338  for (
339  FwIndexType port = 0;
340  port < static_cast<FwIndexType>(this->getNum_pingOut_OutputPorts());
341  port++
342  ) {
343  this->m_pingOut_OutputPort[port].init();
344 
345 #if FW_OBJECT_NAMES == 1
346  Fw::ObjectName portName;
347  portName.format(
348  "%s_pingOut_OutputPort[%" PRI_FwIndexType "]",
349  this->m_objName.toChar(),
350  port
351  );
352  this->m_pingOut_OutputPort[port].setObjName(portName.toChar());
353 #endif
354  }
355 
356  // Create the queue
357  Os::Queue::Status qStat = this->createQueue(
358  queueDepth,
359  static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
360  );
361  FW_ASSERT(
362  Os::Queue::Status::OP_OK == qStat,
363  static_cast<FwAssertArgType>(qStat)
364  );
365  }
366 
367  // ----------------------------------------------------------------------
368  // Getters for special input ports
369  // ----------------------------------------------------------------------
370 
373  {
374  FW_ASSERT(
375  (0 <= portNum) && (portNum < this->getNum_cmdIn_InputPorts()),
376  static_cast<FwAssertArgType>(portNum)
377  );
378 
379  return &this->m_cmdIn_InputPort[portNum];
380  }
381 
382  // ----------------------------------------------------------------------
383  // Getters for typed input ports
384  // ----------------------------------------------------------------------
385 
388  {
389  FW_ASSERT(
390  (0 <= portNum) && (portNum < this->getNum_Run_InputPorts()),
391  static_cast<FwAssertArgType>(portNum)
392  );
393 
394  return &this->m_Run_InputPort[portNum];
395  }
396 
399  {
400  FW_ASSERT(
401  (0 <= portNum) && (portNum < this->getNum_TlmGet_InputPorts()),
402  static_cast<FwAssertArgType>(portNum)
403  );
404 
405  return &this->m_TlmGet_InputPort[portNum];
406  }
407 
410  {
411  FW_ASSERT(
412  (0 <= portNum) && (portNum < this->getNum_TlmRecv_InputPorts()),
413  static_cast<FwAssertArgType>(portNum)
414  );
415 
416  return &this->m_TlmRecv_InputPort[portNum];
417  }
418 
421  {
422  FW_ASSERT(
423  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
424  static_cast<FwAssertArgType>(portNum)
425  );
426 
427  return &this->m_pingIn_InputPort[portNum];
428  }
429 
430  // ----------------------------------------------------------------------
431  // Connect input ports to special output ports
432  // ----------------------------------------------------------------------
433 
436  FwIndexType portNum,
437  Fw::InputCmdRegPort* port
438  )
439  {
440  FW_ASSERT(
441  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
442  static_cast<FwAssertArgType>(portNum)
443  );
444 
445  this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
446  }
447 
450  FwIndexType portNum,
452  )
453  {
454  FW_ASSERT(
455  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
456  static_cast<FwAssertArgType>(portNum)
457  );
458 
459  this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
460  }
461 
464  FwIndexType portNum,
465  Fw::InputLogPort* port
466  )
467  {
468  FW_ASSERT(
469  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
470  static_cast<FwAssertArgType>(portNum)
471  );
472 
473  this->m_eventOut_OutputPort[portNum].addCallPort(port);
474  }
475 
476 #if FW_ENABLE_TEXT_LOGGING == 1
477 
478  void TlmPacketizerComponentBase ::
479  set_textEventOut_OutputPort(
480  FwIndexType portNum,
482  )
483  {
484  FW_ASSERT(
485  (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
486  static_cast<FwAssertArgType>(portNum)
487  );
488 
489  this->m_textEventOut_OutputPort[portNum].addCallPort(port);
490  }
491 
492 #endif
493 
496  FwIndexType portNum,
497  Fw::InputTimePort* port
498  )
499  {
500  FW_ASSERT(
501  (0 <= portNum) && (portNum < this->getNum_timeGetOut_OutputPorts()),
502  static_cast<FwAssertArgType>(portNum)
503  );
504 
505  this->m_timeGetOut_OutputPort[portNum].addCallPort(port);
506  }
507 
510  FwIndexType portNum,
511  Fw::InputTlmPort* port
512  )
513  {
514  FW_ASSERT(
515  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
516  static_cast<FwAssertArgType>(portNum)
517  );
518 
519  this->m_tlmOut_OutputPort[portNum].addCallPort(port);
520  }
521 
522  // ----------------------------------------------------------------------
523  // Connect typed input ports to typed output ports
524  // ----------------------------------------------------------------------
525 
528  FwIndexType portNum,
529  Fw::InputComPort* port
530  )
531  {
532  FW_ASSERT(
533  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
534  static_cast<FwAssertArgType>(portNum)
535  );
536 
537  this->m_PktSend_OutputPort[portNum].addCallPort(port);
538  }
539 
542  FwIndexType portNum,
543  Svc::InputPingPort* port
544  )
545  {
546  FW_ASSERT(
547  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
548  static_cast<FwAssertArgType>(portNum)
549  );
550 
551  this->m_pingOut_OutputPort[portNum].addCallPort(port);
552  }
553 
554 #if FW_PORT_SERIALIZATION
555 
556  // ----------------------------------------------------------------------
557  // Connect serial input ports to special output ports
558  // ----------------------------------------------------------------------
559 
562  FwIndexType portNum,
563  Fw::InputSerializePort* port
564  )
565  {
566  FW_ASSERT(
567  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
568  static_cast<FwAssertArgType>(portNum)
569  );
570 
571  this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
572  }
573 
576  FwIndexType portNum,
577  Fw::InputSerializePort* port
578  )
579  {
580  FW_ASSERT(
581  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
582  static_cast<FwAssertArgType>(portNum)
583  );
584 
585  this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
586  }
587 
590  FwIndexType portNum,
591  Fw::InputSerializePort* port
592  )
593  {
594  FW_ASSERT(
595  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
596  static_cast<FwAssertArgType>(portNum)
597  );
598 
599  this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
600  }
601 
602 #if FW_ENABLE_TEXT_LOGGING == 1
603 
604  void TlmPacketizerComponentBase ::
605  set_textEventOut_OutputPort(
606  FwIndexType portNum,
607  Fw::InputSerializePort* port
608  )
609  {
610  FW_ASSERT(
611  (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
612  static_cast<FwAssertArgType>(portNum)
613  );
614 
615  this->m_textEventOut_OutputPort[portNum].registerSerialPort(port);
616  }
617 
618 #endif
619 
622  FwIndexType portNum,
623  Fw::InputSerializePort* port
624  )
625  {
626  FW_ASSERT(
627  (0 <= portNum) && (portNum < this->getNum_timeGetOut_OutputPorts()),
628  static_cast<FwAssertArgType>(portNum)
629  );
630 
631  this->m_timeGetOut_OutputPort[portNum].registerSerialPort(port);
632  }
633 
636  FwIndexType portNum,
637  Fw::InputSerializePort* port
638  )
639  {
640  FW_ASSERT(
641  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
642  static_cast<FwAssertArgType>(portNum)
643  );
644 
645  this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
646  }
647 
648 #endif
649 
650 #if FW_PORT_SERIALIZATION
651 
652  // ----------------------------------------------------------------------
653  // Connect serial input ports to typed output ports
654  // ----------------------------------------------------------------------
655 
658  FwIndexType portNum,
659  Fw::InputSerializePort* port
660  )
661  {
662  FW_ASSERT(
663  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
664  static_cast<FwAssertArgType>(portNum)
665  );
666 
667  this->m_PktSend_OutputPort[portNum].registerSerialPort(port);
668  }
669 
672  FwIndexType portNum,
673  Fw::InputSerializePort* port
674  )
675  {
676  FW_ASSERT(
677  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
678  static_cast<FwAssertArgType>(portNum)
679  );
680 
681  this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
682  }
683 
684 #endif
685 
686  // ----------------------------------------------------------------------
687  // Command registration
688  // ----------------------------------------------------------------------
689 
692  {
693  FW_ASSERT(this->m_cmdRegOut_OutputPort[0].isConnected());
694 
695  this->m_cmdRegOut_OutputPort[0].invoke(
696  this->getIdBase() + OPCODE_SET_LEVEL
697  );
698 
699  this->m_cmdRegOut_OutputPort[0].invoke(
700  this->getIdBase() + OPCODE_SEND_PKT
701  );
702  }
703 
704  // ----------------------------------------------------------------------
705  // Component construction and destruction
706  // ----------------------------------------------------------------------
707 
709  TlmPacketizerComponentBase(const char* compName) :
710  Fw::ActiveComponentBase(compName)
711  {
712 
713  }
714 
717  {
718 
719  }
720 
721  // ----------------------------------------------------------------------
722  // Getters for numbers of special input ports
723  // ----------------------------------------------------------------------
724 
727  {
728  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdIn_InputPort));
729  }
730 
731  // ----------------------------------------------------------------------
732  // Getters for numbers of typed input ports
733  // ----------------------------------------------------------------------
734 
737  {
738  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_Run_InputPort));
739  }
740 
743  {
744  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_TlmGet_InputPort));
745  }
746 
749  {
750  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_TlmRecv_InputPort));
751  }
752 
755  {
756  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_pingIn_InputPort));
757  }
758 
759  // ----------------------------------------------------------------------
760  // Getters for numbers of special output ports
761  // ----------------------------------------------------------------------
762 
765  {
766  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdRegOut_OutputPort));
767  }
768 
771  {
772  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdResponseOut_OutputPort));
773  }
774 
777  {
778  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_eventOut_OutputPort));
779  }
780 
781 #if FW_ENABLE_TEXT_LOGGING == 1
782 
783  FwIndexType TlmPacketizerComponentBase ::
784  getNum_textEventOut_OutputPorts() const
785  {
786  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_textEventOut_OutputPort));
787  }
788 
789 #endif
790 
793  {
794  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_timeGetOut_OutputPort));
795  }
796 
799  {
800  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_tlmOut_OutputPort));
801  }
802 
803  // ----------------------------------------------------------------------
804  // Getters for numbers of typed output ports
805  // ----------------------------------------------------------------------
806 
809  {
810  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_PktSend_OutputPort));
811  }
812 
815  {
816  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_pingOut_OutputPort));
817  }
818 
819  // ----------------------------------------------------------------------
820  // Connection status queries for special output ports
821  // ----------------------------------------------------------------------
822 
825  {
826  FW_ASSERT(
827  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
828  static_cast<FwAssertArgType>(portNum)
829  );
830 
831  return this->m_cmdRegOut_OutputPort[portNum].isConnected();
832  }
833 
836  {
837  FW_ASSERT(
838  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
839  static_cast<FwAssertArgType>(portNum)
840  );
841 
842  return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
843  }
844 
847  {
848  FW_ASSERT(
849  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
850  static_cast<FwAssertArgType>(portNum)
851  );
852 
853  return this->m_eventOut_OutputPort[portNum].isConnected();
854  }
855 
856 #if FW_ENABLE_TEXT_LOGGING == 1
857 
858  bool TlmPacketizerComponentBase ::
859  isConnected_textEventOut_OutputPort(FwIndexType portNum)
860  {
861  FW_ASSERT(
862  (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
863  static_cast<FwAssertArgType>(portNum)
864  );
865 
866  return this->m_textEventOut_OutputPort[portNum].isConnected();
867  }
868 
869 #endif
870 
873  {
874  FW_ASSERT(
875  (0 <= portNum) && (portNum < this->getNum_timeGetOut_OutputPorts()),
876  static_cast<FwAssertArgType>(portNum)
877  );
878 
879  return this->m_timeGetOut_OutputPort[portNum].isConnected();
880  }
881 
884  {
885  FW_ASSERT(
886  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
887  static_cast<FwAssertArgType>(portNum)
888  );
889 
890  return this->m_tlmOut_OutputPort[portNum].isConnected();
891  }
892 
893  // ----------------------------------------------------------------------
894  // Connection status queries for typed output ports
895  // ----------------------------------------------------------------------
896 
899  {
900  FW_ASSERT(
901  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
902  static_cast<FwAssertArgType>(portNum)
903  );
904 
905  return this->m_PktSend_OutputPort[portNum].isConnected();
906  }
907 
910  {
911  FW_ASSERT(
912  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
913  static_cast<FwAssertArgType>(portNum)
914  );
915 
916  return this->m_pingOut_OutputPort[portNum].isConnected();
917  }
918 
919  // ----------------------------------------------------------------------
920  // Port handler base-class functions for typed input ports
921  //
922  // Call these functions directly to bypass the corresponding ports
923  // ----------------------------------------------------------------------
924 
927  FwIndexType portNum,
928  U32 context
929  )
930  {
931  // Make sure port number is valid
932  FW_ASSERT(
933  (0 <= portNum) && (portNum < this->getNum_Run_InputPorts()),
934  static_cast<FwAssertArgType>(portNum)
935  );
936 
937  // Call pre-message hook
939  portNum,
940  context
941  );
942  ComponentIpcSerializableBuffer msg;
944 
945  // Serialize message ID
946  _status = msg.serialize(
947  static_cast<FwEnumStoreType>(RUN_SCHED)
948  );
949  FW_ASSERT(
950  _status == Fw::FW_SERIALIZE_OK,
951  static_cast<FwAssertArgType>(_status)
952  );
953 
954  // Serialize port number
955  _status = msg.serialize(portNum);
956  FW_ASSERT(
957  _status == Fw::FW_SERIALIZE_OK,
958  static_cast<FwAssertArgType>(_status)
959  );
960 
961  // Serialize argument context
962  _status = msg.serialize(context);
963  FW_ASSERT(
964  _status == Fw::FW_SERIALIZE_OK,
965  static_cast<FwAssertArgType>(_status)
966  );
967 
968  // Send message
970  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
971 
972  FW_ASSERT(
973  qStatus == Os::Queue::OP_OK,
974  static_cast<FwAssertArgType>(qStatus)
975  );
976  }
977 
980  FwIndexType portNum,
981  FwChanIdType id,
982  Fw::Time& timeTag,
983  Fw::TlmBuffer& val
984  )
985  {
986  // Make sure port number is valid
987  FW_ASSERT(
988  (0 <= portNum) && (portNum < this->getNum_TlmGet_InputPorts()),
989  static_cast<FwAssertArgType>(portNum)
990  );
991 
992  Fw::TlmValid retVal;
993 
994  // Call handler function
995  retVal = this->TlmGet_handler(
996  portNum,
997  id,
998  timeTag,
999  val
1000  );
1001 
1002  return retVal;
1003  }
1004 
1007  FwIndexType portNum,
1008  FwChanIdType id,
1009  Fw::Time& timeTag,
1010  Fw::TlmBuffer& val
1011  )
1012  {
1013  // Make sure port number is valid
1014  FW_ASSERT(
1015  (0 <= portNum) && (portNum < this->getNum_TlmRecv_InputPorts()),
1016  static_cast<FwAssertArgType>(portNum)
1017  );
1018 
1019  // Call handler function
1020  this->TlmRecv_handler(
1021  portNum,
1022  id,
1023  timeTag,
1024  val
1025  );
1026  }
1027 
1030  FwIndexType portNum,
1031  U32 key
1032  )
1033  {
1034  // Make sure port number is valid
1035  FW_ASSERT(
1036  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
1037  static_cast<FwAssertArgType>(portNum)
1038  );
1039 
1040  // Call pre-message hook
1042  portNum,
1043  key
1044  );
1045  ComponentIpcSerializableBuffer msg;
1047 
1048  // Serialize message ID
1049  _status = msg.serialize(
1050  static_cast<FwEnumStoreType>(PINGIN_PING)
1051  );
1052  FW_ASSERT(
1053  _status == Fw::FW_SERIALIZE_OK,
1054  static_cast<FwAssertArgType>(_status)
1055  );
1056 
1057  // Serialize port number
1058  _status = msg.serialize(portNum);
1059  FW_ASSERT(
1060  _status == Fw::FW_SERIALIZE_OK,
1061  static_cast<FwAssertArgType>(_status)
1062  );
1063 
1064  // Serialize argument key
1065  _status = msg.serialize(key);
1066  FW_ASSERT(
1067  _status == Fw::FW_SERIALIZE_OK,
1068  static_cast<FwAssertArgType>(_status)
1069  );
1070 
1071  // Send message
1073  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1074 
1075  FW_ASSERT(
1076  qStatus == Os::Queue::OP_OK,
1077  static_cast<FwAssertArgType>(qStatus)
1078  );
1079  }
1080 
1081  // ----------------------------------------------------------------------
1082  // Pre-message hooks for typed async input ports
1083  //
1084  // Each of these functions is invoked just before processing a message
1085  // on the corresponding port. By default, they do nothing. You can
1086  // override them to provide specific pre-message behavior.
1087  // ----------------------------------------------------------------------
1088 
1091  FwIndexType portNum,
1092  U32 context
1093  )
1094  {
1095  // Default: no-op
1096  }
1097 
1100  FwIndexType portNum,
1101  U32 key
1102  )
1103  {
1104  // Default: no-op
1105  }
1106 
1107  // ----------------------------------------------------------------------
1108  // Invocation functions for typed output ports
1109  // ----------------------------------------------------------------------
1110 
1113  FwIndexType portNum,
1114  Fw::ComBuffer& data,
1115  U32 context
1116  )
1117  {
1118  FW_ASSERT(
1119  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
1120  static_cast<FwAssertArgType>(portNum)
1121  );
1122 
1123  FW_ASSERT(
1124  this->m_PktSend_OutputPort[portNum].isConnected(),
1125  static_cast<FwAssertArgType>(portNum)
1126  );
1127  this->m_PktSend_OutputPort[portNum].invoke(
1128  data,
1129  context
1130  );
1131  }
1132 
1135  FwIndexType portNum,
1136  U32 key
1137  )
1138  {
1139  FW_ASSERT(
1140  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
1141  static_cast<FwAssertArgType>(portNum)
1142  );
1143 
1144  FW_ASSERT(
1145  this->m_pingOut_OutputPort[portNum].isConnected(),
1146  static_cast<FwAssertArgType>(portNum)
1147  );
1148  this->m_pingOut_OutputPort[portNum].invoke(
1149  key
1150  );
1151  }
1152 
1153  // ----------------------------------------------------------------------
1154  // Command response
1155  // ----------------------------------------------------------------------
1156 
1159  FwOpcodeType opCode,
1160  U32 cmdSeq,
1161  Fw::CmdResponse response
1162  )
1163  {
1164  FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
1165  this->m_cmdResponseOut_OutputPort[0].invoke(opCode, cmdSeq, response);
1166  }
1167 
1168  // ----------------------------------------------------------------------
1169  // Command handler base-class functions
1170  //
1171  // Call these functions directly to bypass the command input port
1172  // ----------------------------------------------------------------------
1173 
1176  FwOpcodeType opCode,
1177  U32 cmdSeq,
1178  Fw::CmdArgBuffer& args
1179  )
1180  {
1181  // Call pre-message hook
1182  this->SET_LEVEL_preMsgHook(opCode,cmdSeq);
1183 
1184  // Defer deserializing arguments to the message dispatcher
1185  // to avoid deserializing and reserializing just for IPC
1186  ComponentIpcSerializableBuffer msg;
1188 
1189  // Serialize for IPC
1190  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_SET_LEVEL));
1191  FW_ASSERT (
1192  _status == Fw::FW_SERIALIZE_OK,
1193  static_cast<FwAssertArgType>(_status)
1194  );
1195 
1196  // Fake port number to make message dequeue work
1197  FwIndexType port = 0;
1198 
1199  _status = msg.serialize(port);
1200  FW_ASSERT (
1201  _status == Fw::FW_SERIALIZE_OK,
1202  static_cast<FwAssertArgType>(_status)
1203  );
1204 
1205  _status = msg.serialize(opCode);
1206  FW_ASSERT (
1207  _status == Fw::FW_SERIALIZE_OK,
1208  static_cast<FwAssertArgType>(_status)
1209  );
1210 
1211  _status = msg.serialize(cmdSeq);
1212  FW_ASSERT (
1213  _status == Fw::FW_SERIALIZE_OK,
1214  static_cast<FwAssertArgType>(_status)
1215  );
1216 
1217  _status = msg.serialize(args);
1218  FW_ASSERT (
1219  _status == Fw::FW_SERIALIZE_OK,
1220  static_cast<FwAssertArgType>(_status)
1221  );
1222 
1223  // Send message
1225  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1226 
1227  FW_ASSERT(
1228  qStatus == Os::Queue::OP_OK,
1229  static_cast<FwAssertArgType>(qStatus)
1230  );
1231  }
1232 
1235  FwOpcodeType opCode,
1236  U32 cmdSeq,
1237  Fw::CmdArgBuffer& args
1238  )
1239  {
1240  // Call pre-message hook
1241  this->SEND_PKT_preMsgHook(opCode,cmdSeq);
1242 
1243  // Defer deserializing arguments to the message dispatcher
1244  // to avoid deserializing and reserializing just for IPC
1245  ComponentIpcSerializableBuffer msg;
1247 
1248  // Serialize for IPC
1249  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_SEND_PKT));
1250  FW_ASSERT (
1251  _status == Fw::FW_SERIALIZE_OK,
1252  static_cast<FwAssertArgType>(_status)
1253  );
1254 
1255  // Fake port number to make message dequeue work
1256  FwIndexType port = 0;
1257 
1258  _status = msg.serialize(port);
1259  FW_ASSERT (
1260  _status == Fw::FW_SERIALIZE_OK,
1261  static_cast<FwAssertArgType>(_status)
1262  );
1263 
1264  _status = msg.serialize(opCode);
1265  FW_ASSERT (
1266  _status == Fw::FW_SERIALIZE_OK,
1267  static_cast<FwAssertArgType>(_status)
1268  );
1269 
1270  _status = msg.serialize(cmdSeq);
1271  FW_ASSERT (
1272  _status == Fw::FW_SERIALIZE_OK,
1273  static_cast<FwAssertArgType>(_status)
1274  );
1275 
1276  _status = msg.serialize(args);
1277  FW_ASSERT (
1278  _status == Fw::FW_SERIALIZE_OK,
1279  static_cast<FwAssertArgType>(_status)
1280  );
1281 
1282  // Send message
1284  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1285 
1286  FW_ASSERT(
1287  qStatus == Os::Queue::OP_OK,
1288  static_cast<FwAssertArgType>(qStatus)
1289  );
1290  }
1291 
1292  // ----------------------------------------------------------------------
1293  // Pre-message hooks for async commands
1294  //
1295  // Each of these functions is invoked just before processing the
1296  // corresponding command. By default they do nothing. You can
1297  // override them to provide specific pre-command behavior.
1298  // ----------------------------------------------------------------------
1299 
1302  FwOpcodeType opCode,
1303  U32 cmdSeq
1304  )
1305  {
1306  // Defaults to no-op; can be overridden
1307  (void) opCode;
1308  (void) cmdSeq;
1309  }
1310 
1313  FwOpcodeType opCode,
1314  U32 cmdSeq
1315  )
1316  {
1317  // Defaults to no-op; can be overridden
1318  (void) opCode;
1319  (void) cmdSeq;
1320  }
1321 
1322  // ----------------------------------------------------------------------
1323  // Event logging functions
1324  // ----------------------------------------------------------------------
1325 
1328  {
1329  // Get the time
1330  Fw::Time _logTime;
1331  if (this->m_timeGetOut_OutputPort[0].isConnected()) {
1332  this->m_timeGetOut_OutputPort[0].invoke(_logTime);
1333  }
1334 
1335  FwEventIdType _id = static_cast<FwEventIdType>(0);
1336 
1337  _id = this->getIdBase() + EVENTID_NOCHAN;
1338 
1339  // Emit the event on the log port
1340  if (this->m_eventOut_OutputPort[0].isConnected()) {
1341  Fw::LogBuffer _logBuff;
1343 
1344 #if FW_AMPCS_COMPATIBLE
1345  // Serialize the number of arguments
1346  _status = _logBuff.serialize(static_cast<U8>(1));
1347  FW_ASSERT(
1348  _status == Fw::FW_SERIALIZE_OK,
1349  static_cast<FwAssertArgType>(_status)
1350  );
1351 #endif
1352 
1353 #if FW_AMPCS_COMPATIBLE
1354  // Serialize the argument size
1355  _status = _logBuff.serialize(
1356  static_cast<U8>(sizeof(U32))
1357  );
1358  FW_ASSERT(
1359  _status == Fw::FW_SERIALIZE_OK,
1360  static_cast<FwAssertArgType>(_status)
1361  );
1362 #endif
1363  _status = _logBuff.serialize(Id);
1364  FW_ASSERT(
1365  _status == Fw::FW_SERIALIZE_OK,
1366  static_cast<FwAssertArgType>(_status)
1367  );
1368 
1369  this->m_eventOut_OutputPort[0].invoke(
1370  _id,
1371  _logTime,
1373  _logBuff
1374  );
1375  }
1376 
1377  // Emit the event on the text log port
1378 #if FW_ENABLE_TEXT_LOGGING
1379  if (this->m_textEventOut_OutputPort[0].isConnected()) {
1380 #if FW_OBJECT_NAMES == 1
1381  const char* _formatString =
1382  "(%s) %s: Telemetry ID 0x%" PRIx32 " not packetized";
1383 #else
1384  const char* _formatString =
1385  "%s: Telemetry ID 0x%" PRIx32 " not packetized";
1386 #endif
1387 
1388  Fw::TextLogString _logString;
1389  _logString.format(
1390  _formatString,
1391 #if FW_OBJECT_NAMES == 1
1392  this->m_objName.toChar(),
1393 #endif
1394  "NoChan ",
1395  Id
1396  );
1397 
1398  this->m_textEventOut_OutputPort[0].invoke(
1399  _id,
1400  _logTime,
1402  _logString
1403  );
1404  }
1405 #endif
1406  }
1407 
1410  {
1411  // Get the time
1412  Fw::Time _logTime;
1413  if (this->m_timeGetOut_OutputPort[0].isConnected()) {
1414  this->m_timeGetOut_OutputPort[0].invoke(_logTime);
1415  }
1416 
1417  FwEventIdType _id = static_cast<FwEventIdType>(0);
1418 
1419  _id = this->getIdBase() + EVENTID_LEVELSET;
1420 
1421  // Emit the event on the log port
1422  if (this->m_eventOut_OutputPort[0].isConnected()) {
1423  Fw::LogBuffer _logBuff;
1425 
1426 #if FW_AMPCS_COMPATIBLE
1427  // Serialize the number of arguments
1428  _status = _logBuff.serialize(static_cast<U8>(1));
1429  FW_ASSERT(
1430  _status == Fw::FW_SERIALIZE_OK,
1431  static_cast<FwAssertArgType>(_status)
1432  );
1433 #endif
1434 
1435 #if FW_AMPCS_COMPATIBLE
1436  // Serialize the argument size
1437  _status = _logBuff.serialize(
1438  static_cast<U8>(sizeof(U32))
1439  );
1440  FW_ASSERT(
1441  _status == Fw::FW_SERIALIZE_OK,
1442  static_cast<FwAssertArgType>(_status)
1443  );
1444 #endif
1445  _status = _logBuff.serialize(id);
1446  FW_ASSERT(
1447  _status == Fw::FW_SERIALIZE_OK,
1448  static_cast<FwAssertArgType>(_status)
1449  );
1450 
1451  this->m_eventOut_OutputPort[0].invoke(
1452  _id,
1453  _logTime,
1455  _logBuff
1456  );
1457  }
1458 
1459  // Emit the event on the text log port
1460 #if FW_ENABLE_TEXT_LOGGING
1461  if (this->m_textEventOut_OutputPort[0].isConnected()) {
1462 #if FW_OBJECT_NAMES == 1
1463  const char* _formatString =
1464  "(%s) %s: Telemetry send level to %" PRIu32 "";
1465 #else
1466  const char* _formatString =
1467  "%s: Telemetry send level to %" PRIu32 "";
1468 #endif
1469 
1470  Fw::TextLogString _logString;
1471  _logString.format(
1472  _formatString,
1473 #if FW_OBJECT_NAMES == 1
1474  this->m_objName.toChar(),
1475 #endif
1476  "LevelSet ",
1477  id
1478  );
1479 
1480  this->m_textEventOut_OutputPort[0].invoke(
1481  _id,
1482  _logTime,
1484  _logString
1485  );
1486  }
1487 #endif
1488  }
1489 
1492  U32 level,
1493  U32 max
1494  ) const
1495  {
1496  // Get the time
1497  Fw::Time _logTime;
1498  if (this->m_timeGetOut_OutputPort[0].isConnected()) {
1499  this->m_timeGetOut_OutputPort[0].invoke(_logTime);
1500  }
1501 
1502  FwEventIdType _id = static_cast<FwEventIdType>(0);
1503 
1504  _id = this->getIdBase() + EVENTID_MAXLEVELEXCEED;
1505 
1506  // Emit the event on the log port
1507  if (this->m_eventOut_OutputPort[0].isConnected()) {
1508  Fw::LogBuffer _logBuff;
1510 
1511 #if FW_AMPCS_COMPATIBLE
1512  // Serialize the number of arguments
1513  _status = _logBuff.serialize(static_cast<U8>(2));
1514  FW_ASSERT(
1515  _status == Fw::FW_SERIALIZE_OK,
1516  static_cast<FwAssertArgType>(_status)
1517  );
1518 #endif
1519 
1520 #if FW_AMPCS_COMPATIBLE
1521  // Serialize the argument size
1522  _status = _logBuff.serialize(
1523  static_cast<U8>(sizeof(U32))
1524  );
1525  FW_ASSERT(
1526  _status == Fw::FW_SERIALIZE_OK,
1527  static_cast<FwAssertArgType>(_status)
1528  );
1529 #endif
1530  _status = _logBuff.serialize(level);
1531  FW_ASSERT(
1532  _status == Fw::FW_SERIALIZE_OK,
1533  static_cast<FwAssertArgType>(_status)
1534  );
1535 
1536 #if FW_AMPCS_COMPATIBLE
1537  // Serialize the argument size
1538  _status = _logBuff.serialize(
1539  static_cast<U8>(sizeof(U32))
1540  );
1541  FW_ASSERT(
1542  _status == Fw::FW_SERIALIZE_OK,
1543  static_cast<FwAssertArgType>(_status)
1544  );
1545 #endif
1546  _status = _logBuff.serialize(max);
1547  FW_ASSERT(
1548  _status == Fw::FW_SERIALIZE_OK,
1549  static_cast<FwAssertArgType>(_status)
1550  );
1551 
1552  this->m_eventOut_OutputPort[0].invoke(
1553  _id,
1554  _logTime,
1556  _logBuff
1557  );
1558  }
1559 
1560  // Emit the event on the text log port
1561 #if FW_ENABLE_TEXT_LOGGING
1562  if (this->m_textEventOut_OutputPort[0].isConnected()) {
1563 #if FW_OBJECT_NAMES == 1
1564  const char* _formatString =
1565  "(%s) %s: Requested send level %" PRIu32 " higher than max packet level of %" PRIu32 "";
1566 #else
1567  const char* _formatString =
1568  "%s: Requested send level %" PRIu32 " higher than max packet level of %" PRIu32 "";
1569 #endif
1570 
1571  Fw::TextLogString _logString;
1572  _logString.format(
1573  _formatString,
1574 #if FW_OBJECT_NAMES == 1
1575  this->m_objName.toChar(),
1576 #endif
1577  "MaxLevelExceed ",
1578  level,
1579  max
1580  );
1581 
1582  this->m_textEventOut_OutputPort[0].invoke(
1583  _id,
1584  _logTime,
1586  _logString
1587  );
1588  }
1589 #endif
1590  }
1591 
1594  {
1595  // Get the time
1596  Fw::Time _logTime;
1597  if (this->m_timeGetOut_OutputPort[0].isConnected()) {
1598  this->m_timeGetOut_OutputPort[0].invoke(_logTime);
1599  }
1600 
1601  FwEventIdType _id = static_cast<FwEventIdType>(0);
1602 
1603  _id = this->getIdBase() + EVENTID_PACKETSENT;
1604 
1605  // Emit the event on the log port
1606  if (this->m_eventOut_OutputPort[0].isConnected()) {
1607  Fw::LogBuffer _logBuff;
1609 
1610 #if FW_AMPCS_COMPATIBLE
1611  // Serialize the number of arguments
1612  _status = _logBuff.serialize(static_cast<U8>(1));
1613  FW_ASSERT(
1614  _status == Fw::FW_SERIALIZE_OK,
1615  static_cast<FwAssertArgType>(_status)
1616  );
1617 #endif
1618 
1619 #if FW_AMPCS_COMPATIBLE
1620  // Serialize the argument size
1621  _status = _logBuff.serialize(
1622  static_cast<U8>(sizeof(U32))
1623  );
1624  FW_ASSERT(
1625  _status == Fw::FW_SERIALIZE_OK,
1626  static_cast<FwAssertArgType>(_status)
1627  );
1628 #endif
1629  _status = _logBuff.serialize(id);
1630  FW_ASSERT(
1631  _status == Fw::FW_SERIALIZE_OK,
1632  static_cast<FwAssertArgType>(_status)
1633  );
1634 
1635  this->m_eventOut_OutputPort[0].invoke(
1636  _id,
1637  _logTime,
1639  _logBuff
1640  );
1641  }
1642 
1643  // Emit the event on the text log port
1644 #if FW_ENABLE_TEXT_LOGGING
1645  if (this->m_textEventOut_OutputPort[0].isConnected()) {
1646 #if FW_OBJECT_NAMES == 1
1647  const char* _formatString =
1648  "(%s) %s: Sent packet ID %" PRIu32 "";
1649 #else
1650  const char* _formatString =
1651  "%s: Sent packet ID %" PRIu32 "";
1652 #endif
1653 
1654  Fw::TextLogString _logString;
1655  _logString.format(
1656  _formatString,
1657 #if FW_OBJECT_NAMES == 1
1658  this->m_objName.toChar(),
1659 #endif
1660  "PacketSent ",
1661  id
1662  );
1663 
1664  this->m_textEventOut_OutputPort[0].invoke(
1665  _id,
1666  _logTime,
1668  _logString
1669  );
1670  }
1671 #endif
1672  }
1673 
1676  {
1677  // Get the time
1678  Fw::Time _logTime;
1679  if (this->m_timeGetOut_OutputPort[0].isConnected()) {
1680  this->m_timeGetOut_OutputPort[0].invoke(_logTime);
1681  }
1682 
1683  FwEventIdType _id = static_cast<FwEventIdType>(0);
1684 
1685  _id = this->getIdBase() + EVENTID_PACKETNOTFOUND;
1686 
1687  // Emit the event on the log port
1688  if (this->m_eventOut_OutputPort[0].isConnected()) {
1689  Fw::LogBuffer _logBuff;
1691 
1692 #if FW_AMPCS_COMPATIBLE
1693  // Serialize the number of arguments
1694  _status = _logBuff.serialize(static_cast<U8>(1));
1695  FW_ASSERT(
1696  _status == Fw::FW_SERIALIZE_OK,
1697  static_cast<FwAssertArgType>(_status)
1698  );
1699 #endif
1700 
1701 #if FW_AMPCS_COMPATIBLE
1702  // Serialize the argument size
1703  _status = _logBuff.serialize(
1704  static_cast<U8>(sizeof(U32))
1705  );
1706  FW_ASSERT(
1707  _status == Fw::FW_SERIALIZE_OK,
1708  static_cast<FwAssertArgType>(_status)
1709  );
1710 #endif
1711  _status = _logBuff.serialize(id);
1712  FW_ASSERT(
1713  _status == Fw::FW_SERIALIZE_OK,
1714  static_cast<FwAssertArgType>(_status)
1715  );
1716 
1717  this->m_eventOut_OutputPort[0].invoke(
1718  _id,
1719  _logTime,
1721  _logBuff
1722  );
1723  }
1724 
1725  // Emit the event on the text log port
1726 #if FW_ENABLE_TEXT_LOGGING
1727  if (this->m_textEventOut_OutputPort[0].isConnected()) {
1728 #if FW_OBJECT_NAMES == 1
1729  const char* _formatString =
1730  "(%s) %s: Could not find packet ID %" PRIu32 "";
1731 #else
1732  const char* _formatString =
1733  "%s: Could not find packet ID %" PRIu32 "";
1734 #endif
1735 
1736  Fw::TextLogString _logString;
1737  _logString.format(
1738  _formatString,
1739 #if FW_OBJECT_NAMES == 1
1740  this->m_objName.toChar(),
1741 #endif
1742  "PacketNotFound ",
1743  id
1744  );
1745 
1746  this->m_textEventOut_OutputPort[0].invoke(
1747  _id,
1748  _logTime,
1750  _logString
1751  );
1752  }
1753 #endif
1754  }
1755 
1756  // ----------------------------------------------------------------------
1757  // Telemetry write functions
1758  // ----------------------------------------------------------------------
1759 
1762  U32 arg,
1763  Fw::Time _tlmTime
1764  ) const
1765  {
1766  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1767  if (
1768  this->m_timeGetOut_OutputPort[0].isConnected() &&
1769  (_tlmTime == Fw::ZERO_TIME)
1770  ) {
1771  this->m_timeGetOut_OutputPort[0].invoke(_tlmTime);
1772  }
1773 
1774  Fw::TlmBuffer _tlmBuff;
1775  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1776  FW_ASSERT(
1777  _stat == Fw::FW_SERIALIZE_OK,
1778  static_cast<FwAssertArgType>(_stat)
1779  );
1780 
1781  FwChanIdType _id;
1782 
1783  _id = this->getIdBase() + CHANNELID_SENDLEVEL;
1784 
1785  this->m_tlmOut_OutputPort[0].invoke(
1786  _id,
1787  _tlmTime,
1788  _tlmBuff
1789  );
1790  }
1791  }
1792 
1793  // ----------------------------------------------------------------------
1794  // Time
1795  // ----------------------------------------------------------------------
1796 
1798  getTime() const
1799  {
1800  if (this->m_timeGetOut_OutputPort[0].isConnected()) {
1801  Fw::Time _time;
1802  this->m_timeGetOut_OutputPort[0].invoke(_time);
1803  return _time;
1804  }
1805  else {
1806  return Fw::Time(TB_NONE, 0, 0);
1807  }
1808  }
1809 
1810  // ----------------------------------------------------------------------
1811  // Message dispatch functions
1812  // ----------------------------------------------------------------------
1813 
1814  Fw::QueuedComponentBase::MsgDispatchStatus TlmPacketizerComponentBase ::
1815  doDispatch()
1816  {
1817  ComponentIpcSerializableBuffer _msg;
1818  FwQueuePriorityType _priority = 0;
1819 
1820  Os::Queue::Status _msgStatus = this->m_queue.receive(
1821  _msg,
1823  _priority
1824  );
1825  FW_ASSERT(
1826  _msgStatus == Os::Queue::OP_OK,
1827  static_cast<FwAssertArgType>(_msgStatus)
1828  );
1829 
1830  // Reset to beginning of buffer
1831  _msg.resetDeser();
1832 
1833  FwEnumStoreType _desMsg = 0;
1834  Fw::SerializeStatus _deserStatus = _msg.deserialize(_desMsg);
1835  FW_ASSERT(
1836  _deserStatus == Fw::FW_SERIALIZE_OK,
1837  static_cast<FwAssertArgType>(_deserStatus)
1838  );
1839 
1840  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
1841 
1842  if (_msgType == TLMPACKETIZER_COMPONENT_EXIT) {
1843  return MSG_DISPATCH_EXIT;
1844  }
1845 
1846  FwIndexType portNum = 0;
1847  _deserStatus = _msg.deserialize(portNum);
1848  FW_ASSERT(
1849  _deserStatus == Fw::FW_SERIALIZE_OK,
1850  static_cast<FwAssertArgType>(_deserStatus)
1851  );
1852 
1853  switch (_msgType) {
1854  // Handle async input port Run
1855  case RUN_SCHED: {
1856  // Deserialize argument context
1857  U32 context;
1858  _deserStatus = _msg.deserialize(context);
1859  FW_ASSERT(
1860  _deserStatus == Fw::FW_SERIALIZE_OK,
1861  static_cast<FwAssertArgType>(_deserStatus)
1862  );
1863  // Call handler function
1864  this->Run_handler(
1865  portNum,
1866  context
1867  );
1868 
1869  break;
1870  }
1871 
1872  // Handle async input port pingIn
1873  case PINGIN_PING: {
1874  // Deserialize argument key
1875  U32 key;
1876  _deserStatus = _msg.deserialize(key);
1877  FW_ASSERT(
1878  _deserStatus == Fw::FW_SERIALIZE_OK,
1879  static_cast<FwAssertArgType>(_deserStatus)
1880  );
1881  // Call handler function
1882  this->pingIn_handler(
1883  portNum,
1884  key
1885  );
1886 
1887  break;
1888  }
1889 
1890  // Handle command SET_LEVEL
1891  case CMD_SET_LEVEL: {
1892  // Deserialize opcode
1893  FwOpcodeType _opCode = 0;
1894  _deserStatus = _msg.deserialize(_opCode);
1895  FW_ASSERT (
1896  _deserStatus == Fw::FW_SERIALIZE_OK,
1897  static_cast<FwAssertArgType>(_deserStatus)
1898  );
1899 
1900  // Deserialize command sequence
1901  U32 _cmdSeq = 0;
1902  _deserStatus = _msg.deserialize(_cmdSeq);
1903  FW_ASSERT (
1904  _deserStatus == Fw::FW_SERIALIZE_OK,
1905  static_cast<FwAssertArgType>(_deserStatus)
1906  );
1907 
1908  // Deserialize command argument buffer
1909  Fw::CmdArgBuffer args;
1910  _deserStatus = _msg.deserialize(args);
1911  FW_ASSERT (
1912  _deserStatus == Fw::FW_SERIALIZE_OK,
1913  static_cast<FwAssertArgType>(_deserStatus)
1914  );
1915 
1916  // Reset buffer
1917  args.resetDeser();
1918 
1919  // Deserialize argument level
1920  U32 level;
1921  _deserStatus = args.deserialize(level);
1922  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
1923  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
1924  this->cmdResponse_out(
1925  _opCode,
1926  _cmdSeq,
1928  );
1929  }
1930  // Don't crash the task if bad arguments were passed from the ground
1931  break;
1932  }
1933 
1934  // Make sure there was no data left over.
1935  // That means the argument buffer size was incorrect.
1936 #if FW_CMD_CHECK_RESIDUAL
1937  if (args.getBuffLeft() != 0) {
1938  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
1939  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
1940  }
1941  // Don't crash the task if bad arguments were passed from the ground
1942  break;
1943  }
1944 #endif
1945 
1946  // Call handler function
1947  this->SET_LEVEL_cmdHandler(
1948  _opCode, _cmdSeq,
1949  level
1950  );
1951 
1952  break;
1953  }
1954 
1955  // Handle command SEND_PKT
1956  case CMD_SEND_PKT: {
1957  // Deserialize opcode
1958  FwOpcodeType _opCode = 0;
1959  _deserStatus = _msg.deserialize(_opCode);
1960  FW_ASSERT (
1961  _deserStatus == Fw::FW_SERIALIZE_OK,
1962  static_cast<FwAssertArgType>(_deserStatus)
1963  );
1964 
1965  // Deserialize command sequence
1966  U32 _cmdSeq = 0;
1967  _deserStatus = _msg.deserialize(_cmdSeq);
1968  FW_ASSERT (
1969  _deserStatus == Fw::FW_SERIALIZE_OK,
1970  static_cast<FwAssertArgType>(_deserStatus)
1971  );
1972 
1973  // Deserialize command argument buffer
1974  Fw::CmdArgBuffer args;
1975  _deserStatus = _msg.deserialize(args);
1976  FW_ASSERT (
1977  _deserStatus == Fw::FW_SERIALIZE_OK,
1978  static_cast<FwAssertArgType>(_deserStatus)
1979  );
1980 
1981  // Reset buffer
1982  args.resetDeser();
1983 
1984  // Deserialize argument id
1985  U32 id;
1986  _deserStatus = args.deserialize(id);
1987  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
1988  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
1989  this->cmdResponse_out(
1990  _opCode,
1991  _cmdSeq,
1993  );
1994  }
1995  // Don't crash the task if bad arguments were passed from the ground
1996  break;
1997  }
1998 
1999  // Make sure there was no data left over.
2000  // That means the argument buffer size was incorrect.
2001 #if FW_CMD_CHECK_RESIDUAL
2002  if (args.getBuffLeft() != 0) {
2003  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
2004  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2005  }
2006  // Don't crash the task if bad arguments were passed from the ground
2007  break;
2008  }
2009 #endif
2010 
2011  // Call handler function
2012  this->SEND_PKT_cmdHandler(
2013  _opCode, _cmdSeq,
2014  id
2015  );
2016 
2017  break;
2018  }
2019 
2020  default:
2021  return MSG_DISPATCH_ERROR;
2022  }
2023 
2024  return MSG_DISPATCH_OK;
2025  }
2026 
2027  // ----------------------------------------------------------------------
2028  // Calls for messages received on special input ports
2029  // ----------------------------------------------------------------------
2030 
2031  void TlmPacketizerComponentBase ::
2032  m_p_cmdIn_in(
2033  Fw::PassiveComponentBase* callComp,
2034  FwIndexType portNum,
2035  FwOpcodeType opCode,
2036  U32 cmdSeq,
2037  Fw::CmdArgBuffer& args
2038  )
2039  {
2040  FW_ASSERT(callComp);
2041  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
2042 
2043  const U32 idBase = callComp->getIdBase();
2044  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
2045 
2046  // Select base class function based on opcode
2047  switch (opCode - idBase) {
2048  case OPCODE_SET_LEVEL: {
2049  compPtr->SET_LEVEL_cmdHandlerBase(
2050  opCode,
2051  cmdSeq,
2052  args
2053  );
2054  break;
2055  }
2056 
2057  case OPCODE_SEND_PKT: {
2058  compPtr->SEND_PKT_cmdHandlerBase(
2059  opCode,
2060  cmdSeq,
2061  args
2062  );
2063  break;
2064  }
2065  }
2066  }
2067 
2068  // ----------------------------------------------------------------------
2069  // Calls for messages received on typed input ports
2070  // ----------------------------------------------------------------------
2071 
2072  void TlmPacketizerComponentBase ::
2073  m_p_Run_in(
2074  Fw::PassiveComponentBase* callComp,
2075  FwIndexType portNum,
2076  U32 context
2077  )
2078  {
2079  FW_ASSERT(callComp);
2080  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
2081  compPtr->Run_handlerBase(
2082  portNum,
2083  context
2084  );
2085  }
2086 
2087  Fw::TlmValid TlmPacketizerComponentBase ::
2088  m_p_TlmGet_in(
2089  Fw::PassiveComponentBase* callComp,
2090  FwIndexType portNum,
2091  FwChanIdType id,
2092  Fw::Time& timeTag,
2093  Fw::TlmBuffer& val
2094  )
2095  {
2096  FW_ASSERT(callComp);
2097  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
2098  return compPtr->TlmGet_handlerBase(
2099  portNum,
2100  id,
2101  timeTag,
2102  val
2103  );
2104  }
2105 
2106  void TlmPacketizerComponentBase ::
2107  m_p_TlmRecv_in(
2108  Fw::PassiveComponentBase* callComp,
2109  FwIndexType portNum,
2110  FwChanIdType id,
2111  Fw::Time& timeTag,
2112  Fw::TlmBuffer& val
2113  )
2114  {
2115  FW_ASSERT(callComp);
2116  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
2117  compPtr->TlmRecv_handlerBase(
2118  portNum,
2119  id,
2120  timeTag,
2121  val
2122  );
2123  }
2124 
2125  void TlmPacketizerComponentBase ::
2126  m_p_pingIn_in(
2127  Fw::PassiveComponentBase* callComp,
2128  FwIndexType portNum,
2129  U32 key
2130  )
2131  {
2132  FW_ASSERT(callComp);
2133  TlmPacketizerComponentBase* compPtr = static_cast<TlmPacketizerComponentBase*>(callComp);
2134  compPtr->pingIn_handlerBase(
2135  portNum,
2136  key
2137  );
2138  }
2139 
2140 }
Serialization/Deserialization operation was successful.
The size of the serial representations of the port arguments.
Definition: CmdPortAc.hpp:38
void SEND_PKT_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:134
void invoke(Fw::ComBuffer &data, U32 context) const
Invoke a port interface.
Definition: ComPortAc.cpp:156
Definition: Time.hpp:9
void init()
Initialization function.
Definition: ComPortAc.cpp:137
void set_PktSend_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to PktSend[portNum].
Operation succeeded.
Definition: Os.hpp:26
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
PlatformSizeType FwSizeType
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
Definition: Queue.cpp:59
Fw::InputCmdPort * get_cmdIn_InputPort(FwIndexType portNum)
I32 FwEnumStoreType
void init()
Initialization function.
virtual void TlmRecv_handler(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)=0
Handler for input port TlmRecv.
void Run_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port Run.
Status
status returned from the queue send function
Definition: Queue.hpp:30
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
void init()
Initialization function.
Definition: SchedPortAc.cpp:56
void init()
Initialization function.
Definition: CmdPortAc.cpp:56
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: TlmPortAc.cpp:62
U32 FwChanIdType
The type of a telemetry channel identifier.
void invoke(U32 key) const
Invoke a port interface.
Definition: PingPortAc.cpp:147
void TlmRecv_handlerBase(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Handler base-class function for input port TlmRecv.
const Time ZERO_TIME
Definition: Time.cpp:5
void PktSend_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Invoke output port PktSend.
bool isConnected_tlmOut_OutputPort(FwIndexType portNum)
void init()
Initialization function.
Definition: TlmPortAc.cpp:144
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:56
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
Os::Queue m_queue
queue object for active component
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:150
virtual ~TlmPacketizerComponentBase()
Destroy TlmPacketizerComponentBase object.
void set_pingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
void init()
Object initializer.
Definition: ObjBase.cpp:26
U32 FwEventIdType
The type of an event identifier.
SerializeStatus
forward declaration for string
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: CmdPortAc.cpp:62
Message will block until space is available.
Definition: Queue.hpp:47
void invoke(FwOpcodeType opCode) const
Invoke a port interface.
U32 FwOpcodeType
The type of a command opcode.
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:53
Serializable::SizeType getBuffLeft() const
returns how much deserialization buffer is left
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
void init()
Initialization function.
Definition: TimePortAc.cpp:128
Fw::InputTlmGetPort * get_TlmGet_InputPort(FwIndexType portNum)
Less important informational events.
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
virtual void Run_preMsgHook(FwIndexType portNum, U32 context)
Pre-message hook for async input port Run.
A less serious but recoverable event.
void init()
Initialization function.
Definition: PingPortAc.cpp:128
void invoke(Fw::Time &time) const
Invoke a port interface.
Definition: TimePortAc.cpp:147
const char * toChar() const
Definition: ObjectName.hpp:50
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke a port interface.
FwSizeType SizeType
void addCallPort(InputPingPort *callPort)
Register an input port.
Definition: PingPortAc.cpp:134
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
Definition: Queue.cpp:42
void resetDeser()
reset deserialization to beginning
message to exit active component task
virtual void pingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port pingIn.
The size of the serial representations of the port arguments.
Definition: PingPortAc.hpp:36
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port interface.
Definition: TlmPortAc.cpp:163
bool isConnected_cmdRegOut_OutputPort(FwIndexType portNum)
void set_eventOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to eventOut[portNum].
bool isConnected() const
Definition: PortBase.cpp:42
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
#define PRI_FwIndexType
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:55
Fw::TlmValid TlmGet_handlerBase(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Handler base-class function for input port TlmGet.
void init()
Initialization function.
Definition: LogPortAc.cpp:151
The size of the serial representations of the port arguments.
Definition: SchedPortAc.hpp:36
void log_WARNING_LO_MaxLevelExceed(U32 level, U32 max) const
virtual void Run_handler(FwIndexType portNum, U32 context)=0
Handler for input port Run.
void setPortNum(FwIndexType portNum)
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:56
BlockingType
message type
Definition: Queue.hpp:46
Command failed to deserialize.
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
Important informational events.
virtual void SET_LEVEL_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, U32 level)=0
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: SchedPortAc.cpp:62
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port interface.
Definition: LogPortAc.cpp:170
virtual void SEND_PKT_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, U32 id)=0
A message was sent requesting an exit of the loop.
No time base has been established.
Definition: FpConfig.h:30
void tlmWrite_SendLevel(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
PlatformIndexType FwIndexType
TlmPacketizerComponentBase(const char *compName="")
Construct TlmPacketizerComponentBase object.
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition: BasicTypes.h:93
void set_timeGetOut_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeGetOut[portNum].
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:157
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void init()
Initialization function.
virtual void SEND_PKT_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command SEND_PKT.
void init()
Initialization function.
Definition: PingPortAc.cpp:56
RateGroupDivider component implementation.
message sent/received okay
Definition: Queue.hpp:31
U8 BYTE
byte type
Definition: BasicTypes.h:59
bool isConnected_PktSend_OutputPort(FwIndexType portNum)
Svc::InputSchedPort * get_Run_InputPort(FwIndexType portNum)
bool isConnected_pingOut_OutputPort(FwIndexType portNum)
void addCallPort(InputComPort *callPort)
Register an input port.
Definition: ComPortAc.cpp:143
Fw::InputTlmPort * get_TlmRecv_InputPort(FwIndexType portNum)
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: PingPortAc.cpp:62
bool isConnected_timeGetOut_OutputPort(FwIndexType portNum)
void regCommands()
Register commands with the Command Dispatcher.
bool isConnected_eventOut_OutputPort(FwIndexType portNum)
Message will return with status when space is unavailable.
Definition: Queue.hpp:48
bool isConnected_cmdResponseOut_OutputPort(FwIndexType portNum)
void init()
Initialization function.
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.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
void set_cmdResponseOut_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
void pingOut_out(FwIndexType portNum, U32 key)
Invoke output port pingOut.
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
virtual Fw::TlmValid TlmGet_handler(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)=0
Handler for input port TlmGet.
void set_cmdRegOut_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to cmdRegOut[portNum].
Telemetry channel is not part of a telemetry packet.