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