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