F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
BufferLoggerComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title BufferLoggerComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for BufferLogger 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  BUFFERLOGGER_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT,
19  BUFFERSENDIN_BUFFERSEND,
20  COMIN_COM,
21  PINGIN_PING,
22  SCHEDIN_SCHED,
23  CMD_BL_OPENFILE,
24  CMD_BL_CLOSEFILE,
25  CMD_BL_SETLOGGING,
26  CMD_BL_FLUSHFILE,
27  };
28 
29  // Get the max size by constructing a union of the async input, command, and
30  // internal port serialization sizes
31  union BuffUnion {
32  BYTE bufferSendInPortSize[Fw::BufferSendPortBuffer::CAPACITY];
33  BYTE comInPortSize[Fw::ComPortBuffer::CAPACITY];
35  BYTE schedInPortSize[Svc::SchedPortBuffer::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  // Component initialization
69  // ----------------------------------------------------------------------
70 
73  FwSizeType queueDepth,
74  FwEnumStoreType instance
75  )
76  {
77  // Initialize base class
79 
80 #if !FW_DIRECT_PORT_CALLS
81  // Connect input port cmdIn
82  for (
83  FwIndexType port = 0;
84  port < static_cast<FwIndexType>(this->getNum_cmdIn_InputPorts());
85  port++
86  ) {
87  this->m_cmdIn_InputPort[port].init();
88  this->m_cmdIn_InputPort[port].addCallComp(
89  this,
90  m_p_cmdIn_in
91  );
92  this->m_cmdIn_InputPort[port].setPortNum(port);
93 
94 #if FW_OBJECT_NAMES == 1
95  Fw::ObjectName portName;
96  portName.format(
97  "%s_cmdIn_InputPort[%" PRI_FwIndexType "]",
98  this->m_objName.toChar(),
99  port
100  );
101  this->m_cmdIn_InputPort[port].setObjName(portName.toChar());
102 #endif
103  }
104 #endif
105 
106 #if !FW_DIRECT_PORT_CALLS
107  // Connect input port bufferSendIn
108  for (
109  FwIndexType port = 0;
110  port < static_cast<FwIndexType>(this->getNum_bufferSendIn_InputPorts());
111  port++
112  ) {
113  this->m_bufferSendIn_InputPort[port].init();
114  this->m_bufferSendIn_InputPort[port].addCallComp(
115  this,
116  m_p_bufferSendIn_in
117  );
118  this->m_bufferSendIn_InputPort[port].setPortNum(port);
119 
120 #if FW_OBJECT_NAMES == 1
121  Fw::ObjectName portName;
122  portName.format(
123  "%s_bufferSendIn_InputPort[%" PRI_FwIndexType "]",
124  this->m_objName.toChar(),
125  port
126  );
127  this->m_bufferSendIn_InputPort[port].setObjName(portName.toChar());
128 #endif
129  }
130 #endif
131 
132 #if !FW_DIRECT_PORT_CALLS
133  // Connect input port comIn
134  for (
135  FwIndexType port = 0;
136  port < static_cast<FwIndexType>(this->getNum_comIn_InputPorts());
137  port++
138  ) {
139  this->m_comIn_InputPort[port].init();
140  this->m_comIn_InputPort[port].addCallComp(
141  this,
142  m_p_comIn_in
143  );
144  this->m_comIn_InputPort[port].setPortNum(port);
145 
146 #if FW_OBJECT_NAMES == 1
147  Fw::ObjectName portName;
148  portName.format(
149  "%s_comIn_InputPort[%" PRI_FwIndexType "]",
150  this->m_objName.toChar(),
151  port
152  );
153  this->m_comIn_InputPort[port].setObjName(portName.toChar());
154 #endif
155  }
156 #endif
157 
158 #if !FW_DIRECT_PORT_CALLS
159  // Connect input port pingIn
160  for (
161  FwIndexType port = 0;
162  port < static_cast<FwIndexType>(this->getNum_pingIn_InputPorts());
163  port++
164  ) {
165  this->m_pingIn_InputPort[port].init();
166  this->m_pingIn_InputPort[port].addCallComp(
167  this,
168  m_p_pingIn_in
169  );
170  this->m_pingIn_InputPort[port].setPortNum(port);
171 
172 #if FW_OBJECT_NAMES == 1
173  Fw::ObjectName portName;
174  portName.format(
175  "%s_pingIn_InputPort[%" PRI_FwIndexType "]",
176  this->m_objName.toChar(),
177  port
178  );
179  this->m_pingIn_InputPort[port].setObjName(portName.toChar());
180 #endif
181  }
182 #endif
183 
184 #if !FW_DIRECT_PORT_CALLS
185  // Connect input port schedIn
186  for (
187  FwIndexType port = 0;
188  port < static_cast<FwIndexType>(this->getNum_schedIn_InputPorts());
189  port++
190  ) {
191  this->m_schedIn_InputPort[port].init();
192  this->m_schedIn_InputPort[port].addCallComp(
193  this,
194  m_p_schedIn_in
195  );
196  this->m_schedIn_InputPort[port].setPortNum(port);
197 
198 #if FW_OBJECT_NAMES == 1
199  Fw::ObjectName portName;
200  portName.format(
201  "%s_schedIn_InputPort[%" PRI_FwIndexType "]",
202  this->m_objName.toChar(),
203  port
204  );
205  this->m_schedIn_InputPort[port].setObjName(portName.toChar());
206 #endif
207  }
208 #endif
209 
210 #if !FW_DIRECT_PORT_CALLS
211  // Connect output port cmdRegOut
212  for (
213  FwIndexType port = 0;
214  port < static_cast<FwIndexType>(this->getNum_cmdRegOut_OutputPorts());
215  port++
216  ) {
217  this->m_cmdRegOut_OutputPort[port].init();
218 
219 #if FW_OBJECT_NAMES == 1
220  Fw::ObjectName portName;
221  portName.format(
222  "%s_cmdRegOut_OutputPort[%" PRI_FwIndexType "]",
223  this->m_objName.toChar(),
224  port
225  );
226  this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar());
227 #endif
228  }
229 #endif
230 
231 #if !FW_DIRECT_PORT_CALLS
232  // Connect output port cmdResponseOut
233  for (
234  FwIndexType port = 0;
235  port < static_cast<FwIndexType>(this->getNum_cmdResponseOut_OutputPorts());
236  port++
237  ) {
238  this->m_cmdResponseOut_OutputPort[port].init();
239 
240 #if FW_OBJECT_NAMES == 1
241  Fw::ObjectName portName;
242  portName.format(
243  "%s_cmdResponseOut_OutputPort[%" PRI_FwIndexType "]",
244  this->m_objName.toChar(),
245  port
246  );
247  this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar());
248 #endif
249  }
250 #endif
251 
252 #if !FW_DIRECT_PORT_CALLS
253  // Connect output port eventOut
254  for (
255  FwIndexType port = 0;
256  port < static_cast<FwIndexType>(this->getNum_eventOut_OutputPorts());
257  port++
258  ) {
259  this->m_eventOut_OutputPort[port].init();
260 
261 #if FW_OBJECT_NAMES == 1
262  Fw::ObjectName portName;
263  portName.format(
264  "%s_eventOut_OutputPort[%" PRI_FwIndexType "]",
265  this->m_objName.toChar(),
266  port
267  );
268  this->m_eventOut_OutputPort[port].setObjName(portName.toChar());
269 #endif
270  }
271 #endif
272 
273 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING
274  // Connect output port eventOutText
275  for (
276  FwIndexType port = 0;
277  port < static_cast<FwIndexType>(this->getNum_eventOutText_OutputPorts());
278  port++
279  ) {
280  this->m_eventOutText_OutputPort[port].init();
281 
282 #if FW_OBJECT_NAMES == 1
283  Fw::ObjectName portName;
284  portName.format(
285  "%s_eventOutText_OutputPort[%" PRI_FwIndexType "]",
286  this->m_objName.toChar(),
287  port
288  );
289  this->m_eventOutText_OutputPort[port].setObjName(portName.toChar());
290 #endif
291  }
292 #endif
293 
294 #if !FW_DIRECT_PORT_CALLS
295  // Connect output port timeCaller
296  for (
297  FwIndexType port = 0;
298  port < static_cast<FwIndexType>(this->getNum_timeCaller_OutputPorts());
299  port++
300  ) {
301  this->m_timeCaller_OutputPort[port].init();
302 
303 #if FW_OBJECT_NAMES == 1
304  Fw::ObjectName portName;
305  portName.format(
306  "%s_timeCaller_OutputPort[%" PRI_FwIndexType "]",
307  this->m_objName.toChar(),
308  port
309  );
310  this->m_timeCaller_OutputPort[port].setObjName(portName.toChar());
311 #endif
312  }
313 #endif
314 
315 #if !FW_DIRECT_PORT_CALLS
316  // Connect output port tlmOut
317  for (
318  FwIndexType port = 0;
319  port < static_cast<FwIndexType>(this->getNum_tlmOut_OutputPorts());
320  port++
321  ) {
322  this->m_tlmOut_OutputPort[port].init();
323 
324 #if FW_OBJECT_NAMES == 1
325  Fw::ObjectName portName;
326  portName.format(
327  "%s_tlmOut_OutputPort[%" PRI_FwIndexType "]",
328  this->m_objName.toChar(),
329  port
330  );
331  this->m_tlmOut_OutputPort[port].setObjName(portName.toChar());
332 #endif
333  }
334 #endif
335 
336 #if !FW_DIRECT_PORT_CALLS
337  // Connect output port bufferSendOut
338  for (
339  FwIndexType port = 0;
340  port < static_cast<FwIndexType>(this->getNum_bufferSendOut_OutputPorts());
341  port++
342  ) {
343  this->m_bufferSendOut_OutputPort[port].init();
344 
345 #if FW_OBJECT_NAMES == 1
346  Fw::ObjectName portName;
347  portName.format(
348  "%s_bufferSendOut_OutputPort[%" PRI_FwIndexType "]",
349  this->m_objName.toChar(),
350  port
351  );
352  this->m_bufferSendOut_OutputPort[port].setObjName(portName.toChar());
353 #endif
354  }
355 #endif
356 
357 #if !FW_DIRECT_PORT_CALLS
358  // Connect output port pingOut
359  for (
360  FwIndexType port = 0;
361  port < static_cast<FwIndexType>(this->getNum_pingOut_OutputPorts());
362  port++
363  ) {
364  this->m_pingOut_OutputPort[port].init();
365 
366 #if FW_OBJECT_NAMES == 1
367  Fw::ObjectName portName;
368  portName.format(
369  "%s_pingOut_OutputPort[%" PRI_FwIndexType "]",
370  this->m_objName.toChar(),
371  port
372  );
373  this->m_pingOut_OutputPort[port].setObjName(portName.toChar());
374 #endif
375  }
376 #endif
377 
378  // Create the queue
379  Os::Queue::Status qStat = this->createQueue(
380  queueDepth,
381  static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
382  );
383  FW_ASSERT(
384  Os::Queue::Status::OP_OK == qStat,
385  static_cast<FwAssertArgType>(qStat)
386  );
387  }
388 
389 #if !FW_DIRECT_PORT_CALLS
390 
391  // ----------------------------------------------------------------------
392  // Getters for special input ports
393  // ----------------------------------------------------------------------
394 
397  {
398  FW_ASSERT(
399  (0 <= portNum) && (portNum < this->getNum_cmdIn_InputPorts()),
400  static_cast<FwAssertArgType>(portNum)
401  );
402 
403  return &this->m_cmdIn_InputPort[portNum];
404  }
405 
406 #endif
407 
408 #if !FW_DIRECT_PORT_CALLS
409 
410  // ----------------------------------------------------------------------
411  // Getters for typed input ports
412  // ----------------------------------------------------------------------
413 
416  {
417  FW_ASSERT(
418  (0 <= portNum) && (portNum < this->getNum_bufferSendIn_InputPorts()),
419  static_cast<FwAssertArgType>(portNum)
420  );
421 
422  return &this->m_bufferSendIn_InputPort[portNum];
423  }
424 
427  {
428  FW_ASSERT(
429  (0 <= portNum) && (portNum < this->getNum_comIn_InputPorts()),
430  static_cast<FwAssertArgType>(portNum)
431  );
432 
433  return &this->m_comIn_InputPort[portNum];
434  }
435 
438  {
439  FW_ASSERT(
440  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
441  static_cast<FwAssertArgType>(portNum)
442  );
443 
444  return &this->m_pingIn_InputPort[portNum];
445  }
446 
449  {
450  FW_ASSERT(
451  (0 <= portNum) && (portNum < this->getNum_schedIn_InputPorts()),
452  static_cast<FwAssertArgType>(portNum)
453  );
454 
455  return &this->m_schedIn_InputPort[portNum];
456  }
457 
458 #endif
459 
460 #if !FW_DIRECT_PORT_CALLS
461 
462  // ----------------------------------------------------------------------
463  // Connect input ports to special output ports
464  // ----------------------------------------------------------------------
465 
468  FwIndexType portNum,
469  Fw::InputCmdRegPort* port
470  )
471  {
472  FW_ASSERT(
473  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
474  static_cast<FwAssertArgType>(portNum)
475  );
476 
477  this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
478  }
479 
482  FwIndexType portNum,
484  )
485  {
486  FW_ASSERT(
487  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
488  static_cast<FwAssertArgType>(portNum)
489  );
490 
491  this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
492  }
493 
496  FwIndexType portNum,
497  Fw::InputLogPort* port
498  )
499  {
500  FW_ASSERT(
501  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
502  static_cast<FwAssertArgType>(portNum)
503  );
504 
505  this->m_eventOut_OutputPort[portNum].addCallPort(port);
506  }
507 
508 #if FW_ENABLE_TEXT_LOGGING == 1
509 
510  void BufferLoggerComponentBase ::
511  set_eventOutText_OutputPort(
512  FwIndexType portNum,
514  )
515  {
516  FW_ASSERT(
517  (0 <= portNum) && (portNum < this->getNum_eventOutText_OutputPorts()),
518  static_cast<FwAssertArgType>(portNum)
519  );
520 
521  this->m_eventOutText_OutputPort[portNum].addCallPort(port);
522  }
523 
524 #endif
525 
528  FwIndexType portNum,
529  Fw::InputTimePort* port
530  )
531  {
532  FW_ASSERT(
533  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
534  static_cast<FwAssertArgType>(portNum)
535  );
536 
537  this->m_timeCaller_OutputPort[portNum].addCallPort(port);
538  }
539 
542  FwIndexType portNum,
543  Fw::InputTlmPort* port
544  )
545  {
546  FW_ASSERT(
547  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
548  static_cast<FwAssertArgType>(portNum)
549  );
550 
551  this->m_tlmOut_OutputPort[portNum].addCallPort(port);
552  }
553 
554 #endif
555 
556 #if !FW_DIRECT_PORT_CALLS
557 
558  // ----------------------------------------------------------------------
559  // Connect typed input ports to typed output ports
560  // ----------------------------------------------------------------------
561 
564  FwIndexType portNum,
566  )
567  {
568  FW_ASSERT(
569  (0 <= portNum) && (portNum < this->getNum_bufferSendOut_OutputPorts()),
570  static_cast<FwAssertArgType>(portNum)
571  );
572 
573  this->m_bufferSendOut_OutputPort[portNum].addCallPort(port);
574  }
575 
578  FwIndexType portNum,
579  Svc::InputPingPort* port
580  )
581  {
582  FW_ASSERT(
583  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
584  static_cast<FwAssertArgType>(portNum)
585  );
586 
587  this->m_pingOut_OutputPort[portNum].addCallPort(port);
588  }
589 
590 #endif
591 
592 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
593 
594  // ----------------------------------------------------------------------
595  // Connect serial input ports to special output ports
596  // ----------------------------------------------------------------------
597 
600  FwIndexType portNum,
601  Fw::InputSerializePort* port
602  )
603  {
604  FW_ASSERT(
605  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
606  static_cast<FwAssertArgType>(portNum)
607  );
608 
609  this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
610  }
611 
614  FwIndexType portNum,
615  Fw::InputSerializePort* port
616  )
617  {
618  FW_ASSERT(
619  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
620  static_cast<FwAssertArgType>(portNum)
621  );
622 
623  this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
624  }
625 
628  FwIndexType portNum,
629  Fw::InputSerializePort* port
630  )
631  {
632  FW_ASSERT(
633  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
634  static_cast<FwAssertArgType>(portNum)
635  );
636 
637  this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
638  }
639 
640 #if FW_ENABLE_TEXT_LOGGING == 1
641 
642  void BufferLoggerComponentBase ::
643  set_eventOutText_OutputPort(
644  FwIndexType portNum,
645  Fw::InputSerializePort* port
646  )
647  {
648  FW_ASSERT(
649  (0 <= portNum) && (portNum < this->getNum_eventOutText_OutputPorts()),
650  static_cast<FwAssertArgType>(portNum)
651  );
652 
653  this->m_eventOutText_OutputPort[portNum].registerSerialPort(port);
654  }
655 
656 #endif
657 
660  FwIndexType portNum,
661  Fw::InputSerializePort* port
662  )
663  {
664  FW_ASSERT(
665  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
666  static_cast<FwAssertArgType>(portNum)
667  );
668 
669  this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
670  }
671 
674  FwIndexType portNum,
675  Fw::InputSerializePort* port
676  )
677  {
678  FW_ASSERT(
679  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
680  static_cast<FwAssertArgType>(portNum)
681  );
682 
683  this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
684  }
685 
686 #endif
687 
688 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
689 
690  // ----------------------------------------------------------------------
691  // Connect serial input ports to typed output ports
692  // ----------------------------------------------------------------------
693 
696  FwIndexType portNum,
697  Fw::InputSerializePort* port
698  )
699  {
700  FW_ASSERT(
701  (0 <= portNum) && (portNum < this->getNum_bufferSendOut_OutputPorts()),
702  static_cast<FwAssertArgType>(portNum)
703  );
704 
705  this->m_bufferSendOut_OutputPort[portNum].registerSerialPort(port);
706  }
707 
710  FwIndexType portNum,
711  Fw::InputSerializePort* port
712  )
713  {
714  FW_ASSERT(
715  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
716  static_cast<FwAssertArgType>(portNum)
717  );
718 
719  this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
720  }
721 
722 #endif
723 
724  // ----------------------------------------------------------------------
725  // Command registration
726  // ----------------------------------------------------------------------
727 
730  {
732 
733  this->cmdRegOut_out(
734  0,
735  this->getIdBase() + OPCODE_BL_OPENFILE
736  );
737 
738  this->cmdRegOut_out(
739  0,
741  );
742 
743  this->cmdRegOut_out(
744  0,
746  );
747 
748  this->cmdRegOut_out(
749  0,
751  );
752  }
753 
754  // ----------------------------------------------------------------------
755  // Component construction and destruction
756  // ----------------------------------------------------------------------
757 
759  BufferLoggerComponentBase(const char* compName) :
760  Fw::ActiveComponentBase(compName)
761  {
762 
763  }
764 
767  {
768 
769  }
770 
771 #if !FW_DIRECT_PORT_CALLS
772 
773  // ----------------------------------------------------------------------
774  // Connection status queries for special output ports
775  // ----------------------------------------------------------------------
776 
779  {
780  FW_ASSERT(
781  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
782  static_cast<FwAssertArgType>(portNum)
783  );
784 
785  return this->m_cmdRegOut_OutputPort[portNum].isConnected();
786  }
787 
790  {
791  FW_ASSERT(
792  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
793  static_cast<FwAssertArgType>(portNum)
794  );
795 
796  return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
797  }
798 
801  {
802  FW_ASSERT(
803  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
804  static_cast<FwAssertArgType>(portNum)
805  );
806 
807  return this->m_eventOut_OutputPort[portNum].isConnected();
808  }
809 
810 #if FW_ENABLE_TEXT_LOGGING == 1
811 
812  bool BufferLoggerComponentBase ::
813  isConnected_eventOutText_OutputPort(FwIndexType portNum) const
814  {
815  FW_ASSERT(
816  (0 <= portNum) && (portNum < this->getNum_eventOutText_OutputPorts()),
817  static_cast<FwAssertArgType>(portNum)
818  );
819 
820  return this->m_eventOutText_OutputPort[portNum].isConnected();
821  }
822 
823 #endif
824 
827  {
828  FW_ASSERT(
829  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
830  static_cast<FwAssertArgType>(portNum)
831  );
832 
833  return this->m_timeCaller_OutputPort[portNum].isConnected();
834  }
835 
838  {
839  FW_ASSERT(
840  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
841  static_cast<FwAssertArgType>(portNum)
842  );
843 
844  return this->m_tlmOut_OutputPort[portNum].isConnected();
845  }
846 
847 #endif
848 
849 #if !FW_DIRECT_PORT_CALLS
850 
851  // ----------------------------------------------------------------------
852  // Connection status queries for typed output ports
853  // ----------------------------------------------------------------------
854 
857  {
858  FW_ASSERT(
859  (0 <= portNum) && (portNum < this->getNum_bufferSendOut_OutputPorts()),
860  static_cast<FwAssertArgType>(portNum)
861  );
862 
863  return this->m_bufferSendOut_OutputPort[portNum].isConnected();
864  }
865 
868  {
869  FW_ASSERT(
870  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
871  static_cast<FwAssertArgType>(portNum)
872  );
873 
874  return this->m_pingOut_OutputPort[portNum].isConnected();
875  }
876 
877 #endif
878 
879  // ----------------------------------------------------------------------
880  // Port handler base-class functions for special input ports
881  //
882  // Call these functions directly to bypass the corresponding ports
883  // ----------------------------------------------------------------------
884 
887  FwIndexType portNum,
888  FwOpcodeType opCode,
889  U32 cmdSeq,
890  Fw::CmdArgBuffer& args
891  )
892  {
893 
894  const U32 idBase = this->getIdBase();
895  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
896 
897  // Select base class function based on opcode
898  switch (opCode - idBase) {
899  case OPCODE_BL_OPENFILE: {
901  opCode,
902  cmdSeq,
903  args
904  );
905  break;
906  }
907 
908  case OPCODE_BL_CLOSEFILE: {
910  opCode,
911  cmdSeq,
912  args
913  );
914  break;
915  }
916 
917  case OPCODE_BL_SETLOGGING: {
919  opCode,
920  cmdSeq,
921  args
922  );
923  break;
924  }
925 
926  case OPCODE_BL_FLUSHFILE: {
928  opCode,
929  cmdSeq,
930  args
931  );
932  break;
933  }
934  default:
935  // Unknown opcode: ignore it
936  break;
937  }
938  }
939 
940  // ----------------------------------------------------------------------
941  // Port handler base-class functions for typed input ports
942  //
943  // Call these functions directly to bypass the corresponding ports
944  // ----------------------------------------------------------------------
945 
948  FwIndexType portNum,
949  Fw::Buffer& fwBuffer
950  )
951  {
952  // Make sure port number is valid
953  FW_ASSERT(
954  (0 <= portNum) && (portNum < this->getNum_bufferSendIn_InputPorts()),
955  static_cast<FwAssertArgType>(portNum)
956  );
957 
958  // Call pre-message hook
960  portNum,
961  fwBuffer
962  );
963  ComponentIpcSerializableBuffer msg;
965 
966  // Serialize message ID
967  _status = msg.serializeFrom(
968  static_cast<FwEnumStoreType>(BUFFERSENDIN_BUFFERSEND)
969  );
970  FW_ASSERT(
971  _status == Fw::FW_SERIALIZE_OK,
972  static_cast<FwAssertArgType>(_status)
973  );
974 
975  // Serialize port number
976  _status = msg.serializeFrom(portNum);
977  FW_ASSERT(
978  _status == Fw::FW_SERIALIZE_OK,
979  static_cast<FwAssertArgType>(_status)
980  );
981 
982  // Serialize argument fwBuffer
983  _status = msg.serializeFrom(fwBuffer);
984  FW_ASSERT(
985  _status == Fw::FW_SERIALIZE_OK,
986  static_cast<FwAssertArgType>(_status)
987  );
988 
989  // Send message
991  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
992 
993  FW_ASSERT(
994  qStatus == Os::Queue::OP_OK,
995  static_cast<FwAssertArgType>(qStatus)
996  );
997  }
998 
1001  FwIndexType portNum,
1002  Fw::ComBuffer& data,
1003  U32 context
1004  )
1005  {
1006  // Make sure port number is valid
1007  FW_ASSERT(
1008  (0 <= portNum) && (portNum < this->getNum_comIn_InputPorts()),
1009  static_cast<FwAssertArgType>(portNum)
1010  );
1011 
1012  // Call pre-message hook
1014  portNum,
1015  data,
1016  context
1017  );
1018  ComponentIpcSerializableBuffer msg;
1020 
1021  // Serialize message ID
1022  _status = msg.serializeFrom(
1023  static_cast<FwEnumStoreType>(COMIN_COM)
1024  );
1025  FW_ASSERT(
1026  _status == Fw::FW_SERIALIZE_OK,
1027  static_cast<FwAssertArgType>(_status)
1028  );
1029 
1030  // Serialize port number
1031  _status = msg.serializeFrom(portNum);
1032  FW_ASSERT(
1033  _status == Fw::FW_SERIALIZE_OK,
1034  static_cast<FwAssertArgType>(_status)
1035  );
1036 
1037  // Serialize argument data
1038  _status = msg.serializeFrom(data);
1039  FW_ASSERT(
1040  _status == Fw::FW_SERIALIZE_OK,
1041  static_cast<FwAssertArgType>(_status)
1042  );
1043 
1044  // Serialize argument context
1045  _status = msg.serializeFrom(context);
1046  FW_ASSERT(
1047  _status == Fw::FW_SERIALIZE_OK,
1048  static_cast<FwAssertArgType>(_status)
1049  );
1050 
1051  // Send message
1053  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1054 
1055  FW_ASSERT(
1056  qStatus == Os::Queue::OP_OK,
1057  static_cast<FwAssertArgType>(qStatus)
1058  );
1059  }
1060 
1063  FwIndexType portNum,
1064  U32 key
1065  )
1066  {
1067  // Make sure port number is valid
1068  FW_ASSERT(
1069  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
1070  static_cast<FwAssertArgType>(portNum)
1071  );
1072 
1073  // Call pre-message hook
1075  portNum,
1076  key
1077  );
1078  ComponentIpcSerializableBuffer msg;
1080 
1081  // Serialize message ID
1082  _status = msg.serializeFrom(
1083  static_cast<FwEnumStoreType>(PINGIN_PING)
1084  );
1085  FW_ASSERT(
1086  _status == Fw::FW_SERIALIZE_OK,
1087  static_cast<FwAssertArgType>(_status)
1088  );
1089 
1090  // Serialize port number
1091  _status = msg.serializeFrom(portNum);
1092  FW_ASSERT(
1093  _status == Fw::FW_SERIALIZE_OK,
1094  static_cast<FwAssertArgType>(_status)
1095  );
1096 
1097  // Serialize argument key
1098  _status = msg.serializeFrom(key);
1099  FW_ASSERT(
1100  _status == Fw::FW_SERIALIZE_OK,
1101  static_cast<FwAssertArgType>(_status)
1102  );
1103 
1104  // Send message
1106  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1107 
1108  FW_ASSERT(
1109  qStatus == Os::Queue::OP_OK,
1110  static_cast<FwAssertArgType>(qStatus)
1111  );
1112  }
1113 
1116  FwIndexType portNum,
1117  U32 context
1118  )
1119  {
1120  // Make sure port number is valid
1121  FW_ASSERT(
1122  (0 <= portNum) && (portNum < this->getNum_schedIn_InputPorts()),
1123  static_cast<FwAssertArgType>(portNum)
1124  );
1125 
1126  // Call pre-message hook
1128  portNum,
1129  context
1130  );
1131  ComponentIpcSerializableBuffer msg;
1133 
1134  // Serialize message ID
1135  _status = msg.serializeFrom(
1136  static_cast<FwEnumStoreType>(SCHEDIN_SCHED)
1137  );
1138  FW_ASSERT(
1139  _status == Fw::FW_SERIALIZE_OK,
1140  static_cast<FwAssertArgType>(_status)
1141  );
1142 
1143  // Serialize port number
1144  _status = msg.serializeFrom(portNum);
1145  FW_ASSERT(
1146  _status == Fw::FW_SERIALIZE_OK,
1147  static_cast<FwAssertArgType>(_status)
1148  );
1149 
1150  // Serialize argument context
1151  _status = msg.serializeFrom(context);
1152  FW_ASSERT(
1153  _status == Fw::FW_SERIALIZE_OK,
1154  static_cast<FwAssertArgType>(_status)
1155  );
1156 
1157  // Send message
1159  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1160 
1161  FW_ASSERT(
1162  qStatus == Os::Queue::OP_OK,
1163  static_cast<FwAssertArgType>(qStatus)
1164  );
1165  }
1166 
1167  // ----------------------------------------------------------------------
1168  // Pre-message hooks for typed async input ports
1169  //
1170  // Each of these functions is invoked just before processing a message
1171  // on the corresponding port. By default, they do nothing. You can
1172  // override them to provide specific pre-message behavior.
1173  // ----------------------------------------------------------------------
1174 
1177  FwIndexType portNum,
1178  Fw::Buffer& fwBuffer
1179  )
1180  {
1181  // Default: no-op
1182  }
1183 
1186  FwIndexType portNum,
1187  Fw::ComBuffer& data,
1188  U32 context
1189  )
1190  {
1191  // Default: no-op
1192  }
1193 
1196  FwIndexType portNum,
1197  U32 key
1198  )
1199  {
1200  // Default: no-op
1201  }
1202 
1205  FwIndexType portNum,
1206  U32 context
1207  )
1208  {
1209  // Default: no-op
1210  }
1211 
1212 #if !FW_DIRECT_PORT_CALLS
1213 
1214  // ----------------------------------------------------------------------
1215  // Invocation functions for typed output ports
1216  // ----------------------------------------------------------------------
1217 
1220  FwIndexType portNum,
1221  Fw::Buffer& fwBuffer
1222  ) const
1223  {
1224  FW_ASSERT(
1225  (0 <= portNum) && (portNum < this->getNum_bufferSendOut_OutputPorts()),
1226  static_cast<FwAssertArgType>(portNum)
1227  );
1228 
1229  FW_ASSERT(
1230  this->m_bufferSendOut_OutputPort[portNum].isConnected(),
1231  static_cast<FwAssertArgType>(portNum)
1232  );
1233  this->m_bufferSendOut_OutputPort[portNum].invoke(
1234  fwBuffer
1235  );
1236  }
1237 
1240  FwIndexType portNum,
1241  U32 key
1242  ) const
1243  {
1244  FW_ASSERT(
1245  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
1246  static_cast<FwAssertArgType>(portNum)
1247  );
1248 
1249  FW_ASSERT(
1250  this->m_pingOut_OutputPort[portNum].isConnected(),
1251  static_cast<FwAssertArgType>(portNum)
1252  );
1253  this->m_pingOut_OutputPort[portNum].invoke(
1254  key
1255  );
1256  }
1257 
1258 #endif
1259 
1260  // ----------------------------------------------------------------------
1261  // Command response
1262  // ----------------------------------------------------------------------
1263 
1266  FwOpcodeType opCode,
1267  U32 cmdSeq,
1268  Fw::CmdResponse response
1269  )
1270  {
1272  this->cmdResponseOut_out(0, opCode, cmdSeq, response);
1273  }
1274 
1275  // ----------------------------------------------------------------------
1276  // Command handler base-class functions
1277  //
1278  // Call these functions directly to bypass the command input port
1279  // ----------------------------------------------------------------------
1280 
1283  FwOpcodeType opCode,
1284  U32 cmdSeq,
1285  Fw::CmdArgBuffer& args
1286  )
1287  {
1288  // Call pre-message hook
1289  this->BL_OpenFile_preMsgHook(opCode,cmdSeq);
1290 
1291  // Defer deserializing arguments to the message dispatcher
1292  // to avoid deserializing and reserializing just for IPC
1293  ComponentIpcSerializableBuffer msg;
1295 
1296  // Serialize for IPC
1297  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_BL_OPENFILE));
1298  FW_ASSERT (
1299  _status == Fw::FW_SERIALIZE_OK,
1300  static_cast<FwAssertArgType>(_status)
1301  );
1302 
1303  // Fake port number to make message dequeue work
1304  FwIndexType port = 0;
1305 
1306  _status = msg.serializeFrom(port);
1307  FW_ASSERT (
1308  _status == Fw::FW_SERIALIZE_OK,
1309  static_cast<FwAssertArgType>(_status)
1310  );
1311 
1312  _status = msg.serializeFrom(opCode);
1313  FW_ASSERT (
1314  _status == Fw::FW_SERIALIZE_OK,
1315  static_cast<FwAssertArgType>(_status)
1316  );
1317 
1318  _status = msg.serializeFrom(cmdSeq);
1319  FW_ASSERT (
1320  _status == Fw::FW_SERIALIZE_OK,
1321  static_cast<FwAssertArgType>(_status)
1322  );
1323 
1324  _status = msg.serializeFrom(args);
1325  FW_ASSERT (
1326  _status == Fw::FW_SERIALIZE_OK,
1327  static_cast<FwAssertArgType>(_status)
1328  );
1329 
1330  // Send message
1332  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1333 
1334  FW_ASSERT(
1335  qStatus == Os::Queue::OP_OK,
1336  static_cast<FwAssertArgType>(qStatus)
1337  );
1338  }
1339 
1342  FwOpcodeType opCode,
1343  U32 cmdSeq,
1344  Fw::CmdArgBuffer& args
1345  )
1346  {
1347  // Call pre-message hook
1348  this->BL_CloseFile_preMsgHook(opCode,cmdSeq);
1349 
1350  // Defer deserializing arguments to the message dispatcher
1351  // to avoid deserializing and reserializing just for IPC
1352  ComponentIpcSerializableBuffer msg;
1354 
1355  // Serialize for IPC
1356  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_BL_CLOSEFILE));
1357  FW_ASSERT (
1358  _status == Fw::FW_SERIALIZE_OK,
1359  static_cast<FwAssertArgType>(_status)
1360  );
1361 
1362  // Fake port number to make message dequeue work
1363  FwIndexType port = 0;
1364 
1365  _status = msg.serializeFrom(port);
1366  FW_ASSERT (
1367  _status == Fw::FW_SERIALIZE_OK,
1368  static_cast<FwAssertArgType>(_status)
1369  );
1370 
1371  _status = msg.serializeFrom(opCode);
1372  FW_ASSERT (
1373  _status == Fw::FW_SERIALIZE_OK,
1374  static_cast<FwAssertArgType>(_status)
1375  );
1376 
1377  _status = msg.serializeFrom(cmdSeq);
1378  FW_ASSERT (
1379  _status == Fw::FW_SERIALIZE_OK,
1380  static_cast<FwAssertArgType>(_status)
1381  );
1382 
1383  _status = msg.serializeFrom(args);
1384  FW_ASSERT (
1385  _status == Fw::FW_SERIALIZE_OK,
1386  static_cast<FwAssertArgType>(_status)
1387  );
1388 
1389  // Send message
1391  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1392 
1393  FW_ASSERT(
1394  qStatus == Os::Queue::OP_OK,
1395  static_cast<FwAssertArgType>(qStatus)
1396  );
1397  }
1398 
1401  FwOpcodeType opCode,
1402  U32 cmdSeq,
1403  Fw::CmdArgBuffer& args
1404  )
1405  {
1406  // Call pre-message hook
1407  this->BL_SetLogging_preMsgHook(opCode,cmdSeq);
1408 
1409  // Defer deserializing arguments to the message dispatcher
1410  // to avoid deserializing and reserializing just for IPC
1411  ComponentIpcSerializableBuffer msg;
1413 
1414  // Serialize for IPC
1415  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_BL_SETLOGGING));
1416  FW_ASSERT (
1417  _status == Fw::FW_SERIALIZE_OK,
1418  static_cast<FwAssertArgType>(_status)
1419  );
1420 
1421  // Fake port number to make message dequeue work
1422  FwIndexType port = 0;
1423 
1424  _status = msg.serializeFrom(port);
1425  FW_ASSERT (
1426  _status == Fw::FW_SERIALIZE_OK,
1427  static_cast<FwAssertArgType>(_status)
1428  );
1429 
1430  _status = msg.serializeFrom(opCode);
1431  FW_ASSERT (
1432  _status == Fw::FW_SERIALIZE_OK,
1433  static_cast<FwAssertArgType>(_status)
1434  );
1435 
1436  _status = msg.serializeFrom(cmdSeq);
1437  FW_ASSERT (
1438  _status == Fw::FW_SERIALIZE_OK,
1439  static_cast<FwAssertArgType>(_status)
1440  );
1441 
1442  _status = msg.serializeFrom(args);
1443  FW_ASSERT (
1444  _status == Fw::FW_SERIALIZE_OK,
1445  static_cast<FwAssertArgType>(_status)
1446  );
1447 
1448  // Send message
1450  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1451 
1452  FW_ASSERT(
1453  qStatus == Os::Queue::OP_OK,
1454  static_cast<FwAssertArgType>(qStatus)
1455  );
1456  }
1457 
1460  FwOpcodeType opCode,
1461  U32 cmdSeq,
1462  Fw::CmdArgBuffer& args
1463  )
1464  {
1465  // Call pre-message hook
1466  this->BL_FlushFile_preMsgHook(opCode,cmdSeq);
1467 
1468  // Defer deserializing arguments to the message dispatcher
1469  // to avoid deserializing and reserializing just for IPC
1470  ComponentIpcSerializableBuffer msg;
1472 
1473  // Serialize for IPC
1474  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_BL_FLUSHFILE));
1475  FW_ASSERT (
1476  _status == Fw::FW_SERIALIZE_OK,
1477  static_cast<FwAssertArgType>(_status)
1478  );
1479 
1480  // Fake port number to make message dequeue work
1481  FwIndexType port = 0;
1482 
1483  _status = msg.serializeFrom(port);
1484  FW_ASSERT (
1485  _status == Fw::FW_SERIALIZE_OK,
1486  static_cast<FwAssertArgType>(_status)
1487  );
1488 
1489  _status = msg.serializeFrom(opCode);
1490  FW_ASSERT (
1491  _status == Fw::FW_SERIALIZE_OK,
1492  static_cast<FwAssertArgType>(_status)
1493  );
1494 
1495  _status = msg.serializeFrom(cmdSeq);
1496  FW_ASSERT (
1497  _status == Fw::FW_SERIALIZE_OK,
1498  static_cast<FwAssertArgType>(_status)
1499  );
1500 
1501  _status = msg.serializeFrom(args);
1502  FW_ASSERT (
1503  _status == Fw::FW_SERIALIZE_OK,
1504  static_cast<FwAssertArgType>(_status)
1505  );
1506 
1507  // Send message
1509  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1510 
1511  FW_ASSERT(
1512  qStatus == Os::Queue::OP_OK,
1513  static_cast<FwAssertArgType>(qStatus)
1514  );
1515  }
1516 
1517  // ----------------------------------------------------------------------
1518  // Pre-message hooks for async commands
1519  //
1520  // Each of these functions is invoked just before processing the
1521  // corresponding command. By default they do nothing. You can
1522  // override them to provide specific pre-command behavior.
1523  // ----------------------------------------------------------------------
1524 
1527  FwOpcodeType opCode,
1528  U32 cmdSeq
1529  )
1530  {
1531  // Defaults to no-op; can be overridden
1532  (void) opCode;
1533  (void) cmdSeq;
1534  }
1535 
1538  FwOpcodeType opCode,
1539  U32 cmdSeq
1540  )
1541  {
1542  // Defaults to no-op; can be overridden
1543  (void) opCode;
1544  (void) cmdSeq;
1545  }
1546 
1549  FwOpcodeType opCode,
1550  U32 cmdSeq
1551  )
1552  {
1553  // Defaults to no-op; can be overridden
1554  (void) opCode;
1555  (void) cmdSeq;
1556  }
1557 
1560  FwOpcodeType opCode,
1561  U32 cmdSeq
1562  )
1563  {
1564  // Defaults to no-op; can be overridden
1565  (void) opCode;
1566  (void) cmdSeq;
1567  }
1568 
1569  // ----------------------------------------------------------------------
1570  // Event logging functions
1571  // ----------------------------------------------------------------------
1572 
1575  {
1576  // Get the time
1577  Fw::Time _logTime;
1578  if (this->isConnected_timeCaller_OutputPort(0)) {
1579  this->timeCaller_out(0, _logTime);
1580  }
1581 
1582  const FwEventIdType _id = this->getIdBase() + EVENTID_BL_LOGFILECLOSED;
1583 
1584  // Emit the event on the log port
1585  if (this->isConnected_eventOut_OutputPort(0)) {
1586  Fw::LogBuffer _logBuff;
1588 
1589 #if FW_AMPCS_COMPATIBLE
1590  // Serialize the number of arguments
1591  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1592  FW_ASSERT(
1593  _status == Fw::FW_SERIALIZE_OK,
1594  static_cast<FwAssertArgType>(_status)
1595  );
1596 #endif
1597 
1598  _status = file.serializeTo(
1599  _logBuff,
1600  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 256)
1601  );
1602  FW_ASSERT(
1603  _status == Fw::FW_SERIALIZE_OK,
1604  static_cast<FwAssertArgType>(_status)
1605  );
1606 
1607  this->eventOut_out(
1608  0,
1609  _id,
1610  _logTime,
1612  _logBuff
1613  );
1614  }
1615 
1616  // Emit the event on the text log port
1617 #if FW_ENABLE_TEXT_LOGGING
1618  if (this->isConnected_eventOutText_OutputPort(0)) {
1619 #if FW_OBJECT_NAMES == 1
1620  const char* _formatString =
1621  "(%s) %s: File %s closed";
1622 #else
1623  const char* _formatString =
1624  "%s: File %s closed";
1625 #endif
1626 
1627  Fw::TextLogString _logString;
1628  (void) _logString.format(
1629  _formatString,
1630 #if FW_OBJECT_NAMES == 1
1631  this->m_objName.toChar(),
1632 #endif
1633  "BL_LogFileClosed ",
1634  file.toChar()
1635  );
1636 
1637  this->eventOutText_out(
1638  0,
1639  _id,
1640  _logTime,
1642  _logString
1643  );
1644  }
1645 #endif
1646  }
1647 
1650  U32 errornum,
1651  const Fw::StringBase& file
1652  ) const
1653  {
1654  // Get the time
1655  Fw::Time _logTime;
1656  if (this->isConnected_timeCaller_OutputPort(0)) {
1657  this->timeCaller_out(0, _logTime);
1658  }
1659 
1660  const FwEventIdType _id = this->getIdBase() + EVENTID_BL_LOGFILEOPENERROR;
1661 
1662  // Emit the event on the log port
1663  if (this->isConnected_eventOut_OutputPort(0)) {
1664  Fw::LogBuffer _logBuff;
1666 
1667 #if FW_AMPCS_COMPATIBLE
1668  // Serialize the number of arguments
1669  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1670  FW_ASSERT(
1671  _status == Fw::FW_SERIALIZE_OK,
1672  static_cast<FwAssertArgType>(_status)
1673  );
1674 #endif
1675 
1676 #if FW_AMPCS_COMPATIBLE
1677  // Serialize the argument size
1678  _status = _logBuff.serializeFrom(
1679  static_cast<U8>(sizeof(U32))
1680  );
1681  FW_ASSERT(
1682  _status == Fw::FW_SERIALIZE_OK,
1683  static_cast<FwAssertArgType>(_status)
1684  );
1685 #endif
1686  _status = _logBuff.serializeFrom(errornum);
1687  FW_ASSERT(
1688  _status == Fw::FW_SERIALIZE_OK,
1689  static_cast<FwAssertArgType>(_status)
1690  );
1691 
1692  _status = file.serializeTo(
1693  _logBuff,
1694  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 256)
1695  );
1696  FW_ASSERT(
1697  _status == Fw::FW_SERIALIZE_OK,
1698  static_cast<FwAssertArgType>(_status)
1699  );
1700 
1701  this->eventOut_out(
1702  0,
1703  _id,
1704  _logTime,
1706  _logBuff
1707  );
1708  }
1709 
1710  // Emit the event on the text log port
1711 #if FW_ENABLE_TEXT_LOGGING
1712  if (this->isConnected_eventOutText_OutputPort(0)) {
1713 #if FW_OBJECT_NAMES == 1
1714  const char* _formatString =
1715  "(%s) %s: Error %" PRIu32 " opening file %s";
1716 #else
1717  const char* _formatString =
1718  "%s: Error %" PRIu32 " opening file %s";
1719 #endif
1720 
1721  Fw::TextLogString _logString;
1722  (void) _logString.format(
1723  _formatString,
1724 #if FW_OBJECT_NAMES == 1
1725  this->m_objName.toChar(),
1726 #endif
1727  "BL_LogFileOpenError ",
1728  errornum,
1729  file.toChar()
1730  );
1731 
1732  this->eventOutText_out(
1733  0,
1734  _id,
1735  _logTime,
1737  _logString
1738  );
1739  }
1740 #endif
1741  }
1742 
1745  const Fw::StringBase& validationFile,
1746  U32 status
1747  ) const
1748  {
1749  // Get the time
1750  Fw::Time _logTime;
1751  if (this->isConnected_timeCaller_OutputPort(0)) {
1752  this->timeCaller_out(0, _logTime);
1753  }
1754 
1756 
1757  // Emit the event on the log port
1758  if (this->isConnected_eventOut_OutputPort(0)) {
1759  Fw::LogBuffer _logBuff;
1761 
1762 #if FW_AMPCS_COMPATIBLE
1763  // Serialize the number of arguments
1764  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1765  FW_ASSERT(
1766  _status == Fw::FW_SERIALIZE_OK,
1767  static_cast<FwAssertArgType>(_status)
1768  );
1769 #endif
1770 
1771  _status = validationFile.serializeTo(
1772  _logBuff,
1773  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 256)
1774  );
1775  FW_ASSERT(
1776  _status == Fw::FW_SERIALIZE_OK,
1777  static_cast<FwAssertArgType>(_status)
1778  );
1779 
1780 #if FW_AMPCS_COMPATIBLE
1781  // Serialize the argument size
1782  _status = _logBuff.serializeFrom(
1783  static_cast<U8>(sizeof(U32))
1784  );
1785  FW_ASSERT(
1786  _status == Fw::FW_SERIALIZE_OK,
1787  static_cast<FwAssertArgType>(_status)
1788  );
1789 #endif
1790  _status = _logBuff.serializeFrom(status);
1791  FW_ASSERT(
1792  _status == Fw::FW_SERIALIZE_OK,
1793  static_cast<FwAssertArgType>(_status)
1794  );
1795 
1796  this->eventOut_out(
1797  0,
1798  _id,
1799  _logTime,
1801  _logBuff
1802  );
1803  }
1804 
1805  // Emit the event on the text log port
1806 #if FW_ENABLE_TEXT_LOGGING
1807  if (this->isConnected_eventOutText_OutputPort(0)) {
1808 #if FW_OBJECT_NAMES == 1
1809  const char* _formatString =
1810  "(%s) %s: Failed creating validation file %s with status %" PRIu32 "";
1811 #else
1812  const char* _formatString =
1813  "%s: Failed creating validation file %s with status %" PRIu32 "";
1814 #endif
1815 
1816  Fw::TextLogString _logString;
1817  (void) _logString.format(
1818  _formatString,
1819 #if FW_OBJECT_NAMES == 1
1820  this->m_objName.toChar(),
1821 #endif
1822  "BL_LogFileValidationError ",
1823  validationFile.toChar(),
1824  status
1825  );
1826 
1827  this->eventOutText_out(
1828  0,
1829  _id,
1830  _logTime,
1832  _logString
1833  );
1834  }
1835 #endif
1836  }
1837 
1840  U32 errornum,
1841  U32 bytesWritten,
1842  U32 bytesToWrite,
1843  const Fw::StringBase& file
1844  ) const
1845  {
1846  // Get the time
1847  Fw::Time _logTime;
1848  if (this->isConnected_timeCaller_OutputPort(0)) {
1849  this->timeCaller_out(0, _logTime);
1850  }
1851 
1853 
1854  // Emit the event on the log port
1855  if (this->isConnected_eventOut_OutputPort(0)) {
1856  Fw::LogBuffer _logBuff;
1858 
1859 #if FW_AMPCS_COMPATIBLE
1860  // Serialize the number of arguments
1861  _status = _logBuff.serializeFrom(static_cast<U8>(4));
1862  FW_ASSERT(
1863  _status == Fw::FW_SERIALIZE_OK,
1864  static_cast<FwAssertArgType>(_status)
1865  );
1866 #endif
1867 
1868 #if FW_AMPCS_COMPATIBLE
1869  // Serialize the argument size
1870  _status = _logBuff.serializeFrom(
1871  static_cast<U8>(sizeof(U32))
1872  );
1873  FW_ASSERT(
1874  _status == Fw::FW_SERIALIZE_OK,
1875  static_cast<FwAssertArgType>(_status)
1876  );
1877 #endif
1878  _status = _logBuff.serializeFrom(errornum);
1879  FW_ASSERT(
1880  _status == Fw::FW_SERIALIZE_OK,
1881  static_cast<FwAssertArgType>(_status)
1882  );
1883 
1884 #if FW_AMPCS_COMPATIBLE
1885  // Serialize the argument size
1886  _status = _logBuff.serializeFrom(
1887  static_cast<U8>(sizeof(U32))
1888  );
1889  FW_ASSERT(
1890  _status == Fw::FW_SERIALIZE_OK,
1891  static_cast<FwAssertArgType>(_status)
1892  );
1893 #endif
1894  _status = _logBuff.serializeFrom(bytesWritten);
1895  FW_ASSERT(
1896  _status == Fw::FW_SERIALIZE_OK,
1897  static_cast<FwAssertArgType>(_status)
1898  );
1899 
1900 #if FW_AMPCS_COMPATIBLE
1901  // Serialize the argument size
1902  _status = _logBuff.serializeFrom(
1903  static_cast<U8>(sizeof(U32))
1904  );
1905  FW_ASSERT(
1906  _status == Fw::FW_SERIALIZE_OK,
1907  static_cast<FwAssertArgType>(_status)
1908  );
1909 #endif
1910  _status = _logBuff.serializeFrom(bytesToWrite);
1911  FW_ASSERT(
1912  _status == Fw::FW_SERIALIZE_OK,
1913  static_cast<FwAssertArgType>(_status)
1914  );
1915 
1916  _status = file.serializeTo(
1917  _logBuff,
1918  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 256)
1919  );
1920  FW_ASSERT(
1921  _status == Fw::FW_SERIALIZE_OK,
1922  static_cast<FwAssertArgType>(_status)
1923  );
1924 
1925  this->eventOut_out(
1926  0,
1927  _id,
1928  _logTime,
1930  _logBuff
1931  );
1932  }
1933 
1934  // Emit the event on the text log port
1935 #if FW_ENABLE_TEXT_LOGGING
1936  if (this->isConnected_eventOutText_OutputPort(0)) {
1937 #if FW_OBJECT_NAMES == 1
1938  const char* _formatString =
1939  "(%s) %s: Error %" PRIu32 " while writing %" PRIu32 " of %" PRIu32 " bytes to %s";
1940 #else
1941  const char* _formatString =
1942  "%s: Error %" PRIu32 " while writing %" PRIu32 " of %" PRIu32 " bytes to %s";
1943 #endif
1944 
1945  Fw::TextLogString _logString;
1946  (void) _logString.format(
1947  _formatString,
1948 #if FW_OBJECT_NAMES == 1
1949  this->m_objName.toChar(),
1950 #endif
1951  "BL_LogFileWriteError ",
1952  errornum,
1953  bytesWritten,
1954  bytesToWrite,
1955  file.toChar()
1956  );
1957 
1958  this->eventOutText_out(
1959  0,
1960  _id,
1961  _logTime,
1963  _logString
1964  );
1965  }
1966 #endif
1967  }
1968 
1971  {
1972  // Get the time
1973  Fw::Time _logTime;
1974  if (this->isConnected_timeCaller_OutputPort(0)) {
1975  this->timeCaller_out(0, _logTime);
1976  }
1977 
1978  const FwEventIdType _id = this->getIdBase() + EVENTID_BL_ACTIVATED;
1979 
1980  // Emit the event on the log port
1981  if (this->isConnected_eventOut_OutputPort(0)) {
1982  Fw::LogBuffer _logBuff;
1983 
1984 #if FW_AMPCS_COMPATIBLE
1986  // Serialize the number of arguments
1987  _status = _logBuff.serializeFrom(static_cast<U8>(0));
1988  FW_ASSERT(
1989  _status == Fw::FW_SERIALIZE_OK,
1990  static_cast<FwAssertArgType>(_status)
1991  );
1992 #endif
1993 
1994  this->eventOut_out(
1995  0,
1996  _id,
1997  _logTime,
1999  _logBuff
2000  );
2001  }
2002 
2003  // Emit the event on the text log port
2004 #if FW_ENABLE_TEXT_LOGGING
2005  if (this->isConnected_eventOutText_OutputPort(0)) {
2006 #if FW_OBJECT_NAMES == 1
2007  const char* _formatString =
2008  "(%s) %s: Buffer logger was activated";
2009 #else
2010  const char* _formatString =
2011  "%s: Buffer logger was activated";
2012 #endif
2013 
2014  Fw::TextLogString _logString;
2015  (void) _logString.format(
2016  _formatString,
2017 #if FW_OBJECT_NAMES == 1
2018  this->m_objName.toChar(),
2019 #endif
2020  "BL_Activated "
2021  );
2022 
2023  this->eventOutText_out(
2024  0,
2025  _id,
2026  _logTime,
2028  _logString
2029  );
2030  }
2031 #endif
2032  }
2033 
2036  {
2037  // Get the time
2038  Fw::Time _logTime;
2039  if (this->isConnected_timeCaller_OutputPort(0)) {
2040  this->timeCaller_out(0, _logTime);
2041  }
2042 
2043  const FwEventIdType _id = this->getIdBase() + EVENTID_BL_DEACTIVATED;
2044 
2045  // Emit the event on the log port
2046  if (this->isConnected_eventOut_OutputPort(0)) {
2047  Fw::LogBuffer _logBuff;
2048 
2049 #if FW_AMPCS_COMPATIBLE
2051  // Serialize the number of arguments
2052  _status = _logBuff.serializeFrom(static_cast<U8>(0));
2053  FW_ASSERT(
2054  _status == Fw::FW_SERIALIZE_OK,
2055  static_cast<FwAssertArgType>(_status)
2056  );
2057 #endif
2058 
2059  this->eventOut_out(
2060  0,
2061  _id,
2062  _logTime,
2064  _logBuff
2065  );
2066  }
2067 
2068  // Emit the event on the text log port
2069 #if FW_ENABLE_TEXT_LOGGING
2070  if (this->isConnected_eventOutText_OutputPort(0)) {
2071 #if FW_OBJECT_NAMES == 1
2072  const char* _formatString =
2073  "(%s) %s: Buffer logger was deactivated";
2074 #else
2075  const char* _formatString =
2076  "%s: Buffer logger was deactivated";
2077 #endif
2078 
2079  Fw::TextLogString _logString;
2080  (void) _logString.format(
2081  _formatString,
2082 #if FW_OBJECT_NAMES == 1
2083  this->m_objName.toChar(),
2084 #endif
2085  "BL_Deactivated "
2086  );
2087 
2088  this->eventOutText_out(
2089  0,
2090  _id,
2091  _logTime,
2093  _logString
2094  );
2095  }
2096 #endif
2097  }
2098 
2101  {
2102  // Get the time
2103  Fw::Time _logTime;
2104  if (this->isConnected_timeCaller_OutputPort(0)) {
2105  this->timeCaller_out(0, _logTime);
2106  }
2107 
2109 
2110  // Emit the event on the log port
2111  if (this->isConnected_eventOut_OutputPort(0)) {
2112  Fw::LogBuffer _logBuff;
2113 
2114 #if FW_AMPCS_COMPATIBLE
2116  // Serialize the number of arguments
2117  _status = _logBuff.serializeFrom(static_cast<U8>(0));
2118  FW_ASSERT(
2119  _status == Fw::FW_SERIALIZE_OK,
2120  static_cast<FwAssertArgType>(_status)
2121  );
2122 #endif
2123 
2124  this->eventOut_out(
2125  0,
2126  _id,
2127  _logTime,
2129  _logBuff
2130  );
2131  }
2132 
2133  // Emit the event on the text log port
2134 #if FW_ENABLE_TEXT_LOGGING
2135  if (this->isConnected_eventOutText_OutputPort(0)) {
2136 #if FW_OBJECT_NAMES == 1
2137  const char* _formatString =
2138  "(%s) %s: No log file open command";
2139 #else
2140  const char* _formatString =
2141  "%s: No log file open command";
2142 #endif
2143 
2144  Fw::TextLogString _logString;
2145  (void) _logString.format(
2146  _formatString,
2147 #if FW_OBJECT_NAMES == 1
2148  this->m_objName.toChar(),
2149 #endif
2150  "BL_NoLogFileOpenInitError "
2151  );
2152 
2153  this->eventOutText_out(
2154  0,
2155  _id,
2156  _logTime,
2158  _logString
2159  );
2160  }
2161 #endif
2162  }
2163 
2166  {
2167  // Get the time
2168  Fw::Time _logTime;
2169  if (this->isConnected_timeCaller_OutputPort(0)) {
2170  this->timeCaller_out(0, _logTime);
2171  }
2172 
2173  const FwEventIdType _id = this->getIdBase() + EVENTID_BL_LOGFILENAMEERROR;
2174 
2175  // Emit the event on the log port
2176  if (this->isConnected_eventOut_OutputPort(0)) {
2177  Fw::LogBuffer _logBuff;
2179 
2180 #if FW_AMPCS_COMPATIBLE
2181  // Serialize the number of arguments
2182  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2183  FW_ASSERT(
2184  _status == Fw::FW_SERIALIZE_OK,
2185  static_cast<FwAssertArgType>(_status)
2186  );
2187 #endif
2188 
2189 #if FW_AMPCS_COMPATIBLE
2190  // Serialize the argument size
2191  _status = _logBuff.serializeFrom(
2193  );
2194  FW_ASSERT(
2195  _status == Fw::FW_SERIALIZE_OK,
2196  static_cast<FwAssertArgType>(_status)
2197  );
2198 #endif
2199  _status = _logBuff.serializeFrom(status);
2200  FW_ASSERT(
2201  _status == Fw::FW_SERIALIZE_OK,
2202  static_cast<FwAssertArgType>(_status)
2203  );
2204 
2205  this->eventOut_out(
2206  0,
2207  _id,
2208  _logTime,
2210  _logBuff
2211  );
2212  }
2213 
2214  // Emit the event on the text log port
2215 #if FW_ENABLE_TEXT_LOGGING
2216  if (this->isConnected_eventOutText_OutputPort(0)) {
2217 #if FW_OBJECT_NAMES == 1
2218  const char* _formatString =
2219  "(%s) %s: Error %s formatting log file name";
2220 #else
2221  const char* _formatString =
2222  "%s: Error %s formatting log file name";
2223 #endif
2224 
2225  Fw::String statusStr;
2226  status.toString(statusStr);
2227 
2228  Fw::TextLogString _logString;
2229  (void) _logString.format(
2230  _formatString,
2231 #if FW_OBJECT_NAMES == 1
2232  this->m_objName.toChar(),
2233 #endif
2234  "BL_LogFileNameError ",
2235  statusStr.toChar()
2236  );
2237 
2238  this->eventOutText_out(
2239  0,
2240  _id,
2241  _logTime,
2243  _logString
2244  );
2245  }
2246 #endif
2247  }
2248 
2249  // ----------------------------------------------------------------------
2250  // Telemetry serialized write
2251  // ----------------------------------------------------------------------
2252 
2255  FwChanIdType id,
2256  Fw::TlmBuffer& _tlmBuff,
2257  Fw::Time _tlmTime
2258  ) const
2259  {
2260  if (this->isConnected_tlmOut_OutputPort(0)) {
2261  if (
2263  (_tlmTime == Fw::ZERO_TIME)
2264  ) {
2265  this->timeCaller_out(0, _tlmTime);
2266  }
2267 
2268  FwChanIdType _id;
2269  _id = this->getIdBase() + id;
2270 
2271  this->tlmOut_out(
2272  0,
2273  _id,
2274  _tlmTime,
2275  _tlmBuff
2276  );
2277  }
2278  }
2279 
2280  // ----------------------------------------------------------------------
2281  // Telemetry write functions
2282  // ----------------------------------------------------------------------
2283 
2286  U32 arg,
2287  Fw::Time _tlmTime
2288  ) const
2289  {
2290  if (this->isConnected_tlmOut_OutputPort(0)) {
2291  Fw::TlmBuffer _tlmBuff;
2292  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
2293  FW_ASSERT(
2294  _stat == Fw::FW_SERIALIZE_OK,
2295  static_cast<FwAssertArgType>(_stat)
2296  );
2297 
2298  this->tlmWrite(
2300  _tlmBuff,
2301  _tlmTime
2302  );
2303  }
2304  }
2305 
2306  // ----------------------------------------------------------------------
2307  // Time
2308  // ----------------------------------------------------------------------
2309 
2311  getTime() const
2312  {
2313  if (this->isConnected_timeCaller_OutputPort(0)) {
2314  Fw::Time _time;
2315  this->timeCaller_out(0, _time);
2316  return _time;
2317  }
2318  else {
2319  return Fw::Time(TimeBase::TB_NONE, 0, 0);
2320  }
2321  }
2322 
2323  // ----------------------------------------------------------------------
2324  // Message dispatch functions
2325  // ----------------------------------------------------------------------
2326 
2327  Fw::QueuedComponentBase::MsgDispatchStatus BufferLoggerComponentBase ::
2328  doDispatch()
2329  {
2330  ComponentIpcSerializableBuffer _msg;
2331  FwQueuePriorityType _priority = 0;
2332 
2333  Os::Queue::Status _msgStatus = this->m_queue.receive(
2334  _msg,
2336  _priority
2337  );
2338  FW_ASSERT(
2339  _msgStatus == Os::Queue::OP_OK,
2340  static_cast<FwAssertArgType>(_msgStatus)
2341  );
2342 
2343  // Reset to beginning of buffer
2344  _msg.resetDeser();
2345 
2346  FwEnumStoreType _desMsg = 0;
2347  Fw::SerializeStatus _deserStatus = _msg.deserializeTo(_desMsg);
2348  FW_ASSERT(
2349  _deserStatus == Fw::FW_SERIALIZE_OK,
2350  static_cast<FwAssertArgType>(_deserStatus)
2351  );
2352 
2353  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
2354 
2355  if (_msgType == BUFFERLOGGER_COMPONENT_EXIT) {
2356  return MSG_DISPATCH_EXIT;
2357  }
2358 
2359  FwIndexType portNum = 0;
2360  _deserStatus = _msg.deserializeTo(portNum);
2361  FW_ASSERT(
2362  _deserStatus == Fw::FW_SERIALIZE_OK,
2363  static_cast<FwAssertArgType>(_deserStatus)
2364  );
2365 
2366  switch (_msgType) {
2367  // Handle async input port bufferSendIn
2368  case BUFFERSENDIN_BUFFERSEND: {
2369  // Deserialize argument fwBuffer
2370  Fw::Buffer fwBuffer;
2371  _deserStatus = _msg.deserializeTo(fwBuffer);
2372  FW_ASSERT(
2373  _deserStatus == Fw::FW_SERIALIZE_OK,
2374  static_cast<FwAssertArgType>(_deserStatus)
2375  );
2376  // Call handler function
2377  this->bufferSendIn_handler(
2378  portNum,
2379  fwBuffer
2380  );
2381 
2382  break;
2383  }
2384 
2385  // Handle async input port comIn
2386  case COMIN_COM: {
2387  // Deserialize argument data
2388  Fw::ComBuffer data;
2389  _deserStatus = _msg.deserializeTo(data);
2390  FW_ASSERT(
2391  _deserStatus == Fw::FW_SERIALIZE_OK,
2392  static_cast<FwAssertArgType>(_deserStatus)
2393  );
2394 
2395  // Deserialize argument context
2396  U32 context;
2397  _deserStatus = _msg.deserializeTo(context);
2398  FW_ASSERT(
2399  _deserStatus == Fw::FW_SERIALIZE_OK,
2400  static_cast<FwAssertArgType>(_deserStatus)
2401  );
2402  // Call handler function
2403  this->comIn_handler(
2404  portNum,
2405  data,
2406  context
2407  );
2408 
2409  break;
2410  }
2411 
2412  // Handle async input port pingIn
2413  case PINGIN_PING: {
2414  // Deserialize argument key
2415  U32 key;
2416  _deserStatus = _msg.deserializeTo(key);
2417  FW_ASSERT(
2418  _deserStatus == Fw::FW_SERIALIZE_OK,
2419  static_cast<FwAssertArgType>(_deserStatus)
2420  );
2421  // Call handler function
2422  this->pingIn_handler(
2423  portNum,
2424  key
2425  );
2426 
2427  break;
2428  }
2429 
2430  // Handle async input port schedIn
2431  case SCHEDIN_SCHED: {
2432  // Deserialize argument context
2433  U32 context;
2434  _deserStatus = _msg.deserializeTo(context);
2435  FW_ASSERT(
2436  _deserStatus == Fw::FW_SERIALIZE_OK,
2437  static_cast<FwAssertArgType>(_deserStatus)
2438  );
2439  // Call handler function
2440  this->schedIn_handler(
2441  portNum,
2442  context
2443  );
2444 
2445  break;
2446  }
2447 
2448  // Handle command BL_OpenFile
2449  case CMD_BL_OPENFILE: {
2450  // Deserialize opcode
2451  FwOpcodeType _opCode = 0;
2452  _deserStatus = _msg.deserializeTo(_opCode);
2453  FW_ASSERT (
2454  _deserStatus == Fw::FW_SERIALIZE_OK,
2455  static_cast<FwAssertArgType>(_deserStatus)
2456  );
2457 
2458  // Deserialize command sequence
2459  U32 _cmdSeq = 0;
2460  _deserStatus = _msg.deserializeTo(_cmdSeq);
2461  FW_ASSERT (
2462  _deserStatus == Fw::FW_SERIALIZE_OK,
2463  static_cast<FwAssertArgType>(_deserStatus)
2464  );
2465 
2466  // Deserialize command argument buffer
2467  Fw::CmdArgBuffer args;
2468  _deserStatus = _msg.deserializeTo(args);
2469  FW_ASSERT (
2470  _deserStatus == Fw::FW_SERIALIZE_OK,
2471  static_cast<FwAssertArgType>(_deserStatus)
2472  );
2473 
2474  // Reset buffer
2475  args.resetDeser();
2476 
2477  // Deserialize argument file
2478  Fw::CmdStringArg file;
2479  _deserStatus = args.deserializeTo(file);
2480  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2482  this->cmdResponse_out(
2483  _opCode,
2484  _cmdSeq,
2486  );
2487  }
2488  // Don't crash the task if bad arguments were passed from the ground
2489  break;
2490  }
2491 
2492  // Make sure there was no data left over.
2493  // That means the argument buffer size was incorrect.
2494 #if FW_CMD_CHECK_RESIDUAL
2495  if (args.getDeserializeSizeLeft() != 0) {
2497  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2498  }
2499  // Don't crash the task if bad arguments were passed from the ground
2500  break;
2501  }
2502 #endif
2503 
2504  // Call handler function
2505  this->BL_OpenFile_cmdHandler(
2506  _opCode, _cmdSeq,
2507  file
2508  );
2509 
2510  break;
2511  }
2512 
2513  // Handle command BL_CloseFile
2514  case CMD_BL_CLOSEFILE: {
2515  // Deserialize opcode
2516  FwOpcodeType _opCode = 0;
2517  _deserStatus = _msg.deserializeTo(_opCode);
2518  FW_ASSERT (
2519  _deserStatus == Fw::FW_SERIALIZE_OK,
2520  static_cast<FwAssertArgType>(_deserStatus)
2521  );
2522 
2523  // Deserialize command sequence
2524  U32 _cmdSeq = 0;
2525  _deserStatus = _msg.deserializeTo(_cmdSeq);
2526  FW_ASSERT (
2527  _deserStatus == Fw::FW_SERIALIZE_OK,
2528  static_cast<FwAssertArgType>(_deserStatus)
2529  );
2530 
2531  // Deserialize command argument buffer
2532  Fw::CmdArgBuffer args;
2533  _deserStatus = _msg.deserializeTo(args);
2534  FW_ASSERT (
2535  _deserStatus == Fw::FW_SERIALIZE_OK,
2536  static_cast<FwAssertArgType>(_deserStatus)
2537  );
2538 
2539  // Reset buffer
2540  args.resetDeser();
2541 
2542  // Make sure there was no data left over.
2543  // That means the argument buffer size was incorrect.
2544 #if FW_CMD_CHECK_RESIDUAL
2545  if (args.getDeserializeSizeLeft() != 0) {
2547  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2548  }
2549  // Don't crash the task if bad arguments were passed from the ground
2550  break;
2551  }
2552 #endif
2553 
2554  // Call handler function
2555  this->BL_CloseFile_cmdHandler(_opCode, _cmdSeq);
2556 
2557  break;
2558  }
2559 
2560  // Handle command BL_SetLogging
2561  case CMD_BL_SETLOGGING: {
2562  // Deserialize opcode
2563  FwOpcodeType _opCode = 0;
2564  _deserStatus = _msg.deserializeTo(_opCode);
2565  FW_ASSERT (
2566  _deserStatus == Fw::FW_SERIALIZE_OK,
2567  static_cast<FwAssertArgType>(_deserStatus)
2568  );
2569 
2570  // Deserialize command sequence
2571  U32 _cmdSeq = 0;
2572  _deserStatus = _msg.deserializeTo(_cmdSeq);
2573  FW_ASSERT (
2574  _deserStatus == Fw::FW_SERIALIZE_OK,
2575  static_cast<FwAssertArgType>(_deserStatus)
2576  );
2577 
2578  // Deserialize command argument buffer
2579  Fw::CmdArgBuffer args;
2580  _deserStatus = _msg.deserializeTo(args);
2581  FW_ASSERT (
2582  _deserStatus == Fw::FW_SERIALIZE_OK,
2583  static_cast<FwAssertArgType>(_deserStatus)
2584  );
2585 
2586  // Reset buffer
2587  args.resetDeser();
2588 
2589  // Deserialize argument state
2591  _deserStatus = args.deserializeTo(state);
2592  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2594  this->cmdResponse_out(
2595  _opCode,
2596  _cmdSeq,
2598  );
2599  }
2600  // Don't crash the task if bad arguments were passed from the ground
2601  break;
2602  }
2603 
2604  // Make sure there was no data left over.
2605  // That means the argument buffer size was incorrect.
2606 #if FW_CMD_CHECK_RESIDUAL
2607  if (args.getDeserializeSizeLeft() != 0) {
2609  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2610  }
2611  // Don't crash the task if bad arguments were passed from the ground
2612  break;
2613  }
2614 #endif
2615 
2616  // Call handler function
2618  _opCode, _cmdSeq,
2619  state
2620  );
2621 
2622  break;
2623  }
2624 
2625  // Handle command BL_FlushFile
2626  case CMD_BL_FLUSHFILE: {
2627  // Deserialize opcode
2628  FwOpcodeType _opCode = 0;
2629  _deserStatus = _msg.deserializeTo(_opCode);
2630  FW_ASSERT (
2631  _deserStatus == Fw::FW_SERIALIZE_OK,
2632  static_cast<FwAssertArgType>(_deserStatus)
2633  );
2634 
2635  // Deserialize command sequence
2636  U32 _cmdSeq = 0;
2637  _deserStatus = _msg.deserializeTo(_cmdSeq);
2638  FW_ASSERT (
2639  _deserStatus == Fw::FW_SERIALIZE_OK,
2640  static_cast<FwAssertArgType>(_deserStatus)
2641  );
2642 
2643  // Deserialize command argument buffer
2644  Fw::CmdArgBuffer args;
2645  _deserStatus = _msg.deserializeTo(args);
2646  FW_ASSERT (
2647  _deserStatus == Fw::FW_SERIALIZE_OK,
2648  static_cast<FwAssertArgType>(_deserStatus)
2649  );
2650 
2651  // Reset buffer
2652  args.resetDeser();
2653 
2654  // Make sure there was no data left over.
2655  // That means the argument buffer size was incorrect.
2656 #if FW_CMD_CHECK_RESIDUAL
2657  if (args.getDeserializeSizeLeft() != 0) {
2659  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2660  }
2661  // Don't crash the task if bad arguments were passed from the ground
2662  break;
2663  }
2664 #endif
2665 
2666  // Call handler function
2667  this->BL_FlushFile_cmdHandler(_opCode, _cmdSeq);
2668 
2669  break;
2670  }
2671 
2672  default:
2673  return MSG_DISPATCH_ERROR;
2674  }
2675 
2676  return MSG_DISPATCH_OK;
2677  }
2678 
2679  // ----------------------------------------------------------------------
2680  // Calls for messages received on special input ports
2681  // ----------------------------------------------------------------------
2682 
2683  void BufferLoggerComponentBase ::
2684  m_p_cmdIn_in(
2685  Fw::PassiveComponentBase* callComp,
2686  FwIndexType portNum,
2687  FwOpcodeType opCode,
2688  U32 cmdSeq,
2689  Fw::CmdArgBuffer& args
2690  )
2691  {
2692  FW_ASSERT(callComp != nullptr);
2693  BufferLoggerComponentBase* compPtr = static_cast<BufferLoggerComponentBase*>(callComp);
2694  compPtr->cmdIn_handlerBase(
2695  portNum,
2696  opCode,
2697  cmdSeq,
2698  args
2699  );
2700  }
2701 
2702  // ----------------------------------------------------------------------
2703  // Calls for messages received on typed input ports
2704  // ----------------------------------------------------------------------
2705 
2706  void BufferLoggerComponentBase ::
2707  m_p_bufferSendIn_in(
2708  Fw::PassiveComponentBase* callComp,
2709  FwIndexType portNum,
2710  Fw::Buffer& fwBuffer
2711  )
2712  {
2713  FW_ASSERT(callComp != nullptr);
2714  BufferLoggerComponentBase* compPtr = static_cast<BufferLoggerComponentBase*>(callComp);
2715  compPtr->bufferSendIn_handlerBase(
2716  portNum,
2717  fwBuffer
2718  );
2719  }
2720 
2721  void BufferLoggerComponentBase ::
2722  m_p_comIn_in(
2723  Fw::PassiveComponentBase* callComp,
2724  FwIndexType portNum,
2725  Fw::ComBuffer& data,
2726  U32 context
2727  )
2728  {
2729  FW_ASSERT(callComp != nullptr);
2730  BufferLoggerComponentBase* compPtr = static_cast<BufferLoggerComponentBase*>(callComp);
2731  compPtr->comIn_handlerBase(
2732  portNum,
2733  data,
2734  context
2735  );
2736  }
2737 
2738  void BufferLoggerComponentBase ::
2739  m_p_pingIn_in(
2740  Fw::PassiveComponentBase* callComp,
2741  FwIndexType portNum,
2742  U32 key
2743  )
2744  {
2745  FW_ASSERT(callComp != nullptr);
2746  BufferLoggerComponentBase* compPtr = static_cast<BufferLoggerComponentBase*>(callComp);
2747  compPtr->pingIn_handlerBase(
2748  portNum,
2749  key
2750  );
2751  }
2752 
2753  void BufferLoggerComponentBase ::
2754  m_p_schedIn_in(
2755  Fw::PassiveComponentBase* callComp,
2756  FwIndexType portNum,
2757  U32 context
2758  )
2759  {
2760  FW_ASSERT(callComp != nullptr);
2761  BufferLoggerComponentBase* compPtr = static_cast<BufferLoggerComponentBase*>(callComp);
2762  compPtr->schedIn_handlerBase(
2763  portNum,
2764  context
2765  );
2766  }
2767 
2768 #if !FW_DIRECT_PORT_CALLS
2769 
2770  // ----------------------------------------------------------------------
2771  // Invocation functions for special output ports
2772  // ----------------------------------------------------------------------
2773 
2774  void BufferLoggerComponentBase ::
2775  cmdRegOut_out(
2776  FwIndexType portNum,
2777  FwOpcodeType opCode
2778  ) const
2779  {
2780  FW_ASSERT(
2781  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
2782  static_cast<FwAssertArgType>(portNum)
2783  );
2784 
2785  FW_ASSERT(
2786  this->m_cmdRegOut_OutputPort[portNum].isConnected(),
2787  static_cast<FwAssertArgType>(portNum)
2788  );
2789  this->m_cmdRegOut_OutputPort[portNum].invoke(
2790  opCode
2791  );
2792  }
2793 
2794  void BufferLoggerComponentBase ::
2795  cmdResponseOut_out(
2796  FwIndexType portNum,
2797  FwOpcodeType opCode,
2798  U32 cmdSeq,
2799  const Fw::CmdResponse& response
2800  ) const
2801  {
2802  FW_ASSERT(
2803  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
2804  static_cast<FwAssertArgType>(portNum)
2805  );
2806 
2807  FW_ASSERT(
2808  this->m_cmdResponseOut_OutputPort[portNum].isConnected(),
2809  static_cast<FwAssertArgType>(portNum)
2810  );
2811  this->m_cmdResponseOut_OutputPort[portNum].invoke(
2812  opCode,
2813  cmdSeq,
2814  response
2815  );
2816  }
2817 
2818  void BufferLoggerComponentBase ::
2819  eventOut_out(
2820  FwIndexType portNum,
2821  FwEventIdType id,
2822  Fw::Time& timeTag,
2823  const Fw::LogSeverity& severity,
2824  Fw::LogBuffer& args
2825  ) const
2826  {
2827  FW_ASSERT(
2828  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
2829  static_cast<FwAssertArgType>(portNum)
2830  );
2831 
2832  FW_ASSERT(
2833  this->m_eventOut_OutputPort[portNum].isConnected(),
2834  static_cast<FwAssertArgType>(portNum)
2835  );
2836  this->m_eventOut_OutputPort[portNum].invoke(
2837  id,
2838  timeTag,
2839  severity,
2840  args
2841  );
2842  }
2843 
2844 #if FW_ENABLE_TEXT_LOGGING
2845 
2846  void BufferLoggerComponentBase ::
2847  eventOutText_out(
2848  FwIndexType portNum,
2849  FwEventIdType id,
2850  Fw::Time& timeTag,
2851  const Fw::LogSeverity& severity,
2852  Fw::TextLogString& text
2853  ) const
2854  {
2855  FW_ASSERT(
2856  (0 <= portNum) && (portNum < this->getNum_eventOutText_OutputPorts()),
2857  static_cast<FwAssertArgType>(portNum)
2858  );
2859 
2860  FW_ASSERT(
2861  this->m_eventOutText_OutputPort[portNum].isConnected(),
2862  static_cast<FwAssertArgType>(portNum)
2863  );
2864  this->m_eventOutText_OutputPort[portNum].invoke(
2865  id,
2866  timeTag,
2867  severity,
2868  text
2869  );
2870  }
2871 
2872 #endif
2873 
2874  void BufferLoggerComponentBase ::
2875  timeCaller_out(
2876  FwIndexType portNum,
2877  Fw::Time& time
2878  ) const
2879  {
2880  FW_ASSERT(
2881  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
2882  static_cast<FwAssertArgType>(portNum)
2883  );
2884 
2885  FW_ASSERT(
2886  this->m_timeCaller_OutputPort[portNum].isConnected(),
2887  static_cast<FwAssertArgType>(portNum)
2888  );
2889  this->m_timeCaller_OutputPort[portNum].invoke(
2890  time
2891  );
2892  }
2893 
2894  void BufferLoggerComponentBase ::
2895  tlmOut_out(
2896  FwIndexType portNum,
2897  FwChanIdType id,
2898  Fw::Time& timeTag,
2899  Fw::TlmBuffer& val
2900  ) const
2901  {
2902  FW_ASSERT(
2903  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
2904  static_cast<FwAssertArgType>(portNum)
2905  );
2906 
2907  FW_ASSERT(
2908  this->m_tlmOut_OutputPort[portNum].isConnected(),
2909  static_cast<FwAssertArgType>(portNum)
2910  );
2911  this->m_tlmOut_OutputPort[portNum].invoke(
2912  id,
2913  timeTag,
2914  val
2915  );
2916  }
2917 
2918 #endif
2919 
2920 }
Serialization/Deserialization operation was successful.
void BL_SetLogging_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void set_cmdResponseOut_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:157
void regCommands()
Register commands with the Command Dispatcher.
virtual void bufferSendIn_preMsgHook(FwIndexType portNum, Fw::Buffer &fwBuffer)
Pre-message hook for async input port bufferSendIn.
static constexpr FwSizeType CAPACITY
Definition: CmdPortAc.hpp:36
FwIdType FwOpcodeType
The type of a command opcode.
Operation succeeded.
Definition: Os.hpp:27
Svc::InputSchedPort * get_schedIn_InputPort(FwIndexType portNum)
The size of the serial representation.
void pingOut_out(FwIndexType portNum, U32 key) const
Invoke output port pingOut.
PlatformSizeType FwSizeType
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
Definition: Queue.cpp:71
I32 FwEnumStoreType
virtual void schedIn_preMsgHook(FwIndexType portNum, U32 context)
Pre-message hook for async input port schedIn.
static constexpr FwIndexType getNum_pingIn_InputPorts()
Status
status returned from the queue send function
Definition: Queue.hpp:30
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
void init()
Initialization function.
Definition: SchedPortAc.cpp:73
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
message to exit active component task
BYTE pingInPortSize[Svc::PingPortBuffer::CAPACITY]
void init()
Initialization function.
Definition: CmdPortAc.cpp:89
SerializeStatus deserializeTo(U8 &val, Endianness mode=Endianness::BIG) override
Deserialize an 8-bit unsigned integer value.
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
bool isConnected_cmdResponseOut_OutputPort(FwIndexType portNum) const
virtual void BL_SetLogging_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command BL_SetLogging.
static constexpr FwSizeType CAPACITY
virtual void BL_CloseFile_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command BL_CloseFile.
void invoke(U32 key) const
Invoke a port connection.
Definition: PingPortAc.cpp:170
virtual const CHAR * toChar() const =0
Convert to a C-style char*.
const Time ZERO_TIME
Definition: Time.cpp:5
bool isConnected_timeCaller_OutputPort(FwIndexType portNum) const
virtual void BL_OpenFile_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command BL_OpenFile.
virtual void BL_FlushFile_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command BL_FlushFile.
virtual void bufferSendIn_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port bufferSendIn.
void BL_OpenFile_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void init()
Initialization function.
Definition: TlmPortAc.cpp:171
void log_DIAGNOSTIC_BL_LogFileClosed(const Fw::StringBase &file) 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.
FPP shadow-enum representing Fw::FormatStatus.
static constexpr FwIndexType getNum_timeCaller_OutputPorts()
Open a new log file with specified name; also resets unique file counter to 0.
Os::Queue m_queue
queue object for active component
Software diagnostic events.
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:177
void bufferSendIn_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port bufferSendIn.
void init()
Object initializer.
Definition: ObjBase.cpp:24
bool isConnected_cmdRegOut_OutputPort(FwIndexType portNum) const
void init()
Initialization function.
Definition: ComPortAc.cpp:81
SerializeStatus
forward declaration for string
virtual void comIn_handler(FwIndexType portNum, Fw::ComBuffer &data, U32 context)=0
Handler for input port comIn.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: CmdPortAc.cpp:95
Message will block until space is available.
Definition: Queue.hpp:47
void log_WARNING_HI_BL_LogFileOpenError(U32 errornum, const Fw::StringBase &file) const
The Buffer Logger encountered an error formatting a log file name.
void set_pingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
FwIdType FwEventIdType
The type of an event identifier.
virtual void comIn_preMsgHook(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Pre-message hook for async input port comIn.
static constexpr FwIndexType getNum_schedIn_InputPorts()
void invoke(FwOpcodeType opCode) const
Invoke a port connection.
static constexpr FwIndexType getNum_cmdRegOut_OutputPorts()
static constexpr FwSizeType CAPACITY
Definition: PingPortAc.hpp:34
void set_bufferSendOut_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to bufferSendOut[portNum].
Fw::InputCmdPort * get_cmdIn_InputPort(FwIndexType portNum)
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:40
static constexpr FwIndexType getNum_cmdIn_InputPorts()
void init()
Initialization function.
Definition: TimePortAc.cpp:151
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
#define FW_MIN(a, b)
MIN macro (deprecated in C++, use std::min)
Definition: BasicTypes.h:99
void invoke(Fw::Buffer &fwBuffer) const
Invoke a port connection.
void init()
Initialization function.
Definition: PingPortAc.cpp:151
void tlmWrite_BufferLogger_NumLoggedBuffers(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
void init()
Initialization function.
void addCallPort(InputBufferSendPort *callPort)
Register an input port.
void invoke(Fw::Time &time) const
Invoke a port connection.
Definition: TimePortAc.cpp:170
virtual void BL_FlushFile_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
bool isConnected_tlmOut_OutputPort(FwIndexType portNum) const
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.
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
bool isConnected_bufferSendOut_OutputPort(FwIndexType portNum) const
void BL_CloseFile_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void log_WARNING_HI_BL_LogFileWriteError(U32 errornum, U32 bytesWritten, U32 bytesToWrite, const Fw::StringBase &file) const
void resetDeser() override
Reset deserialization pointer to beginning of buffer.
BufferLoggerComponentBase(const char *compName="")
Construct BufferLoggerComponentBase object.
virtual void schedIn_handler(FwIndexType portNum, U32 context)=0
Handler for input port schedIn.
void log_WARNING_HI_BL_LogFileNameError(const Fw::StringFormatStatus &status) const
A serious but recoverable event.
bool isConnected_pingOut_OutputPort(FwIndexType portNum) const
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port connection.
Definition: TlmPortAc.cpp:190
The Buffer Logger encountered an error writing a validation file.
const char * toChar() const
Convert to a C-style char*.
bool isConnected() const
Definition: PortBase.cpp:38
Enum representing event severity.
Fw::InputBufferSendPort * get_bufferSendIn_InputPort(FwIndexType portNum)
void cmdIn_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Handler base-class function for input port cmdIn.
void bufferSendOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer) const
Invoke output port bufferSendOut.
#define PRI_FwIndexType
static constexpr FwIndexType getNum_eventOut_OutputPorts()
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:58
void init()
Initialization function.
Definition: LogPortAc.cpp:180
No log file open command was received by BufferLogger.
void tlmWrite(FwChanIdType id, Fw::TlmBuffer &_tlmBuff, Fw::Time _tlmTime=Fw::Time()) const
bool isConnected_eventOut_OutputPort(FwIndexType portNum) const
void setPortNum(FwIndexType portNum)
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
BlockingType
message type
Definition: Queue.hpp:46
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
Flushes the current open log file to disk; a no-op with fprime&#39;s unbuffered file I/O, so always returns success.
Fw::InputComPort * get_comIn_InputPort(FwIndexType portNum)
Command failed to deserialize.
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
virtual void BL_SetLogging_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Svc::BufferLogger_LogState &state)=0
void init()
Initialization function.
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
virtual void pingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port pingIn.
static constexpr FwIndexType getNum_bufferSendOut_OutputPorts()
A message was sent requesting an exit of the loop.
virtual ~BufferLoggerComponentBase()
Destroy BufferLoggerComponentBase object.
PlatformIndexType FwIndexType
static constexpr FwIndexType getNum_pingOut_OutputPorts()
static constexpr FwIndexType getNum_tlmOut_OutputPorts()
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:186
void init()
Initialization function.
void init()
Initialization function.
Definition: PingPortAc.cpp:73
RateGroupDivider component implementation.
message sent/received okay
Definition: Queue.hpp:31
U8 BYTE
byte type
Definition: BasicTypes.h:57
static constexpr FwIndexType getNum_cmdResponseOut_OutputPorts()
Close the currently open log file, if any.
The Buffer Logger encountered an error opening a log file.
void BL_FlushFile_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: PingPortAc.cpp:79
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
void set_eventOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to eventOut[portNum].
Message will return with status when space is unavailable.
Definition: Queue.hpp:48
Implementation of malloc based allocator.
static constexpr FwIndexType getNum_bufferSendIn_InputPorts()
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_comIn_InputPorts()
void schedIn_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port schedIn.
void init()
Initialization function.
The Buffer Logger encountered an error writing to a log file.
virtual void BL_CloseFile_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
virtual void BL_OpenFile_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &file)=0
#define FW_ASSERT(...)
Definition: Assert.hpp:14
static constexpr FwSizeType CAPACITY
Definition: SchedPortAc.hpp:34
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
void log_WARNING_HI_BL_LogFileValidationError(const Fw::StringBase &validationFile, U32 status) const
SerializeStatus serializeTo(SerialBufferBase &buffer, Endianness mode=Endianness::BIG) const override
Serialize the contents of this object to a buffer.
BYTE cmdPortSize[Fw::CmdPortBuffer::CAPACITY]
void set_cmdRegOut_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to cmdRegOut[portNum].