F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
ComLoggerDpComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title ComLoggerDpComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for ComLoggerDp 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  COMLOGGERDP_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT,
19  COMIN_COM,
20  PINGIN_PING,
21  STARTRECORDINGIN_COMLOGGERSTART,
22  STOPRECORDINGIN_COMLOGGERSTOP,
23  CMD_STARTCOMDP,
24  CMD_UPDATEPRIORITY,
25  CMD_STOPCOMDP,
26  CMD_CLEAR_COUNTERS,
27  INT_IF_SCHEDININTERNAL,
28  };
29 
30  // Get the max size by constructing a union of the async input, command, and
31  // internal port serialization sizes
32  union BuffUnion {
33  BYTE comInPortSize[Fw::ComPortBuffer::CAPACITY];
35  BYTE startRecordingInPortSize[Svc::ComLoggerStartPortBuffer::CAPACITY];
37  };
38 
39  // Define a message buffer class large enough to handle all the
40  // asynchronous inputs to the component
41  class ComponentIpcSerializableBuffer :
43  {
44 
45  public:
46 
47  enum {
48  // Offset into data in buffer: Size of message ID and port number
49  DATA_OFFSET = sizeof(FwEnumStoreType) + sizeof(FwIndexType),
50  // Max data size
51  MAX_DATA_SIZE = sizeof(BuffUnion),
52  // Max message size: Size of message id + size of port + max data size
53  SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
54  };
55 
56  ComponentIpcSerializableBuffer() : Fw::LinearBufferBase(m_buff, sizeof(m_buff)) {
57 
58  }
59 
60  private:
61  // Should be the max of all the input ports serialized sizes...
62  U8 m_buff[SERIALIZATION_SIZE];
63 
64  };
65  }
66 
67  // ----------------------------------------------------------------------
68  // Types for data products
69  // ----------------------------------------------------------------------
70 
73  FwDpIdType id,
74  const Fw::Buffer& buffer,
75  FwDpIdType baseId
76  ) :
77  Fw::DpContainer(id, buffer),
78  m_baseId(baseId)
79  {
80 
81  }
82 
85  Fw::DpContainer(),
86  m_baseId(0)
87  {
88 
89  }
90 
93  const U8* array,
94  FwSizeType size
95  )
96  {
97  FW_ASSERT(array != nullptr);
98  // Compute the size delta
99  const FwSizeType sizeDelta =
100  sizeof(FwDpIdType) +
101  sizeof(FwSizeStoreType) +
102  size * sizeof(U8);
103  // Serialize the elements if they will fit
105  if ((this->m_dataBuffer.getSize() + sizeDelta) <= this->m_dataBuffer.getCapacity()) {
106  const FwDpIdType id = this->m_baseId + RecordId::ComBufferRecord;
107  status = this->m_dataBuffer.serializeFrom(id);
108  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
109  status = this->m_dataBuffer.serializeSize(size);
110  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
111  status = this->m_dataBuffer.serializeFrom(array, size, Fw::Serialization::OMIT_LENGTH);
112  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
113  this->m_dataSize += sizeDelta;
114  }
115  else {
117  }
118  return status;
119  }
120 
121  // ----------------------------------------------------------------------
122  // Component initialization
123  // ----------------------------------------------------------------------
124 
127  FwSizeType queueDepth,
128  FwEnumStoreType instance
129  )
130  {
131  // Initialize base class
133 
134 #if !FW_DIRECT_PORT_CALLS
135  // Connect input port cmdIn
136  for (
137  FwIndexType port = 0;
138  port < static_cast<FwIndexType>(this->getNum_cmdIn_InputPorts());
139  port++
140  ) {
141  this->m_cmdIn_InputPort[port].init();
142  this->m_cmdIn_InputPort[port].addCallComp(
143  this,
144  m_p_cmdIn_in
145  );
146  this->m_cmdIn_InputPort[port].setPortNum(port);
147 
148 #if FW_OBJECT_NAMES == 1
149  Fw::ObjectName portName;
150  portName.format(
151  "%s_cmdIn_InputPort[%" PRI_FwIndexType "]",
152  this->m_objName.toChar(),
153  port
154  );
155  this->m_cmdIn_InputPort[port].setObjName(portName.toChar());
156 #endif
157  }
158 #endif
159 
160 #if !FW_DIRECT_PORT_CALLS
161  // Connect input port comIn
162  for (
163  FwIndexType port = 0;
164  port < static_cast<FwIndexType>(this->getNum_comIn_InputPorts());
165  port++
166  ) {
167  this->m_comIn_InputPort[port].init();
168  this->m_comIn_InputPort[port].addCallComp(
169  this,
170  m_p_comIn_in
171  );
172  this->m_comIn_InputPort[port].setPortNum(port);
173 
174 #if FW_OBJECT_NAMES == 1
175  Fw::ObjectName portName;
176  portName.format(
177  "%s_comIn_InputPort[%" PRI_FwIndexType "]",
178  this->m_objName.toChar(),
179  port
180  );
181  this->m_comIn_InputPort[port].setObjName(portName.toChar());
182 #endif
183  }
184 #endif
185 
186 #if !FW_DIRECT_PORT_CALLS
187  // Connect input port pingIn
188  for (
189  FwIndexType port = 0;
190  port < static_cast<FwIndexType>(this->getNum_pingIn_InputPorts());
191  port++
192  ) {
193  this->m_pingIn_InputPort[port].init();
194  this->m_pingIn_InputPort[port].addCallComp(
195  this,
196  m_p_pingIn_in
197  );
198  this->m_pingIn_InputPort[port].setPortNum(port);
199 
200 #if FW_OBJECT_NAMES == 1
201  Fw::ObjectName portName;
202  portName.format(
203  "%s_pingIn_InputPort[%" PRI_FwIndexType "]",
204  this->m_objName.toChar(),
205  port
206  );
207  this->m_pingIn_InputPort[port].setObjName(portName.toChar());
208 #endif
209  }
210 #endif
211 
212 #if !FW_DIRECT_PORT_CALLS
213  // Connect input port schedIn
214  for (
215  FwIndexType port = 0;
216  port < static_cast<FwIndexType>(this->getNum_schedIn_InputPorts());
217  port++
218  ) {
219  this->m_schedIn_InputPort[port].init();
220  this->m_schedIn_InputPort[port].addCallComp(
221  this,
222  m_p_schedIn_in
223  );
224  this->m_schedIn_InputPort[port].setPortNum(port);
225 
226 #if FW_OBJECT_NAMES == 1
227  Fw::ObjectName portName;
228  portName.format(
229  "%s_schedIn_InputPort[%" PRI_FwIndexType "]",
230  this->m_objName.toChar(),
231  port
232  );
233  this->m_schedIn_InputPort[port].setObjName(portName.toChar());
234 #endif
235  }
236 #endif
237 
238 #if !FW_DIRECT_PORT_CALLS
239  // Connect input port startRecordingIn
240  for (
241  FwIndexType port = 0;
242  port < static_cast<FwIndexType>(this->getNum_startRecordingIn_InputPorts());
243  port++
244  ) {
245  this->m_startRecordingIn_InputPort[port].init();
246  this->m_startRecordingIn_InputPort[port].addCallComp(
247  this,
248  m_p_startRecordingIn_in
249  );
250  this->m_startRecordingIn_InputPort[port].setPortNum(port);
251 
252 #if FW_OBJECT_NAMES == 1
253  Fw::ObjectName portName;
254  portName.format(
255  "%s_startRecordingIn_InputPort[%" PRI_FwIndexType "]",
256  this->m_objName.toChar(),
257  port
258  );
259  this->m_startRecordingIn_InputPort[port].setObjName(portName.toChar());
260 #endif
261  }
262 #endif
263 
264 #if !FW_DIRECT_PORT_CALLS
265  // Connect input port stopRecordingIn
266  for (
267  FwIndexType port = 0;
268  port < static_cast<FwIndexType>(this->getNum_stopRecordingIn_InputPorts());
269  port++
270  ) {
271  this->m_stopRecordingIn_InputPort[port].init();
272  this->m_stopRecordingIn_InputPort[port].addCallComp(
273  this,
274  m_p_stopRecordingIn_in
275  );
276  this->m_stopRecordingIn_InputPort[port].setPortNum(port);
277 
278 #if FW_OBJECT_NAMES == 1
279  Fw::ObjectName portName;
280  portName.format(
281  "%s_stopRecordingIn_InputPort[%" PRI_FwIndexType "]",
282  this->m_objName.toChar(),
283  port
284  );
285  this->m_stopRecordingIn_InputPort[port].setObjName(portName.toChar());
286 #endif
287  }
288 #endif
289 
290 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING
291  // Connect output port LogText
292  for (
293  FwIndexType port = 0;
294  port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
295  port++
296  ) {
297  this->m_LogText_OutputPort[port].init();
298 
299 #if FW_OBJECT_NAMES == 1
300  Fw::ObjectName portName;
301  portName.format(
302  "%s_LogText_OutputPort[%" PRI_FwIndexType "]",
303  this->m_objName.toChar(),
304  port
305  );
306  this->m_LogText_OutputPort[port].setObjName(portName.toChar());
307 #endif
308  }
309 #endif
310 
311 #if !FW_DIRECT_PORT_CALLS
312  // Connect output port cmdRegOut
313  for (
314  FwIndexType port = 0;
315  port < static_cast<FwIndexType>(this->getNum_cmdRegOut_OutputPorts());
316  port++
317  ) {
318  this->m_cmdRegOut_OutputPort[port].init();
319 
320 #if FW_OBJECT_NAMES == 1
321  Fw::ObjectName portName;
322  portName.format(
323  "%s_cmdRegOut_OutputPort[%" PRI_FwIndexType "]",
324  this->m_objName.toChar(),
325  port
326  );
327  this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar());
328 #endif
329  }
330 #endif
331 
332 #if !FW_DIRECT_PORT_CALLS
333  // Connect output port cmdResponseOut
334  for (
335  FwIndexType port = 0;
336  port < static_cast<FwIndexType>(this->getNum_cmdResponseOut_OutputPorts());
337  port++
338  ) {
339  this->m_cmdResponseOut_OutputPort[port].init();
340 
341 #if FW_OBJECT_NAMES == 1
342  Fw::ObjectName portName;
343  portName.format(
344  "%s_cmdResponseOut_OutputPort[%" PRI_FwIndexType "]",
345  this->m_objName.toChar(),
346  port
347  );
348  this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar());
349 #endif
350  }
351 #endif
352 
353 #if !FW_DIRECT_PORT_CALLS
354  // Connect output port logOut
355  for (
356  FwIndexType port = 0;
357  port < static_cast<FwIndexType>(this->getNum_logOut_OutputPorts());
358  port++
359  ) {
360  this->m_logOut_OutputPort[port].init();
361 
362 #if FW_OBJECT_NAMES == 1
363  Fw::ObjectName portName;
364  portName.format(
365  "%s_logOut_OutputPort[%" PRI_FwIndexType "]",
366  this->m_objName.toChar(),
367  port
368  );
369  this->m_logOut_OutputPort[port].setObjName(portName.toChar());
370 #endif
371  }
372 #endif
373 
374 #if !FW_DIRECT_PORT_CALLS
375  // Connect output port productGetOut
376  for (
377  FwIndexType port = 0;
378  port < static_cast<FwIndexType>(this->getNum_productGetOut_OutputPorts());
379  port++
380  ) {
381  this->m_productGetOut_OutputPort[port].init();
382 
383 #if FW_OBJECT_NAMES == 1
384  Fw::ObjectName portName;
385  portName.format(
386  "%s_productGetOut_OutputPort[%" PRI_FwIndexType "]",
387  this->m_objName.toChar(),
388  port
389  );
390  this->m_productGetOut_OutputPort[port].setObjName(portName.toChar());
391 #endif
392  }
393 #endif
394 
395 #if !FW_DIRECT_PORT_CALLS
396  // Connect output port productSendOut
397  for (
398  FwIndexType port = 0;
399  port < static_cast<FwIndexType>(this->getNum_productSendOut_OutputPorts());
400  port++
401  ) {
402  this->m_productSendOut_OutputPort[port].init();
403 
404 #if FW_OBJECT_NAMES == 1
405  Fw::ObjectName portName;
406  portName.format(
407  "%s_productSendOut_OutputPort[%" PRI_FwIndexType "]",
408  this->m_objName.toChar(),
409  port
410  );
411  this->m_productSendOut_OutputPort[port].setObjName(portName.toChar());
412 #endif
413  }
414 #endif
415 
416 #if !FW_DIRECT_PORT_CALLS
417  // Connect output port timeCaller
418  for (
419  FwIndexType port = 0;
420  port < static_cast<FwIndexType>(this->getNum_timeCaller_OutputPorts());
421  port++
422  ) {
423  this->m_timeCaller_OutputPort[port].init();
424 
425 #if FW_OBJECT_NAMES == 1
426  Fw::ObjectName portName;
427  portName.format(
428  "%s_timeCaller_OutputPort[%" PRI_FwIndexType "]",
429  this->m_objName.toChar(),
430  port
431  );
432  this->m_timeCaller_OutputPort[port].setObjName(portName.toChar());
433 #endif
434  }
435 #endif
436 
437 #if !FW_DIRECT_PORT_CALLS
438  // Connect output port tlmOut
439  for (
440  FwIndexType port = 0;
441  port < static_cast<FwIndexType>(this->getNum_tlmOut_OutputPorts());
442  port++
443  ) {
444  this->m_tlmOut_OutputPort[port].init();
445 
446 #if FW_OBJECT_NAMES == 1
447  Fw::ObjectName portName;
448  portName.format(
449  "%s_tlmOut_OutputPort[%" PRI_FwIndexType "]",
450  this->m_objName.toChar(),
451  port
452  );
453  this->m_tlmOut_OutputPort[port].setObjName(portName.toChar());
454 #endif
455  }
456 #endif
457 
458 #if !FW_DIRECT_PORT_CALLS
459  // Connect output port pingOut
460  for (
461  FwIndexType port = 0;
462  port < static_cast<FwIndexType>(this->getNum_pingOut_OutputPorts());
463  port++
464  ) {
465  this->m_pingOut_OutputPort[port].init();
466 
467 #if FW_OBJECT_NAMES == 1
468  Fw::ObjectName portName;
469  portName.format(
470  "%s_pingOut_OutputPort[%" PRI_FwIndexType "]",
471  this->m_objName.toChar(),
472  port
473  );
474  this->m_pingOut_OutputPort[port].setObjName(portName.toChar());
475 #endif
476  }
477 #endif
478 
479  // Create the queue
480  Os::Queue::Status qStat = this->createQueue(
481  queueDepth,
482  static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
483  );
484  FW_ASSERT(
485  Os::Queue::Status::OP_OK == qStat,
486  static_cast<FwAssertArgType>(qStat)
487  );
488  }
489 
490 #if !FW_DIRECT_PORT_CALLS
491 
492  // ----------------------------------------------------------------------
493  // Getters for special input ports
494  // ----------------------------------------------------------------------
495 
498  {
499  FW_ASSERT(
500  (0 <= portNum) && (portNum < this->getNum_cmdIn_InputPorts()),
501  static_cast<FwAssertArgType>(portNum)
502  );
503 
504  return &this->m_cmdIn_InputPort[portNum];
505  }
506 
507 #endif
508 
509 #if !FW_DIRECT_PORT_CALLS
510 
511  // ----------------------------------------------------------------------
512  // Getters for typed input ports
513  // ----------------------------------------------------------------------
514 
517  {
518  FW_ASSERT(
519  (0 <= portNum) && (portNum < this->getNum_comIn_InputPorts()),
520  static_cast<FwAssertArgType>(portNum)
521  );
522 
523  return &this->m_comIn_InputPort[portNum];
524  }
525 
528  {
529  FW_ASSERT(
530  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
531  static_cast<FwAssertArgType>(portNum)
532  );
533 
534  return &this->m_pingIn_InputPort[portNum];
535  }
536 
539  {
540  FW_ASSERT(
541  (0 <= portNum) && (portNum < this->getNum_schedIn_InputPorts()),
542  static_cast<FwAssertArgType>(portNum)
543  );
544 
545  return &this->m_schedIn_InputPort[portNum];
546  }
547 
550  {
551  FW_ASSERT(
552  (0 <= portNum) && (portNum < this->getNum_startRecordingIn_InputPorts()),
553  static_cast<FwAssertArgType>(portNum)
554  );
555 
556  return &this->m_startRecordingIn_InputPort[portNum];
557  }
558 
561  {
562  FW_ASSERT(
563  (0 <= portNum) && (portNum < this->getNum_stopRecordingIn_InputPorts()),
564  static_cast<FwAssertArgType>(portNum)
565  );
566 
567  return &this->m_stopRecordingIn_InputPort[portNum];
568  }
569 
570 #endif
571 
572 #if !FW_DIRECT_PORT_CALLS
573 
574  // ----------------------------------------------------------------------
575  // Connect input ports to special output ports
576  // ----------------------------------------------------------------------
577 
578 #if FW_ENABLE_TEXT_LOGGING == 1
579 
580  void ComLoggerDpComponentBase ::
581  set_LogText_OutputPort(
582  FwIndexType portNum,
584  )
585  {
586  FW_ASSERT(
587  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
588  static_cast<FwAssertArgType>(portNum)
589  );
590 
591  this->m_LogText_OutputPort[portNum].addCallPort(port);
592  }
593 
594 #endif
595 
598  FwIndexType portNum,
599  Fw::InputCmdRegPort* port
600  )
601  {
602  FW_ASSERT(
603  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
604  static_cast<FwAssertArgType>(portNum)
605  );
606 
607  this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
608  }
609 
612  FwIndexType portNum,
614  )
615  {
616  FW_ASSERT(
617  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
618  static_cast<FwAssertArgType>(portNum)
619  );
620 
621  this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
622  }
623 
626  FwIndexType portNum,
627  Fw::InputLogPort* port
628  )
629  {
630  FW_ASSERT(
631  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
632  static_cast<FwAssertArgType>(portNum)
633  );
634 
635  this->m_logOut_OutputPort[portNum].addCallPort(port);
636  }
637 
640  FwIndexType portNum,
641  Fw::InputDpGetPort* port
642  )
643  {
644  FW_ASSERT(
645  (0 <= portNum) && (portNum < this->getNum_productGetOut_OutputPorts()),
646  static_cast<FwAssertArgType>(portNum)
647  );
648 
649  this->m_productGetOut_OutputPort[portNum].addCallPort(port);
650  }
651 
654  FwIndexType portNum,
655  Fw::InputDpSendPort* port
656  )
657  {
658  FW_ASSERT(
659  (0 <= portNum) && (portNum < this->getNum_productSendOut_OutputPorts()),
660  static_cast<FwAssertArgType>(portNum)
661  );
662 
663  this->m_productSendOut_OutputPort[portNum].addCallPort(port);
664  }
665 
668  FwIndexType portNum,
669  Fw::InputTimePort* port
670  )
671  {
672  FW_ASSERT(
673  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
674  static_cast<FwAssertArgType>(portNum)
675  );
676 
677  this->m_timeCaller_OutputPort[portNum].addCallPort(port);
678  }
679 
682  FwIndexType portNum,
683  Fw::InputTlmPort* port
684  )
685  {
686  FW_ASSERT(
687  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
688  static_cast<FwAssertArgType>(portNum)
689  );
690 
691  this->m_tlmOut_OutputPort[portNum].addCallPort(port);
692  }
693 
694 #endif
695 
696 #if !FW_DIRECT_PORT_CALLS
697 
698  // ----------------------------------------------------------------------
699  // Connect typed input ports to typed output ports
700  // ----------------------------------------------------------------------
701 
704  FwIndexType portNum,
705  Svc::InputPingPort* port
706  )
707  {
708  FW_ASSERT(
709  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
710  static_cast<FwAssertArgType>(portNum)
711  );
712 
713  this->m_pingOut_OutputPort[portNum].addCallPort(port);
714  }
715 
716 #endif
717 
718 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
719 
720  // ----------------------------------------------------------------------
721  // Connect serial input ports to special output ports
722  // ----------------------------------------------------------------------
723 
724 #if FW_ENABLE_TEXT_LOGGING == 1
725 
726  void ComLoggerDpComponentBase ::
727  set_LogText_OutputPort(
728  FwIndexType portNum,
729  Fw::InputSerializePort* port
730  )
731  {
732  FW_ASSERT(
733  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
734  static_cast<FwAssertArgType>(portNum)
735  );
736 
737  this->m_LogText_OutputPort[portNum].registerSerialPort(port);
738  }
739 
740 #endif
741 
744  FwIndexType portNum,
745  Fw::InputSerializePort* port
746  )
747  {
748  FW_ASSERT(
749  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
750  static_cast<FwAssertArgType>(portNum)
751  );
752 
753  this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
754  }
755 
758  FwIndexType portNum,
759  Fw::InputSerializePort* port
760  )
761  {
762  FW_ASSERT(
763  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
764  static_cast<FwAssertArgType>(portNum)
765  );
766 
767  this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
768  }
769 
772  FwIndexType portNum,
773  Fw::InputSerializePort* port
774  )
775  {
776  FW_ASSERT(
777  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
778  static_cast<FwAssertArgType>(portNum)
779  );
780 
781  this->m_logOut_OutputPort[portNum].registerSerialPort(port);
782  }
783 
786  FwIndexType portNum,
787  Fw::InputSerializePort* port
788  )
789  {
790  FW_ASSERT(
791  (0 <= portNum) && (portNum < this->getNum_productSendOut_OutputPorts()),
792  static_cast<FwAssertArgType>(portNum)
793  );
794 
795  this->m_productSendOut_OutputPort[portNum].registerSerialPort(port);
796  }
797 
800  FwIndexType portNum,
801  Fw::InputSerializePort* port
802  )
803  {
804  FW_ASSERT(
805  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
806  static_cast<FwAssertArgType>(portNum)
807  );
808 
809  this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
810  }
811 
814  FwIndexType portNum,
815  Fw::InputSerializePort* port
816  )
817  {
818  FW_ASSERT(
819  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
820  static_cast<FwAssertArgType>(portNum)
821  );
822 
823  this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
824  }
825 
826 #endif
827 
828 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
829 
830  // ----------------------------------------------------------------------
831  // Connect serial input ports to typed output ports
832  // ----------------------------------------------------------------------
833 
836  FwIndexType portNum,
837  Fw::InputSerializePort* port
838  )
839  {
840  FW_ASSERT(
841  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
842  static_cast<FwAssertArgType>(portNum)
843  );
844 
845  this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
846  }
847 
848 #endif
849 
850  // ----------------------------------------------------------------------
851  // Command registration
852  // ----------------------------------------------------------------------
853 
856  {
858 
859  this->cmdRegOut_out(
860  0,
861  this->getIdBase() + OPCODE_STARTCOMDP
862  );
863 
864  this->cmdRegOut_out(
865  0,
867  );
868 
869  this->cmdRegOut_out(
870  0,
871  this->getIdBase() + OPCODE_STOPCOMDP
872  );
873 
874  this->cmdRegOut_out(
875  0,
877  );
878  }
879 
880  // ----------------------------------------------------------------------
881  // Component construction and destruction
882  // ----------------------------------------------------------------------
883 
885  ComLoggerDpComponentBase(const char* compName) :
886  Fw::ActiveComponentBase(compName)
887  {
888  this->m_DpBufferErrorThrottle = 0;
889  }
890 
893  {
894 
895  }
896 
897 #if !FW_DIRECT_PORT_CALLS
898 
899  // ----------------------------------------------------------------------
900  // Connection status queries for special output ports
901  // ----------------------------------------------------------------------
902 
903 #if FW_ENABLE_TEXT_LOGGING == 1
904 
905  bool ComLoggerDpComponentBase ::
906  isConnected_LogText_OutputPort(FwIndexType portNum) const
907  {
908  FW_ASSERT(
909  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
910  static_cast<FwAssertArgType>(portNum)
911  );
912 
913  return this->m_LogText_OutputPort[portNum].isConnected();
914  }
915 
916 #endif
917 
920  {
921  FW_ASSERT(
922  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
923  static_cast<FwAssertArgType>(portNum)
924  );
925 
926  return this->m_cmdRegOut_OutputPort[portNum].isConnected();
927  }
928 
931  {
932  FW_ASSERT(
933  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
934  static_cast<FwAssertArgType>(portNum)
935  );
936 
937  return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
938  }
939 
942  {
943  FW_ASSERT(
944  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
945  static_cast<FwAssertArgType>(portNum)
946  );
947 
948  return this->m_logOut_OutputPort[portNum].isConnected();
949  }
950 
953  {
954  FW_ASSERT(
955  (0 <= portNum) && (portNum < this->getNum_productGetOut_OutputPorts()),
956  static_cast<FwAssertArgType>(portNum)
957  );
958 
959  return this->m_productGetOut_OutputPort[portNum].isConnected();
960  }
961 
964  {
965  FW_ASSERT(
966  (0 <= portNum) && (portNum < this->getNum_productSendOut_OutputPorts()),
967  static_cast<FwAssertArgType>(portNum)
968  );
969 
970  return this->m_productSendOut_OutputPort[portNum].isConnected();
971  }
972 
975  {
976  FW_ASSERT(
977  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
978  static_cast<FwAssertArgType>(portNum)
979  );
980 
981  return this->m_timeCaller_OutputPort[portNum].isConnected();
982  }
983 
986  {
987  FW_ASSERT(
988  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
989  static_cast<FwAssertArgType>(portNum)
990  );
991 
992  return this->m_tlmOut_OutputPort[portNum].isConnected();
993  }
994 
995 #endif
996 
997 #if !FW_DIRECT_PORT_CALLS
998 
999  // ----------------------------------------------------------------------
1000  // Connection status queries for typed output ports
1001  // ----------------------------------------------------------------------
1002 
1005  {
1006  FW_ASSERT(
1007  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
1008  static_cast<FwAssertArgType>(portNum)
1009  );
1010 
1011  return this->m_pingOut_OutputPort[portNum].isConnected();
1012  }
1013 
1014 #endif
1015 
1016  // ----------------------------------------------------------------------
1017  // Port handler base-class functions for special input ports
1018  //
1019  // Call these functions directly to bypass the corresponding ports
1020  // ----------------------------------------------------------------------
1021 
1024  FwIndexType portNum,
1025  FwOpcodeType opCode,
1026  U32 cmdSeq,
1027  Fw::CmdArgBuffer& args
1028  )
1029  {
1030 
1031  const U32 idBase = this->getIdBase();
1032  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
1033 
1034  // Select base class function based on opcode
1035  switch (opCode - idBase) {
1036  case OPCODE_STARTCOMDP: {
1038  opCode,
1039  cmdSeq,
1040  args
1041  );
1042  break;
1043  }
1044 
1045  case OPCODE_UPDATEPRIORITY: {
1047  opCode,
1048  cmdSeq,
1049  args
1050  );
1051  break;
1052  }
1053 
1054  case OPCODE_STOPCOMDP: {
1056  opCode,
1057  cmdSeq,
1058  args
1059  );
1060  break;
1061  }
1062 
1063  case OPCODE_CLEAR_COUNTERS: {
1065  opCode,
1066  cmdSeq,
1067  args
1068  );
1069  break;
1070  }
1071  default:
1072  // Unknown opcode: ignore it
1073  break;
1074  }
1075  }
1076 
1077  // ----------------------------------------------------------------------
1078  // Port handler base-class functions for typed input ports
1079  //
1080  // Call these functions directly to bypass the corresponding ports
1081  // ----------------------------------------------------------------------
1082 
1085  FwIndexType portNum,
1086  Fw::ComBuffer& data,
1087  U32 context
1088  )
1089  {
1090  // Make sure port number is valid
1091  FW_ASSERT(
1092  (0 <= portNum) && (portNum < this->getNum_comIn_InputPorts()),
1093  static_cast<FwAssertArgType>(portNum)
1094  );
1095 
1096  // Call pre-message hook
1098  portNum,
1099  data,
1100  context
1101  );
1102  ComponentIpcSerializableBuffer msg;
1104 
1105  // Serialize message ID
1106  _status = msg.serializeFrom(
1107  static_cast<FwEnumStoreType>(COMIN_COM)
1108  );
1109  FW_ASSERT(
1110  _status == Fw::FW_SERIALIZE_OK,
1111  static_cast<FwAssertArgType>(_status)
1112  );
1113 
1114  // Serialize port number
1115  _status = msg.serializeFrom(portNum);
1116  FW_ASSERT(
1117  _status == Fw::FW_SERIALIZE_OK,
1118  static_cast<FwAssertArgType>(_status)
1119  );
1120 
1121  // Serialize argument data
1122  _status = msg.serializeFrom(data);
1123  FW_ASSERT(
1124  _status == Fw::FW_SERIALIZE_OK,
1125  static_cast<FwAssertArgType>(_status)
1126  );
1127 
1128  // Serialize argument context
1129  _status = msg.serializeFrom(context);
1130  FW_ASSERT(
1131  _status == Fw::FW_SERIALIZE_OK,
1132  static_cast<FwAssertArgType>(_status)
1133  );
1134 
1135  // Send message
1137  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1138 
1139  if (qStatus == Os::Queue::Status::FULL) {
1140  this->incNumMsgDropped();
1141  return;
1142  }
1143 
1144  FW_ASSERT(
1145  qStatus == Os::Queue::OP_OK,
1146  static_cast<FwAssertArgType>(qStatus)
1147  );
1148  }
1149 
1152  FwIndexType portNum,
1153  U32 key
1154  )
1155  {
1156  // Make sure port number is valid
1157  FW_ASSERT(
1158  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
1159  static_cast<FwAssertArgType>(portNum)
1160  );
1161 
1162  // Call pre-message hook
1164  portNum,
1165  key
1166  );
1167  ComponentIpcSerializableBuffer msg;
1169 
1170  // Serialize message ID
1171  _status = msg.serializeFrom(
1172  static_cast<FwEnumStoreType>(PINGIN_PING)
1173  );
1174  FW_ASSERT(
1175  _status == Fw::FW_SERIALIZE_OK,
1176  static_cast<FwAssertArgType>(_status)
1177  );
1178 
1179  // Serialize port number
1180  _status = msg.serializeFrom(portNum);
1181  FW_ASSERT(
1182  _status == Fw::FW_SERIALIZE_OK,
1183  static_cast<FwAssertArgType>(_status)
1184  );
1185 
1186  // Serialize argument key
1187  _status = msg.serializeFrom(key);
1188  FW_ASSERT(
1189  _status == Fw::FW_SERIALIZE_OK,
1190  static_cast<FwAssertArgType>(_status)
1191  );
1192 
1193  // Send message
1195  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1196 
1197  FW_ASSERT(
1198  qStatus == Os::Queue::OP_OK,
1199  static_cast<FwAssertArgType>(qStatus)
1200  );
1201  }
1202 
1205  FwIndexType portNum,
1206  U32 context
1207  )
1208  {
1209  // Make sure port number is valid
1210  FW_ASSERT(
1211  (0 <= portNum) && (portNum < this->getNum_schedIn_InputPorts()),
1212  static_cast<FwAssertArgType>(portNum)
1213  );
1214 
1215  // Call handler function
1216  this->schedIn_handler(
1217  portNum,
1218  context
1219  );
1220  }
1221 
1224  FwIndexType portNum,
1225  FwSizeType packetsPerContainer,
1226  FwDpPriorityType priority
1227  )
1228  {
1229  // Make sure port number is valid
1230  FW_ASSERT(
1231  (0 <= portNum) && (portNum < this->getNum_startRecordingIn_InputPorts()),
1232  static_cast<FwAssertArgType>(portNum)
1233  );
1234 
1235  // Call pre-message hook
1237  portNum,
1238  packetsPerContainer,
1239  priority
1240  );
1241  ComponentIpcSerializableBuffer msg;
1243 
1244  // Serialize message ID
1245  _status = msg.serializeFrom(
1246  static_cast<FwEnumStoreType>(STARTRECORDINGIN_COMLOGGERSTART)
1247  );
1248  FW_ASSERT(
1249  _status == Fw::FW_SERIALIZE_OK,
1250  static_cast<FwAssertArgType>(_status)
1251  );
1252 
1253  // Serialize port number
1254  _status = msg.serializeFrom(portNum);
1255  FW_ASSERT(
1256  _status == Fw::FW_SERIALIZE_OK,
1257  static_cast<FwAssertArgType>(_status)
1258  );
1259 
1260  // Serialize argument packetsPerContainer
1261  _status = msg.serializeFrom(packetsPerContainer);
1262  FW_ASSERT(
1263  _status == Fw::FW_SERIALIZE_OK,
1264  static_cast<FwAssertArgType>(_status)
1265  );
1266 
1267  // Serialize argument priority
1268  _status = msg.serializeFrom(priority);
1269  FW_ASSERT(
1270  _status == Fw::FW_SERIALIZE_OK,
1271  static_cast<FwAssertArgType>(_status)
1272  );
1273 
1274  // Send message
1276  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1277 
1278  FW_ASSERT(
1279  qStatus == Os::Queue::OP_OK,
1280  static_cast<FwAssertArgType>(qStatus)
1281  );
1282  }
1283 
1286  {
1287  // Make sure port number is valid
1288  FW_ASSERT(
1289  (0 <= portNum) && (portNum < this->getNum_stopRecordingIn_InputPorts()),
1290  static_cast<FwAssertArgType>(portNum)
1291  );
1292 
1293  // Call pre-message hook
1294  stopRecordingIn_preMsgHook(portNum);
1295  ComponentIpcSerializableBuffer msg;
1297 
1298  // Serialize message ID
1299  _status = msg.serializeFrom(
1300  static_cast<FwEnumStoreType>(STOPRECORDINGIN_COMLOGGERSTOP)
1301  );
1302  FW_ASSERT(
1303  _status == Fw::FW_SERIALIZE_OK,
1304  static_cast<FwAssertArgType>(_status)
1305  );
1306 
1307  // Serialize port number
1308  _status = msg.serializeFrom(portNum);
1309  FW_ASSERT(
1310  _status == Fw::FW_SERIALIZE_OK,
1311  static_cast<FwAssertArgType>(_status)
1312  );
1313 
1314  // Send message
1316  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1317 
1318  FW_ASSERT(
1319  qStatus == Os::Queue::OP_OK,
1320  static_cast<FwAssertArgType>(qStatus)
1321  );
1322  }
1323 
1324  // ----------------------------------------------------------------------
1325  // Pre-message hooks for typed async input ports
1326  //
1327  // Each of these functions is invoked just before processing a message
1328  // on the corresponding port. By default, they do nothing. You can
1329  // override them to provide specific pre-message behavior.
1330  // ----------------------------------------------------------------------
1331 
1334  FwIndexType portNum,
1335  Fw::ComBuffer& data,
1336  U32 context
1337  )
1338  {
1339  // Default: no-op
1340  }
1341 
1344  FwIndexType portNum,
1345  U32 key
1346  )
1347  {
1348  // Default: no-op
1349  }
1350 
1353  FwIndexType portNum,
1354  FwSizeType packetsPerContainer,
1355  FwDpPriorityType priority
1356  )
1357  {
1358  // Default: no-op
1359  }
1360 
1363  {
1364  // Default: no-op
1365  }
1366 
1367 #if !FW_DIRECT_PORT_CALLS
1368 
1369  // ----------------------------------------------------------------------
1370  // Invocation functions for typed output ports
1371  // ----------------------------------------------------------------------
1372 
1375  FwIndexType portNum,
1376  U32 key
1377  ) const
1378  {
1379  FW_ASSERT(
1380  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
1381  static_cast<FwAssertArgType>(portNum)
1382  );
1383 
1384  FW_ASSERT(
1385  this->m_pingOut_OutputPort[portNum].isConnected(),
1386  static_cast<FwAssertArgType>(portNum)
1387  );
1388  this->m_pingOut_OutputPort[portNum].invoke(
1389  key
1390  );
1391  }
1392 
1393 #endif
1394 
1395  // ----------------------------------------------------------------------
1396  // Hooks for internal ports
1397  //
1398  // Each of these functions is invoked just before dropping a message
1399  // on the corresponding internal port. You should override them to provide
1400  // specific drop behavior.
1401  // ----------------------------------------------------------------------
1402 
1403  // ----------------------------------------------------------------------
1404  // Internal interface base-class functions
1405  // ----------------------------------------------------------------------
1406 
1409  {
1410  ComponentIpcSerializableBuffer msg;
1412 
1413  // Serialize the message ID
1414  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(INT_IF_SCHEDININTERNAL));
1415  FW_ASSERT (
1416  _status == Fw::FW_SERIALIZE_OK,
1417  static_cast<FwAssertArgType>(_status)
1418  );
1419 
1420  // Fake port number to make message dequeue work
1421  _status = msg.serializeFrom(static_cast<FwIndexType>(0));
1422  FW_ASSERT (
1423  _status == Fw::FW_SERIALIZE_OK,
1424  static_cast<FwAssertArgType>(_status)
1425  );
1426 
1427  // Send message
1429  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1430 
1431  if (qStatus == Os::Queue::Status::FULL) {
1433  return;
1434  }
1435 
1436  FW_ASSERT(
1437  qStatus == Os::Queue::OP_OK,
1438  static_cast<FwAssertArgType>(qStatus)
1439  );
1440  }
1441 
1442  // ----------------------------------------------------------------------
1443  // Command response
1444  // ----------------------------------------------------------------------
1445 
1448  FwOpcodeType opCode,
1449  U32 cmdSeq,
1450  Fw::CmdResponse response
1451  )
1452  {
1454  this->cmdResponseOut_out(0, opCode, cmdSeq, response);
1455  }
1456 
1457  // ----------------------------------------------------------------------
1458  // Command handler base-class functions
1459  //
1460  // Call these functions directly to bypass the command input port
1461  // ----------------------------------------------------------------------
1462 
1465  FwOpcodeType opCode,
1466  U32 cmdSeq,
1467  Fw::CmdArgBuffer& args
1468  )
1469  {
1470  // Call pre-message hook
1471  this->StartComDp_preMsgHook(opCode,cmdSeq);
1472 
1473  // Defer deserializing arguments to the message dispatcher
1474  // to avoid deserializing and reserializing just for IPC
1475  ComponentIpcSerializableBuffer msg;
1477 
1478  // Serialize for IPC
1479  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_STARTCOMDP));
1480  FW_ASSERT (
1481  _status == Fw::FW_SERIALIZE_OK,
1482  static_cast<FwAssertArgType>(_status)
1483  );
1484 
1485  // Fake port number to make message dequeue work
1486  FwIndexType port = 0;
1487 
1488  _status = msg.serializeFrom(port);
1489  FW_ASSERT (
1490  _status == Fw::FW_SERIALIZE_OK,
1491  static_cast<FwAssertArgType>(_status)
1492  );
1493 
1494  _status = msg.serializeFrom(opCode);
1495  FW_ASSERT (
1496  _status == Fw::FW_SERIALIZE_OK,
1497  static_cast<FwAssertArgType>(_status)
1498  );
1499 
1500  _status = msg.serializeFrom(cmdSeq);
1501  FW_ASSERT (
1502  _status == Fw::FW_SERIALIZE_OK,
1503  static_cast<FwAssertArgType>(_status)
1504  );
1505 
1506  _status = msg.serializeFrom(args);
1507  FW_ASSERT (
1508  _status == Fw::FW_SERIALIZE_OK,
1509  static_cast<FwAssertArgType>(_status)
1510  );
1511 
1512  // Send message
1514  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1515 
1516  FW_ASSERT(
1517  qStatus == Os::Queue::OP_OK,
1518  static_cast<FwAssertArgType>(qStatus)
1519  );
1520  }
1521 
1524  FwOpcodeType opCode,
1525  U32 cmdSeq,
1526  Fw::CmdArgBuffer& args
1527  )
1528  {
1529  // Call pre-message hook
1530  this->UpdatePriority_preMsgHook(opCode,cmdSeq);
1531 
1532  // Defer deserializing arguments to the message dispatcher
1533  // to avoid deserializing and reserializing just for IPC
1534  ComponentIpcSerializableBuffer msg;
1536 
1537  // Serialize for IPC
1538  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_UPDATEPRIORITY));
1539  FW_ASSERT (
1540  _status == Fw::FW_SERIALIZE_OK,
1541  static_cast<FwAssertArgType>(_status)
1542  );
1543 
1544  // Fake port number to make message dequeue work
1545  FwIndexType port = 0;
1546 
1547  _status = msg.serializeFrom(port);
1548  FW_ASSERT (
1549  _status == Fw::FW_SERIALIZE_OK,
1550  static_cast<FwAssertArgType>(_status)
1551  );
1552 
1553  _status = msg.serializeFrom(opCode);
1554  FW_ASSERT (
1555  _status == Fw::FW_SERIALIZE_OK,
1556  static_cast<FwAssertArgType>(_status)
1557  );
1558 
1559  _status = msg.serializeFrom(cmdSeq);
1560  FW_ASSERT (
1561  _status == Fw::FW_SERIALIZE_OK,
1562  static_cast<FwAssertArgType>(_status)
1563  );
1564 
1565  _status = msg.serializeFrom(args);
1566  FW_ASSERT (
1567  _status == Fw::FW_SERIALIZE_OK,
1568  static_cast<FwAssertArgType>(_status)
1569  );
1570 
1571  // Send message
1573  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1574 
1575  FW_ASSERT(
1576  qStatus == Os::Queue::OP_OK,
1577  static_cast<FwAssertArgType>(qStatus)
1578  );
1579  }
1580 
1583  FwOpcodeType opCode,
1584  U32 cmdSeq,
1585  Fw::CmdArgBuffer& args
1586  )
1587  {
1588  // Call pre-message hook
1589  this->StopComDp_preMsgHook(opCode,cmdSeq);
1590 
1591  // Defer deserializing arguments to the message dispatcher
1592  // to avoid deserializing and reserializing just for IPC
1593  ComponentIpcSerializableBuffer msg;
1595 
1596  // Serialize for IPC
1597  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_STOPCOMDP));
1598  FW_ASSERT (
1599  _status == Fw::FW_SERIALIZE_OK,
1600  static_cast<FwAssertArgType>(_status)
1601  );
1602 
1603  // Fake port number to make message dequeue work
1604  FwIndexType port = 0;
1605 
1606  _status = msg.serializeFrom(port);
1607  FW_ASSERT (
1608  _status == Fw::FW_SERIALIZE_OK,
1609  static_cast<FwAssertArgType>(_status)
1610  );
1611 
1612  _status = msg.serializeFrom(opCode);
1613  FW_ASSERT (
1614  _status == Fw::FW_SERIALIZE_OK,
1615  static_cast<FwAssertArgType>(_status)
1616  );
1617 
1618  _status = msg.serializeFrom(cmdSeq);
1619  FW_ASSERT (
1620  _status == Fw::FW_SERIALIZE_OK,
1621  static_cast<FwAssertArgType>(_status)
1622  );
1623 
1624  _status = msg.serializeFrom(args);
1625  FW_ASSERT (
1626  _status == Fw::FW_SERIALIZE_OK,
1627  static_cast<FwAssertArgType>(_status)
1628  );
1629 
1630  // Send message
1632  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1633 
1634  FW_ASSERT(
1635  qStatus == Os::Queue::OP_OK,
1636  static_cast<FwAssertArgType>(qStatus)
1637  );
1638  }
1639 
1642  FwOpcodeType opCode,
1643  U32 cmdSeq,
1644  Fw::CmdArgBuffer& args
1645  )
1646  {
1647  // Call pre-message hook
1648  this->CLEAR_COUNTERS_preMsgHook(opCode,cmdSeq);
1649 
1650  // Defer deserializing arguments to the message dispatcher
1651  // to avoid deserializing and reserializing just for IPC
1652  ComponentIpcSerializableBuffer msg;
1654 
1655  // Serialize for IPC
1656  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_CLEAR_COUNTERS));
1657  FW_ASSERT (
1658  _status == Fw::FW_SERIALIZE_OK,
1659  static_cast<FwAssertArgType>(_status)
1660  );
1661 
1662  // Fake port number to make message dequeue work
1663  FwIndexType port = 0;
1664 
1665  _status = msg.serializeFrom(port);
1666  FW_ASSERT (
1667  _status == Fw::FW_SERIALIZE_OK,
1668  static_cast<FwAssertArgType>(_status)
1669  );
1670 
1671  _status = msg.serializeFrom(opCode);
1672  FW_ASSERT (
1673  _status == Fw::FW_SERIALIZE_OK,
1674  static_cast<FwAssertArgType>(_status)
1675  );
1676 
1677  _status = msg.serializeFrom(cmdSeq);
1678  FW_ASSERT (
1679  _status == Fw::FW_SERIALIZE_OK,
1680  static_cast<FwAssertArgType>(_status)
1681  );
1682 
1683  _status = msg.serializeFrom(args);
1684  FW_ASSERT (
1685  _status == Fw::FW_SERIALIZE_OK,
1686  static_cast<FwAssertArgType>(_status)
1687  );
1688 
1689  // Send message
1691  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1692 
1693  FW_ASSERT(
1694  qStatus == Os::Queue::OP_OK,
1695  static_cast<FwAssertArgType>(qStatus)
1696  );
1697  }
1698 
1699  // ----------------------------------------------------------------------
1700  // Pre-message hooks for async commands
1701  //
1702  // Each of these functions is invoked just before processing the
1703  // corresponding command. By default they do nothing. You can
1704  // override them to provide specific pre-command behavior.
1705  // ----------------------------------------------------------------------
1706 
1709  FwOpcodeType opCode,
1710  U32 cmdSeq
1711  )
1712  {
1713  // Defaults to no-op; can be overridden
1714  (void) opCode;
1715  (void) cmdSeq;
1716  }
1717 
1720  FwOpcodeType opCode,
1721  U32 cmdSeq
1722  )
1723  {
1724  // Defaults to no-op; can be overridden
1725  (void) opCode;
1726  (void) cmdSeq;
1727  }
1728 
1731  FwOpcodeType opCode,
1732  U32 cmdSeq
1733  )
1734  {
1735  // Defaults to no-op; can be overridden
1736  (void) opCode;
1737  (void) cmdSeq;
1738  }
1739 
1742  FwOpcodeType opCode,
1743  U32 cmdSeq
1744  )
1745  {
1746  // Defaults to no-op; can be overridden
1747  (void) opCode;
1748  (void) cmdSeq;
1749  }
1750 
1751  // ----------------------------------------------------------------------
1752  // Event logging functions
1753  // ----------------------------------------------------------------------
1754 
1757  {
1758  // Check throttle value
1759  if (this->m_DpBufferErrorThrottle >= EVENTID_DPBUFFERERROR_THROTTLE) {
1760  return;
1761  }
1762  else {
1763  this->m_DpBufferErrorThrottle++;
1764  }
1765 
1766  // Get the time
1767  Fw::Time _logTime;
1768  if (this->isConnected_timeCaller_OutputPort(0)) {
1769  this->timeCaller_out(0, _logTime);
1770  }
1771 
1772  const FwEventIdType _id = this->getIdBase() + EVENTID_DPBUFFERERROR;
1773 
1774  // Emit the event on the log port
1775  if (this->isConnected_logOut_OutputPort(0)) {
1776  Fw::LogBuffer _logBuff;
1778 
1779 #if FW_AMPCS_COMPATIBLE
1780  // Serialize the number of arguments
1781  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1782  FW_ASSERT(
1783  _status == Fw::FW_SERIALIZE_OK,
1784  static_cast<FwAssertArgType>(_status)
1785  );
1786 #endif
1787 
1788 #if FW_AMPCS_COMPATIBLE
1789  // Serialize the argument size
1790  _status = _logBuff.serializeFrom(
1791  static_cast<U8>(sizeof(U32))
1792  );
1793  FW_ASSERT(
1794  _status == Fw::FW_SERIALIZE_OK,
1795  static_cast<FwAssertArgType>(_status)
1796  );
1797 #endif
1798  _status = _logBuff.serializeFrom(size);
1799  FW_ASSERT(
1800  _status == Fw::FW_SERIALIZE_OK,
1801  static_cast<FwAssertArgType>(_status)
1802  );
1803 
1804  this->logOut_out(
1805  0,
1806  _id,
1807  _logTime,
1809  _logBuff
1810  );
1811  }
1812 
1813  // Emit the event on the text log port
1814 #if FW_ENABLE_TEXT_LOGGING
1815  if (this->isConnected_LogText_OutputPort(0)) {
1816 #if FW_OBJECT_NAMES == 1
1817  const char* _formatString =
1818  "(%s) %s: Error getting ComDp buffer of size %" PRIu32 "";
1819 #else
1820  const char* _formatString =
1821  "%s: Error getting ComDp buffer of size %" PRIu32 "";
1822 #endif
1823 
1824  Fw::TextLogString _logString;
1825  (void) _logString.format(
1826  _formatString,
1827 #if FW_OBJECT_NAMES == 1
1828  this->m_objName.toChar(),
1829 #endif
1830  "DpBufferError ",
1831  size
1832  );
1833 
1834  this->LogText_out(
1835  0,
1836  _id,
1837  _logTime,
1839  _logString
1840  );
1841  }
1842 #endif
1843  }
1844 
1846  log_ACTIVITY_HI_ComDpStarted(FwSizeType packetsPerContainer) const
1847  {
1848  // Get the time
1849  Fw::Time _logTime;
1850  if (this->isConnected_timeCaller_OutputPort(0)) {
1851  this->timeCaller_out(0, _logTime);
1852  }
1853 
1854  const FwEventIdType _id = this->getIdBase() + EVENTID_COMDPSTARTED;
1855 
1856  // Emit the event on the log port
1857  if (this->isConnected_logOut_OutputPort(0)) {
1858  Fw::LogBuffer _logBuff;
1860 
1861 #if FW_AMPCS_COMPATIBLE
1862  // Serialize the number of arguments
1863  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1864  FW_ASSERT(
1865  _status == Fw::FW_SERIALIZE_OK,
1866  static_cast<FwAssertArgType>(_status)
1867  );
1868 #endif
1869 
1870 #if FW_AMPCS_COMPATIBLE
1871  // Serialize the argument size
1872  _status = _logBuff.serializeFrom(
1873  static_cast<U8>(sizeof(FwSizeType))
1874  );
1875  FW_ASSERT(
1876  _status == Fw::FW_SERIALIZE_OK,
1877  static_cast<FwAssertArgType>(_status)
1878  );
1879 #endif
1880  _status = _logBuff.serializeFrom(packetsPerContainer);
1881  FW_ASSERT(
1882  _status == Fw::FW_SERIALIZE_OK,
1883  static_cast<FwAssertArgType>(_status)
1884  );
1885 
1886  this->logOut_out(
1887  0,
1888  _id,
1889  _logTime,
1891  _logBuff
1892  );
1893  }
1894 
1895  // Emit the event on the text log port
1896 #if FW_ENABLE_TEXT_LOGGING
1897  if (this->isConnected_LogText_OutputPort(0)) {
1898 #if FW_OBJECT_NAMES == 1
1899  const char* _formatString =
1900  "(%s) %s: Started Com DP logging: %" PRIu64 " packets per container";
1901 #else
1902  const char* _formatString =
1903  "%s: Started Com DP logging: %" PRIu64 " packets per container";
1904 #endif
1905 
1906  Fw::TextLogString _logString;
1907  (void) _logString.format(
1908  _formatString,
1909 #if FW_OBJECT_NAMES == 1
1910  this->m_objName.toChar(),
1911 #endif
1912  "ComDpStarted ",
1913  packetsPerContainer
1914  );
1915 
1916  this->LogText_out(
1917  0,
1918  _id,
1919  _logTime,
1921  _logString
1922  );
1923  }
1924 #endif
1925  }
1926 
1929  {
1930  // Get the time
1931  Fw::Time _logTime;
1932  if (this->isConnected_timeCaller_OutputPort(0)) {
1933  this->timeCaller_out(0, _logTime);
1934  }
1935 
1936  const FwEventIdType _id = this->getIdBase() + EVENTID_COMDPSTOPPED;
1937 
1938  // Emit the event on the log port
1939  if (this->isConnected_logOut_OutputPort(0)) {
1940  Fw::LogBuffer _logBuff;
1942 
1943 #if FW_AMPCS_COMPATIBLE
1944  // Serialize the number of arguments
1945  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1946  FW_ASSERT(
1947  _status == Fw::FW_SERIALIZE_OK,
1948  static_cast<FwAssertArgType>(_status)
1949  );
1950 #endif
1951 
1952 #if FW_AMPCS_COMPATIBLE
1953  // Serialize the argument size
1954  _status = _logBuff.serializeFrom(
1956  );
1957  FW_ASSERT(
1958  _status == Fw::FW_SERIALIZE_OK,
1959  static_cast<FwAssertArgType>(_status)
1960  );
1961 #endif
1962  _status = _logBuff.serializeFrom(partialContainer);
1963  FW_ASSERT(
1964  _status == Fw::FW_SERIALIZE_OK,
1965  static_cast<FwAssertArgType>(_status)
1966  );
1967 
1968  this->logOut_out(
1969  0,
1970  _id,
1971  _logTime,
1973  _logBuff
1974  );
1975  }
1976 
1977  // Emit the event on the text log port
1978 #if FW_ENABLE_TEXT_LOGGING
1979  if (this->isConnected_LogText_OutputPort(0)) {
1980 #if FW_OBJECT_NAMES == 1
1981  const char* _formatString =
1982  "(%s) %s: Stopped Com DP logging: partial container %s";
1983 #else
1984  const char* _formatString =
1985  "%s: Stopped Com DP logging: partial container %s";
1986 #endif
1987 
1988  Fw::String partialContainerStr;
1989  partialContainer.toString(partialContainerStr);
1990 
1991  Fw::TextLogString _logString;
1992  (void) _logString.format(
1993  _formatString,
1994 #if FW_OBJECT_NAMES == 1
1995  this->m_objName.toChar(),
1996 #endif
1997  "ComDpStopped ",
1998  partialContainerStr.toChar()
1999  );
2000 
2001  this->LogText_out(
2002  0,
2003  _id,
2004  _logTime,
2006  _logString
2007  );
2008  }
2009 #endif
2010  }
2011 
2014  {
2015  // Get the time
2016  Fw::Time _logTime;
2017  if (this->isConnected_timeCaller_OutputPort(0)) {
2018  this->timeCaller_out(0, _logTime);
2019  }
2020 
2021  const FwEventIdType _id = this->getIdBase() + EVENTID_PRIORITYUPDATED;
2022 
2023  // Emit the event on the log port
2024  if (this->isConnected_logOut_OutputPort(0)) {
2025  Fw::LogBuffer _logBuff;
2027 
2028 #if FW_AMPCS_COMPATIBLE
2029  // Serialize the number of arguments
2030  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2031  FW_ASSERT(
2032  _status == Fw::FW_SERIALIZE_OK,
2033  static_cast<FwAssertArgType>(_status)
2034  );
2035 #endif
2036 
2037 #if FW_AMPCS_COMPATIBLE
2038  // Serialize the argument size
2039  _status = _logBuff.serializeFrom(
2040  static_cast<U8>(sizeof(FwDpPriorityType))
2041  );
2042  FW_ASSERT(
2043  _status == Fw::FW_SERIALIZE_OK,
2044  static_cast<FwAssertArgType>(_status)
2045  );
2046 #endif
2047  _status = _logBuff.serializeFrom(priority);
2048  FW_ASSERT(
2049  _status == Fw::FW_SERIALIZE_OK,
2050  static_cast<FwAssertArgType>(_status)
2051  );
2052 
2053  this->logOut_out(
2054  0,
2055  _id,
2056  _logTime,
2058  _logBuff
2059  );
2060  }
2061 
2062  // Emit the event on the text log port
2063 #if FW_ENABLE_TEXT_LOGGING
2064  if (this->isConnected_LogText_OutputPort(0)) {
2065 #if FW_OBJECT_NAMES == 1
2066  const char* _formatString =
2067  "(%s) %s: Updated Com DP priority to %" PRIu32 "";
2068 #else
2069  const char* _formatString =
2070  "%s: Updated Com DP priority to %" PRIu32 "";
2071 #endif
2072 
2073  Fw::TextLogString _logString;
2074  (void) _logString.format(
2075  _formatString,
2076 #if FW_OBJECT_NAMES == 1
2077  this->m_objName.toChar(),
2078 #endif
2079  "PriorityUpdated ",
2080  priority
2081  );
2082 
2083  this->LogText_out(
2084  0,
2085  _id,
2086  _logTime,
2088  _logString
2089  );
2090  }
2091 #endif
2092  }
2093 
2096  {
2097  // Get the time
2098  Fw::Time _logTime;
2099  if (this->isConnected_timeCaller_OutputPort(0)) {
2100  this->timeCaller_out(0, _logTime);
2101  }
2102 
2103  const FwEventIdType _id = this->getIdBase() + EVENTID_COUNTERSCLEARED;
2104 
2105  // Emit the event on the log port
2106  if (this->isConnected_logOut_OutputPort(0)) {
2107  Fw::LogBuffer _logBuff;
2108 
2109 #if FW_AMPCS_COMPATIBLE
2111  // Serialize the number of arguments
2112  _status = _logBuff.serializeFrom(static_cast<U8>(0));
2113  FW_ASSERT(
2114  _status == Fw::FW_SERIALIZE_OK,
2115  static_cast<FwAssertArgType>(_status)
2116  );
2117 #endif
2118 
2119  this->logOut_out(
2120  0,
2121  _id,
2122  _logTime,
2124  _logBuff
2125  );
2126  }
2127 
2128  // Emit the event on the text log port
2129 #if FW_ENABLE_TEXT_LOGGING
2130  if (this->isConnected_LogText_OutputPort(0)) {
2131 #if FW_OBJECT_NAMES == 1
2132  const char* _formatString =
2133  "(%s) %s: Cleared NumBuffersLogged counter and DpBufferError throttle";
2134 #else
2135  const char* _formatString =
2136  "%s: Cleared NumBuffersLogged counter and DpBufferError throttle";
2137 #endif
2138 
2139  Fw::TextLogString _logString;
2140  (void) _logString.format(
2141  _formatString,
2142 #if FW_OBJECT_NAMES == 1
2143  this->m_objName.toChar(),
2144 #endif
2145  "CountersCleared "
2146  );
2147 
2148  this->LogText_out(
2149  0,
2150  _id,
2151  _logTime,
2153  _logString
2154  );
2155  }
2156 #endif
2157  }
2158 
2161  {
2162  // Get the time
2163  Fw::Time _logTime;
2164  if (this->isConnected_timeCaller_OutputPort(0)) {
2165  this->timeCaller_out(0, _logTime);
2166  }
2167 
2169 
2170  // Emit the event on the log port
2171  if (this->isConnected_logOut_OutputPort(0)) {
2172  Fw::LogBuffer _logBuff;
2174 
2175 #if FW_AMPCS_COMPATIBLE
2176  // Serialize the number of arguments
2177  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2178  FW_ASSERT(
2179  _status == Fw::FW_SERIALIZE_OK,
2180  static_cast<FwAssertArgType>(_status)
2181  );
2182 #endif
2183 
2184 #if FW_AMPCS_COMPATIBLE
2185  // Serialize the argument size
2186  _status = _logBuff.serializeFrom(
2187  static_cast<U8>(sizeof(FwSizeType))
2188  );
2189  FW_ASSERT(
2190  _status == Fw::FW_SERIALIZE_OK,
2191  static_cast<FwAssertArgType>(_status)
2192  );
2193 #endif
2194  _status = _logBuff.serializeFrom(packetsPerContainer);
2195  FW_ASSERT(
2196  _status == Fw::FW_SERIALIZE_OK,
2197  static_cast<FwAssertArgType>(_status)
2198  );
2199 
2200  this->logOut_out(
2201  0,
2202  _id,
2203  _logTime,
2205  _logBuff
2206  );
2207  }
2208 
2209  // Emit the event on the text log port
2210 #if FW_ENABLE_TEXT_LOGGING
2211  if (this->isConnected_LogText_OutputPort(0)) {
2212 #if FW_OBJECT_NAMES == 1
2213  const char* _formatString =
2214  "(%s) %s: Failed to start Com DP recording: packetsPerContainer %" PRIu64 " is invalid (must be > 0)";
2215 #else
2216  const char* _formatString =
2217  "%s: Failed to start Com DP recording: packetsPerContainer %" PRIu64 " is invalid (must be > 0)";
2218 #endif
2219 
2220  Fw::TextLogString _logString;
2221  (void) _logString.format(
2222  _formatString,
2223 #if FW_OBJECT_NAMES == 1
2224  this->m_objName.toChar(),
2225 #endif
2226  "StartRecordingFailed ",
2227  packetsPerContainer
2228  );
2229 
2230  this->LogText_out(
2231  0,
2232  _id,
2233  _logTime,
2235  _logString
2236  );
2237  }
2238 #endif
2239  }
2240 
2241  // ----------------------------------------------------------------------
2242  // Event throttle reset functions
2243  // ----------------------------------------------------------------------
2244 
2247  {
2248  // Reset throttle counter
2249  this->m_DpBufferErrorThrottle = 0;
2250  }
2251 
2252  // ----------------------------------------------------------------------
2253  // Telemetry serialized write
2254  // ----------------------------------------------------------------------
2255 
2258  FwChanIdType id,
2259  Fw::TlmBuffer& _tlmBuff,
2260  Fw::Time _tlmTime
2261  ) const
2262  {
2263  if (this->isConnected_tlmOut_OutputPort(0)) {
2264  if (
2266  (_tlmTime == Fw::ZERO_TIME)
2267  ) {
2268  this->timeCaller_out(0, _tlmTime);
2269  }
2270 
2271  FwChanIdType _id;
2272  _id = this->getIdBase() + id;
2273 
2274  this->tlmOut_out(
2275  0,
2276  _id,
2277  _tlmTime,
2278  _tlmBuff
2279  );
2280  }
2281  }
2282 
2283  // ----------------------------------------------------------------------
2284  // Telemetry write functions
2285  // ----------------------------------------------------------------------
2286 
2289  bool arg,
2290  Fw::Time _tlmTime
2291  ) const
2292  {
2293  if (this->isConnected_tlmOut_OutputPort(0)) {
2294  Fw::TlmBuffer _tlmBuff;
2295  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
2296  FW_ASSERT(
2297  _stat == Fw::FW_SERIALIZE_OK,
2298  static_cast<FwAssertArgType>(_stat)
2299  );
2300 
2301  this->tlmWrite(
2303  _tlmBuff,
2304  _tlmTime
2305  );
2306  }
2307  }
2308 
2311  U32 arg,
2312  Fw::Time _tlmTime
2313  ) const
2314  {
2315  if (this->isConnected_tlmOut_OutputPort(0)) {
2316  Fw::TlmBuffer _tlmBuff;
2317  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
2318  FW_ASSERT(
2319  _stat == Fw::FW_SERIALIZE_OK,
2320  static_cast<FwAssertArgType>(_stat)
2321  );
2322 
2323  this->tlmWrite(
2325  _tlmBuff,
2326  _tlmTime
2327  );
2328  }
2329  }
2330 
2333  U32 arg,
2334  Fw::Time _tlmTime
2335  ) const
2336  {
2337  if (this->isConnected_tlmOut_OutputPort(0)) {
2338  Fw::TlmBuffer _tlmBuff;
2339  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
2340  FW_ASSERT(
2341  _stat == Fw::FW_SERIALIZE_OK,
2342  static_cast<FwAssertArgType>(_stat)
2343  );
2344 
2345  this->tlmWrite(
2347  _tlmBuff,
2348  _tlmTime
2349  );
2350  }
2351  }
2352 
2355  U32 arg,
2356  Fw::Time _tlmTime
2357  ) const
2358  {
2359  if (this->isConnected_tlmOut_OutputPort(0)) {
2360  Fw::TlmBuffer _tlmBuff;
2361  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
2362  FW_ASSERT(
2363  _stat == Fw::FW_SERIALIZE_OK,
2364  static_cast<FwAssertArgType>(_stat)
2365  );
2366 
2367  this->tlmWrite(
2369  _tlmBuff,
2370  _tlmTime
2371  );
2372  }
2373  }
2374 
2375  // ----------------------------------------------------------------------
2376  // Functions for managing data products
2377  // ----------------------------------------------------------------------
2378 
2381  DpContainer& container,
2382  Fw::Time timeTag
2383  )
2384  {
2385  // Update the time tag
2386  if (timeTag == Fw::ZERO_TIME) {
2387  // Get the time from the time port
2388  timeTag = this->getTime();
2389  }
2390  container.setTimeTag(timeTag);
2391  // Serialize the header into the packet
2392  container.serializeHeader();
2393  // Update the size of the buffer according to the data size
2394  const FwSizeType packetSize = container.getPacketSize();
2395  Fw::Buffer buffer = container.getBuffer();
2396  FW_ASSERT(packetSize <= buffer.getSize(), static_cast<FwAssertArgType>(packetSize),
2397  static_cast<FwAssertArgType>(buffer.getSize()));
2398  buffer.setSize(static_cast<U32>(packetSize));
2399  // Invalidate the buffer in the container, so it can't be reused
2400  container.invalidateBuffer();
2401  // Send the buffer
2402  this->productSendOut_out(0, container.getId(), buffer);
2403  }
2404 
2405  // ----------------------------------------------------------------------
2406  // Time
2407  // ----------------------------------------------------------------------
2408 
2410  getTime() const
2411  {
2412  if (this->isConnected_timeCaller_OutputPort(0)) {
2413  Fw::Time _time;
2414  this->timeCaller_out(0, _time);
2415  return _time;
2416  }
2417  else {
2418  return Fw::Time(TimeBase::TB_NONE, 0, 0);
2419  }
2420  }
2421 
2422  // ----------------------------------------------------------------------
2423  // Message dispatch functions
2424  // ----------------------------------------------------------------------
2425 
2426  Fw::QueuedComponentBase::MsgDispatchStatus ComLoggerDpComponentBase ::
2427  doDispatch()
2428  {
2429  ComponentIpcSerializableBuffer _msg;
2430  FwQueuePriorityType _priority = 0;
2431 
2432  Os::Queue::Status _msgStatus = this->m_queue.receive(
2433  _msg,
2435  _priority
2436  );
2437  FW_ASSERT(
2438  _msgStatus == Os::Queue::OP_OK,
2439  static_cast<FwAssertArgType>(_msgStatus)
2440  );
2441 
2442  // Reset to beginning of buffer
2443  _msg.resetDeser();
2444 
2445  FwEnumStoreType _desMsg = 0;
2446  Fw::SerializeStatus _deserStatus = _msg.deserializeTo(_desMsg);
2447  FW_ASSERT(
2448  _deserStatus == Fw::FW_SERIALIZE_OK,
2449  static_cast<FwAssertArgType>(_deserStatus)
2450  );
2451 
2452  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
2453 
2454  if (_msgType == COMLOGGERDP_COMPONENT_EXIT) {
2455  return MSG_DISPATCH_EXIT;
2456  }
2457 
2458  FwIndexType portNum = 0;
2459  _deserStatus = _msg.deserializeTo(portNum);
2460  FW_ASSERT(
2461  _deserStatus == Fw::FW_SERIALIZE_OK,
2462  static_cast<FwAssertArgType>(_deserStatus)
2463  );
2464 
2465  switch (_msgType) {
2466  // Handle async input port comIn
2467  case COMIN_COM: {
2468  // Deserialize argument data
2469  Fw::ComBuffer data;
2470  _deserStatus = _msg.deserializeTo(data);
2471  FW_ASSERT(
2472  _deserStatus == Fw::FW_SERIALIZE_OK,
2473  static_cast<FwAssertArgType>(_deserStatus)
2474  );
2475 
2476  // Deserialize argument context
2477  U32 context;
2478  _deserStatus = _msg.deserializeTo(context);
2479  FW_ASSERT(
2480  _deserStatus == Fw::FW_SERIALIZE_OK,
2481  static_cast<FwAssertArgType>(_deserStatus)
2482  );
2483  // Call handler function
2484  this->comIn_handler(
2485  portNum,
2486  data,
2487  context
2488  );
2489 
2490  break;
2491  }
2492 
2493  // Handle async input port pingIn
2494  case PINGIN_PING: {
2495  // Deserialize argument key
2496  U32 key;
2497  _deserStatus = _msg.deserializeTo(key);
2498  FW_ASSERT(
2499  _deserStatus == Fw::FW_SERIALIZE_OK,
2500  static_cast<FwAssertArgType>(_deserStatus)
2501  );
2502  // Call handler function
2503  this->pingIn_handler(
2504  portNum,
2505  key
2506  );
2507 
2508  break;
2509  }
2510 
2511  // Handle async input port startRecordingIn
2512  case STARTRECORDINGIN_COMLOGGERSTART: {
2513  // Deserialize argument packetsPerContainer
2514  FwSizeType packetsPerContainer;
2515  _deserStatus = _msg.deserializeTo(packetsPerContainer);
2516  FW_ASSERT(
2517  _deserStatus == Fw::FW_SERIALIZE_OK,
2518  static_cast<FwAssertArgType>(_deserStatus)
2519  );
2520 
2521  // Deserialize argument priority
2522  FwDpPriorityType priority;
2523  _deserStatus = _msg.deserializeTo(priority);
2524  FW_ASSERT(
2525  _deserStatus == Fw::FW_SERIALIZE_OK,
2526  static_cast<FwAssertArgType>(_deserStatus)
2527  );
2528  // Call handler function
2530  portNum,
2531  packetsPerContainer,
2532  priority
2533  );
2534 
2535  break;
2536  }
2537 
2538  // Handle async input port stopRecordingIn
2539  case STOPRECORDINGIN_COMLOGGERSTOP: {
2540  // Call handler function
2541  this->stopRecordingIn_handler(portNum);
2542 
2543  break;
2544  }
2545 
2546  // Handle command StartComDp
2547  case CMD_STARTCOMDP: {
2548  // Deserialize opcode
2549  FwOpcodeType _opCode = 0;
2550  _deserStatus = _msg.deserializeTo(_opCode);
2551  FW_ASSERT (
2552  _deserStatus == Fw::FW_SERIALIZE_OK,
2553  static_cast<FwAssertArgType>(_deserStatus)
2554  );
2555 
2556  // Deserialize command sequence
2557  U32 _cmdSeq = 0;
2558  _deserStatus = _msg.deserializeTo(_cmdSeq);
2559  FW_ASSERT (
2560  _deserStatus == Fw::FW_SERIALIZE_OK,
2561  static_cast<FwAssertArgType>(_deserStatus)
2562  );
2563 
2564  // Deserialize command argument buffer
2565  Fw::CmdArgBuffer args;
2566  _deserStatus = _msg.deserializeTo(args);
2567  FW_ASSERT (
2568  _deserStatus == Fw::FW_SERIALIZE_OK,
2569  static_cast<FwAssertArgType>(_deserStatus)
2570  );
2571 
2572  // Reset buffer
2573  args.resetDeser();
2574 
2575  // Deserialize argument packetsPerContainer
2576  FwSizeType packetsPerContainer;
2577  _deserStatus = args.deserializeTo(packetsPerContainer);
2578  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2580  this->cmdResponse_out(
2581  _opCode,
2582  _cmdSeq,
2584  );
2585  }
2586  // Don't crash the task if bad arguments were passed from the ground
2587  break;
2588  }
2589 
2590  // Deserialize argument priority
2591  FwDpPriorityType priority;
2592  _deserStatus = args.deserializeTo(priority);
2593  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2595  this->cmdResponse_out(
2596  _opCode,
2597  _cmdSeq,
2599  );
2600  }
2601  // Don't crash the task if bad arguments were passed from the ground
2602  break;
2603  }
2604 
2605  // Make sure there was no data left over.
2606  // That means the argument buffer size was incorrect.
2607 #if FW_CMD_CHECK_RESIDUAL
2608  if (args.getDeserializeSizeLeft() != 0) {
2610  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2611  }
2612  // Don't crash the task if bad arguments were passed from the ground
2613  break;
2614  }
2615 #endif
2616 
2617  // Call handler function
2618  this->StartComDp_cmdHandler(
2619  _opCode, _cmdSeq,
2620  packetsPerContainer,
2621  priority
2622  );
2623 
2624  break;
2625  }
2626 
2627  // Handle command UpdatePriority
2628  case CMD_UPDATEPRIORITY: {
2629  // Deserialize opcode
2630  FwOpcodeType _opCode = 0;
2631  _deserStatus = _msg.deserializeTo(_opCode);
2632  FW_ASSERT (
2633  _deserStatus == Fw::FW_SERIALIZE_OK,
2634  static_cast<FwAssertArgType>(_deserStatus)
2635  );
2636 
2637  // Deserialize command sequence
2638  U32 _cmdSeq = 0;
2639  _deserStatus = _msg.deserializeTo(_cmdSeq);
2640  FW_ASSERT (
2641  _deserStatus == Fw::FW_SERIALIZE_OK,
2642  static_cast<FwAssertArgType>(_deserStatus)
2643  );
2644 
2645  // Deserialize command argument buffer
2646  Fw::CmdArgBuffer args;
2647  _deserStatus = _msg.deserializeTo(args);
2648  FW_ASSERT (
2649  _deserStatus == Fw::FW_SERIALIZE_OK,
2650  static_cast<FwAssertArgType>(_deserStatus)
2651  );
2652 
2653  // Reset buffer
2654  args.resetDeser();
2655 
2656  // Deserialize argument priority
2657  FwDpPriorityType priority;
2658  _deserStatus = args.deserializeTo(priority);
2659  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2661  this->cmdResponse_out(
2662  _opCode,
2663  _cmdSeq,
2665  );
2666  }
2667  // Don't crash the task if bad arguments were passed from the ground
2668  break;
2669  }
2670 
2671  // Make sure there was no data left over.
2672  // That means the argument buffer size was incorrect.
2673 #if FW_CMD_CHECK_RESIDUAL
2674  if (args.getDeserializeSizeLeft() != 0) {
2676  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2677  }
2678  // Don't crash the task if bad arguments were passed from the ground
2679  break;
2680  }
2681 #endif
2682 
2683  // Call handler function
2685  _opCode, _cmdSeq,
2686  priority
2687  );
2688 
2689  break;
2690  }
2691 
2692  // Handle command StopComDp
2693  case CMD_STOPCOMDP: {
2694  // Deserialize opcode
2695  FwOpcodeType _opCode = 0;
2696  _deserStatus = _msg.deserializeTo(_opCode);
2697  FW_ASSERT (
2698  _deserStatus == Fw::FW_SERIALIZE_OK,
2699  static_cast<FwAssertArgType>(_deserStatus)
2700  );
2701 
2702  // Deserialize command sequence
2703  U32 _cmdSeq = 0;
2704  _deserStatus = _msg.deserializeTo(_cmdSeq);
2705  FW_ASSERT (
2706  _deserStatus == Fw::FW_SERIALIZE_OK,
2707  static_cast<FwAssertArgType>(_deserStatus)
2708  );
2709 
2710  // Deserialize command argument buffer
2711  Fw::CmdArgBuffer args;
2712  _deserStatus = _msg.deserializeTo(args);
2713  FW_ASSERT (
2714  _deserStatus == Fw::FW_SERIALIZE_OK,
2715  static_cast<FwAssertArgType>(_deserStatus)
2716  );
2717 
2718  // Reset buffer
2719  args.resetDeser();
2720 
2721  // Make sure there was no data left over.
2722  // That means the argument buffer size was incorrect.
2723 #if FW_CMD_CHECK_RESIDUAL
2724  if (args.getDeserializeSizeLeft() != 0) {
2726  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2727  }
2728  // Don't crash the task if bad arguments were passed from the ground
2729  break;
2730  }
2731 #endif
2732 
2733  // Call handler function
2734  this->StopComDp_cmdHandler(_opCode, _cmdSeq);
2735 
2736  break;
2737  }
2738 
2739  // Handle command CLEAR_COUNTERS
2740  case CMD_CLEAR_COUNTERS: {
2741  // Deserialize opcode
2742  FwOpcodeType _opCode = 0;
2743  _deserStatus = _msg.deserializeTo(_opCode);
2744  FW_ASSERT (
2745  _deserStatus == Fw::FW_SERIALIZE_OK,
2746  static_cast<FwAssertArgType>(_deserStatus)
2747  );
2748 
2749  // Deserialize command sequence
2750  U32 _cmdSeq = 0;
2751  _deserStatus = _msg.deserializeTo(_cmdSeq);
2752  FW_ASSERT (
2753  _deserStatus == Fw::FW_SERIALIZE_OK,
2754  static_cast<FwAssertArgType>(_deserStatus)
2755  );
2756 
2757  // Deserialize command argument buffer
2758  Fw::CmdArgBuffer args;
2759  _deserStatus = _msg.deserializeTo(args);
2760  FW_ASSERT (
2761  _deserStatus == Fw::FW_SERIALIZE_OK,
2762  static_cast<FwAssertArgType>(_deserStatus)
2763  );
2764 
2765  // Reset buffer
2766  args.resetDeser();
2767 
2768  // Make sure there was no data left over.
2769  // That means the argument buffer size was incorrect.
2770 #if FW_CMD_CHECK_RESIDUAL
2771  if (args.getDeserializeSizeLeft() != 0) {
2773  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2774  }
2775  // Don't crash the task if bad arguments were passed from the ground
2776  break;
2777  }
2778 #endif
2779 
2780  // Call handler function
2781  this->CLEAR_COUNTERS_cmdHandler(_opCode, _cmdSeq);
2782 
2783  break;
2784  }
2785 
2786  // Handle internal interface schedInInternal
2787  case INT_IF_SCHEDININTERNAL: {
2788  // Make sure there was no data left over.
2789  // That means the buffer size was incorrect.
2790  FW_ASSERT(
2791  _msg.getDeserializeSizeLeft() == 0,
2792  static_cast<FwAssertArgType>(_msg.getDeserializeSizeLeft())
2793  );
2794 
2795  // Call handler function
2797 
2798  break;
2799  }
2800 
2801  default:
2802  return MSG_DISPATCH_ERROR;
2803  }
2804 
2805  return MSG_DISPATCH_OK;
2806  }
2807 
2808  // ----------------------------------------------------------------------
2809  // Calls for messages received on special input ports
2810  // ----------------------------------------------------------------------
2811 
2812  void ComLoggerDpComponentBase ::
2813  m_p_cmdIn_in(
2814  Fw::PassiveComponentBase* callComp,
2815  FwIndexType portNum,
2816  FwOpcodeType opCode,
2817  U32 cmdSeq,
2818  Fw::CmdArgBuffer& args
2819  )
2820  {
2821  FW_ASSERT(callComp != nullptr);
2822  ComLoggerDpComponentBase* compPtr = static_cast<ComLoggerDpComponentBase*>(callComp);
2823  compPtr->cmdIn_handlerBase(
2824  portNum,
2825  opCode,
2826  cmdSeq,
2827  args
2828  );
2829  }
2830 
2831  // ----------------------------------------------------------------------
2832  // Calls for messages received on typed input ports
2833  // ----------------------------------------------------------------------
2834 
2835  void ComLoggerDpComponentBase ::
2836  m_p_comIn_in(
2837  Fw::PassiveComponentBase* callComp,
2838  FwIndexType portNum,
2839  Fw::ComBuffer& data,
2840  U32 context
2841  )
2842  {
2843  FW_ASSERT(callComp != nullptr);
2844  ComLoggerDpComponentBase* compPtr = static_cast<ComLoggerDpComponentBase*>(callComp);
2845  compPtr->comIn_handlerBase(
2846  portNum,
2847  data,
2848  context
2849  );
2850  }
2851 
2852  void ComLoggerDpComponentBase ::
2853  m_p_pingIn_in(
2854  Fw::PassiveComponentBase* callComp,
2855  FwIndexType portNum,
2856  U32 key
2857  )
2858  {
2859  FW_ASSERT(callComp != nullptr);
2860  ComLoggerDpComponentBase* compPtr = static_cast<ComLoggerDpComponentBase*>(callComp);
2861  compPtr->pingIn_handlerBase(
2862  portNum,
2863  key
2864  );
2865  }
2866 
2867  void ComLoggerDpComponentBase ::
2868  m_p_schedIn_in(
2869  Fw::PassiveComponentBase* callComp,
2870  FwIndexType portNum,
2871  U32 context
2872  )
2873  {
2874  FW_ASSERT(callComp != nullptr);
2875  ComLoggerDpComponentBase* compPtr = static_cast<ComLoggerDpComponentBase*>(callComp);
2876  compPtr->schedIn_handlerBase(
2877  portNum,
2878  context
2879  );
2880  }
2881 
2882  void ComLoggerDpComponentBase ::
2883  m_p_startRecordingIn_in(
2884  Fw::PassiveComponentBase* callComp,
2885  FwIndexType portNum,
2886  FwSizeType packetsPerContainer,
2887  FwDpPriorityType priority
2888  )
2889  {
2890  FW_ASSERT(callComp != nullptr);
2891  ComLoggerDpComponentBase* compPtr = static_cast<ComLoggerDpComponentBase*>(callComp);
2892  compPtr->startRecordingIn_handlerBase(
2893  portNum,
2894  packetsPerContainer,
2895  priority
2896  );
2897  }
2898 
2899  void ComLoggerDpComponentBase ::
2900  m_p_stopRecordingIn_in(
2901  Fw::PassiveComponentBase* callComp,
2902  FwIndexType portNum
2903  )
2904  {
2905  FW_ASSERT(callComp != nullptr);
2906  ComLoggerDpComponentBase* compPtr = static_cast<ComLoggerDpComponentBase*>(callComp);
2907  compPtr->stopRecordingIn_handlerBase(portNum);
2908  }
2909 
2910 #if !FW_DIRECT_PORT_CALLS
2911 
2912  // ----------------------------------------------------------------------
2913  // Invocation functions for special output ports
2914  // ----------------------------------------------------------------------
2915 
2916 #if FW_ENABLE_TEXT_LOGGING
2917 
2918  void ComLoggerDpComponentBase ::
2919  LogText_out(
2920  FwIndexType portNum,
2921  FwEventIdType id,
2922  Fw::Time& timeTag,
2923  const Fw::LogSeverity& severity,
2924  Fw::TextLogString& text
2925  ) const
2926  {
2927  FW_ASSERT(
2928  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
2929  static_cast<FwAssertArgType>(portNum)
2930  );
2931 
2932  FW_ASSERT(
2933  this->m_LogText_OutputPort[portNum].isConnected(),
2934  static_cast<FwAssertArgType>(portNum)
2935  );
2936  this->m_LogText_OutputPort[portNum].invoke(
2937  id,
2938  timeTag,
2939  severity,
2940  text
2941  );
2942  }
2943 
2944 #endif
2945 
2946  void ComLoggerDpComponentBase ::
2947  cmdRegOut_out(
2948  FwIndexType portNum,
2949  FwOpcodeType opCode
2950  ) const
2951  {
2952  FW_ASSERT(
2953  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
2954  static_cast<FwAssertArgType>(portNum)
2955  );
2956 
2957  FW_ASSERT(
2958  this->m_cmdRegOut_OutputPort[portNum].isConnected(),
2959  static_cast<FwAssertArgType>(portNum)
2960  );
2961  this->m_cmdRegOut_OutputPort[portNum].invoke(
2962  opCode
2963  );
2964  }
2965 
2966  void ComLoggerDpComponentBase ::
2967  cmdResponseOut_out(
2968  FwIndexType portNum,
2969  FwOpcodeType opCode,
2970  U32 cmdSeq,
2971  const Fw::CmdResponse& response
2972  ) const
2973  {
2974  FW_ASSERT(
2975  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
2976  static_cast<FwAssertArgType>(portNum)
2977  );
2978 
2979  FW_ASSERT(
2980  this->m_cmdResponseOut_OutputPort[portNum].isConnected(),
2981  static_cast<FwAssertArgType>(portNum)
2982  );
2983  this->m_cmdResponseOut_OutputPort[portNum].invoke(
2984  opCode,
2985  cmdSeq,
2986  response
2987  );
2988  }
2989 
2990  void ComLoggerDpComponentBase ::
2991  logOut_out(
2992  FwIndexType portNum,
2993  FwEventIdType id,
2994  Fw::Time& timeTag,
2995  const Fw::LogSeverity& severity,
2996  Fw::LogBuffer& args
2997  ) const
2998  {
2999  FW_ASSERT(
3000  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
3001  static_cast<FwAssertArgType>(portNum)
3002  );
3003 
3004  FW_ASSERT(
3005  this->m_logOut_OutputPort[portNum].isConnected(),
3006  static_cast<FwAssertArgType>(portNum)
3007  );
3008  this->m_logOut_OutputPort[portNum].invoke(
3009  id,
3010  timeTag,
3011  severity,
3012  args
3013  );
3014  }
3015 
3016  Fw::Success ComLoggerDpComponentBase ::
3017  productGetOut_out(
3018  FwIndexType portNum,
3019  FwDpIdType id,
3020  FwSizeType dataSize,
3021  Fw::Buffer& buffer
3022  ) const
3023  {
3024  FW_ASSERT(
3025  (0 <= portNum) && (portNum < this->getNum_productGetOut_OutputPorts()),
3026  static_cast<FwAssertArgType>(portNum)
3027  );
3028 
3029  FW_ASSERT(
3030  this->m_productGetOut_OutputPort[portNum].isConnected(),
3031  static_cast<FwAssertArgType>(portNum)
3032  );
3033  return this->m_productGetOut_OutputPort[portNum].invoke(
3034  id,
3035  dataSize,
3036  buffer
3037  );
3038  }
3039 
3040  void ComLoggerDpComponentBase ::
3041  productSendOut_out(
3042  FwIndexType portNum,
3043  FwDpIdType id,
3044  const Fw::Buffer& buffer
3045  ) const
3046  {
3047  FW_ASSERT(
3048  (0 <= portNum) && (portNum < this->getNum_productSendOut_OutputPorts()),
3049  static_cast<FwAssertArgType>(portNum)
3050  );
3051 
3052  FW_ASSERT(
3053  this->m_productSendOut_OutputPort[portNum].isConnected(),
3054  static_cast<FwAssertArgType>(portNum)
3055  );
3056  this->m_productSendOut_OutputPort[portNum].invoke(
3057  id,
3058  buffer
3059  );
3060  }
3061 
3062  void ComLoggerDpComponentBase ::
3063  timeCaller_out(
3064  FwIndexType portNum,
3065  Fw::Time& time
3066  ) const
3067  {
3068  FW_ASSERT(
3069  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
3070  static_cast<FwAssertArgType>(portNum)
3071  );
3072 
3073  FW_ASSERT(
3074  this->m_timeCaller_OutputPort[portNum].isConnected(),
3075  static_cast<FwAssertArgType>(portNum)
3076  );
3077  this->m_timeCaller_OutputPort[portNum].invoke(
3078  time
3079  );
3080  }
3081 
3082  void ComLoggerDpComponentBase ::
3083  tlmOut_out(
3084  FwIndexType portNum,
3085  FwChanIdType id,
3086  Fw::Time& timeTag,
3087  Fw::TlmBuffer& val
3088  ) const
3089  {
3090  FW_ASSERT(
3091  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
3092  static_cast<FwAssertArgType>(portNum)
3093  );
3094 
3095  FW_ASSERT(
3096  this->m_tlmOut_OutputPort[portNum].isConnected(),
3097  static_cast<FwAssertArgType>(portNum)
3098  );
3099  this->m_tlmOut_OutputPort[portNum].invoke(
3100  id,
3101  timeTag,
3102  val
3103  );
3104  }
3105 
3106 #endif
3107 
3108  // ----------------------------------------------------------------------
3109  // Private data product handling functions
3110  // ----------------------------------------------------------------------
3111 
3112  Fw::Success::T ComLoggerDpComponentBase ::
3113  dpGet(
3114  ContainerId::T containerId,
3115  FwSizeType dataSize,
3116  FwDpPriorityType priority,
3117  DpContainer& container
3118  )
3119  {
3120  const FwDpIdType baseId = this->getIdBase();
3121  const FwDpIdType globalId = baseId + containerId;
3122  const FwSizeType size = DpContainer::getPacketSizeForDataSize(dataSize);
3123  Fw::Buffer buffer;
3124  const Fw::Success::T status = this->productGetOut_out(0, globalId, size, buffer);
3125  if (status == Fw::Success::SUCCESS) {
3126  // Assign a fresh DpContainer into container
3127  // This action clears out all the container state
3128  container = DpContainer(globalId, buffer, baseId);
3129  container.setPriority(priority);
3130  }
3131  return status;
3132  }
3133 
3134 }
Serialization/Deserialization operation was successful.
Fw::InputComPort * get_comIn_InputPort(FwIndexType portNum)
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:157
void init()
Initialization function.
static constexpr FwIndexType getNum_logOut_OutputPorts()
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
static constexpr FwSizeType CAPACITY
Definition: CmdPortAc.hpp:36
static constexpr FwIndexType getNum_productGetOut_OutputPorts()
void setTimeTag(Fw::Time timeTag)
Set the time tag.
FwIdType FwOpcodeType
The type of a command opcode.
Starts recording ComBuffers at the specified priority.
virtual ~ComLoggerDpComponentBase()
Destroy ComLoggerDpComponentBase object.
Operation succeeded.
Definition: Os.hpp:27
void init()
Initialization function.
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
Representing success.
PlatformSizeType FwSizeType
Svc::InputComLoggerStartPort * get_startRecordingIn_InputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_cmdRegOut_OutputPorts()
U32 FwDpPriorityType
The type of a data product priority.
void dpSend(DpContainer &container, Fw::Time timeTag=Fw::ZERO_TIME)
Send a data product.
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
void addCallPort(InputDpSendPort *callPort)
Register an input port.
void setSize(FwSizeType size)
Definition: Buffer.cpp:131
void set_productSendOut_OutputPort(FwIndexType portNum, Fw::InputDpSendPort *port)
Connect port to productSendOut[portNum].
Status
status returned from the queue send function
Definition: Queue.hpp:30
virtual void schedInInternal_overflowHook()=0
Overflow hook for async input port schedInInternal.
static constexpr FwIndexType getNum_pingOut_OutputPorts()
static constexpr FwIndexType getNum_schedIn_InputPorts()
void init()
Initialization function.
Definition: SchedPortAc.cpp:73
BYTE pingInPortSize[Svc::PingPortBuffer::CAPACITY]
void init()
Initialization function.
Definition: CmdPortAc.cpp:89
bool isConnected_pingOut_OutputPort(FwIndexType portNum) const
SerializeStatus deserializeTo(U8 &val, Endianness mode=Endianness::BIG) override
Deserialize an 8-bit unsigned integer value.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
virtual void StartComDp_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, FwSizeType packetsPerContainer, FwDpPriorityType priority)=0
No room left in the buffer to serialize data.
void StartComDp_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void invoke(U32 key) const
Invoke a port connection.
Definition: PingPortAc.cpp:170
void tlmWrite_NumBuffersDropped(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
void startRecordingIn_handlerBase(FwIndexType portNum, FwSizeType packetsPerContainer, FwDpPriorityType priority)
Handler base-class function for input port startRecordingIn.
const Time ZERO_TIME
Definition: Time.cpp:5
static constexpr FwIndexType getNum_productSendOut_OutputPorts()
void set_pingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
void init()
Initialization function.
Definition: TlmPortAc.cpp:171
void tlmWrite(FwChanIdType id, Fw::TlmBuffer &_tlmBuff, Fw::Time _tlmTime=Fw::Time()) const
Enum representing a command response.
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.
virtual void pingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port pingIn.
void set_productGetOut_OutputPort(FwIndexType portNum, Fw::InputDpGetPort *port)
Connect port to productGetOut[portNum].
void StopComDp_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
static constexpr FwIndexType getNum_comIn_InputPorts()
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
message to exit active component task
bool isConnected_cmdResponseOut_OutputPort(FwIndexType portNum) const
void init()
Initialization function.
Definition: ComPortAc.cpp:81
Svc::InputSchedPort * get_schedIn_InputPort(FwIndexType portNum)
SerializeStatus
forward declaration for string
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: CmdPortAc.cpp:95
void log_WARNING_HI_DpBufferError(U32 size)
Log event DpBufferError.
Message will block until space is available.
Definition: Queue.hpp:47
static constexpr FwSizeType CAPACITY
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
virtual void StopComDp_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command StopComDp.
FwIdType FwEventIdType
The type of an event identifier.
Svc::InputComLoggerStopPort * get_stopRecordingIn_InputPort(FwIndexType portNum)
void invoke(FwOpcodeType opCode) const
Invoke a port connection.
static constexpr FwSizeType CAPACITY
Definition: PingPortAc.hpp:34
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:40
void init()
Initialization function.
Definition: TimePortAc.cpp:151
bool isConnected_cmdRegOut_OutputPort(FwIndexType portNum) const
virtual void UpdatePriority_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, FwDpPriorityType priority)=0
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: ComPortAc.cpp:87
Less important informational events.
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
static constexpr FwSizeType CAPACITY
Definition: ComPortAc.hpp:35
virtual void comIn_preMsgHook(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Pre-message hook for async input port comIn.
A less serious but recoverable event.
static constexpr FwIndexType getNum_pingIn_InputPorts()
Omit length from serialization.
ActiveComponentBase(const char *name)
Constructor.
void init()
Initialization function.
Definition: PingPortAc.cpp:151
void log_ACTIVITY_LO_PriorityUpdated(FwDpPriorityType priority) const
void invoke(Fw::Time &time) const
Invoke a port connection.
Definition: TimePortAc.cpp:170
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Serializable::SizeType getDeserializeSizeLeft() const override
Get remaining deserialization buffer size.
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke a port connection.
void invalidateBuffer()
Invalidate the packet buffer.
T
The raw enum type.
FwIdType FwChanIdType
The type of a telemetry channel identifier.
void addCallPort(InputPingPort *callPort)
Register an input port.
Definition: PingPortAc.cpp:157
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
Definition: Queue.cpp:54
virtual void comIn_handler(FwIndexType portNum, Fw::ComBuffer &data, U32 context)=0
Handler for input port comIn.
Fw::SerializeStatus serializeRecord_ComBufferRecord(const U8 *array, FwSizeType size)
void resetDeser() override
Reset deserialization pointer to beginning of buffer.
bool isConnected_logOut_OutputPort(FwIndexType portNum) const
A serious but recoverable event.
FwSizeType FwSizeStoreType
void schedInInternal_internalInterfaceInvoke()
Internal interface base-class function for schedInInternal.
static constexpr FwIndexType getNum_stopRecordingIn_InputPorts()
void pingOut_out(FwIndexType portNum, U32 key) const
Invoke output port pingOut.
static constexpr FwSizeType getPacketSizeForDataSize(FwSizeType dataSize)
Get the packet size for a given data size.
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.
FwSizeType getPacketSize() const
Get the packet size corresponding to the data size.
Fw::Buffer getBuffer() const
#define PRI_FwIndexType
virtual void UpdatePriority_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command UpdatePriority.
virtual void StartComDp_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command StartComDp.
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:58
void init()
Initialization function.
Definition: LogPortAc.cpp:180
void stopRecordingIn_handlerBase(FwIndexType portNum)
Handler base-class function for input port stopRecordingIn.
virtual void schedInInternal_internalInterfaceHandler()=0
Internal interface handler for schedInInternal.
void setPortNum(FwIndexType portNum)
virtual void schedIn_handler(FwIndexType portNum, U32 context)=0
Handler for input port schedIn.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
virtual void StopComDp_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
BlockingType
message type
Definition: Queue.hpp:46
Updates the priority of the active container (if any) and of all future containers.
FwSizeType getSize() const
Definition: Buffer.cpp:90
Command failed to deserialize.
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
void set_cmdResponseOut_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
Important informational events.
FwIdType FwDpIdType
The type of a data product identifier.
void comIn_handlerBase(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Handler base-class function for input port comIn.
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 schedIn_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port schedIn.
bool isConnected_timeCaller_OutputPort(FwIndexType portNum) const
Clears NumBuffersLogged and NumBuffersDropped counters and DpBufferError event throttle.
A message was sent requesting an exit of the loop.
void log_WARNING_LO_StartRecordingFailed(FwSizeType packetsPerContainer) const
Fw::Success invoke(FwDpIdType id, FwSizeType dataSize, Fw::Buffer &buffer) const
virtual void startRecordingIn_handler(FwIndexType portNum, FwSizeType packetsPerContainer, FwDpPriorityType priority)=0
Handler for input port startRecordingIn.
PlatformIndexType FwIndexType
virtual void CLEAR_COUNTERS_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CLEAR_COUNTERS.
void serializeHeader()
Definition: DpContainer.cpp:89
Failed to start recording due to invalid configuration.
void addCallPort(InputDpGetPort *callPort)
Register an input port.
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:186
virtual void stopRecordingIn_handler(FwIndexType portNum)=0
Handler for input port stopRecordingIn.
static constexpr FwIndexType getNum_cmdResponseOut_OutputPorts()
void init()
Initialization function.
void incNumMsgDropped()
increment the number of messages dropped
virtual void stopRecordingIn_preMsgHook(FwIndexType portNum)
Pre-message hook for async input port stopRecordingIn.
void init()
Initialization function.
Definition: PingPortAc.cpp:73
RateGroupDivider component implementation.
void set_cmdRegOut_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to cmdRegOut[portNum].
message sent/received okay
Definition: Queue.hpp:31
bool isConnected_productGetOut_OutputPort(FwIndexType portNum) const
U8 BYTE
byte type
Definition: BasicTypes.h:57
void init()
Initialization function.
static constexpr FwIndexType getNum_tlmOut_OutputPorts()
Fw::InputCmdPort * get_cmdIn_InputPort(FwIndexType portNum)
void cmdIn_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Handler base-class function for input port cmdIn.
Whether a partial container was sent when recording stopped.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: PingPortAc.cpp:79
FwDpIdType getId() const
void tlmWrite_NumQueueDrops(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
void UpdatePriority_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Message will return with status when space is unavailable.
Definition: Queue.hpp:48
void log_ACTIVITY_HI_ComDpStarted(FwSizeType packetsPerContainer) const
Implementation of malloc based allocator.
static constexpr FwIndexType getNum_startRecordingIn_InputPorts()
ComLoggerDpComponentBase(const char *compName="")
Construct ComLoggerDpComponentBase object.
void log_ACTIVITY_HI_ComDpStopped(const Svc::ComLoggerDp_PartialContainerStatus &partialContainer) const
void log_WARNING_HI_DpBufferError_ThrottleClear()
Reset throttle value for DpBufferError.
void init()
Initialization function.
void tlmWrite_NumBuffersLogged(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
DpContainer()
Constructor with default initialization.
void invoke(FwDpIdType id, const Fw::Buffer &buffer) const
Invoke a port connection.
virtual void CLEAR_COUNTERS_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
bool isConnected_productSendOut_OutputPort(FwIndexType portNum) const
void init()
Initialization function.
virtual void startRecordingIn_preMsgHook(FwIndexType portNum, FwSizeType packetsPerContainer, FwDpPriorityType priority)
Pre-message hook for async input port startRecordingIn.
void tlmWrite_LoggingEnabled(bool arg, Fw::Time _tlmTime=Fw::Time()) const
Success/Failure.
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
bool isConnected_tlmOut_OutputPort(FwIndexType portNum) const
void regCommands()
Register commands with the Command Dispatcher.
PlatformAssertArgType FwAssertArgType
The type of arguments to assert functions.
void CLEAR_COUNTERS_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
static constexpr FwIndexType getNum_cmdIn_InputPorts()
BYTE cmdPortSize[Fw::CmdPortBuffer::CAPACITY]
static constexpr FwIndexType getNum_timeCaller_OutputPorts()