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  if (qStatus == Os::Queue::Status::FULL) {
1109  this->incNumMsgDropped();
1110  return;
1111  }
1112 
1113  FW_ASSERT(
1114  qStatus == Os::Queue::OP_OK,
1115  static_cast<FwAssertArgType>(qStatus)
1116  );
1117  }
1118 
1121  FwIndexType portNum,
1122  U32 context
1123  )
1124  {
1125  // Make sure port number is valid
1126  FW_ASSERT(
1127  (0 <= portNum) && (portNum < this->getNum_schedIn_InputPorts()),
1128  static_cast<FwAssertArgType>(portNum)
1129  );
1130 
1131  // Call pre-message hook
1133  portNum,
1134  context
1135  );
1136  ComponentIpcSerializableBuffer msg;
1138 
1139  // Serialize message ID
1140  _status = msg.serializeFrom(
1141  static_cast<FwEnumStoreType>(SCHEDIN_SCHED)
1142  );
1143  FW_ASSERT(
1144  _status == Fw::FW_SERIALIZE_OK,
1145  static_cast<FwAssertArgType>(_status)
1146  );
1147 
1148  // Serialize port number
1149  _status = msg.serializeFrom(portNum);
1150  FW_ASSERT(
1151  _status == Fw::FW_SERIALIZE_OK,
1152  static_cast<FwAssertArgType>(_status)
1153  );
1154 
1155  // Serialize argument context
1156  _status = msg.serializeFrom(context);
1157  FW_ASSERT(
1158  _status == Fw::FW_SERIALIZE_OK,
1159  static_cast<FwAssertArgType>(_status)
1160  );
1161 
1162  // Send message
1164  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1165 
1166  FW_ASSERT(
1167  qStatus == Os::Queue::OP_OK,
1168  static_cast<FwAssertArgType>(qStatus)
1169  );
1170  }
1171 
1172  // ----------------------------------------------------------------------
1173  // Pre-message hooks for typed async input ports
1174  //
1175  // Each of these functions is invoked just before processing a message
1176  // on the corresponding port. By default, they do nothing. You can
1177  // override them to provide specific pre-message behavior.
1178  // ----------------------------------------------------------------------
1179 
1182  FwIndexType portNum,
1183  Fw::Buffer& fwBuffer
1184  )
1185  {
1186  // Default: no-op
1187  }
1188 
1191  FwIndexType portNum,
1192  Fw::ComBuffer& data,
1193  U32 context
1194  )
1195  {
1196  // Default: no-op
1197  }
1198 
1201  FwIndexType portNum,
1202  U32 key
1203  )
1204  {
1205  // Default: no-op
1206  }
1207 
1210  FwIndexType portNum,
1211  U32 context
1212  )
1213  {
1214  // Default: no-op
1215  }
1216 
1217 #if !FW_DIRECT_PORT_CALLS
1218 
1219  // ----------------------------------------------------------------------
1220  // Invocation functions for typed output ports
1221  // ----------------------------------------------------------------------
1222 
1225  FwIndexType portNum,
1226  Fw::Buffer& fwBuffer
1227  ) const
1228  {
1229  FW_ASSERT(
1230  (0 <= portNum) && (portNum < this->getNum_bufferSendOut_OutputPorts()),
1231  static_cast<FwAssertArgType>(portNum)
1232  );
1233 
1234  FW_ASSERT(
1235  this->m_bufferSendOut_OutputPort[portNum].isConnected(),
1236  static_cast<FwAssertArgType>(portNum)
1237  );
1238  this->m_bufferSendOut_OutputPort[portNum].invoke(
1239  fwBuffer
1240  );
1241  }
1242 
1245  FwIndexType portNum,
1246  U32 key
1247  ) const
1248  {
1249  FW_ASSERT(
1250  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
1251  static_cast<FwAssertArgType>(portNum)
1252  );
1253 
1254  FW_ASSERT(
1255  this->m_pingOut_OutputPort[portNum].isConnected(),
1256  static_cast<FwAssertArgType>(portNum)
1257  );
1258  this->m_pingOut_OutputPort[portNum].invoke(
1259  key
1260  );
1261  }
1262 
1263 #endif
1264 
1265  // ----------------------------------------------------------------------
1266  // Command response
1267  // ----------------------------------------------------------------------
1268 
1271  FwOpcodeType opCode,
1272  U32 cmdSeq,
1273  Fw::CmdResponse response
1274  )
1275  {
1277  this->cmdResponseOut_out(0, opCode, cmdSeq, response);
1278  }
1279 
1280  // ----------------------------------------------------------------------
1281  // Command handler base-class functions
1282  //
1283  // Call these functions directly to bypass the command input port
1284  // ----------------------------------------------------------------------
1285 
1288  FwOpcodeType opCode,
1289  U32 cmdSeq,
1290  Fw::CmdArgBuffer& args
1291  )
1292  {
1293  // Call pre-message hook
1294  this->BL_OpenFile_preMsgHook(opCode,cmdSeq);
1295 
1296  // Defer deserializing arguments to the message dispatcher
1297  // to avoid deserializing and reserializing just for IPC
1298  ComponentIpcSerializableBuffer msg;
1300 
1301  // Serialize for IPC
1302  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_BL_OPENFILE));
1303  FW_ASSERT (
1304  _status == Fw::FW_SERIALIZE_OK,
1305  static_cast<FwAssertArgType>(_status)
1306  );
1307 
1308  // Fake port number to make message dequeue work
1309  FwIndexType port = 0;
1310 
1311  _status = msg.serializeFrom(port);
1312  FW_ASSERT (
1313  _status == Fw::FW_SERIALIZE_OK,
1314  static_cast<FwAssertArgType>(_status)
1315  );
1316 
1317  _status = msg.serializeFrom(opCode);
1318  FW_ASSERT (
1319  _status == Fw::FW_SERIALIZE_OK,
1320  static_cast<FwAssertArgType>(_status)
1321  );
1322 
1323  _status = msg.serializeFrom(cmdSeq);
1324  FW_ASSERT (
1325  _status == Fw::FW_SERIALIZE_OK,
1326  static_cast<FwAssertArgType>(_status)
1327  );
1328 
1329  _status = msg.serializeFrom(args);
1330  FW_ASSERT (
1331  _status == Fw::FW_SERIALIZE_OK,
1332  static_cast<FwAssertArgType>(_status)
1333  );
1334 
1335  // Send message
1337  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1338 
1339  FW_ASSERT(
1340  qStatus == Os::Queue::OP_OK,
1341  static_cast<FwAssertArgType>(qStatus)
1342  );
1343  }
1344 
1347  FwOpcodeType opCode,
1348  U32 cmdSeq,
1349  Fw::CmdArgBuffer& args
1350  )
1351  {
1352  // Call pre-message hook
1353  this->BL_CloseFile_preMsgHook(opCode,cmdSeq);
1354 
1355  // Defer deserializing arguments to the message dispatcher
1356  // to avoid deserializing and reserializing just for IPC
1357  ComponentIpcSerializableBuffer msg;
1359 
1360  // Serialize for IPC
1361  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_BL_CLOSEFILE));
1362  FW_ASSERT (
1363  _status == Fw::FW_SERIALIZE_OK,
1364  static_cast<FwAssertArgType>(_status)
1365  );
1366 
1367  // Fake port number to make message dequeue work
1368  FwIndexType port = 0;
1369 
1370  _status = msg.serializeFrom(port);
1371  FW_ASSERT (
1372  _status == Fw::FW_SERIALIZE_OK,
1373  static_cast<FwAssertArgType>(_status)
1374  );
1375 
1376  _status = msg.serializeFrom(opCode);
1377  FW_ASSERT (
1378  _status == Fw::FW_SERIALIZE_OK,
1379  static_cast<FwAssertArgType>(_status)
1380  );
1381 
1382  _status = msg.serializeFrom(cmdSeq);
1383  FW_ASSERT (
1384  _status == Fw::FW_SERIALIZE_OK,
1385  static_cast<FwAssertArgType>(_status)
1386  );
1387 
1388  _status = msg.serializeFrom(args);
1389  FW_ASSERT (
1390  _status == Fw::FW_SERIALIZE_OK,
1391  static_cast<FwAssertArgType>(_status)
1392  );
1393 
1394  // Send message
1396  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1397 
1398  FW_ASSERT(
1399  qStatus == Os::Queue::OP_OK,
1400  static_cast<FwAssertArgType>(qStatus)
1401  );
1402  }
1403 
1406  FwOpcodeType opCode,
1407  U32 cmdSeq,
1408  Fw::CmdArgBuffer& args
1409  )
1410  {
1411  // Call pre-message hook
1412  this->BL_SetLogging_preMsgHook(opCode,cmdSeq);
1413 
1414  // Defer deserializing arguments to the message dispatcher
1415  // to avoid deserializing and reserializing just for IPC
1416  ComponentIpcSerializableBuffer msg;
1418 
1419  // Serialize for IPC
1420  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_BL_SETLOGGING));
1421  FW_ASSERT (
1422  _status == Fw::FW_SERIALIZE_OK,
1423  static_cast<FwAssertArgType>(_status)
1424  );
1425 
1426  // Fake port number to make message dequeue work
1427  FwIndexType port = 0;
1428 
1429  _status = msg.serializeFrom(port);
1430  FW_ASSERT (
1431  _status == Fw::FW_SERIALIZE_OK,
1432  static_cast<FwAssertArgType>(_status)
1433  );
1434 
1435  _status = msg.serializeFrom(opCode);
1436  FW_ASSERT (
1437  _status == Fw::FW_SERIALIZE_OK,
1438  static_cast<FwAssertArgType>(_status)
1439  );
1440 
1441  _status = msg.serializeFrom(cmdSeq);
1442  FW_ASSERT (
1443  _status == Fw::FW_SERIALIZE_OK,
1444  static_cast<FwAssertArgType>(_status)
1445  );
1446 
1447  _status = msg.serializeFrom(args);
1448  FW_ASSERT (
1449  _status == Fw::FW_SERIALIZE_OK,
1450  static_cast<FwAssertArgType>(_status)
1451  );
1452 
1453  // Send message
1455  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1456 
1457  FW_ASSERT(
1458  qStatus == Os::Queue::OP_OK,
1459  static_cast<FwAssertArgType>(qStatus)
1460  );
1461  }
1462 
1465  FwOpcodeType opCode,
1466  U32 cmdSeq,
1467  Fw::CmdArgBuffer& args
1468  )
1469  {
1470  // Call pre-message hook
1471  this->BL_FlushFile_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_BL_FLUSHFILE));
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 
1522  // ----------------------------------------------------------------------
1523  // Pre-message hooks for async commands
1524  //
1525  // Each of these functions is invoked just before processing the
1526  // corresponding command. By default they do nothing. You can
1527  // override them to provide specific pre-command behavior.
1528  // ----------------------------------------------------------------------
1529 
1532  FwOpcodeType opCode,
1533  U32 cmdSeq
1534  )
1535  {
1536  // Defaults to no-op; can be overridden
1537  (void) opCode;
1538  (void) cmdSeq;
1539  }
1540 
1543  FwOpcodeType opCode,
1544  U32 cmdSeq
1545  )
1546  {
1547  // Defaults to no-op; can be overridden
1548  (void) opCode;
1549  (void) cmdSeq;
1550  }
1551 
1554  FwOpcodeType opCode,
1555  U32 cmdSeq
1556  )
1557  {
1558  // Defaults to no-op; can be overridden
1559  (void) opCode;
1560  (void) cmdSeq;
1561  }
1562 
1565  FwOpcodeType opCode,
1566  U32 cmdSeq
1567  )
1568  {
1569  // Defaults to no-op; can be overridden
1570  (void) opCode;
1571  (void) cmdSeq;
1572  }
1573 
1574  // ----------------------------------------------------------------------
1575  // Event logging functions
1576  // ----------------------------------------------------------------------
1577 
1580  {
1581  // Get the time
1582  Fw::Time _logTime;
1583  if (this->isConnected_timeCaller_OutputPort(0)) {
1584  this->timeCaller_out(0, _logTime);
1585  }
1586 
1587  const FwEventIdType _id = this->getIdBase() + EVENTID_BL_LOGFILECLOSED;
1588 
1589  // Emit the event on the log port
1590  if (this->isConnected_eventOut_OutputPort(0)) {
1591  Fw::LogBuffer _logBuff;
1593 
1594 #if FW_AMPCS_COMPATIBLE
1595  // Serialize the number of arguments
1596  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1597  FW_ASSERT(
1598  _status == Fw::FW_SERIALIZE_OK,
1599  static_cast<FwAssertArgType>(_status)
1600  );
1601 #endif
1602 
1603  _status = file.serializeTo(
1604  _logBuff,
1605  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 256)
1606  );
1607  FW_ASSERT(
1608  _status == Fw::FW_SERIALIZE_OK,
1609  static_cast<FwAssertArgType>(_status)
1610  );
1611 
1612  this->eventOut_out(
1613  0,
1614  _id,
1615  _logTime,
1617  _logBuff
1618  );
1619  }
1620 
1621  // Emit the event on the text log port
1622 #if FW_ENABLE_TEXT_LOGGING
1623  if (this->isConnected_eventOutText_OutputPort(0)) {
1624 #if FW_OBJECT_NAMES == 1
1625  const char* _formatString =
1626  "(%s) %s: File %s closed";
1627 #else
1628  const char* _formatString =
1629  "%s: File %s closed";
1630 #endif
1631 
1632  Fw::TextLogString _logString;
1633  (void) _logString.format(
1634  _formatString,
1635 #if FW_OBJECT_NAMES == 1
1636  this->m_objName.toChar(),
1637 #endif
1638  "BL_LogFileClosed ",
1639  file.toChar()
1640  );
1641 
1642  this->eventOutText_out(
1643  0,
1644  _id,
1645  _logTime,
1647  _logString
1648  );
1649  }
1650 #endif
1651  }
1652 
1655  U32 errornum,
1656  const Fw::StringBase& file
1657  ) const
1658  {
1659  // Get the time
1660  Fw::Time _logTime;
1661  if (this->isConnected_timeCaller_OutputPort(0)) {
1662  this->timeCaller_out(0, _logTime);
1663  }
1664 
1665  const FwEventIdType _id = this->getIdBase() + EVENTID_BL_LOGFILEOPENERROR;
1666 
1667  // Emit the event on the log port
1668  if (this->isConnected_eventOut_OutputPort(0)) {
1669  Fw::LogBuffer _logBuff;
1671 
1672 #if FW_AMPCS_COMPATIBLE
1673  // Serialize the number of arguments
1674  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1675  FW_ASSERT(
1676  _status == Fw::FW_SERIALIZE_OK,
1677  static_cast<FwAssertArgType>(_status)
1678  );
1679 #endif
1680 
1681 #if FW_AMPCS_COMPATIBLE
1682  // Serialize the argument size
1683  _status = _logBuff.serializeFrom(
1684  static_cast<U8>(sizeof(U32))
1685  );
1686  FW_ASSERT(
1687  _status == Fw::FW_SERIALIZE_OK,
1688  static_cast<FwAssertArgType>(_status)
1689  );
1690 #endif
1691  _status = _logBuff.serializeFrom(errornum);
1692  FW_ASSERT(
1693  _status == Fw::FW_SERIALIZE_OK,
1694  static_cast<FwAssertArgType>(_status)
1695  );
1696 
1697  _status = file.serializeTo(
1698  _logBuff,
1699  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 256)
1700  );
1701  FW_ASSERT(
1702  _status == Fw::FW_SERIALIZE_OK,
1703  static_cast<FwAssertArgType>(_status)
1704  );
1705 
1706  this->eventOut_out(
1707  0,
1708  _id,
1709  _logTime,
1711  _logBuff
1712  );
1713  }
1714 
1715  // Emit the event on the text log port
1716 #if FW_ENABLE_TEXT_LOGGING
1717  if (this->isConnected_eventOutText_OutputPort(0)) {
1718 #if FW_OBJECT_NAMES == 1
1719  const char* _formatString =
1720  "(%s) %s: Error %" PRIu32 " opening file %s";
1721 #else
1722  const char* _formatString =
1723  "%s: Error %" PRIu32 " opening file %s";
1724 #endif
1725 
1726  Fw::TextLogString _logString;
1727  (void) _logString.format(
1728  _formatString,
1729 #if FW_OBJECT_NAMES == 1
1730  this->m_objName.toChar(),
1731 #endif
1732  "BL_LogFileOpenError ",
1733  errornum,
1734  file.toChar()
1735  );
1736 
1737  this->eventOutText_out(
1738  0,
1739  _id,
1740  _logTime,
1742  _logString
1743  );
1744  }
1745 #endif
1746  }
1747 
1750  const Fw::StringBase& validationFile,
1751  U32 status
1752  ) const
1753  {
1754  // Get the time
1755  Fw::Time _logTime;
1756  if (this->isConnected_timeCaller_OutputPort(0)) {
1757  this->timeCaller_out(0, _logTime);
1758  }
1759 
1761 
1762  // Emit the event on the log port
1763  if (this->isConnected_eventOut_OutputPort(0)) {
1764  Fw::LogBuffer _logBuff;
1766 
1767 #if FW_AMPCS_COMPATIBLE
1768  // Serialize the number of arguments
1769  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1770  FW_ASSERT(
1771  _status == Fw::FW_SERIALIZE_OK,
1772  static_cast<FwAssertArgType>(_status)
1773  );
1774 #endif
1775 
1776  _status = validationFile.serializeTo(
1777  _logBuff,
1778  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 256)
1779  );
1780  FW_ASSERT(
1781  _status == Fw::FW_SERIALIZE_OK,
1782  static_cast<FwAssertArgType>(_status)
1783  );
1784 
1785 #if FW_AMPCS_COMPATIBLE
1786  // Serialize the argument size
1787  _status = _logBuff.serializeFrom(
1788  static_cast<U8>(sizeof(U32))
1789  );
1790  FW_ASSERT(
1791  _status == Fw::FW_SERIALIZE_OK,
1792  static_cast<FwAssertArgType>(_status)
1793  );
1794 #endif
1795  _status = _logBuff.serializeFrom(status);
1796  FW_ASSERT(
1797  _status == Fw::FW_SERIALIZE_OK,
1798  static_cast<FwAssertArgType>(_status)
1799  );
1800 
1801  this->eventOut_out(
1802  0,
1803  _id,
1804  _logTime,
1806  _logBuff
1807  );
1808  }
1809 
1810  // Emit the event on the text log port
1811 #if FW_ENABLE_TEXT_LOGGING
1812  if (this->isConnected_eventOutText_OutputPort(0)) {
1813 #if FW_OBJECT_NAMES == 1
1814  const char* _formatString =
1815  "(%s) %s: Failed creating validation file %s with status %" PRIu32 "";
1816 #else
1817  const char* _formatString =
1818  "%s: Failed creating validation file %s with status %" PRIu32 "";
1819 #endif
1820 
1821  Fw::TextLogString _logString;
1822  (void) _logString.format(
1823  _formatString,
1824 #if FW_OBJECT_NAMES == 1
1825  this->m_objName.toChar(),
1826 #endif
1827  "BL_LogFileValidationError ",
1828  validationFile.toChar(),
1829  status
1830  );
1831 
1832  this->eventOutText_out(
1833  0,
1834  _id,
1835  _logTime,
1837  _logString
1838  );
1839  }
1840 #endif
1841  }
1842 
1845  U32 errornum,
1846  U32 bytesWritten,
1847  U32 bytesToWrite,
1848  const Fw::StringBase& file
1849  ) const
1850  {
1851  // Get the time
1852  Fw::Time _logTime;
1853  if (this->isConnected_timeCaller_OutputPort(0)) {
1854  this->timeCaller_out(0, _logTime);
1855  }
1856 
1858 
1859  // Emit the event on the log port
1860  if (this->isConnected_eventOut_OutputPort(0)) {
1861  Fw::LogBuffer _logBuff;
1863 
1864 #if FW_AMPCS_COMPATIBLE
1865  // Serialize the number of arguments
1866  _status = _logBuff.serializeFrom(static_cast<U8>(4));
1867  FW_ASSERT(
1868  _status == Fw::FW_SERIALIZE_OK,
1869  static_cast<FwAssertArgType>(_status)
1870  );
1871 #endif
1872 
1873 #if FW_AMPCS_COMPATIBLE
1874  // Serialize the argument size
1875  _status = _logBuff.serializeFrom(
1876  static_cast<U8>(sizeof(U32))
1877  );
1878  FW_ASSERT(
1879  _status == Fw::FW_SERIALIZE_OK,
1880  static_cast<FwAssertArgType>(_status)
1881  );
1882 #endif
1883  _status = _logBuff.serializeFrom(errornum);
1884  FW_ASSERT(
1885  _status == Fw::FW_SERIALIZE_OK,
1886  static_cast<FwAssertArgType>(_status)
1887  );
1888 
1889 #if FW_AMPCS_COMPATIBLE
1890  // Serialize the argument size
1891  _status = _logBuff.serializeFrom(
1892  static_cast<U8>(sizeof(U32))
1893  );
1894  FW_ASSERT(
1895  _status == Fw::FW_SERIALIZE_OK,
1896  static_cast<FwAssertArgType>(_status)
1897  );
1898 #endif
1899  _status = _logBuff.serializeFrom(bytesWritten);
1900  FW_ASSERT(
1901  _status == Fw::FW_SERIALIZE_OK,
1902  static_cast<FwAssertArgType>(_status)
1903  );
1904 
1905 #if FW_AMPCS_COMPATIBLE
1906  // Serialize the argument size
1907  _status = _logBuff.serializeFrom(
1908  static_cast<U8>(sizeof(U32))
1909  );
1910  FW_ASSERT(
1911  _status == Fw::FW_SERIALIZE_OK,
1912  static_cast<FwAssertArgType>(_status)
1913  );
1914 #endif
1915  _status = _logBuff.serializeFrom(bytesToWrite);
1916  FW_ASSERT(
1917  _status == Fw::FW_SERIALIZE_OK,
1918  static_cast<FwAssertArgType>(_status)
1919  );
1920 
1921  _status = file.serializeTo(
1922  _logBuff,
1923  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 256)
1924  );
1925  FW_ASSERT(
1926  _status == Fw::FW_SERIALIZE_OK,
1927  static_cast<FwAssertArgType>(_status)
1928  );
1929 
1930  this->eventOut_out(
1931  0,
1932  _id,
1933  _logTime,
1935  _logBuff
1936  );
1937  }
1938 
1939  // Emit the event on the text log port
1940 #if FW_ENABLE_TEXT_LOGGING
1941  if (this->isConnected_eventOutText_OutputPort(0)) {
1942 #if FW_OBJECT_NAMES == 1
1943  const char* _formatString =
1944  "(%s) %s: Error %" PRIu32 " while writing %" PRIu32 " of %" PRIu32 " bytes to %s";
1945 #else
1946  const char* _formatString =
1947  "%s: Error %" PRIu32 " while writing %" PRIu32 " of %" PRIu32 " bytes to %s";
1948 #endif
1949 
1950  Fw::TextLogString _logString;
1951  (void) _logString.format(
1952  _formatString,
1953 #if FW_OBJECT_NAMES == 1
1954  this->m_objName.toChar(),
1955 #endif
1956  "BL_LogFileWriteError ",
1957  errornum,
1958  bytesWritten,
1959  bytesToWrite,
1960  file.toChar()
1961  );
1962 
1963  this->eventOutText_out(
1964  0,
1965  _id,
1966  _logTime,
1968  _logString
1969  );
1970  }
1971 #endif
1972  }
1973 
1976  {
1977  // Get the time
1978  Fw::Time _logTime;
1979  if (this->isConnected_timeCaller_OutputPort(0)) {
1980  this->timeCaller_out(0, _logTime);
1981  }
1982 
1983  const FwEventIdType _id = this->getIdBase() + EVENTID_BL_ACTIVATED;
1984 
1985  // Emit the event on the log port
1986  if (this->isConnected_eventOut_OutputPort(0)) {
1987  Fw::LogBuffer _logBuff;
1988 
1989 #if FW_AMPCS_COMPATIBLE
1991  // Serialize the number of arguments
1992  _status = _logBuff.serializeFrom(static_cast<U8>(0));
1993  FW_ASSERT(
1994  _status == Fw::FW_SERIALIZE_OK,
1995  static_cast<FwAssertArgType>(_status)
1996  );
1997 #endif
1998 
1999  this->eventOut_out(
2000  0,
2001  _id,
2002  _logTime,
2004  _logBuff
2005  );
2006  }
2007 
2008  // Emit the event on the text log port
2009 #if FW_ENABLE_TEXT_LOGGING
2010  if (this->isConnected_eventOutText_OutputPort(0)) {
2011 #if FW_OBJECT_NAMES == 1
2012  const char* _formatString =
2013  "(%s) %s: Buffer logger was activated";
2014 #else
2015  const char* _formatString =
2016  "%s: Buffer logger was activated";
2017 #endif
2018 
2019  Fw::TextLogString _logString;
2020  (void) _logString.format(
2021  _formatString,
2022 #if FW_OBJECT_NAMES == 1
2023  this->m_objName.toChar(),
2024 #endif
2025  "BL_Activated "
2026  );
2027 
2028  this->eventOutText_out(
2029  0,
2030  _id,
2031  _logTime,
2033  _logString
2034  );
2035  }
2036 #endif
2037  }
2038 
2041  {
2042  // Get the time
2043  Fw::Time _logTime;
2044  if (this->isConnected_timeCaller_OutputPort(0)) {
2045  this->timeCaller_out(0, _logTime);
2046  }
2047 
2048  const FwEventIdType _id = this->getIdBase() + EVENTID_BL_DEACTIVATED;
2049 
2050  // Emit the event on the log port
2051  if (this->isConnected_eventOut_OutputPort(0)) {
2052  Fw::LogBuffer _logBuff;
2053 
2054 #if FW_AMPCS_COMPATIBLE
2056  // Serialize the number of arguments
2057  _status = _logBuff.serializeFrom(static_cast<U8>(0));
2058  FW_ASSERT(
2059  _status == Fw::FW_SERIALIZE_OK,
2060  static_cast<FwAssertArgType>(_status)
2061  );
2062 #endif
2063 
2064  this->eventOut_out(
2065  0,
2066  _id,
2067  _logTime,
2069  _logBuff
2070  );
2071  }
2072 
2073  // Emit the event on the text log port
2074 #if FW_ENABLE_TEXT_LOGGING
2075  if (this->isConnected_eventOutText_OutputPort(0)) {
2076 #if FW_OBJECT_NAMES == 1
2077  const char* _formatString =
2078  "(%s) %s: Buffer logger was deactivated";
2079 #else
2080  const char* _formatString =
2081  "%s: Buffer logger was deactivated";
2082 #endif
2083 
2084  Fw::TextLogString _logString;
2085  (void) _logString.format(
2086  _formatString,
2087 #if FW_OBJECT_NAMES == 1
2088  this->m_objName.toChar(),
2089 #endif
2090  "BL_Deactivated "
2091  );
2092 
2093  this->eventOutText_out(
2094  0,
2095  _id,
2096  _logTime,
2098  _logString
2099  );
2100  }
2101 #endif
2102  }
2103 
2106  {
2107  // Get the time
2108  Fw::Time _logTime;
2109  if (this->isConnected_timeCaller_OutputPort(0)) {
2110  this->timeCaller_out(0, _logTime);
2111  }
2112 
2114 
2115  // Emit the event on the log port
2116  if (this->isConnected_eventOut_OutputPort(0)) {
2117  Fw::LogBuffer _logBuff;
2118 
2119 #if FW_AMPCS_COMPATIBLE
2121  // Serialize the number of arguments
2122  _status = _logBuff.serializeFrom(static_cast<U8>(0));
2123  FW_ASSERT(
2124  _status == Fw::FW_SERIALIZE_OK,
2125  static_cast<FwAssertArgType>(_status)
2126  );
2127 #endif
2128 
2129  this->eventOut_out(
2130  0,
2131  _id,
2132  _logTime,
2134  _logBuff
2135  );
2136  }
2137 
2138  // Emit the event on the text log port
2139 #if FW_ENABLE_TEXT_LOGGING
2140  if (this->isConnected_eventOutText_OutputPort(0)) {
2141 #if FW_OBJECT_NAMES == 1
2142  const char* _formatString =
2143  "(%s) %s: No log file open command";
2144 #else
2145  const char* _formatString =
2146  "%s: No log file open command";
2147 #endif
2148 
2149  Fw::TextLogString _logString;
2150  (void) _logString.format(
2151  _formatString,
2152 #if FW_OBJECT_NAMES == 1
2153  this->m_objName.toChar(),
2154 #endif
2155  "BL_NoLogFileOpenInitError "
2156  );
2157 
2158  this->eventOutText_out(
2159  0,
2160  _id,
2161  _logTime,
2163  _logString
2164  );
2165  }
2166 #endif
2167  }
2168 
2171  {
2172  // Get the time
2173  Fw::Time _logTime;
2174  if (this->isConnected_timeCaller_OutputPort(0)) {
2175  this->timeCaller_out(0, _logTime);
2176  }
2177 
2178  const FwEventIdType _id = this->getIdBase() + EVENTID_BL_LOGFILENAMEERROR;
2179 
2180  // Emit the event on the log port
2181  if (this->isConnected_eventOut_OutputPort(0)) {
2182  Fw::LogBuffer _logBuff;
2184 
2185 #if FW_AMPCS_COMPATIBLE
2186  // Serialize the number of arguments
2187  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2188  FW_ASSERT(
2189  _status == Fw::FW_SERIALIZE_OK,
2190  static_cast<FwAssertArgType>(_status)
2191  );
2192 #endif
2193 
2194 #if FW_AMPCS_COMPATIBLE
2195  // Serialize the argument size
2196  _status = _logBuff.serializeFrom(
2198  );
2199  FW_ASSERT(
2200  _status == Fw::FW_SERIALIZE_OK,
2201  static_cast<FwAssertArgType>(_status)
2202  );
2203 #endif
2204  _status = _logBuff.serializeFrom(status);
2205  FW_ASSERT(
2206  _status == Fw::FW_SERIALIZE_OK,
2207  static_cast<FwAssertArgType>(_status)
2208  );
2209 
2210  this->eventOut_out(
2211  0,
2212  _id,
2213  _logTime,
2215  _logBuff
2216  );
2217  }
2218 
2219  // Emit the event on the text log port
2220 #if FW_ENABLE_TEXT_LOGGING
2221  if (this->isConnected_eventOutText_OutputPort(0)) {
2222 #if FW_OBJECT_NAMES == 1
2223  const char* _formatString =
2224  "(%s) %s: Error %s formatting log file name";
2225 #else
2226  const char* _formatString =
2227  "%s: Error %s formatting log file name";
2228 #endif
2229 
2230  Fw::String statusStr;
2231  status.toString(statusStr);
2232 
2233  Fw::TextLogString _logString;
2234  (void) _logString.format(
2235  _formatString,
2236 #if FW_OBJECT_NAMES == 1
2237  this->m_objName.toChar(),
2238 #endif
2239  "BL_LogFileNameError ",
2240  statusStr.toChar()
2241  );
2242 
2243  this->eventOutText_out(
2244  0,
2245  _id,
2246  _logTime,
2248  _logString
2249  );
2250  }
2251 #endif
2252  }
2253 
2254  // ----------------------------------------------------------------------
2255  // Telemetry serialized write
2256  // ----------------------------------------------------------------------
2257 
2260  FwChanIdType id,
2261  Fw::TlmBuffer& _tlmBuff,
2262  Fw::Time _tlmTime
2263  ) const
2264  {
2265  if (this->isConnected_tlmOut_OutputPort(0)) {
2266  if (
2268  (_tlmTime == Fw::ZERO_TIME)
2269  ) {
2270  this->timeCaller_out(0, _tlmTime);
2271  }
2272 
2273  FwChanIdType _id;
2274  _id = this->getIdBase() + id;
2275 
2276  this->tlmOut_out(
2277  0,
2278  _id,
2279  _tlmTime,
2280  _tlmBuff
2281  );
2282  }
2283  }
2284 
2285  // ----------------------------------------------------------------------
2286  // Telemetry write functions
2287  // ----------------------------------------------------------------------
2288 
2291  U32 arg,
2292  Fw::Time _tlmTime
2293  ) const
2294  {
2295  if (this->isConnected_tlmOut_OutputPort(0)) {
2296  Fw::TlmBuffer _tlmBuff;
2297  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
2298  FW_ASSERT(
2299  _stat == Fw::FW_SERIALIZE_OK,
2300  static_cast<FwAssertArgType>(_stat)
2301  );
2302 
2303  this->tlmWrite(
2305  _tlmBuff,
2306  _tlmTime
2307  );
2308  }
2309  }
2310 
2311  // ----------------------------------------------------------------------
2312  // Time
2313  // ----------------------------------------------------------------------
2314 
2316  getTime() const
2317  {
2318  if (this->isConnected_timeCaller_OutputPort(0)) {
2319  Fw::Time _time;
2320  this->timeCaller_out(0, _time);
2321  return _time;
2322  }
2323  else {
2324  return Fw::Time(TimeBase::TB_NONE, 0, 0);
2325  }
2326  }
2327 
2328  // ----------------------------------------------------------------------
2329  // Message dispatch functions
2330  // ----------------------------------------------------------------------
2331 
2332  Fw::QueuedComponentBase::MsgDispatchStatus BufferLoggerComponentBase ::
2333  doDispatch()
2334  {
2335  ComponentIpcSerializableBuffer _msg;
2336  FwQueuePriorityType _priority = 0;
2337 
2338  Os::Queue::Status _msgStatus = this->m_queue.receive(
2339  _msg,
2341  _priority
2342  );
2343  FW_ASSERT(
2344  _msgStatus == Os::Queue::OP_OK,
2345  static_cast<FwAssertArgType>(_msgStatus)
2346  );
2347 
2348  // Reset to beginning of buffer
2349  _msg.resetDeser();
2350 
2351  FwEnumStoreType _desMsg = 0;
2352  Fw::SerializeStatus _deserStatus = _msg.deserializeTo(_desMsg);
2353  FW_ASSERT(
2354  _deserStatus == Fw::FW_SERIALIZE_OK,
2355  static_cast<FwAssertArgType>(_deserStatus)
2356  );
2357 
2358  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
2359 
2360  if (_msgType == BUFFERLOGGER_COMPONENT_EXIT) {
2361  return MSG_DISPATCH_EXIT;
2362  }
2363 
2364  FwIndexType portNum = 0;
2365  _deserStatus = _msg.deserializeTo(portNum);
2366  FW_ASSERT(
2367  _deserStatus == Fw::FW_SERIALIZE_OK,
2368  static_cast<FwAssertArgType>(_deserStatus)
2369  );
2370 
2371  switch (_msgType) {
2372  // Handle async input port bufferSendIn
2373  case BUFFERSENDIN_BUFFERSEND: {
2374  // Deserialize argument fwBuffer
2375  Fw::Buffer fwBuffer;
2376  _deserStatus = _msg.deserializeTo(fwBuffer);
2377  FW_ASSERT(
2378  _deserStatus == Fw::FW_SERIALIZE_OK,
2379  static_cast<FwAssertArgType>(_deserStatus)
2380  );
2381  // Call handler function
2382  this->bufferSendIn_handler(
2383  portNum,
2384  fwBuffer
2385  );
2386 
2387  break;
2388  }
2389 
2390  // Handle async input port comIn
2391  case COMIN_COM: {
2392  // Deserialize argument data
2393  Fw::ComBuffer data;
2394  _deserStatus = _msg.deserializeTo(data);
2395  FW_ASSERT(
2396  _deserStatus == Fw::FW_SERIALIZE_OK,
2397  static_cast<FwAssertArgType>(_deserStatus)
2398  );
2399 
2400  // Deserialize argument context
2401  U32 context;
2402  _deserStatus = _msg.deserializeTo(context);
2403  FW_ASSERT(
2404  _deserStatus == Fw::FW_SERIALIZE_OK,
2405  static_cast<FwAssertArgType>(_deserStatus)
2406  );
2407  // Call handler function
2408  this->comIn_handler(
2409  portNum,
2410  data,
2411  context
2412  );
2413 
2414  break;
2415  }
2416 
2417  // Handle async input port pingIn
2418  case PINGIN_PING: {
2419  // Deserialize argument key
2420  U32 key;
2421  _deserStatus = _msg.deserializeTo(key);
2422  FW_ASSERT(
2423  _deserStatus == Fw::FW_SERIALIZE_OK,
2424  static_cast<FwAssertArgType>(_deserStatus)
2425  );
2426  // Call handler function
2427  this->pingIn_handler(
2428  portNum,
2429  key
2430  );
2431 
2432  break;
2433  }
2434 
2435  // Handle async input port schedIn
2436  case SCHEDIN_SCHED: {
2437  // Deserialize argument context
2438  U32 context;
2439  _deserStatus = _msg.deserializeTo(context);
2440  FW_ASSERT(
2441  _deserStatus == Fw::FW_SERIALIZE_OK,
2442  static_cast<FwAssertArgType>(_deserStatus)
2443  );
2444  // Call handler function
2445  this->schedIn_handler(
2446  portNum,
2447  context
2448  );
2449 
2450  break;
2451  }
2452 
2453  // Handle command BL_OpenFile
2454  case CMD_BL_OPENFILE: {
2455  // Deserialize opcode
2456  FwOpcodeType _opCode = 0;
2457  _deserStatus = _msg.deserializeTo(_opCode);
2458  FW_ASSERT (
2459  _deserStatus == Fw::FW_SERIALIZE_OK,
2460  static_cast<FwAssertArgType>(_deserStatus)
2461  );
2462 
2463  // Deserialize command sequence
2464  U32 _cmdSeq = 0;
2465  _deserStatus = _msg.deserializeTo(_cmdSeq);
2466  FW_ASSERT (
2467  _deserStatus == Fw::FW_SERIALIZE_OK,
2468  static_cast<FwAssertArgType>(_deserStatus)
2469  );
2470 
2471  // Deserialize command argument buffer
2472  Fw::CmdArgBuffer args;
2473  _deserStatus = _msg.deserializeTo(args);
2474  FW_ASSERT (
2475  _deserStatus == Fw::FW_SERIALIZE_OK,
2476  static_cast<FwAssertArgType>(_deserStatus)
2477  );
2478 
2479  // Reset buffer
2480  args.resetDeser();
2481 
2482  // Deserialize argument file
2483  Fw::CmdStringArg file;
2484  _deserStatus = args.deserializeTo(file);
2485  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2487  this->cmdResponse_out(
2488  _opCode,
2489  _cmdSeq,
2491  );
2492  }
2493  // Don't crash the task if bad arguments were passed from the ground
2494  break;
2495  }
2496 
2497  // Make sure there was no data left over.
2498  // That means the argument buffer size was incorrect.
2499 #if FW_CMD_CHECK_RESIDUAL
2500  if (args.getDeserializeSizeLeft() != 0) {
2502  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2503  }
2504  // Don't crash the task if bad arguments were passed from the ground
2505  break;
2506  }
2507 #endif
2508 
2509  // Call handler function
2510  this->BL_OpenFile_cmdHandler(
2511  _opCode, _cmdSeq,
2512  file
2513  );
2514 
2515  break;
2516  }
2517 
2518  // Handle command BL_CloseFile
2519  case CMD_BL_CLOSEFILE: {
2520  // Deserialize opcode
2521  FwOpcodeType _opCode = 0;
2522  _deserStatus = _msg.deserializeTo(_opCode);
2523  FW_ASSERT (
2524  _deserStatus == Fw::FW_SERIALIZE_OK,
2525  static_cast<FwAssertArgType>(_deserStatus)
2526  );
2527 
2528  // Deserialize command sequence
2529  U32 _cmdSeq = 0;
2530  _deserStatus = _msg.deserializeTo(_cmdSeq);
2531  FW_ASSERT (
2532  _deserStatus == Fw::FW_SERIALIZE_OK,
2533  static_cast<FwAssertArgType>(_deserStatus)
2534  );
2535 
2536  // Deserialize command argument buffer
2537  Fw::CmdArgBuffer args;
2538  _deserStatus = _msg.deserializeTo(args);
2539  FW_ASSERT (
2540  _deserStatus == Fw::FW_SERIALIZE_OK,
2541  static_cast<FwAssertArgType>(_deserStatus)
2542  );
2543 
2544  // Reset buffer
2545  args.resetDeser();
2546 
2547  // Make sure there was no data left over.
2548  // That means the argument buffer size was incorrect.
2549 #if FW_CMD_CHECK_RESIDUAL
2550  if (args.getDeserializeSizeLeft() != 0) {
2552  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2553  }
2554  // Don't crash the task if bad arguments were passed from the ground
2555  break;
2556  }
2557 #endif
2558 
2559  // Call handler function
2560  this->BL_CloseFile_cmdHandler(_opCode, _cmdSeq);
2561 
2562  break;
2563  }
2564 
2565  // Handle command BL_SetLogging
2566  case CMD_BL_SETLOGGING: {
2567  // Deserialize opcode
2568  FwOpcodeType _opCode = 0;
2569  _deserStatus = _msg.deserializeTo(_opCode);
2570  FW_ASSERT (
2571  _deserStatus == Fw::FW_SERIALIZE_OK,
2572  static_cast<FwAssertArgType>(_deserStatus)
2573  );
2574 
2575  // Deserialize command sequence
2576  U32 _cmdSeq = 0;
2577  _deserStatus = _msg.deserializeTo(_cmdSeq);
2578  FW_ASSERT (
2579  _deserStatus == Fw::FW_SERIALIZE_OK,
2580  static_cast<FwAssertArgType>(_deserStatus)
2581  );
2582 
2583  // Deserialize command argument buffer
2584  Fw::CmdArgBuffer args;
2585  _deserStatus = _msg.deserializeTo(args);
2586  FW_ASSERT (
2587  _deserStatus == Fw::FW_SERIALIZE_OK,
2588  static_cast<FwAssertArgType>(_deserStatus)
2589  );
2590 
2591  // Reset buffer
2592  args.resetDeser();
2593 
2594  // Deserialize argument state
2596  _deserStatus = args.deserializeTo(state);
2597  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2599  this->cmdResponse_out(
2600  _opCode,
2601  _cmdSeq,
2603  );
2604  }
2605  // Don't crash the task if bad arguments were passed from the ground
2606  break;
2607  }
2608 
2609  // Make sure there was no data left over.
2610  // That means the argument buffer size was incorrect.
2611 #if FW_CMD_CHECK_RESIDUAL
2612  if (args.getDeserializeSizeLeft() != 0) {
2614  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2615  }
2616  // Don't crash the task if bad arguments were passed from the ground
2617  break;
2618  }
2619 #endif
2620 
2621  // Call handler function
2623  _opCode, _cmdSeq,
2624  state
2625  );
2626 
2627  break;
2628  }
2629 
2630  // Handle command BL_FlushFile
2631  case CMD_BL_FLUSHFILE: {
2632  // Deserialize opcode
2633  FwOpcodeType _opCode = 0;
2634  _deserStatus = _msg.deserializeTo(_opCode);
2635  FW_ASSERT (
2636  _deserStatus == Fw::FW_SERIALIZE_OK,
2637  static_cast<FwAssertArgType>(_deserStatus)
2638  );
2639 
2640  // Deserialize command sequence
2641  U32 _cmdSeq = 0;
2642  _deserStatus = _msg.deserializeTo(_cmdSeq);
2643  FW_ASSERT (
2644  _deserStatus == Fw::FW_SERIALIZE_OK,
2645  static_cast<FwAssertArgType>(_deserStatus)
2646  );
2647 
2648  // Deserialize command argument buffer
2649  Fw::CmdArgBuffer args;
2650  _deserStatus = _msg.deserializeTo(args);
2651  FW_ASSERT (
2652  _deserStatus == Fw::FW_SERIALIZE_OK,
2653  static_cast<FwAssertArgType>(_deserStatus)
2654  );
2655 
2656  // Reset buffer
2657  args.resetDeser();
2658 
2659  // Make sure there was no data left over.
2660  // That means the argument buffer size was incorrect.
2661 #if FW_CMD_CHECK_RESIDUAL
2662  if (args.getDeserializeSizeLeft() != 0) {
2664  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2665  }
2666  // Don't crash the task if bad arguments were passed from the ground
2667  break;
2668  }
2669 #endif
2670 
2671  // Call handler function
2672  this->BL_FlushFile_cmdHandler(_opCode, _cmdSeq);
2673 
2674  break;
2675  }
2676 
2677  default:
2678  return MSG_DISPATCH_ERROR;
2679  }
2680 
2681  return MSG_DISPATCH_OK;
2682  }
2683 
2684  // ----------------------------------------------------------------------
2685  // Calls for messages received on special input ports
2686  // ----------------------------------------------------------------------
2687 
2688  void BufferLoggerComponentBase ::
2689  m_p_cmdIn_in(
2690  Fw::PassiveComponentBase* callComp,
2691  FwIndexType portNum,
2692  FwOpcodeType opCode,
2693  U32 cmdSeq,
2694  Fw::CmdArgBuffer& args
2695  )
2696  {
2697  FW_ASSERT(callComp != nullptr);
2698  BufferLoggerComponentBase* compPtr = static_cast<BufferLoggerComponentBase*>(callComp);
2699  compPtr->cmdIn_handlerBase(
2700  portNum,
2701  opCode,
2702  cmdSeq,
2703  args
2704  );
2705  }
2706 
2707  // ----------------------------------------------------------------------
2708  // Calls for messages received on typed input ports
2709  // ----------------------------------------------------------------------
2710 
2711  void BufferLoggerComponentBase ::
2712  m_p_bufferSendIn_in(
2713  Fw::PassiveComponentBase* callComp,
2714  FwIndexType portNum,
2715  Fw::Buffer& fwBuffer
2716  )
2717  {
2718  FW_ASSERT(callComp != nullptr);
2719  BufferLoggerComponentBase* compPtr = static_cast<BufferLoggerComponentBase*>(callComp);
2720  compPtr->bufferSendIn_handlerBase(
2721  portNum,
2722  fwBuffer
2723  );
2724  }
2725 
2726  void BufferLoggerComponentBase ::
2727  m_p_comIn_in(
2728  Fw::PassiveComponentBase* callComp,
2729  FwIndexType portNum,
2730  Fw::ComBuffer& data,
2731  U32 context
2732  )
2733  {
2734  FW_ASSERT(callComp != nullptr);
2735  BufferLoggerComponentBase* compPtr = static_cast<BufferLoggerComponentBase*>(callComp);
2736  compPtr->comIn_handlerBase(
2737  portNum,
2738  data,
2739  context
2740  );
2741  }
2742 
2743  void BufferLoggerComponentBase ::
2744  m_p_pingIn_in(
2745  Fw::PassiveComponentBase* callComp,
2746  FwIndexType portNum,
2747  U32 key
2748  )
2749  {
2750  FW_ASSERT(callComp != nullptr);
2751  BufferLoggerComponentBase* compPtr = static_cast<BufferLoggerComponentBase*>(callComp);
2752  compPtr->pingIn_handlerBase(
2753  portNum,
2754  key
2755  );
2756  }
2757 
2758  void BufferLoggerComponentBase ::
2759  m_p_schedIn_in(
2760  Fw::PassiveComponentBase* callComp,
2761  FwIndexType portNum,
2762  U32 context
2763  )
2764  {
2765  FW_ASSERT(callComp != nullptr);
2766  BufferLoggerComponentBase* compPtr = static_cast<BufferLoggerComponentBase*>(callComp);
2767  compPtr->schedIn_handlerBase(
2768  portNum,
2769  context
2770  );
2771  }
2772 
2773 #if !FW_DIRECT_PORT_CALLS
2774 
2775  // ----------------------------------------------------------------------
2776  // Invocation functions for special output ports
2777  // ----------------------------------------------------------------------
2778 
2779  void BufferLoggerComponentBase ::
2780  cmdRegOut_out(
2781  FwIndexType portNum,
2782  FwOpcodeType opCode
2783  ) const
2784  {
2785  FW_ASSERT(
2786  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
2787  static_cast<FwAssertArgType>(portNum)
2788  );
2789 
2790  FW_ASSERT(
2791  this->m_cmdRegOut_OutputPort[portNum].isConnected(),
2792  static_cast<FwAssertArgType>(portNum)
2793  );
2794  this->m_cmdRegOut_OutputPort[portNum].invoke(
2795  opCode
2796  );
2797  }
2798 
2799  void BufferLoggerComponentBase ::
2800  cmdResponseOut_out(
2801  FwIndexType portNum,
2802  FwOpcodeType opCode,
2803  U32 cmdSeq,
2804  const Fw::CmdResponse& response
2805  ) const
2806  {
2807  FW_ASSERT(
2808  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
2809  static_cast<FwAssertArgType>(portNum)
2810  );
2811 
2812  FW_ASSERT(
2813  this->m_cmdResponseOut_OutputPort[portNum].isConnected(),
2814  static_cast<FwAssertArgType>(portNum)
2815  );
2816  this->m_cmdResponseOut_OutputPort[portNum].invoke(
2817  opCode,
2818  cmdSeq,
2819  response
2820  );
2821  }
2822 
2823  void BufferLoggerComponentBase ::
2824  eventOut_out(
2825  FwIndexType portNum,
2826  FwEventIdType id,
2827  Fw::Time& timeTag,
2828  const Fw::LogSeverity& severity,
2829  Fw::LogBuffer& args
2830  ) const
2831  {
2832  FW_ASSERT(
2833  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
2834  static_cast<FwAssertArgType>(portNum)
2835  );
2836 
2837  FW_ASSERT(
2838  this->m_eventOut_OutputPort[portNum].isConnected(),
2839  static_cast<FwAssertArgType>(portNum)
2840  );
2841  this->m_eventOut_OutputPort[portNum].invoke(
2842  id,
2843  timeTag,
2844  severity,
2845  args
2846  );
2847  }
2848 
2849 #if FW_ENABLE_TEXT_LOGGING
2850 
2851  void BufferLoggerComponentBase ::
2852  eventOutText_out(
2853  FwIndexType portNum,
2854  FwEventIdType id,
2855  Fw::Time& timeTag,
2856  const Fw::LogSeverity& severity,
2857  Fw::TextLogString& text
2858  ) const
2859  {
2860  FW_ASSERT(
2861  (0 <= portNum) && (portNum < this->getNum_eventOutText_OutputPorts()),
2862  static_cast<FwAssertArgType>(portNum)
2863  );
2864 
2865  FW_ASSERT(
2866  this->m_eventOutText_OutputPort[portNum].isConnected(),
2867  static_cast<FwAssertArgType>(portNum)
2868  );
2869  this->m_eventOutText_OutputPort[portNum].invoke(
2870  id,
2871  timeTag,
2872  severity,
2873  text
2874  );
2875  }
2876 
2877 #endif
2878 
2879  void BufferLoggerComponentBase ::
2880  timeCaller_out(
2881  FwIndexType portNum,
2882  Fw::Time& time
2883  ) const
2884  {
2885  FW_ASSERT(
2886  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
2887  static_cast<FwAssertArgType>(portNum)
2888  );
2889 
2890  FW_ASSERT(
2891  this->m_timeCaller_OutputPort[portNum].isConnected(),
2892  static_cast<FwAssertArgType>(portNum)
2893  );
2894  this->m_timeCaller_OutputPort[portNum].invoke(
2895  time
2896  );
2897  }
2898 
2899  void BufferLoggerComponentBase ::
2900  tlmOut_out(
2901  FwIndexType portNum,
2902  FwChanIdType id,
2903  Fw::Time& timeTag,
2904  Fw::TlmBuffer& val
2905  ) const
2906  {
2907  FW_ASSERT(
2908  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
2909  static_cast<FwAssertArgType>(portNum)
2910  );
2911 
2912  FW_ASSERT(
2913  this->m_tlmOut_OutputPort[portNum].isConnected(),
2914  static_cast<FwAssertArgType>(portNum)
2915  );
2916  this->m_tlmOut_OutputPort[portNum].invoke(
2917  id,
2918  timeTag,
2919  val
2920  );
2921  }
2922 
2923 #endif
2924 
2925 }
Serialization/Deserialization operation was successful.
void BL_SetLogging_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
The Buffer Logger encountered an error opening a log file.
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)
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.
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.
The size of the serial representation.
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.
Open a new log file with specified name; also resets unique file counter to 0.
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.
The Buffer Logger encountered an error writing to a log file.
static constexpr FwIndexType getNum_timeCaller_OutputPorts()
The Buffer Logger encountered an error formatting a log file name.
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
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.
Close the currently open log file, if any.
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
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
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.
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
message to exit active component task
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 incNumMsgDropped()
increment the number of messages dropped
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()
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.
virtual void BL_CloseFile_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
virtual void BL_OpenFile_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &file)=0
Flushes the current open log file to disk; a no-op with fprime&#39;s unbuffered file I/O, so always returns success.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
The Buffer Logger encountered an error writing a validation file.
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
No log file open command was received by BufferLogger.
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].