F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
EventManagerComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title EventManagerComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for EventManager 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  EVENTMANAGER_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT,
19  PINGIN_PING,
20  RUN_SCHED,
21  CMD_SET_ID_FILTER,
22  CMD_DUMP_FILTER_STATE,
23  INT_IF_LOQQUEUE,
24  };
25 
26  // Get the max size by constructing a union of the async input, command, and
27  // internal port serialization sizes
28  union BuffUnion {
32  // Size of loqQueue argument list
33  BYTE loqQueueIntIfSize[
34  sizeof(FwEventIdType) +
38  ];
39  };
40 
41  // Define a message buffer class large enough to handle all the
42  // asynchronous inputs to the component
43  class ComponentIpcSerializableBuffer :
45  {
46 
47  public:
48 
49  enum {
50  // Offset into data in buffer: Size of message ID and port number
51  DATA_OFFSET = sizeof(FwEnumStoreType) + sizeof(FwIndexType),
52  // Max data size
53  MAX_DATA_SIZE = sizeof(BuffUnion),
54  // Max message size: Size of message id + size of port + max data size
55  SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
56  };
57 
58  ComponentIpcSerializableBuffer() : Fw::LinearBufferBase(m_buff, sizeof(m_buff)) {
59 
60  }
61 
62  private:
63  // Should be the max of all the input ports serialized sizes...
64  U8 m_buff[SERIALIZATION_SIZE];
65 
66  };
67  }
68 
69  // ----------------------------------------------------------------------
70  // Component initialization
71  // ----------------------------------------------------------------------
72 
75  FwSizeType queueDepth,
76  FwEnumStoreType instance
77  )
78  {
79  // Initialize base class
81 
82 #if !FW_DIRECT_PORT_CALLS
83  // Connect input port CmdDisp
84  for (
85  FwIndexType port = 0;
86  port < static_cast<FwIndexType>(this->getNum_CmdDisp_InputPorts());
87  port++
88  ) {
89  this->m_CmdDisp_InputPort[port].init();
90  this->m_CmdDisp_InputPort[port].addCallComp(
91  this,
92  m_p_CmdDisp_in
93  );
94  this->m_CmdDisp_InputPort[port].setPortNum(port);
95 
96 #if FW_OBJECT_NAMES == 1
97  Fw::ObjectName portName;
98  portName.format(
99  "%s_CmdDisp_InputPort[%" PRI_FwIndexType "]",
100  this->m_objName.toChar(),
101  port
102  );
103  this->m_CmdDisp_InputPort[port].setObjName(portName.toChar());
104 #endif
105  }
106 #endif
107 
108 #if !FW_DIRECT_PORT_CALLS
109  // Connect input port LogRecv
110  for (
111  FwIndexType port = 0;
112  port < static_cast<FwIndexType>(this->getNum_LogRecv_InputPorts());
113  port++
114  ) {
115  this->m_LogRecv_InputPort[port].init();
116  this->m_LogRecv_InputPort[port].addCallComp(
117  this,
118  m_p_LogRecv_in
119  );
120  this->m_LogRecv_InputPort[port].setPortNum(port);
121 
122 #if FW_OBJECT_NAMES == 1
123  Fw::ObjectName portName;
124  portName.format(
125  "%s_LogRecv_InputPort[%" PRI_FwIndexType "]",
126  this->m_objName.toChar(),
127  port
128  );
129  this->m_LogRecv_InputPort[port].setObjName(portName.toChar());
130 #endif
131  }
132 #endif
133 
134 #if !FW_DIRECT_PORT_CALLS
135  // Connect input port pingIn
136  for (
137  FwIndexType port = 0;
138  port < static_cast<FwIndexType>(this->getNum_pingIn_InputPorts());
139  port++
140  ) {
141  this->m_pingIn_InputPort[port].init();
142  this->m_pingIn_InputPort[port].addCallComp(
143  this,
144  m_p_pingIn_in
145  );
146  this->m_pingIn_InputPort[port].setPortNum(port);
147 
148 #if FW_OBJECT_NAMES == 1
149  Fw::ObjectName portName;
150  portName.format(
151  "%s_pingIn_InputPort[%" PRI_FwIndexType "]",
152  this->m_objName.toChar(),
153  port
154  );
155  this->m_pingIn_InputPort[port].setObjName(portName.toChar());
156 #endif
157  }
158 #endif
159 
160 #if !FW_DIRECT_PORT_CALLS
161  // Connect input port run
162  for (
163  FwIndexType port = 0;
164  port < static_cast<FwIndexType>(this->getNum_run_InputPorts());
165  port++
166  ) {
167  this->m_run_InputPort[port].init();
168  this->m_run_InputPort[port].addCallComp(
169  this,
170  m_p_run_in
171  );
172  this->m_run_InputPort[port].setPortNum(port);
173 
174 #if FW_OBJECT_NAMES == 1
175  Fw::ObjectName portName;
176  portName.format(
177  "%s_run_InputPort[%" PRI_FwIndexType "]",
178  this->m_objName.toChar(),
179  port
180  );
181  this->m_run_InputPort[port].setObjName(portName.toChar());
182 #endif
183  }
184 #endif
185 
186 #if !FW_DIRECT_PORT_CALLS
187  // Connect output port CmdReg
188  for (
189  FwIndexType port = 0;
190  port < static_cast<FwIndexType>(this->getNum_CmdReg_OutputPorts());
191  port++
192  ) {
193  this->m_CmdReg_OutputPort[port].init();
194 
195 #if FW_OBJECT_NAMES == 1
196  Fw::ObjectName portName;
197  portName.format(
198  "%s_CmdReg_OutputPort[%" PRI_FwIndexType "]",
199  this->m_objName.toChar(),
200  port
201  );
202  this->m_CmdReg_OutputPort[port].setObjName(portName.toChar());
203 #endif
204  }
205 #endif
206 
207 #if !FW_DIRECT_PORT_CALLS
208  // Connect output port CmdStatus
209  for (
210  FwIndexType port = 0;
211  port < static_cast<FwIndexType>(this->getNum_CmdStatus_OutputPorts());
212  port++
213  ) {
214  this->m_CmdStatus_OutputPort[port].init();
215 
216 #if FW_OBJECT_NAMES == 1
217  Fw::ObjectName portName;
218  portName.format(
219  "%s_CmdStatus_OutputPort[%" PRI_FwIndexType "]",
220  this->m_objName.toChar(),
221  port
222  );
223  this->m_CmdStatus_OutputPort[port].setObjName(portName.toChar());
224 #endif
225  }
226 #endif
227 
228 #if !FW_DIRECT_PORT_CALLS
229  // Connect output port Log
230  for (
231  FwIndexType port = 0;
232  port < static_cast<FwIndexType>(this->getNum_Log_OutputPorts());
233  port++
234  ) {
235  this->m_Log_OutputPort[port].init();
236 
237 #if FW_OBJECT_NAMES == 1
238  Fw::ObjectName portName;
239  portName.format(
240  "%s_Log_OutputPort[%" PRI_FwIndexType "]",
241  this->m_objName.toChar(),
242  port
243  );
244  this->m_Log_OutputPort[port].setObjName(portName.toChar());
245 #endif
246  }
247 #endif
248 
249 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING
250  // Connect output port LogText
251  for (
252  FwIndexType port = 0;
253  port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
254  port++
255  ) {
256  this->m_LogText_OutputPort[port].init();
257 
258 #if FW_OBJECT_NAMES == 1
259  Fw::ObjectName portName;
260  portName.format(
261  "%s_LogText_OutputPort[%" PRI_FwIndexType "]",
262  this->m_objName.toChar(),
263  port
264  );
265  this->m_LogText_OutputPort[port].setObjName(portName.toChar());
266 #endif
267  }
268 #endif
269 
270 #if !FW_DIRECT_PORT_CALLS
271  // Connect output port Time
272  for (
273  FwIndexType port = 0;
274  port < static_cast<FwIndexType>(this->getNum_Time_OutputPorts());
275  port++
276  ) {
277  this->m_Time_OutputPort[port].init();
278 
279 #if FW_OBJECT_NAMES == 1
280  Fw::ObjectName portName;
281  portName.format(
282  "%s_Time_OutputPort[%" PRI_FwIndexType "]",
283  this->m_objName.toChar(),
284  port
285  );
286  this->m_Time_OutputPort[port].setObjName(portName.toChar());
287 #endif
288  }
289 #endif
290 
291 #if !FW_DIRECT_PORT_CALLS
292  // Connect output port Tlm
293  for (
294  FwIndexType port = 0;
295  port < static_cast<FwIndexType>(this->getNum_Tlm_OutputPorts());
296  port++
297  ) {
298  this->m_Tlm_OutputPort[port].init();
299 
300 #if FW_OBJECT_NAMES == 1
301  Fw::ObjectName portName;
302  portName.format(
303  "%s_Tlm_OutputPort[%" PRI_FwIndexType "]",
304  this->m_objName.toChar(),
305  port
306  );
307  this->m_Tlm_OutputPort[port].setObjName(portName.toChar());
308 #endif
309  }
310 #endif
311 
312 #if !FW_DIRECT_PORT_CALLS
313  // Connect output port FatalAnnounce
314  for (
315  FwIndexType port = 0;
316  port < static_cast<FwIndexType>(this->getNum_FatalAnnounce_OutputPorts());
317  port++
318  ) {
319  this->m_FatalAnnounce_OutputPort[port].init();
320 
321 #if FW_OBJECT_NAMES == 1
322  Fw::ObjectName portName;
323  portName.format(
324  "%s_FatalAnnounce_OutputPort[%" PRI_FwIndexType "]",
325  this->m_objName.toChar(),
326  port
327  );
328  this->m_FatalAnnounce_OutputPort[port].setObjName(portName.toChar());
329 #endif
330  }
331 #endif
332 
333 #if !FW_DIRECT_PORT_CALLS
334  // Connect output port PktSend
335  for (
336  FwIndexType port = 0;
337  port < static_cast<FwIndexType>(this->getNum_PktSend_OutputPorts());
338  port++
339  ) {
340  this->m_PktSend_OutputPort[port].init();
341 
342 #if FW_OBJECT_NAMES == 1
343  Fw::ObjectName portName;
344  portName.format(
345  "%s_PktSend_OutputPort[%" PRI_FwIndexType "]",
346  this->m_objName.toChar(),
347  port
348  );
349  this->m_PktSend_OutputPort[port].setObjName(portName.toChar());
350 #endif
351  }
352 #endif
353 
354 #if !FW_DIRECT_PORT_CALLS
355  // Connect output port pingOut
356  for (
357  FwIndexType port = 0;
358  port < static_cast<FwIndexType>(this->getNum_pingOut_OutputPorts());
359  port++
360  ) {
361  this->m_pingOut_OutputPort[port].init();
362 
363 #if FW_OBJECT_NAMES == 1
364  Fw::ObjectName portName;
365  portName.format(
366  "%s_pingOut_OutputPort[%" PRI_FwIndexType "]",
367  this->m_objName.toChar(),
368  port
369  );
370  this->m_pingOut_OutputPort[port].setObjName(portName.toChar());
371 #endif
372  }
373 #endif
374 
375  // Create the queue
376  Os::Queue::Status qStat = this->createQueue(
377  queueDepth,
378  static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
379  );
380  FW_ASSERT(
381  Os::Queue::Status::OP_OK == qStat,
382  static_cast<FwAssertArgType>(qStat)
383  );
384  }
385 
386 #if !FW_DIRECT_PORT_CALLS
387 
388  // ----------------------------------------------------------------------
389  // Getters for special input ports
390  // ----------------------------------------------------------------------
391 
394  {
395  FW_ASSERT(
396  (0 <= portNum) && (portNum < this->getNum_CmdDisp_InputPorts()),
397  static_cast<FwAssertArgType>(portNum)
398  );
399 
400  return &this->m_CmdDisp_InputPort[portNum];
401  }
402 
403 #endif
404 
405 #if !FW_DIRECT_PORT_CALLS
406 
407  // ----------------------------------------------------------------------
408  // Getters for typed input ports
409  // ----------------------------------------------------------------------
410 
413  {
414  FW_ASSERT(
415  (0 <= portNum) && (portNum < this->getNum_LogRecv_InputPorts()),
416  static_cast<FwAssertArgType>(portNum)
417  );
418 
419  return &this->m_LogRecv_InputPort[portNum];
420  }
421 
424  {
425  FW_ASSERT(
426  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
427  static_cast<FwAssertArgType>(portNum)
428  );
429 
430  return &this->m_pingIn_InputPort[portNum];
431  }
432 
435  {
436  FW_ASSERT(
437  (0 <= portNum) && (portNum < this->getNum_run_InputPorts()),
438  static_cast<FwAssertArgType>(portNum)
439  );
440 
441  return &this->m_run_InputPort[portNum];
442  }
443 
444 #endif
445 
446 #if !FW_DIRECT_PORT_CALLS
447 
448  // ----------------------------------------------------------------------
449  // Connect input ports to special output ports
450  // ----------------------------------------------------------------------
451 
454  FwIndexType portNum,
455  Fw::InputCmdRegPort* port
456  )
457  {
458  FW_ASSERT(
459  (0 <= portNum) && (portNum < this->getNum_CmdReg_OutputPorts()),
460  static_cast<FwAssertArgType>(portNum)
461  );
462 
463  this->m_CmdReg_OutputPort[portNum].addCallPort(port);
464  }
465 
468  FwIndexType portNum,
470  )
471  {
472  FW_ASSERT(
473  (0 <= portNum) && (portNum < this->getNum_CmdStatus_OutputPorts()),
474  static_cast<FwAssertArgType>(portNum)
475  );
476 
477  this->m_CmdStatus_OutputPort[portNum].addCallPort(port);
478  }
479 
482  FwIndexType portNum,
483  Fw::InputLogPort* port
484  )
485  {
486  FW_ASSERT(
487  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
488  static_cast<FwAssertArgType>(portNum)
489  );
490 
491  this->m_Log_OutputPort[portNum].addCallPort(port);
492  }
493 
494 #if FW_ENABLE_TEXT_LOGGING == 1
495 
496  void EventManagerComponentBase ::
497  set_LogText_OutputPort(
498  FwIndexType portNum,
500  )
501  {
502  FW_ASSERT(
503  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
504  static_cast<FwAssertArgType>(portNum)
505  );
506 
507  this->m_LogText_OutputPort[portNum].addCallPort(port);
508  }
509 
510 #endif
511 
514  FwIndexType portNum,
515  Fw::InputTimePort* port
516  )
517  {
518  FW_ASSERT(
519  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
520  static_cast<FwAssertArgType>(portNum)
521  );
522 
523  this->m_Time_OutputPort[portNum].addCallPort(port);
524  }
525 
528  FwIndexType portNum,
529  Fw::InputTlmPort* port
530  )
531  {
532  FW_ASSERT(
533  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
534  static_cast<FwAssertArgType>(portNum)
535  );
536 
537  this->m_Tlm_OutputPort[portNum].addCallPort(port);
538  }
539 
540 #endif
541 
542 #if !FW_DIRECT_PORT_CALLS
543 
544  // ----------------------------------------------------------------------
545  // Connect typed input ports to typed output ports
546  // ----------------------------------------------------------------------
547 
550  FwIndexType portNum,
552  )
553  {
554  FW_ASSERT(
555  (0 <= portNum) && (portNum < this->getNum_FatalAnnounce_OutputPorts()),
556  static_cast<FwAssertArgType>(portNum)
557  );
558 
559  this->m_FatalAnnounce_OutputPort[portNum].addCallPort(port);
560  }
561 
564  FwIndexType portNum,
565  Fw::InputComPort* port
566  )
567  {
568  FW_ASSERT(
569  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
570  static_cast<FwAssertArgType>(portNum)
571  );
572 
573  this->m_PktSend_OutputPort[portNum].addCallPort(port);
574  }
575 
578  FwIndexType portNum,
579  Svc::InputPingPort* port
580  )
581  {
582  FW_ASSERT(
583  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
584  static_cast<FwAssertArgType>(portNum)
585  );
586 
587  this->m_pingOut_OutputPort[portNum].addCallPort(port);
588  }
589 
590 #endif
591 
592 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
593 
594  // ----------------------------------------------------------------------
595  // Connect serial input ports to special output ports
596  // ----------------------------------------------------------------------
597 
600  FwIndexType portNum,
601  Fw::InputSerializePort* port
602  )
603  {
604  FW_ASSERT(
605  (0 <= portNum) && (portNum < this->getNum_CmdReg_OutputPorts()),
606  static_cast<FwAssertArgType>(portNum)
607  );
608 
609  this->m_CmdReg_OutputPort[portNum].registerSerialPort(port);
610  }
611 
614  FwIndexType portNum,
615  Fw::InputSerializePort* port
616  )
617  {
618  FW_ASSERT(
619  (0 <= portNum) && (portNum < this->getNum_CmdStatus_OutputPorts()),
620  static_cast<FwAssertArgType>(portNum)
621  );
622 
623  this->m_CmdStatus_OutputPort[portNum].registerSerialPort(port);
624  }
625 
628  FwIndexType portNum,
629  Fw::InputSerializePort* port
630  )
631  {
632  FW_ASSERT(
633  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
634  static_cast<FwAssertArgType>(portNum)
635  );
636 
637  this->m_Log_OutputPort[portNum].registerSerialPort(port);
638  }
639 
640 #if FW_ENABLE_TEXT_LOGGING == 1
641 
642  void EventManagerComponentBase ::
643  set_LogText_OutputPort(
644  FwIndexType portNum,
645  Fw::InputSerializePort* port
646  )
647  {
648  FW_ASSERT(
649  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
650  static_cast<FwAssertArgType>(portNum)
651  );
652 
653  this->m_LogText_OutputPort[portNum].registerSerialPort(port);
654  }
655 
656 #endif
657 
660  FwIndexType portNum,
661  Fw::InputSerializePort* port
662  )
663  {
664  FW_ASSERT(
665  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
666  static_cast<FwAssertArgType>(portNum)
667  );
668 
669  this->m_Time_OutputPort[portNum].registerSerialPort(port);
670  }
671 
674  FwIndexType portNum,
675  Fw::InputSerializePort* port
676  )
677  {
678  FW_ASSERT(
679  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
680  static_cast<FwAssertArgType>(portNum)
681  );
682 
683  this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
684  }
685 
686 #endif
687 
688 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
689 
690  // ----------------------------------------------------------------------
691  // Connect serial input ports to typed output ports
692  // ----------------------------------------------------------------------
693 
696  FwIndexType portNum,
697  Fw::InputSerializePort* port
698  )
699  {
700  FW_ASSERT(
701  (0 <= portNum) && (portNum < this->getNum_FatalAnnounce_OutputPorts()),
702  static_cast<FwAssertArgType>(portNum)
703  );
704 
705  this->m_FatalAnnounce_OutputPort[portNum].registerSerialPort(port);
706  }
707 
710  FwIndexType portNum,
711  Fw::InputSerializePort* port
712  )
713  {
714  FW_ASSERT(
715  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
716  static_cast<FwAssertArgType>(portNum)
717  );
718 
719  this->m_PktSend_OutputPort[portNum].registerSerialPort(port);
720  }
721 
724  FwIndexType portNum,
725  Fw::InputSerializePort* port
726  )
727  {
728  FW_ASSERT(
729  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
730  static_cast<FwAssertArgType>(portNum)
731  );
732 
733  this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
734  }
735 
736 #endif
737 
738  // ----------------------------------------------------------------------
739  // Command registration
740  // ----------------------------------------------------------------------
741 
744  {
746 
747  this->CmdReg_out(
748  0,
750  );
751 
752  this->CmdReg_out(
753  0,
755  );
756 
757  this->CmdReg_out(
758  0,
760  );
761  }
762 
763  // ----------------------------------------------------------------------
764  // Component construction and destruction
765  // ----------------------------------------------------------------------
766 
768  EventManagerComponentBase(const char* compName) :
769  Fw::ActiveComponentBase(compName)
770  {
771 
772  }
773 
776  {
777 
778  }
779 
780 #if !FW_DIRECT_PORT_CALLS
781 
782  // ----------------------------------------------------------------------
783  // Connection status queries for special output ports
784  // ----------------------------------------------------------------------
785 
788  {
789  FW_ASSERT(
790  (0 <= portNum) && (portNum < this->getNum_CmdReg_OutputPorts()),
791  static_cast<FwAssertArgType>(portNum)
792  );
793 
794  return this->m_CmdReg_OutputPort[portNum].isConnected();
795  }
796 
799  {
800  FW_ASSERT(
801  (0 <= portNum) && (portNum < this->getNum_CmdStatus_OutputPorts()),
802  static_cast<FwAssertArgType>(portNum)
803  );
804 
805  return this->m_CmdStatus_OutputPort[portNum].isConnected();
806  }
807 
810  {
811  FW_ASSERT(
812  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
813  static_cast<FwAssertArgType>(portNum)
814  );
815 
816  return this->m_Log_OutputPort[portNum].isConnected();
817  }
818 
819 #if FW_ENABLE_TEXT_LOGGING == 1
820 
821  bool EventManagerComponentBase ::
822  isConnected_LogText_OutputPort(FwIndexType portNum) const
823  {
824  FW_ASSERT(
825  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
826  static_cast<FwAssertArgType>(portNum)
827  );
828 
829  return this->m_LogText_OutputPort[portNum].isConnected();
830  }
831 
832 #endif
833 
836  {
837  FW_ASSERT(
838  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
839  static_cast<FwAssertArgType>(portNum)
840  );
841 
842  return this->m_Time_OutputPort[portNum].isConnected();
843  }
844 
847  {
848  FW_ASSERT(
849  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
850  static_cast<FwAssertArgType>(portNum)
851  );
852 
853  return this->m_Tlm_OutputPort[portNum].isConnected();
854  }
855 
856 #endif
857 
858 #if !FW_DIRECT_PORT_CALLS
859 
860  // ----------------------------------------------------------------------
861  // Connection status queries for typed output ports
862  // ----------------------------------------------------------------------
863 
866  {
867  FW_ASSERT(
868  (0 <= portNum) && (portNum < this->getNum_FatalAnnounce_OutputPorts()),
869  static_cast<FwAssertArgType>(portNum)
870  );
871 
872  return this->m_FatalAnnounce_OutputPort[portNum].isConnected();
873  }
874 
877  {
878  FW_ASSERT(
879  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
880  static_cast<FwAssertArgType>(portNum)
881  );
882 
883  return this->m_PktSend_OutputPort[portNum].isConnected();
884  }
885 
888  {
889  FW_ASSERT(
890  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
891  static_cast<FwAssertArgType>(portNum)
892  );
893 
894  return this->m_pingOut_OutputPort[portNum].isConnected();
895  }
896 
897 #endif
898 
899  // ----------------------------------------------------------------------
900  // Port handler base-class functions for special input ports
901  //
902  // Call these functions directly to bypass the corresponding ports
903  // ----------------------------------------------------------------------
904 
907  FwIndexType portNum,
908  FwOpcodeType opCode,
909  U32 cmdSeq,
910  Fw::CmdArgBuffer& args
911  )
912  {
913 
914  const U32 idBase = this->getIdBase();
915  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
916 
917  // Select base class function based on opcode
918  switch (opCode - idBase) {
921  opCode,
922  cmdSeq,
923  args
924  );
925  break;
926  }
927 
928  case OPCODE_SET_ID_FILTER: {
930  opCode,
931  cmdSeq,
932  args
933  );
934  break;
935  }
936 
939  opCode,
940  cmdSeq,
941  args
942  );
943  break;
944  }
945  default:
946  // Unknown opcode: ignore it
947  break;
948  }
949  }
950 
951  // ----------------------------------------------------------------------
952  // Port handler base-class functions for typed input ports
953  //
954  // Call these functions directly to bypass the corresponding ports
955  // ----------------------------------------------------------------------
956 
959  FwIndexType portNum,
960  FwEventIdType id,
961  Fw::Time& timeTag,
962  const Fw::LogSeverity& severity,
963  Fw::LogBuffer& args
964  )
965  {
966  // Make sure port number is valid
967  FW_ASSERT(
968  (0 <= portNum) && (portNum < this->getNum_LogRecv_InputPorts()),
969  static_cast<FwAssertArgType>(portNum)
970  );
971 
972  // Call handler function
973  this->LogRecv_handler(
974  portNum,
975  id,
976  timeTag,
977  severity,
978  args
979  );
980  }
981 
984  FwIndexType portNum,
985  U32 key
986  )
987  {
988  // Make sure port number is valid
989  FW_ASSERT(
990  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
991  static_cast<FwAssertArgType>(portNum)
992  );
993 
994  // Call pre-message hook
996  portNum,
997  key
998  );
999  ComponentIpcSerializableBuffer msg;
1001 
1002  // Serialize message ID
1003  _status = msg.serializeFrom(
1004  static_cast<FwEnumStoreType>(PINGIN_PING)
1005  );
1006  FW_ASSERT(
1007  _status == Fw::FW_SERIALIZE_OK,
1008  static_cast<FwAssertArgType>(_status)
1009  );
1010 
1011  // Serialize port number
1012  _status = msg.serializeFrom(portNum);
1013  FW_ASSERT(
1014  _status == Fw::FW_SERIALIZE_OK,
1015  static_cast<FwAssertArgType>(_status)
1016  );
1017 
1018  // Serialize argument key
1019  _status = msg.serializeFrom(key);
1020  FW_ASSERT(
1021  _status == Fw::FW_SERIALIZE_OK,
1022  static_cast<FwAssertArgType>(_status)
1023  );
1024 
1025  // Send message
1027  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1028 
1029  FW_ASSERT(
1030  qStatus == Os::Queue::OP_OK,
1031  static_cast<FwAssertArgType>(qStatus)
1032  );
1033  }
1034 
1037  FwIndexType portNum,
1038  U32 context
1039  )
1040  {
1041  // Make sure port number is valid
1042  FW_ASSERT(
1043  (0 <= portNum) && (portNum < this->getNum_run_InputPorts()),
1044  static_cast<FwAssertArgType>(portNum)
1045  );
1046 
1047  // Call pre-message hook
1049  portNum,
1050  context
1051  );
1052  ComponentIpcSerializableBuffer msg;
1054 
1055  // Serialize message ID
1056  _status = msg.serializeFrom(
1057  static_cast<FwEnumStoreType>(RUN_SCHED)
1058  );
1059  FW_ASSERT(
1060  _status == Fw::FW_SERIALIZE_OK,
1061  static_cast<FwAssertArgType>(_status)
1062  );
1063 
1064  // Serialize port number
1065  _status = msg.serializeFrom(portNum);
1066  FW_ASSERT(
1067  _status == Fw::FW_SERIALIZE_OK,
1068  static_cast<FwAssertArgType>(_status)
1069  );
1070 
1071  // Serialize argument context
1072  _status = msg.serializeFrom(context);
1073  FW_ASSERT(
1074  _status == Fw::FW_SERIALIZE_OK,
1075  static_cast<FwAssertArgType>(_status)
1076  );
1077 
1078  // Send message
1080  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1081 
1082  if (qStatus == Os::Queue::Status::FULL) {
1083  this->incNumMsgDropped();
1084  return;
1085  }
1086 
1087  FW_ASSERT(
1088  qStatus == Os::Queue::OP_OK,
1089  static_cast<FwAssertArgType>(qStatus)
1090  );
1091  }
1092 
1093  // ----------------------------------------------------------------------
1094  // Pre-message hooks for typed async input ports
1095  //
1096  // Each of these functions is invoked just before processing a message
1097  // on the corresponding port. By default, they do nothing. You can
1098  // override them to provide specific pre-message behavior.
1099  // ----------------------------------------------------------------------
1100 
1103  FwIndexType portNum,
1104  U32 key
1105  )
1106  {
1107  // Default: no-op
1108  }
1109 
1112  FwIndexType portNum,
1113  U32 context
1114  )
1115  {
1116  // Default: no-op
1117  }
1118 
1119 #if !FW_DIRECT_PORT_CALLS
1120 
1121  // ----------------------------------------------------------------------
1122  // Invocation functions for typed output ports
1123  // ----------------------------------------------------------------------
1124 
1127  FwIndexType portNum,
1128  FwEventIdType Id
1129  ) const
1130  {
1131  FW_ASSERT(
1132  (0 <= portNum) && (portNum < this->getNum_FatalAnnounce_OutputPorts()),
1133  static_cast<FwAssertArgType>(portNum)
1134  );
1135 
1136  FW_ASSERT(
1137  this->m_FatalAnnounce_OutputPort[portNum].isConnected(),
1138  static_cast<FwAssertArgType>(portNum)
1139  );
1140  this->m_FatalAnnounce_OutputPort[portNum].invoke(
1141  Id
1142  );
1143  }
1144 
1147  FwIndexType portNum,
1148  Fw::ComBuffer& data,
1149  U32 context
1150  ) const
1151  {
1152  FW_ASSERT(
1153  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
1154  static_cast<FwAssertArgType>(portNum)
1155  );
1156 
1157  FW_ASSERT(
1158  this->m_PktSend_OutputPort[portNum].isConnected(),
1159  static_cast<FwAssertArgType>(portNum)
1160  );
1161  this->m_PktSend_OutputPort[portNum].invoke(
1162  data,
1163  context
1164  );
1165  }
1166 
1169  FwIndexType portNum,
1170  U32 key
1171  ) const
1172  {
1173  FW_ASSERT(
1174  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
1175  static_cast<FwAssertArgType>(portNum)
1176  );
1177 
1178  FW_ASSERT(
1179  this->m_pingOut_OutputPort[portNum].isConnected(),
1180  static_cast<FwAssertArgType>(portNum)
1181  );
1182  this->m_pingOut_OutputPort[portNum].invoke(
1183  key
1184  );
1185  }
1186 
1187 #endif
1188 
1189  // ----------------------------------------------------------------------
1190  // Internal interface base-class functions
1191  // ----------------------------------------------------------------------
1192 
1195  FwEventIdType id,
1196  const Fw::Time& timeTag,
1197  const Fw::LogSeverity& severity,
1198  const Fw::LogBuffer& args
1199  )
1200  {
1201  ComponentIpcSerializableBuffer msg;
1203 
1204  // Serialize the message ID
1205  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(INT_IF_LOQQUEUE));
1206  FW_ASSERT (
1207  _status == Fw::FW_SERIALIZE_OK,
1208  static_cast<FwAssertArgType>(_status)
1209  );
1210 
1211  // Fake port number to make message dequeue work
1212  _status = msg.serializeFrom(static_cast<FwIndexType>(0));
1213  FW_ASSERT (
1214  _status == Fw::FW_SERIALIZE_OK,
1215  static_cast<FwAssertArgType>(_status)
1216  );
1217 
1218  _status = msg.serializeFrom(id);
1219  FW_ASSERT(
1220  _status == Fw::FW_SERIALIZE_OK,
1221  static_cast<FwAssertArgType>(_status)
1222  );
1223 
1224  _status = msg.serializeFrom(timeTag);
1225  FW_ASSERT(
1226  _status == Fw::FW_SERIALIZE_OK,
1227  static_cast<FwAssertArgType>(_status)
1228  );
1229 
1230  _status = msg.serializeFrom(severity);
1231  FW_ASSERT(
1232  _status == Fw::FW_SERIALIZE_OK,
1233  static_cast<FwAssertArgType>(_status)
1234  );
1235 
1236  _status = msg.serializeFrom(args);
1237  FW_ASSERT(
1238  _status == Fw::FW_SERIALIZE_OK,
1239  static_cast<FwAssertArgType>(_status)
1240  );
1241 
1242  // Send message
1244  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1245 
1246  if (qStatus == Os::Queue::Status::FULL) {
1247  this->incNumMsgDropped();
1248  return;
1249  }
1250 
1251  FW_ASSERT(
1252  qStatus == Os::Queue::OP_OK,
1253  static_cast<FwAssertArgType>(qStatus)
1254  );
1255  }
1256 
1257  // ----------------------------------------------------------------------
1258  // Command response
1259  // ----------------------------------------------------------------------
1260 
1263  FwOpcodeType opCode,
1264  U32 cmdSeq,
1265  Fw::CmdResponse response
1266  )
1267  {
1269  this->CmdStatus_out(0, opCode, cmdSeq, response);
1270  }
1271 
1272  // ----------------------------------------------------------------------
1273  // Command handler base-class functions
1274  //
1275  // Call these functions directly to bypass the command input port
1276  // ----------------------------------------------------------------------
1277 
1280  FwOpcodeType opCode,
1281  U32 cmdSeq,
1282  Fw::CmdArgBuffer& args
1283  )
1284  {
1285  // Deserialize the arguments
1287 
1288  // Reset the buffer
1289  args.resetDeser();
1290 
1292  _status = args.deserializeTo(filterLevel);
1293  if (_status != Fw::FW_SERIALIZE_OK) {
1294  if (this->isConnected_CmdStatus_OutputPort(0)) {
1295  this->CmdStatus_out(
1296  0,
1297  opCode,
1298  cmdSeq,
1300  );
1301  }
1302  return;
1303  }
1304 
1305  Svc::EventManager_Enabled filterEnabled;
1306  _status = args.deserializeTo(filterEnabled);
1307  if (_status != Fw::FW_SERIALIZE_OK) {
1308  if (this->isConnected_CmdStatus_OutputPort(0)) {
1309  this->CmdStatus_out(
1310  0,
1311  opCode,
1312  cmdSeq,
1314  );
1315  }
1316  return;
1317  }
1318 
1319 #if FW_CMD_CHECK_RESIDUAL
1320  // Make sure there was no data left over.
1321  // That means the argument buffer size was incorrect.
1322  if (args.getDeserializeSizeLeft() != 0) {
1323  if (this->isConnected_CmdStatus_OutputPort(0)) {
1324  this->CmdStatus_out(
1325  0,
1326  opCode,
1327  cmdSeq,
1329  );
1330  }
1331  return;
1332  }
1333 #endif
1334 
1336  opCode, cmdSeq,
1337  filterLevel,
1338  filterEnabled
1339  );
1340  }
1341 
1344  FwOpcodeType opCode,
1345  U32 cmdSeq,
1346  Fw::CmdArgBuffer& args
1347  )
1348  {
1349  // Call pre-message hook
1350  this->SET_ID_FILTER_preMsgHook(opCode,cmdSeq);
1351 
1352  // Defer deserializing arguments to the message dispatcher
1353  // to avoid deserializing and reserializing just for IPC
1354  ComponentIpcSerializableBuffer msg;
1356 
1357  // Serialize for IPC
1358  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_SET_ID_FILTER));
1359  FW_ASSERT (
1360  _status == Fw::FW_SERIALIZE_OK,
1361  static_cast<FwAssertArgType>(_status)
1362  );
1363 
1364  // Fake port number to make message dequeue work
1365  FwIndexType port = 0;
1366 
1367  _status = msg.serializeFrom(port);
1368  FW_ASSERT (
1369  _status == Fw::FW_SERIALIZE_OK,
1370  static_cast<FwAssertArgType>(_status)
1371  );
1372 
1373  _status = msg.serializeFrom(opCode);
1374  FW_ASSERT (
1375  _status == Fw::FW_SERIALIZE_OK,
1376  static_cast<FwAssertArgType>(_status)
1377  );
1378 
1379  _status = msg.serializeFrom(cmdSeq);
1380  FW_ASSERT (
1381  _status == Fw::FW_SERIALIZE_OK,
1382  static_cast<FwAssertArgType>(_status)
1383  );
1384 
1385  _status = msg.serializeFrom(args);
1386  FW_ASSERT (
1387  _status == Fw::FW_SERIALIZE_OK,
1388  static_cast<FwAssertArgType>(_status)
1389  );
1390 
1391  // Send message
1393  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1394 
1395  FW_ASSERT(
1396  qStatus == Os::Queue::OP_OK,
1397  static_cast<FwAssertArgType>(qStatus)
1398  );
1399  }
1400 
1403  FwOpcodeType opCode,
1404  U32 cmdSeq,
1405  Fw::CmdArgBuffer& args
1406  )
1407  {
1408  // Call pre-message hook
1409  this->DUMP_FILTER_STATE_preMsgHook(opCode,cmdSeq);
1410 
1411  // Defer deserializing arguments to the message dispatcher
1412  // to avoid deserializing and reserializing just for IPC
1413  ComponentIpcSerializableBuffer msg;
1415 
1416  // Serialize for IPC
1417  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_DUMP_FILTER_STATE));
1418  FW_ASSERT (
1419  _status == Fw::FW_SERIALIZE_OK,
1420  static_cast<FwAssertArgType>(_status)
1421  );
1422 
1423  // Fake port number to make message dequeue work
1424  FwIndexType port = 0;
1425 
1426  _status = msg.serializeFrom(port);
1427  FW_ASSERT (
1428  _status == Fw::FW_SERIALIZE_OK,
1429  static_cast<FwAssertArgType>(_status)
1430  );
1431 
1432  _status = msg.serializeFrom(opCode);
1433  FW_ASSERT (
1434  _status == Fw::FW_SERIALIZE_OK,
1435  static_cast<FwAssertArgType>(_status)
1436  );
1437 
1438  _status = msg.serializeFrom(cmdSeq);
1439  FW_ASSERT (
1440  _status == Fw::FW_SERIALIZE_OK,
1441  static_cast<FwAssertArgType>(_status)
1442  );
1443 
1444  _status = msg.serializeFrom(args);
1445  FW_ASSERT (
1446  _status == Fw::FW_SERIALIZE_OK,
1447  static_cast<FwAssertArgType>(_status)
1448  );
1449 
1450  // Send message
1452  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1453 
1454  FW_ASSERT(
1455  qStatus == Os::Queue::OP_OK,
1456  static_cast<FwAssertArgType>(qStatus)
1457  );
1458  }
1459 
1460  // ----------------------------------------------------------------------
1461  // Pre-message hooks for async commands
1462  //
1463  // Each of these functions is invoked just before processing the
1464  // corresponding command. By default they do nothing. You can
1465  // override them to provide specific pre-command behavior.
1466  // ----------------------------------------------------------------------
1467 
1470  FwOpcodeType opCode,
1471  U32 cmdSeq
1472  )
1473  {
1474  // Defaults to no-op; can be overridden
1475  (void) opCode;
1476  (void) cmdSeq;
1477  }
1478 
1481  FwOpcodeType opCode,
1482  U32 cmdSeq
1483  )
1484  {
1485  // Defaults to no-op; can be overridden
1486  (void) opCode;
1487  (void) cmdSeq;
1488  }
1489 
1490  // ----------------------------------------------------------------------
1491  // Event logging functions
1492  // ----------------------------------------------------------------------
1493 
1496  const Svc::EventManager_FilterSeverity& severity,
1497  bool enabled
1498  ) const
1499  {
1500  // Get the time
1501  Fw::Time _logTime;
1502  if (this->isConnected_Time_OutputPort(0)) {
1503  this->Time_out(0, _logTime);
1504  }
1505 
1507 
1508  // Emit the event on the log port
1509  if (this->isConnected_Log_OutputPort(0)) {
1510  Fw::LogBuffer _logBuff;
1512 
1513 #if FW_AMPCS_COMPATIBLE
1514  // Serialize the number of arguments
1515  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1516  FW_ASSERT(
1517  _status == Fw::FW_SERIALIZE_OK,
1518  static_cast<FwAssertArgType>(_status)
1519  );
1520 #endif
1521 
1522 #if FW_AMPCS_COMPATIBLE
1523  // Serialize the argument size
1524  _status = _logBuff.serializeFrom(
1526  );
1527  FW_ASSERT(
1528  _status == Fw::FW_SERIALIZE_OK,
1529  static_cast<FwAssertArgType>(_status)
1530  );
1531 #endif
1532  _status = _logBuff.serializeFrom(severity);
1533  FW_ASSERT(
1534  _status == Fw::FW_SERIALIZE_OK,
1535  static_cast<FwAssertArgType>(_status)
1536  );
1537 
1538 #if FW_AMPCS_COMPATIBLE
1539  // Serialize the argument size
1540  _status = _logBuff.serializeFrom(
1541  static_cast<U8>(sizeof(U8))
1542  );
1543  FW_ASSERT(
1544  _status == Fw::FW_SERIALIZE_OK,
1545  static_cast<FwAssertArgType>(_status)
1546  );
1547 #endif
1548  _status = _logBuff.serializeFrom(enabled);
1549  FW_ASSERT(
1550  _status == Fw::FW_SERIALIZE_OK,
1551  static_cast<FwAssertArgType>(_status)
1552  );
1553 
1554  this->Log_out(
1555  0,
1556  _id,
1557  _logTime,
1559  _logBuff
1560  );
1561  }
1562 
1563  // Emit the event on the text log port
1564 #if FW_ENABLE_TEXT_LOGGING
1565  if (this->isConnected_LogText_OutputPort(0)) {
1566 #if FW_OBJECT_NAMES == 1
1567  const char* _formatString =
1568  "(%s) %s: %s filter state. %d";
1569 #else
1570  const char* _formatString =
1571  "%s: %s filter state. %d";
1572 #endif
1573 
1574  Fw::String severityStr;
1575  severity.toString(severityStr);
1576 
1577  Fw::TextLogString _logString;
1578  (void) _logString.format(
1579  _formatString,
1580 #if FW_OBJECT_NAMES == 1
1581  this->m_objName.toChar(),
1582 #endif
1583  "SEVERITY_FILTER_STATE ",
1584  severityStr.toChar(),
1585  enabled
1586  );
1587 
1588  this->LogText_out(
1589  0,
1590  _id,
1591  _logTime,
1593  _logString
1594  );
1595  }
1596 #endif
1597  }
1598 
1601  {
1602  // Get the time
1603  Fw::Time _logTime;
1604  if (this->isConnected_Time_OutputPort(0)) {
1605  this->Time_out(0, _logTime);
1606  }
1607 
1608  const FwEventIdType _id = this->getIdBase() + EVENTID_ID_FILTER_ENABLED;
1609 
1610  // Emit the event on the log port
1611  if (this->isConnected_Log_OutputPort(0)) {
1612  Fw::LogBuffer _logBuff;
1614 
1615 #if FW_AMPCS_COMPATIBLE
1616  // Serialize the number of arguments
1617  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1618  FW_ASSERT(
1619  _status == Fw::FW_SERIALIZE_OK,
1620  static_cast<FwAssertArgType>(_status)
1621  );
1622 #endif
1623 
1624 #if FW_AMPCS_COMPATIBLE
1625  // Serialize the argument size
1626  _status = _logBuff.serializeFrom(
1627  static_cast<U8>(sizeof(FwEventIdType))
1628  );
1629  FW_ASSERT(
1630  _status == Fw::FW_SERIALIZE_OK,
1631  static_cast<FwAssertArgType>(_status)
1632  );
1633 #endif
1634  _status = _logBuff.serializeFrom(ID);
1635  FW_ASSERT(
1636  _status == Fw::FW_SERIALIZE_OK,
1637  static_cast<FwAssertArgType>(_status)
1638  );
1639 
1640  this->Log_out(
1641  0,
1642  _id,
1643  _logTime,
1645  _logBuff
1646  );
1647  }
1648 
1649  // Emit the event on the text log port
1650 #if FW_ENABLE_TEXT_LOGGING
1651  if (this->isConnected_LogText_OutputPort(0)) {
1652 #if FW_OBJECT_NAMES == 1
1653  const char* _formatString =
1654  "(%s) %s: ID %" PRIu32 " is filtered.";
1655 #else
1656  const char* _formatString =
1657  "%s: ID %" PRIu32 " is filtered.";
1658 #endif
1659 
1660  Fw::TextLogString _logString;
1661  (void) _logString.format(
1662  _formatString,
1663 #if FW_OBJECT_NAMES == 1
1664  this->m_objName.toChar(),
1665 #endif
1666  "ID_FILTER_ENABLED ",
1667  ID
1668  );
1669 
1670  this->LogText_out(
1671  0,
1672  _id,
1673  _logTime,
1675  _logString
1676  );
1677  }
1678 #endif
1679  }
1680 
1683  {
1684  // Get the time
1685  Fw::Time _logTime;
1686  if (this->isConnected_Time_OutputPort(0)) {
1687  this->Time_out(0, _logTime);
1688  }
1689 
1690  const FwEventIdType _id = this->getIdBase() + EVENTID_ID_FILTER_LIST_FULL;
1691 
1692  // Emit the event on the log port
1693  if (this->isConnected_Log_OutputPort(0)) {
1694  Fw::LogBuffer _logBuff;
1696 
1697 #if FW_AMPCS_COMPATIBLE
1698  // Serialize the number of arguments
1699  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1700  FW_ASSERT(
1701  _status == Fw::FW_SERIALIZE_OK,
1702  static_cast<FwAssertArgType>(_status)
1703  );
1704 #endif
1705 
1706 #if FW_AMPCS_COMPATIBLE
1707  // Serialize the argument size
1708  _status = _logBuff.serializeFrom(
1709  static_cast<U8>(sizeof(FwEventIdType))
1710  );
1711  FW_ASSERT(
1712  _status == Fw::FW_SERIALIZE_OK,
1713  static_cast<FwAssertArgType>(_status)
1714  );
1715 #endif
1716  _status = _logBuff.serializeFrom(ID);
1717  FW_ASSERT(
1718  _status == Fw::FW_SERIALIZE_OK,
1719  static_cast<FwAssertArgType>(_status)
1720  );
1721 
1722  this->Log_out(
1723  0,
1724  _id,
1725  _logTime,
1727  _logBuff
1728  );
1729  }
1730 
1731  // Emit the event on the text log port
1732 #if FW_ENABLE_TEXT_LOGGING
1733  if (this->isConnected_LogText_OutputPort(0)) {
1734 #if FW_OBJECT_NAMES == 1
1735  const char* _formatString =
1736  "(%s) %s: ID filter list is full. Cannot filter %" PRIu32 " .";
1737 #else
1738  const char* _formatString =
1739  "%s: ID filter list is full. Cannot filter %" PRIu32 " .";
1740 #endif
1741 
1742  Fw::TextLogString _logString;
1743  (void) _logString.format(
1744  _formatString,
1745 #if FW_OBJECT_NAMES == 1
1746  this->m_objName.toChar(),
1747 #endif
1748  "ID_FILTER_LIST_FULL ",
1749  ID
1750  );
1751 
1752  this->LogText_out(
1753  0,
1754  _id,
1755  _logTime,
1757  _logString
1758  );
1759  }
1760 #endif
1761  }
1762 
1765  {
1766  // Get the time
1767  Fw::Time _logTime;
1768  if (this->isConnected_Time_OutputPort(0)) {
1769  this->Time_out(0, _logTime);
1770  }
1771 
1772  const FwEventIdType _id = this->getIdBase() + EVENTID_ID_FILTER_REMOVED;
1773 
1774  // Emit the event on the log port
1775  if (this->isConnected_Log_OutputPort(0)) {
1776  Fw::LogBuffer _logBuff;
1778 
1779 #if FW_AMPCS_COMPATIBLE
1780  // Serialize the number of arguments
1781  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1782  FW_ASSERT(
1783  _status == Fw::FW_SERIALIZE_OK,
1784  static_cast<FwAssertArgType>(_status)
1785  );
1786 #endif
1787 
1788 #if FW_AMPCS_COMPATIBLE
1789  // Serialize the argument size
1790  _status = _logBuff.serializeFrom(
1791  static_cast<U8>(sizeof(FwEventIdType))
1792  );
1793  FW_ASSERT(
1794  _status == Fw::FW_SERIALIZE_OK,
1795  static_cast<FwAssertArgType>(_status)
1796  );
1797 #endif
1798  _status = _logBuff.serializeFrom(ID);
1799  FW_ASSERT(
1800  _status == Fw::FW_SERIALIZE_OK,
1801  static_cast<FwAssertArgType>(_status)
1802  );
1803 
1804  this->Log_out(
1805  0,
1806  _id,
1807  _logTime,
1809  _logBuff
1810  );
1811  }
1812 
1813  // Emit the event on the text log port
1814 #if FW_ENABLE_TEXT_LOGGING
1815  if (this->isConnected_LogText_OutputPort(0)) {
1816 #if FW_OBJECT_NAMES == 1
1817  const char* _formatString =
1818  "(%s) %s: ID filter ID %" PRIu32 " removed.";
1819 #else
1820  const char* _formatString =
1821  "%s: ID filter ID %" PRIu32 " removed.";
1822 #endif
1823 
1824  Fw::TextLogString _logString;
1825  (void) _logString.format(
1826  _formatString,
1827 #if FW_OBJECT_NAMES == 1
1828  this->m_objName.toChar(),
1829 #endif
1830  "ID_FILTER_REMOVED ",
1831  ID
1832  );
1833 
1834  this->LogText_out(
1835  0,
1836  _id,
1837  _logTime,
1839  _logString
1840  );
1841  }
1842 #endif
1843  }
1844 
1847  {
1848  // Get the time
1849  Fw::Time _logTime;
1850  if (this->isConnected_Time_OutputPort(0)) {
1851  this->Time_out(0, _logTime);
1852  }
1853 
1854  const FwEventIdType _id = this->getIdBase() + EVENTID_ID_FILTER_NOT_FOUND;
1855 
1856  // Emit the event on the log port
1857  if (this->isConnected_Log_OutputPort(0)) {
1858  Fw::LogBuffer _logBuff;
1860 
1861 #if FW_AMPCS_COMPATIBLE
1862  // Serialize the number of arguments
1863  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1864  FW_ASSERT(
1865  _status == Fw::FW_SERIALIZE_OK,
1866  static_cast<FwAssertArgType>(_status)
1867  );
1868 #endif
1869 
1870 #if FW_AMPCS_COMPATIBLE
1871  // Serialize the argument size
1872  _status = _logBuff.serializeFrom(
1873  static_cast<U8>(sizeof(FwEventIdType))
1874  );
1875  FW_ASSERT(
1876  _status == Fw::FW_SERIALIZE_OK,
1877  static_cast<FwAssertArgType>(_status)
1878  );
1879 #endif
1880  _status = _logBuff.serializeFrom(ID);
1881  FW_ASSERT(
1882  _status == Fw::FW_SERIALIZE_OK,
1883  static_cast<FwAssertArgType>(_status)
1884  );
1885 
1886  this->Log_out(
1887  0,
1888  _id,
1889  _logTime,
1891  _logBuff
1892  );
1893  }
1894 
1895  // Emit the event on the text log port
1896 #if FW_ENABLE_TEXT_LOGGING
1897  if (this->isConnected_LogText_OutputPort(0)) {
1898 #if FW_OBJECT_NAMES == 1
1899  const char* _formatString =
1900  "(%s) %s: ID filter ID %" PRIu32 " not found.";
1901 #else
1902  const char* _formatString =
1903  "%s: ID filter ID %" PRIu32 " not found.";
1904 #endif
1905 
1906  Fw::TextLogString _logString;
1907  (void) _logString.format(
1908  _formatString,
1909 #if FW_OBJECT_NAMES == 1
1910  this->m_objName.toChar(),
1911 #endif
1912  "ID_FILTER_NOT_FOUND ",
1913  ID
1914  );
1915 
1916  this->LogText_out(
1917  0,
1918  _id,
1919  _logTime,
1921  _logString
1922  );
1923  }
1924 #endif
1925  }
1926 
1927  // ----------------------------------------------------------------------
1928  // Telemetry serialized write
1929  // ----------------------------------------------------------------------
1930 
1933  FwChanIdType id,
1934  Fw::TlmBuffer& _tlmBuff,
1935  Fw::Time _tlmTime
1936  ) const
1937  {
1938  if (this->isConnected_Tlm_OutputPort(0)) {
1939  if (
1940  this->isConnected_Time_OutputPort(0) &&
1941  (_tlmTime == Fw::ZERO_TIME)
1942  ) {
1943  this->Time_out(0, _tlmTime);
1944  }
1945 
1946  FwChanIdType _id;
1947  _id = this->getIdBase() + id;
1948 
1949  this->Tlm_out(
1950  0,
1951  _id,
1952  _tlmTime,
1953  _tlmBuff
1954  );
1955  }
1956  }
1957 
1958  // ----------------------------------------------------------------------
1959  // Telemetry write functions
1960  // ----------------------------------------------------------------------
1961 
1964  FwSizeType arg,
1965  Fw::Time _tlmTime
1966  )
1967  {
1968  // Check to see if it is the first time
1969  if (not this->m_first_update_EventsDropped) {
1970  // Check to see if value has changed. If not, don't write it.
1971  if (arg == this->m_last_EventsDropped) {
1972  return;
1973  }
1974  else {
1975  this->m_last_EventsDropped = arg;
1976  }
1977  }
1978  else {
1979  this->m_first_update_EventsDropped = false;
1980  this->m_last_EventsDropped = arg;
1981  }
1982 
1983  if (this->isConnected_Tlm_OutputPort(0)) {
1984  Fw::TlmBuffer _tlmBuff;
1985  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1986  FW_ASSERT(
1987  _stat == Fw::FW_SERIALIZE_OK,
1988  static_cast<FwAssertArgType>(_stat)
1989  );
1990 
1991  this->tlmWrite(
1993  _tlmBuff,
1994  _tlmTime
1995  );
1996  }
1997  }
1998 
1999  // ----------------------------------------------------------------------
2000  // Time
2001  // ----------------------------------------------------------------------
2002 
2004  getTime() const
2005  {
2006  if (this->isConnected_Time_OutputPort(0)) {
2007  Fw::Time _time;
2008  this->Time_out(0, _time);
2009  return _time;
2010  }
2011  else {
2012  return Fw::Time(TimeBase::TB_NONE, 0, 0);
2013  }
2014  }
2015 
2016  // ----------------------------------------------------------------------
2017  // Message dispatch functions
2018  // ----------------------------------------------------------------------
2019 
2020  Fw::QueuedComponentBase::MsgDispatchStatus EventManagerComponentBase ::
2021  doDispatch()
2022  {
2023  ComponentIpcSerializableBuffer _msg;
2024  FwQueuePriorityType _priority = 0;
2025 
2026  Os::Queue::Status _msgStatus = this->m_queue.receive(
2027  _msg,
2029  _priority
2030  );
2031  FW_ASSERT(
2032  _msgStatus == Os::Queue::OP_OK,
2033  static_cast<FwAssertArgType>(_msgStatus)
2034  );
2035 
2036  // Reset to beginning of buffer
2037  _msg.resetDeser();
2038 
2039  FwEnumStoreType _desMsg = 0;
2040  Fw::SerializeStatus _deserStatus = _msg.deserializeTo(_desMsg);
2041  FW_ASSERT(
2042  _deserStatus == Fw::FW_SERIALIZE_OK,
2043  static_cast<FwAssertArgType>(_deserStatus)
2044  );
2045 
2046  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
2047 
2048  if (_msgType == EVENTMANAGER_COMPONENT_EXIT) {
2049  return MSG_DISPATCH_EXIT;
2050  }
2051 
2052  FwIndexType portNum = 0;
2053  _deserStatus = _msg.deserializeTo(portNum);
2054  FW_ASSERT(
2055  _deserStatus == Fw::FW_SERIALIZE_OK,
2056  static_cast<FwAssertArgType>(_deserStatus)
2057  );
2058 
2059  switch (_msgType) {
2060  // Handle async input port pingIn
2061  case PINGIN_PING: {
2062  // Deserialize argument key
2063  U32 key;
2064  _deserStatus = _msg.deserializeTo(key);
2065  FW_ASSERT(
2066  _deserStatus == Fw::FW_SERIALIZE_OK,
2067  static_cast<FwAssertArgType>(_deserStatus)
2068  );
2069  // Call handler function
2070  this->pingIn_handler(
2071  portNum,
2072  key
2073  );
2074 
2075  break;
2076  }
2077 
2078  // Handle async input port run
2079  case RUN_SCHED: {
2080  // Deserialize argument context
2081  U32 context;
2082  _deserStatus = _msg.deserializeTo(context);
2083  FW_ASSERT(
2084  _deserStatus == Fw::FW_SERIALIZE_OK,
2085  static_cast<FwAssertArgType>(_deserStatus)
2086  );
2087  // Call handler function
2088  this->run_handler(
2089  portNum,
2090  context
2091  );
2092 
2093  break;
2094  }
2095 
2096  // Handle command SET_ID_FILTER
2097  case CMD_SET_ID_FILTER: {
2098  // Deserialize opcode
2099  FwOpcodeType _opCode = 0;
2100  _deserStatus = _msg.deserializeTo(_opCode);
2101  FW_ASSERT (
2102  _deserStatus == Fw::FW_SERIALIZE_OK,
2103  static_cast<FwAssertArgType>(_deserStatus)
2104  );
2105 
2106  // Deserialize command sequence
2107  U32 _cmdSeq = 0;
2108  _deserStatus = _msg.deserializeTo(_cmdSeq);
2109  FW_ASSERT (
2110  _deserStatus == Fw::FW_SERIALIZE_OK,
2111  static_cast<FwAssertArgType>(_deserStatus)
2112  );
2113 
2114  // Deserialize command argument buffer
2115  Fw::CmdArgBuffer args;
2116  _deserStatus = _msg.deserializeTo(args);
2117  FW_ASSERT (
2118  _deserStatus == Fw::FW_SERIALIZE_OK,
2119  static_cast<FwAssertArgType>(_deserStatus)
2120  );
2121 
2122  // Reset buffer
2123  args.resetDeser();
2124 
2125  // Deserialize argument ID
2126  FwEventIdType ID;
2127  _deserStatus = args.deserializeTo(ID);
2128  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2129  if (this->isConnected_CmdStatus_OutputPort(0)) {
2130  this->cmdResponse_out(
2131  _opCode,
2132  _cmdSeq,
2134  );
2135  }
2136  // Don't crash the task if bad arguments were passed from the ground
2137  break;
2138  }
2139 
2140  // Deserialize argument idFilterEnabled
2141  Svc::EventManager_Enabled idFilterEnabled;
2142  _deserStatus = args.deserializeTo(idFilterEnabled);
2143  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2144  if (this->isConnected_CmdStatus_OutputPort(0)) {
2145  this->cmdResponse_out(
2146  _opCode,
2147  _cmdSeq,
2149  );
2150  }
2151  // Don't crash the task if bad arguments were passed from the ground
2152  break;
2153  }
2154 
2155  // Make sure there was no data left over.
2156  // That means the argument buffer size was incorrect.
2157 #if FW_CMD_CHECK_RESIDUAL
2158  if (args.getDeserializeSizeLeft() != 0) {
2159  if (this->isConnected_CmdStatus_OutputPort(0)) {
2160  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2161  }
2162  // Don't crash the task if bad arguments were passed from the ground
2163  break;
2164  }
2165 #endif
2166 
2167  // Call handler function
2169  _opCode, _cmdSeq,
2170  ID,
2171  idFilterEnabled
2172  );
2173 
2174  break;
2175  }
2176 
2177  // Handle command DUMP_FILTER_STATE
2178  case CMD_DUMP_FILTER_STATE: {
2179  // Deserialize opcode
2180  FwOpcodeType _opCode = 0;
2181  _deserStatus = _msg.deserializeTo(_opCode);
2182  FW_ASSERT (
2183  _deserStatus == Fw::FW_SERIALIZE_OK,
2184  static_cast<FwAssertArgType>(_deserStatus)
2185  );
2186 
2187  // Deserialize command sequence
2188  U32 _cmdSeq = 0;
2189  _deserStatus = _msg.deserializeTo(_cmdSeq);
2190  FW_ASSERT (
2191  _deserStatus == Fw::FW_SERIALIZE_OK,
2192  static_cast<FwAssertArgType>(_deserStatus)
2193  );
2194 
2195  // Deserialize command argument buffer
2196  Fw::CmdArgBuffer args;
2197  _deserStatus = _msg.deserializeTo(args);
2198  FW_ASSERT (
2199  _deserStatus == Fw::FW_SERIALIZE_OK,
2200  static_cast<FwAssertArgType>(_deserStatus)
2201  );
2202 
2203  // Reset buffer
2204  args.resetDeser();
2205 
2206  // Make sure there was no data left over.
2207  // That means the argument buffer size was incorrect.
2208 #if FW_CMD_CHECK_RESIDUAL
2209  if (args.getDeserializeSizeLeft() != 0) {
2210  if (this->isConnected_CmdStatus_OutputPort(0)) {
2211  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2212  }
2213  // Don't crash the task if bad arguments were passed from the ground
2214  break;
2215  }
2216 #endif
2217 
2218  // Call handler function
2219  this->DUMP_FILTER_STATE_cmdHandler(_opCode, _cmdSeq);
2220 
2221  break;
2222  }
2223 
2224  // Handle internal interface loqQueue
2225  case INT_IF_LOQQUEUE: {
2226  FwEventIdType id;
2227  _deserStatus = _msg.deserializeTo(id);
2228 
2229  // Internal interface should always deserialize
2230  FW_ASSERT(
2231  Fw::FW_SERIALIZE_OK == _deserStatus,
2232  static_cast<FwAssertArgType>(_deserStatus)
2233  );
2234 
2235  Fw::Time timeTag;
2236  _deserStatus = _msg.deserializeTo(timeTag);
2237 
2238  // Internal interface should always deserialize
2239  FW_ASSERT(
2240  Fw::FW_SERIALIZE_OK == _deserStatus,
2241  static_cast<FwAssertArgType>(_deserStatus)
2242  );
2243 
2244  Fw::LogSeverity severity;
2245  _deserStatus = _msg.deserializeTo(severity);
2246 
2247  // Internal interface should always deserialize
2248  FW_ASSERT(
2249  Fw::FW_SERIALIZE_OK == _deserStatus,
2250  static_cast<FwAssertArgType>(_deserStatus)
2251  );
2252 
2253  Fw::LogBuffer args;
2254  _deserStatus = _msg.deserializeTo(args);
2255 
2256  // Internal interface should always deserialize
2257  FW_ASSERT(
2258  Fw::FW_SERIALIZE_OK == _deserStatus,
2259  static_cast<FwAssertArgType>(_deserStatus)
2260  );
2261 
2262  // Make sure there was no data left over.
2263  // That means the buffer size was incorrect.
2264  FW_ASSERT(
2265  _msg.getDeserializeSizeLeft() == 0,
2266  static_cast<FwAssertArgType>(_msg.getDeserializeSizeLeft())
2267  );
2268 
2269  // Call handler function
2271  id,
2272  timeTag,
2273  severity,
2274  args
2275  );
2276 
2277  break;
2278  }
2279 
2280  default:
2281  return MSG_DISPATCH_ERROR;
2282  }
2283 
2284  return MSG_DISPATCH_OK;
2285  }
2286 
2287  // ----------------------------------------------------------------------
2288  // Calls for messages received on special input ports
2289  // ----------------------------------------------------------------------
2290 
2291  void EventManagerComponentBase ::
2292  m_p_CmdDisp_in(
2293  Fw::PassiveComponentBase* callComp,
2294  FwIndexType portNum,
2295  FwOpcodeType opCode,
2296  U32 cmdSeq,
2297  Fw::CmdArgBuffer& args
2298  )
2299  {
2300  FW_ASSERT(callComp != nullptr);
2301  EventManagerComponentBase* compPtr = static_cast<EventManagerComponentBase*>(callComp);
2302  compPtr->CmdDisp_handlerBase(
2303  portNum,
2304  opCode,
2305  cmdSeq,
2306  args
2307  );
2308  }
2309 
2310  // ----------------------------------------------------------------------
2311  // Calls for messages received on typed input ports
2312  // ----------------------------------------------------------------------
2313 
2314  void EventManagerComponentBase ::
2315  m_p_LogRecv_in(
2316  Fw::PassiveComponentBase* callComp,
2317  FwIndexType portNum,
2318  FwEventIdType id,
2319  Fw::Time& timeTag,
2320  const Fw::LogSeverity& severity,
2321  Fw::LogBuffer& args
2322  )
2323  {
2324  FW_ASSERT(callComp != nullptr);
2325  EventManagerComponentBase* compPtr = static_cast<EventManagerComponentBase*>(callComp);
2326  compPtr->LogRecv_handlerBase(
2327  portNum,
2328  id,
2329  timeTag,
2330  severity,
2331  args
2332  );
2333  }
2334 
2335  void EventManagerComponentBase ::
2336  m_p_pingIn_in(
2337  Fw::PassiveComponentBase* callComp,
2338  FwIndexType portNum,
2339  U32 key
2340  )
2341  {
2342  FW_ASSERT(callComp != nullptr);
2343  EventManagerComponentBase* compPtr = static_cast<EventManagerComponentBase*>(callComp);
2344  compPtr->pingIn_handlerBase(
2345  portNum,
2346  key
2347  );
2348  }
2349 
2350  void EventManagerComponentBase ::
2351  m_p_run_in(
2352  Fw::PassiveComponentBase* callComp,
2353  FwIndexType portNum,
2354  U32 context
2355  )
2356  {
2357  FW_ASSERT(callComp != nullptr);
2358  EventManagerComponentBase* compPtr = static_cast<EventManagerComponentBase*>(callComp);
2359  compPtr->run_handlerBase(
2360  portNum,
2361  context
2362  );
2363  }
2364 
2365 #if !FW_DIRECT_PORT_CALLS
2366 
2367  // ----------------------------------------------------------------------
2368  // Invocation functions for special output ports
2369  // ----------------------------------------------------------------------
2370 
2371  void EventManagerComponentBase ::
2372  CmdReg_out(
2373  FwIndexType portNum,
2374  FwOpcodeType opCode
2375  ) const
2376  {
2377  FW_ASSERT(
2378  (0 <= portNum) && (portNum < this->getNum_CmdReg_OutputPorts()),
2379  static_cast<FwAssertArgType>(portNum)
2380  );
2381 
2382  FW_ASSERT(
2383  this->m_CmdReg_OutputPort[portNum].isConnected(),
2384  static_cast<FwAssertArgType>(portNum)
2385  );
2386  this->m_CmdReg_OutputPort[portNum].invoke(
2387  opCode
2388  );
2389  }
2390 
2391  void EventManagerComponentBase ::
2392  CmdStatus_out(
2393  FwIndexType portNum,
2394  FwOpcodeType opCode,
2395  U32 cmdSeq,
2396  const Fw::CmdResponse& response
2397  ) const
2398  {
2399  FW_ASSERT(
2400  (0 <= portNum) && (portNum < this->getNum_CmdStatus_OutputPorts()),
2401  static_cast<FwAssertArgType>(portNum)
2402  );
2403 
2404  FW_ASSERT(
2405  this->m_CmdStatus_OutputPort[portNum].isConnected(),
2406  static_cast<FwAssertArgType>(portNum)
2407  );
2408  this->m_CmdStatus_OutputPort[portNum].invoke(
2409  opCode,
2410  cmdSeq,
2411  response
2412  );
2413  }
2414 
2415  void EventManagerComponentBase ::
2416  Log_out(
2417  FwIndexType portNum,
2418  FwEventIdType id,
2419  Fw::Time& timeTag,
2420  const Fw::LogSeverity& severity,
2421  Fw::LogBuffer& args
2422  ) const
2423  {
2424  FW_ASSERT(
2425  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
2426  static_cast<FwAssertArgType>(portNum)
2427  );
2428 
2429  FW_ASSERT(
2430  this->m_Log_OutputPort[portNum].isConnected(),
2431  static_cast<FwAssertArgType>(portNum)
2432  );
2433  this->m_Log_OutputPort[portNum].invoke(
2434  id,
2435  timeTag,
2436  severity,
2437  args
2438  );
2439  }
2440 
2441 #if FW_ENABLE_TEXT_LOGGING
2442 
2443  void EventManagerComponentBase ::
2444  LogText_out(
2445  FwIndexType portNum,
2446  FwEventIdType id,
2447  Fw::Time& timeTag,
2448  const Fw::LogSeverity& severity,
2449  Fw::TextLogString& text
2450  ) const
2451  {
2452  FW_ASSERT(
2453  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
2454  static_cast<FwAssertArgType>(portNum)
2455  );
2456 
2457  FW_ASSERT(
2458  this->m_LogText_OutputPort[portNum].isConnected(),
2459  static_cast<FwAssertArgType>(portNum)
2460  );
2461  this->m_LogText_OutputPort[portNum].invoke(
2462  id,
2463  timeTag,
2464  severity,
2465  text
2466  );
2467  }
2468 
2469 #endif
2470 
2471  void EventManagerComponentBase ::
2472  Time_out(
2473  FwIndexType portNum,
2474  Fw::Time& time
2475  ) const
2476  {
2477  FW_ASSERT(
2478  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
2479  static_cast<FwAssertArgType>(portNum)
2480  );
2481 
2482  FW_ASSERT(
2483  this->m_Time_OutputPort[portNum].isConnected(),
2484  static_cast<FwAssertArgType>(portNum)
2485  );
2486  this->m_Time_OutputPort[portNum].invoke(
2487  time
2488  );
2489  }
2490 
2491  void EventManagerComponentBase ::
2492  Tlm_out(
2493  FwIndexType portNum,
2494  FwChanIdType id,
2495  Fw::Time& timeTag,
2496  Fw::TlmBuffer& val
2497  ) const
2498  {
2499  FW_ASSERT(
2500  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
2501  static_cast<FwAssertArgType>(portNum)
2502  );
2503 
2504  FW_ASSERT(
2505  this->m_Tlm_OutputPort[portNum].isConnected(),
2506  static_cast<FwAssertArgType>(portNum)
2507  );
2508  this->m_Tlm_OutputPort[portNum].invoke(
2509  id,
2510  timeTag,
2511  val
2512  );
2513  }
2514 
2515 #endif
2516 
2517 }
Serialization/Deserialization operation was successful.
void run_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port run.
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:157
void log_ACTIVITY_LO_SEVERITY_FILTER_STATE(const Svc::EventManager_FilterSeverity &severity, bool enabled) const
static constexpr FwIndexType getNum_Tlm_OutputPorts()
virtual void run_preMsgHook(FwIndexType portNum, U32 context)
Pre-message hook for async input port run.
void invoke(Fw::ComBuffer &data, U32 context) const
Invoke a port connection.
Definition: ComPortAc.cpp:181
void tlmWrite_EventsDropped(FwSizeType arg, Fw::Time _tlmTime=Fw::Time())
void set_CmdReg_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to CmdReg[portNum].
void init()
Initialization function.
Definition: ComPortAc.cpp:162
static constexpr FwSizeType CAPACITY
Definition: CmdPortAc.hpp:36
virtual void SET_EVENT_FILTER_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Svc::EventManager_FilterSeverity &filterLevel, const Svc::EventManager_Enabled &filterEnabled)=0
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
Enabled and disabled state.
void LogRecv_handlerBase(FwIndexType portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Handler base-class function for input port LogRecv.
FwIdType FwOpcodeType
The type of a command opcode.
Operation succeeded.
Definition: Os.hpp:27
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:71
I32 FwEnumStoreType
Status
status returned from the queue send function
Definition: Queue.hpp:30
void init()
Initialization function.
Definition: SchedPortAc.cpp:73
message to exit active component task
BYTE pingInPortSize[Svc::PingPortBuffer::CAPACITY]
void init()
Initialization function.
Definition: CmdPortAc.cpp:89
SerializeStatus deserializeTo(U8 &val, Endianness mode=Endianness::BIG) override
Deserialize an 8-bit unsigned integer value.
bool isConnected_CmdStatus_OutputPort(FwIndexType portNum) const
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
void invoke(U32 key) const
Invoke a port connection.
Definition: PingPortAc.cpp:170
bool isConnected_PktSend_OutputPort(FwIndexType portNum) const
const Time ZERO_TIME
Definition: Time.cpp:5
bool isConnected_FatalAnnounce_OutputPort(FwIndexType portNum) const
bool isConnected_Tlm_OutputPort(FwIndexType portNum) const
void set_pingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
static constexpr FwIndexType getNum_CmdReg_OutputPorts()
void CmdDisp_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Handler base-class function for input port CmdDisp.
static constexpr FwIndexType getNum_LogRecv_InputPorts()
Fw::InputCmdPort * get_CmdDisp_InputPort(FwIndexType portNum)
void init()
Initialization function.
Definition: TlmPortAc.cpp:171
Enum representing a command response.
static constexpr FwIndexType getNum_pingOut_OutputPorts()
void invoke(FwEventIdType Id) const
Invoke a port connection.
No time base has been established (Required)
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
void set_PktSend_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to PktSend[portNum].
Svc::InputSchedPort * get_run_InputPort(FwIndexType portNum)
Os::Queue m_queue
queue object for active component
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:177
void init()
Object initializer.
Definition: ObjBase.cpp:24
static constexpr FwIndexType getNum_CmdStatus_OutputPorts()
void regCommands()
Register commands with the Command Dispatcher.
SerializeStatus
forward declaration for string
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: CmdPortAc.cpp:95
The size of the serial representation.
Message will block until space is available.
Definition: Queue.hpp:47
static constexpr FwIndexType getNum_pingIn_InputPorts()
FwIdType FwEventIdType
The type of an event identifier.
void invoke(FwOpcodeType opCode) const
Invoke a port connection.
static constexpr FwSizeType CAPACITY
Definition: PingPortAc.hpp:34
void init()
Initialization function.
Definition: LogPortAc.cpp:97
void SET_EVENT_FILTER_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void addCallPort(InputFatalEventPort *callPort)
Register an input port.
void log_ACTIVITY_HI_ID_FILTER_ENABLED(FwEventIdType ID) const
#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 SET_ID_FILTER_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command SET_ID_FILTER.
virtual void DUMP_FILTER_STATE_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command DUMP_FILTER_STATE.
void init()
Initialization function.
Definition: TimePortAc.cpp:151
void set_Tlm_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to Tlm[portNum].
Less important informational events.
Set filter for reporting events. Events are not stored in component.
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
void log_WARNING_LO_ID_FILTER_LIST_FULL(FwEventIdType ID) const
void tlmWrite(FwChanIdType id, Fw::TlmBuffer &_tlmBuff, Fw::Time _tlmTime=Fw::Time()) const
A less serious but recoverable event.
bool isConnected_Log_OutputPort(FwIndexType portNum) const
void init()
Initialization function.
Definition: PingPortAc.cpp:151
static constexpr FwIndexType getNum_FatalAnnounce_OutputPorts()
static constexpr FwIndexType getNum_PktSend_OutputPorts()
void invoke(Fw::Time &time) const
Invoke a port connection.
Definition: TimePortAc.cpp:170
Serializable::SizeType getDeserializeSizeLeft() const override
Get remaining deserialization buffer size.
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
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 pingOut_out(FwIndexType portNum, U32 key) const
Invoke output port pingOut.
void addCallPort(InputPingPort *callPort)
Register an input port.
Definition: PingPortAc.cpp:157
static constexpr FwIndexType getNum_run_InputPorts()
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 FatalAnnounce_out(FwIndexType portNum, FwEventIdType Id) const
Invoke output port FatalAnnounce.
void resetDeser() override
Reset deserialization pointer to beginning of buffer.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port connection.
Definition: TlmPortAc.cpp:190
const char * toChar() const
Convert to a C-style char*.
bool isConnected() const
Definition: PortBase.cpp:38
Enum representing event severity.
bool isConnected_Time_OutputPort(FwIndexType portNum) const
#define PRI_FwIndexType
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:58
void init()
Initialization function.
Definition: LogPortAc.cpp:180
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: LogPortAc.cpp:103
void setPortNum(FwIndexType portNum)
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
void set_Log_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
BlockingType
message type
Definition: Queue.hpp:46
void log_WARNING_LO_ID_FILTER_NOT_FOUND(FwEventIdType ID) const
bool isConnected_CmdReg_OutputPort(FwIndexType portNum) const
void loqQueue_internalInterfaceInvoke(FwEventIdType id, const Fw::Time &timeTag, const Fw::LogSeverity &severity, const Fw::LogBuffer &args)
Internal interface base-class function for loqQueue.
Command failed to deserialize.
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
Important informational events.
virtual void run_handler(FwIndexType portNum, U32 context)=0
Handler for input port run.
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 set_CmdStatus_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to CmdStatus[portNum].
void SET_ID_FILTER_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
virtual void LogRecv_handler(FwIndexType portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)=0
Handler for input port LogRecv.
A message was sent requesting an exit of the loop.
virtual void pingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port pingIn.
PlatformIndexType FwIndexType
void DUMP_FILTER_STATE_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:186
virtual void DUMP_FILTER_STATE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
void init()
Initialization function.
void incNumMsgDropped()
increment the number of messages dropped
void init()
Initialization function.
Definition: PingPortAc.cpp:73
static constexpr FwIndexType getNum_Time_OutputPorts()
static constexpr FwIndexType getNum_CmdDisp_InputPorts()
virtual void loqQueue_internalInterfaceHandler(FwEventIdType id, const Fw::Time &timeTag, const Fw::LogSeverity &severity, const Fw::LogBuffer &args)=0
Internal interface handler for loqQueue.
RateGroupDivider component implementation.
bool isConnected_pingOut_OutputPort(FwIndexType portNum) const
message sent/received okay
Definition: Queue.hpp:31
U8 BYTE
byte type
Definition: BasicTypes.h:57
static constexpr FwIndexType getNum_Log_OutputPorts()
void addCallPort(InputComPort *callPort)
Register an input port.
Definition: ComPortAc.cpp:168
void PktSend_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context) const
Invoke output port PktSend.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: PingPortAc.cpp:79
Message will return with status when space is unavailable.
Definition: Queue.hpp:48
void init()
Initialization function.
Implementation of malloc based allocator.
virtual ~EventManagerComponentBase()
Destroy EventManagerComponentBase object.
void init()
Initialization function.
EventManagerComponentBase(const char *compName="")
Construct EventManagerComponentBase object.
void set_FatalAnnounce_OutputPort(FwIndexType portNum, Svc::InputFatalEventPort *port)
Connect port to FatalAnnounce[portNum].
Fw::InputLogPort * get_LogRecv_InputPort(FwIndexType portNum)
#define FW_ASSERT(...)
Definition: Assert.hpp:14
static constexpr FwSizeType CAPACITY
Definition: SchedPortAc.hpp:34
void log_ACTIVITY_HI_ID_FILTER_REMOVED(FwEventIdType ID) const
PlatformAssertArgType FwAssertArgType
The type of arguments to assert functions.
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
BYTE cmdPortSize[Fw::CmdPortBuffer::CAPACITY]
virtual void SET_ID_FILTER_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, FwEventIdType ID, const Svc::EventManager_Enabled &idFilterEnabled)=0