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