F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
FileDispatcherComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FileDispatcherComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for FileDispatcher 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  FILEDISPATCHER_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT,
19  FILEANNOUNCERECV_FILEANNOUNCE,
20  PINGIN_PING,
21  CMD_ENABLE_DISPATCH,
22  };
23 
24  // Get the max size by constructing a union of the async input, command, and
25  // internal port serialization sizes
26  union BuffUnion {
27  BYTE fileAnnounceRecvPortSize[Svc::InputFileAnnouncePort::SERIALIZED_SIZE];
30  };
31 
32  // Define a message buffer class large enough to handle all the
33  // asynchronous inputs to the component
34  class ComponentIpcSerializableBuffer :
36  {
37 
38  public:
39 
40  enum {
41  // Offset into data in buffer: Size of message ID and port number
42  DATA_OFFSET = sizeof(FwEnumStoreType) + sizeof(FwIndexType),
43  // Max data size
44  MAX_DATA_SIZE = sizeof(BuffUnion),
45  // Max message size: Size of message id + size of port + max data size
46  SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
47  };
48 
49  Fw::Serializable::SizeType getCapacity() const {
50  return sizeof(m_buff);
51  }
52 
53  U8* getBuffAddr() {
54  return m_buff;
55  }
56 
57  const U8* getBuffAddr() const {
58  return m_buff;
59  }
60 
61  private:
62  // Should be the max of all the input ports serialized sizes...
63  U8 m_buff[SERIALIZATION_SIZE];
64 
65  };
66  }
67 
68  // ----------------------------------------------------------------------
69  // Component initialization
70  // ----------------------------------------------------------------------
71 
74  FwSizeType queueDepth,
75  FwEnumStoreType instance
76  )
77  {
78  // Initialize base class
80 
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 
105  // Connect input port fileAnnounceRecv
106  for (
107  FwIndexType port = 0;
108  port < static_cast<FwIndexType>(this->getNum_fileAnnounceRecv_InputPorts());
109  port++
110  ) {
111  this->m_fileAnnounceRecv_InputPort[port].init();
112  this->m_fileAnnounceRecv_InputPort[port].addCallComp(
113  this,
114  m_p_fileAnnounceRecv_in
115  );
116  this->m_fileAnnounceRecv_InputPort[port].setPortNum(port);
117 
118 #if FW_OBJECT_NAMES == 1
119  Fw::ObjectName portName;
120  portName.format(
121  "%s_fileAnnounceRecv_InputPort[%" PRI_FwIndexType "]",
122  this->m_objName.toChar(),
123  port
124  );
125  this->m_fileAnnounceRecv_InputPort[port].setObjName(portName.toChar());
126 #endif
127  }
128 
129  // Connect input port pingIn
130  for (
131  FwIndexType port = 0;
132  port < static_cast<FwIndexType>(this->getNum_pingIn_InputPorts());
133  port++
134  ) {
135  this->m_pingIn_InputPort[port].init();
136  this->m_pingIn_InputPort[port].addCallComp(
137  this,
138  m_p_pingIn_in
139  );
140  this->m_pingIn_InputPort[port].setPortNum(port);
141 
142 #if FW_OBJECT_NAMES == 1
143  Fw::ObjectName portName;
144  portName.format(
145  "%s_pingIn_InputPort[%" PRI_FwIndexType "]",
146  this->m_objName.toChar(),
147  port
148  );
149  this->m_pingIn_InputPort[port].setObjName(portName.toChar());
150 #endif
151  }
152 
153  // Connect output port cmdRegOut
154  for (
155  FwIndexType port = 0;
156  port < static_cast<FwIndexType>(this->getNum_cmdRegOut_OutputPorts());
157  port++
158  ) {
159  this->m_cmdRegOut_OutputPort[port].init();
160 
161 #if FW_OBJECT_NAMES == 1
162  Fw::ObjectName portName;
163  portName.format(
164  "%s_cmdRegOut_OutputPort[%" PRI_FwIndexType "]",
165  this->m_objName.toChar(),
166  port
167  );
168  this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar());
169 #endif
170  }
171 
172  // Connect output port cmdResponseOut
173  for (
174  FwIndexType port = 0;
175  port < static_cast<FwIndexType>(this->getNum_cmdResponseOut_OutputPorts());
176  port++
177  ) {
178  this->m_cmdResponseOut_OutputPort[port].init();
179 
180 #if FW_OBJECT_NAMES == 1
181  Fw::ObjectName portName;
182  portName.format(
183  "%s_cmdResponseOut_OutputPort[%" PRI_FwIndexType "]",
184  this->m_objName.toChar(),
185  port
186  );
187  this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar());
188 #endif
189  }
190 
191  // Connect output port logOut
192  for (
193  FwIndexType port = 0;
194  port < static_cast<FwIndexType>(this->getNum_logOut_OutputPorts());
195  port++
196  ) {
197  this->m_logOut_OutputPort[port].init();
198 
199 #if FW_OBJECT_NAMES == 1
200  Fw::ObjectName portName;
201  portName.format(
202  "%s_logOut_OutputPort[%" PRI_FwIndexType "]",
203  this->m_objName.toChar(),
204  port
205  );
206  this->m_logOut_OutputPort[port].setObjName(portName.toChar());
207 #endif
208  }
209 
210 #if FW_ENABLE_TEXT_LOGGING == 1
211  // Connect output port logTextOut
212  for (
213  FwIndexType port = 0;
214  port < static_cast<FwIndexType>(this->getNum_logTextOut_OutputPorts());
215  port++
216  ) {
217  this->m_logTextOut_OutputPort[port].init();
218 
219 #if FW_OBJECT_NAMES == 1
220  Fw::ObjectName portName;
221  portName.format(
222  "%s_logTextOut_OutputPort[%" PRI_FwIndexType "]",
223  this->m_objName.toChar(),
224  port
225  );
226  this->m_logTextOut_OutputPort[port].setObjName(portName.toChar());
227 #endif
228  }
229 #endif
230 
231  // Connect output port timeCaller
232  for (
233  FwIndexType port = 0;
234  port < static_cast<FwIndexType>(this->getNum_timeCaller_OutputPorts());
235  port++
236  ) {
237  this->m_timeCaller_OutputPort[port].init();
238 
239 #if FW_OBJECT_NAMES == 1
240  Fw::ObjectName portName;
241  portName.format(
242  "%s_timeCaller_OutputPort[%" PRI_FwIndexType "]",
243  this->m_objName.toChar(),
244  port
245  );
246  this->m_timeCaller_OutputPort[port].setObjName(portName.toChar());
247 #endif
248  }
249 
250  // Connect output port fileDispatch
251  for (
252  FwIndexType port = 0;
253  port < static_cast<FwIndexType>(this->getNum_fileDispatch_OutputPorts());
254  port++
255  ) {
256  this->m_fileDispatch_OutputPort[port].init();
257 
258 #if FW_OBJECT_NAMES == 1
259  Fw::ObjectName portName;
260  portName.format(
261  "%s_fileDispatch_OutputPort[%" PRI_FwIndexType "]",
262  this->m_objName.toChar(),
263  port
264  );
265  this->m_fileDispatch_OutputPort[port].setObjName(portName.toChar());
266 #endif
267  }
268 
269  // Connect output port pingOut
270  for (
271  FwIndexType port = 0;
272  port < static_cast<FwIndexType>(this->getNum_pingOut_OutputPorts());
273  port++
274  ) {
275  this->m_pingOut_OutputPort[port].init();
276 
277 #if FW_OBJECT_NAMES == 1
278  Fw::ObjectName portName;
279  portName.format(
280  "%s_pingOut_OutputPort[%" PRI_FwIndexType "]",
281  this->m_objName.toChar(),
282  port
283  );
284  this->m_pingOut_OutputPort[port].setObjName(portName.toChar());
285 #endif
286  }
287 
288  // Create the queue
289  Os::Queue::Status qStat = this->createQueue(
290  queueDepth,
291  static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
292  );
293  FW_ASSERT(
294  Os::Queue::Status::OP_OK == qStat,
295  static_cast<FwAssertArgType>(qStat)
296  );
297  }
298 
299  // ----------------------------------------------------------------------
300  // Getters for special input ports
301  // ----------------------------------------------------------------------
302 
305  {
306  FW_ASSERT(
307  (0 <= portNum) && (portNum < this->getNum_cmdIn_InputPorts()),
308  static_cast<FwAssertArgType>(portNum)
309  );
310 
311  return &this->m_cmdIn_InputPort[portNum];
312  }
313 
314  // ----------------------------------------------------------------------
315  // Getters for typed input ports
316  // ----------------------------------------------------------------------
317 
320  {
321  FW_ASSERT(
322  (0 <= portNum) && (portNum < this->getNum_fileAnnounceRecv_InputPorts()),
323  static_cast<FwAssertArgType>(portNum)
324  );
325 
326  return &this->m_fileAnnounceRecv_InputPort[portNum];
327  }
328 
331  {
332  FW_ASSERT(
333  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
334  static_cast<FwAssertArgType>(portNum)
335  );
336 
337  return &this->m_pingIn_InputPort[portNum];
338  }
339 
340  // ----------------------------------------------------------------------
341  // Connect input ports to special output ports
342  // ----------------------------------------------------------------------
343 
346  FwIndexType portNum,
347  Fw::InputCmdRegPort* port
348  )
349  {
350  FW_ASSERT(
351  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
352  static_cast<FwAssertArgType>(portNum)
353  );
354 
355  this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
356  }
357 
360  FwIndexType portNum,
362  )
363  {
364  FW_ASSERT(
365  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
366  static_cast<FwAssertArgType>(portNum)
367  );
368 
369  this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
370  }
371 
374  FwIndexType portNum,
375  Fw::InputLogPort* port
376  )
377  {
378  FW_ASSERT(
379  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
380  static_cast<FwAssertArgType>(portNum)
381  );
382 
383  this->m_logOut_OutputPort[portNum].addCallPort(port);
384  }
385 
386 #if FW_ENABLE_TEXT_LOGGING == 1
387 
388  void FileDispatcherComponentBase ::
389  set_logTextOut_OutputPort(
390  FwIndexType portNum,
392  )
393  {
394  FW_ASSERT(
395  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
396  static_cast<FwAssertArgType>(portNum)
397  );
398 
399  this->m_logTextOut_OutputPort[portNum].addCallPort(port);
400  }
401 
402 #endif
403 
406  FwIndexType portNum,
407  Fw::InputTimePort* port
408  )
409  {
410  FW_ASSERT(
411  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
412  static_cast<FwAssertArgType>(portNum)
413  );
414 
415  this->m_timeCaller_OutputPort[portNum].addCallPort(port);
416  }
417 
418  // ----------------------------------------------------------------------
419  // Connect typed input ports to typed output ports
420  // ----------------------------------------------------------------------
421 
424  FwIndexType portNum,
426  )
427  {
428  FW_ASSERT(
429  (0 <= portNum) && (portNum < this->getNum_fileDispatch_OutputPorts()),
430  static_cast<FwAssertArgType>(portNum)
431  );
432 
433  this->m_fileDispatch_OutputPort[portNum].addCallPort(port);
434  }
435 
438  FwIndexType portNum,
439  Svc::InputPingPort* port
440  )
441  {
442  FW_ASSERT(
443  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
444  static_cast<FwAssertArgType>(portNum)
445  );
446 
447  this->m_pingOut_OutputPort[portNum].addCallPort(port);
448  }
449 
450 #if FW_PORT_SERIALIZATION
451 
452  // ----------------------------------------------------------------------
453  // Connect serial input ports to special output ports
454  // ----------------------------------------------------------------------
455 
458  FwIndexType portNum,
459  Fw::InputSerializePort* port
460  )
461  {
462  FW_ASSERT(
463  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
464  static_cast<FwAssertArgType>(portNum)
465  );
466 
467  this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
468  }
469 
472  FwIndexType portNum,
473  Fw::InputSerializePort* port
474  )
475  {
476  FW_ASSERT(
477  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
478  static_cast<FwAssertArgType>(portNum)
479  );
480 
481  this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
482  }
483 
486  FwIndexType portNum,
487  Fw::InputSerializePort* port
488  )
489  {
490  FW_ASSERT(
491  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
492  static_cast<FwAssertArgType>(portNum)
493  );
494 
495  this->m_logOut_OutputPort[portNum].registerSerialPort(port);
496  }
497 
498 #if FW_ENABLE_TEXT_LOGGING == 1
499 
500  void FileDispatcherComponentBase ::
501  set_logTextOut_OutputPort(
502  FwIndexType portNum,
503  Fw::InputSerializePort* port
504  )
505  {
506  FW_ASSERT(
507  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
508  static_cast<FwAssertArgType>(portNum)
509  );
510 
511  this->m_logTextOut_OutputPort[portNum].registerSerialPort(port);
512  }
513 
514 #endif
515 
518  FwIndexType portNum,
519  Fw::InputSerializePort* port
520  )
521  {
522  FW_ASSERT(
523  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
524  static_cast<FwAssertArgType>(portNum)
525  );
526 
527  this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
528  }
529 
530 #endif
531 
532 #if FW_PORT_SERIALIZATION
533 
534  // ----------------------------------------------------------------------
535  // Connect serial input ports to typed output ports
536  // ----------------------------------------------------------------------
537 
540  FwIndexType portNum,
541  Fw::InputSerializePort* port
542  )
543  {
544  FW_ASSERT(
545  (0 <= portNum) && (portNum < this->getNum_fileDispatch_OutputPorts()),
546  static_cast<FwAssertArgType>(portNum)
547  );
548 
549  this->m_fileDispatch_OutputPort[portNum].registerSerialPort(port);
550  }
551 
554  FwIndexType portNum,
555  Fw::InputSerializePort* port
556  )
557  {
558  FW_ASSERT(
559  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
560  static_cast<FwAssertArgType>(portNum)
561  );
562 
563  this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
564  }
565 
566 #endif
567 
568  // ----------------------------------------------------------------------
569  // Command registration
570  // ----------------------------------------------------------------------
571 
574  {
575  FW_ASSERT(this->m_cmdRegOut_OutputPort[0].isConnected());
576 
577  this->m_cmdRegOut_OutputPort[0].invoke(
579  );
580  }
581 
582  // ----------------------------------------------------------------------
583  // Component construction and destruction
584  // ----------------------------------------------------------------------
585 
587  FileDispatcherComponentBase(const char* compName) :
588  Fw::ActiveComponentBase(compName)
589  {
590 
591  }
592 
595  {
596 
597  }
598 
599  // ----------------------------------------------------------------------
600  // Connection status queries for special output ports
601  // ----------------------------------------------------------------------
602 
605  {
606  FW_ASSERT(
607  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
608  static_cast<FwAssertArgType>(portNum)
609  );
610 
611  return this->m_cmdRegOut_OutputPort[portNum].isConnected();
612  }
613 
616  {
617  FW_ASSERT(
618  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
619  static_cast<FwAssertArgType>(portNum)
620  );
621 
622  return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
623  }
624 
627  {
628  FW_ASSERT(
629  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
630  static_cast<FwAssertArgType>(portNum)
631  );
632 
633  return this->m_logOut_OutputPort[portNum].isConnected();
634  }
635 
636 #if FW_ENABLE_TEXT_LOGGING == 1
637 
638  bool FileDispatcherComponentBase ::
639  isConnected_logTextOut_OutputPort(FwIndexType portNum)
640  {
641  FW_ASSERT(
642  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
643  static_cast<FwAssertArgType>(portNum)
644  );
645 
646  return this->m_logTextOut_OutputPort[portNum].isConnected();
647  }
648 
649 #endif
650 
653  {
654  FW_ASSERT(
655  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
656  static_cast<FwAssertArgType>(portNum)
657  );
658 
659  return this->m_timeCaller_OutputPort[portNum].isConnected();
660  }
661 
662  // ----------------------------------------------------------------------
663  // Connection status queries for typed output ports
664  // ----------------------------------------------------------------------
665 
668  {
669  FW_ASSERT(
670  (0 <= portNum) && (portNum < this->getNum_fileDispatch_OutputPorts()),
671  static_cast<FwAssertArgType>(portNum)
672  );
673 
674  return this->m_fileDispatch_OutputPort[portNum].isConnected();
675  }
676 
679  {
680  FW_ASSERT(
681  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
682  static_cast<FwAssertArgType>(portNum)
683  );
684 
685  return this->m_pingOut_OutputPort[portNum].isConnected();
686  }
687 
688  // ----------------------------------------------------------------------
689  // Port handler base-class functions for typed input ports
690  //
691  // Call these functions directly to bypass the corresponding ports
692  // ----------------------------------------------------------------------
693 
696  FwIndexType portNum,
697  Fw::StringBase& file_name
698  )
699  {
700  // Make sure port number is valid
701  FW_ASSERT(
702  (0 <= portNum) && (portNum < this->getNum_fileAnnounceRecv_InputPorts()),
703  static_cast<FwAssertArgType>(portNum)
704  );
705 
706  // Call pre-message hook
708  portNum,
709  file_name
710  );
711  ComponentIpcSerializableBuffer msg;
713 
714  // Serialize message ID
715  _status = msg.serializeFrom(
716  static_cast<FwEnumStoreType>(FILEANNOUNCERECV_FILEANNOUNCE)
717  );
718  FW_ASSERT(
719  _status == Fw::FW_SERIALIZE_OK,
720  static_cast<FwAssertArgType>(_status)
721  );
722 
723  // Serialize port number
724  _status = msg.serializeFrom(portNum);
725  FW_ASSERT(
726  _status == Fw::FW_SERIALIZE_OK,
727  static_cast<FwAssertArgType>(_status)
728  );
729 
730  // Serialize argument file_name
731  _status = file_name.serializeTo(msg, 80);
732  FW_ASSERT(
733  _status == Fw::FW_SERIALIZE_OK,
734  static_cast<FwAssertArgType>(_status)
735  );
736 
737  // Send message
739  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
740 
741  FW_ASSERT(
742  qStatus == Os::Queue::OP_OK,
743  static_cast<FwAssertArgType>(qStatus)
744  );
745  }
746 
749  FwIndexType portNum,
750  U32 key
751  )
752  {
753  // Make sure port number is valid
754  FW_ASSERT(
755  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
756  static_cast<FwAssertArgType>(portNum)
757  );
758 
759  // Call pre-message hook
761  portNum,
762  key
763  );
764  ComponentIpcSerializableBuffer msg;
766 
767  // Serialize message ID
768  _status = msg.serializeFrom(
769  static_cast<FwEnumStoreType>(PINGIN_PING)
770  );
771  FW_ASSERT(
772  _status == Fw::FW_SERIALIZE_OK,
773  static_cast<FwAssertArgType>(_status)
774  );
775 
776  // Serialize port number
777  _status = msg.serializeFrom(portNum);
778  FW_ASSERT(
779  _status == Fw::FW_SERIALIZE_OK,
780  static_cast<FwAssertArgType>(_status)
781  );
782 
783  // Serialize argument key
784  _status = msg.serializeFrom(key);
785  FW_ASSERT(
786  _status == Fw::FW_SERIALIZE_OK,
787  static_cast<FwAssertArgType>(_status)
788  );
789 
790  // Send message
792  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
793 
794  FW_ASSERT(
795  qStatus == Os::Queue::OP_OK,
796  static_cast<FwAssertArgType>(qStatus)
797  );
798  }
799 
800  // ----------------------------------------------------------------------
801  // Pre-message hooks for typed async input ports
802  //
803  // Each of these functions is invoked just before processing a message
804  // on the corresponding port. By default, they do nothing. You can
805  // override them to provide specific pre-message behavior.
806  // ----------------------------------------------------------------------
807 
810  FwIndexType portNum,
811  Fw::StringBase& file_name
812  )
813  {
814  // Default: no-op
815  }
816 
819  FwIndexType portNum,
820  U32 key
821  )
822  {
823  // Default: no-op
824  }
825 
826  // ----------------------------------------------------------------------
827  // Invocation functions for typed output ports
828  // ----------------------------------------------------------------------
829 
832  FwIndexType portNum,
833  Fw::StringBase& file_name
834  )
835  {
836  FW_ASSERT(
837  (0 <= portNum) && (portNum < this->getNum_fileDispatch_OutputPorts()),
838  static_cast<FwAssertArgType>(portNum)
839  );
840 
841  FW_ASSERT(
842  this->m_fileDispatch_OutputPort[portNum].isConnected(),
843  static_cast<FwAssertArgType>(portNum)
844  );
845  this->m_fileDispatch_OutputPort[portNum].invoke(
846  file_name
847  );
848  }
849 
852  FwIndexType portNum,
853  U32 key
854  )
855  {
856  FW_ASSERT(
857  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
858  static_cast<FwAssertArgType>(portNum)
859  );
860 
861  FW_ASSERT(
862  this->m_pingOut_OutputPort[portNum].isConnected(),
863  static_cast<FwAssertArgType>(portNum)
864  );
865  this->m_pingOut_OutputPort[portNum].invoke(
866  key
867  );
868  }
869 
870  // ----------------------------------------------------------------------
871  // Command response
872  // ----------------------------------------------------------------------
873 
876  FwOpcodeType opCode,
877  U32 cmdSeq,
878  Fw::CmdResponse response
879  )
880  {
881  FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
882  this->m_cmdResponseOut_OutputPort[0].invoke(opCode, cmdSeq, response);
883  }
884 
885  // ----------------------------------------------------------------------
886  // Command handler base-class functions
887  //
888  // Call these functions directly to bypass the command input port
889  // ----------------------------------------------------------------------
890 
893  FwOpcodeType opCode,
894  U32 cmdSeq,
895  Fw::CmdArgBuffer& args
896  )
897  {
898  // Call pre-message hook
899  this->ENABLE_DISPATCH_preMsgHook(opCode,cmdSeq);
900 
901  // Defer deserializing arguments to the message dispatcher
902  // to avoid deserializing and reserializing just for IPC
903  ComponentIpcSerializableBuffer msg;
905 
906  // Serialize for IPC
907  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_ENABLE_DISPATCH));
908  FW_ASSERT (
909  _status == Fw::FW_SERIALIZE_OK,
910  static_cast<FwAssertArgType>(_status)
911  );
912 
913  // Fake port number to make message dequeue work
914  FwIndexType port = 0;
915 
916  _status = msg.serializeFrom(port);
917  FW_ASSERT (
918  _status == Fw::FW_SERIALIZE_OK,
919  static_cast<FwAssertArgType>(_status)
920  );
921 
922  _status = msg.serializeFrom(opCode);
923  FW_ASSERT (
924  _status == Fw::FW_SERIALIZE_OK,
925  static_cast<FwAssertArgType>(_status)
926  );
927 
928  _status = msg.serializeFrom(cmdSeq);
929  FW_ASSERT (
930  _status == Fw::FW_SERIALIZE_OK,
931  static_cast<FwAssertArgType>(_status)
932  );
933 
934  _status = msg.serializeFrom(args);
935  FW_ASSERT (
936  _status == Fw::FW_SERIALIZE_OK,
937  static_cast<FwAssertArgType>(_status)
938  );
939 
940  // Send message
942  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
943 
944  FW_ASSERT(
945  qStatus == Os::Queue::OP_OK,
946  static_cast<FwAssertArgType>(qStatus)
947  );
948  }
949 
950  // ----------------------------------------------------------------------
951  // Pre-message hooks for async commands
952  //
953  // Each of these functions is invoked just before processing the
954  // corresponding command. By default they do nothing. You can
955  // override them to provide specific pre-command behavior.
956  // ----------------------------------------------------------------------
957 
960  FwOpcodeType opCode,
961  U32 cmdSeq
962  )
963  {
964  // Defaults to no-op; can be overridden
965  (void) opCode;
966  (void) cmdSeq;
967  }
968 
969  // ----------------------------------------------------------------------
970  // Event logging functions
971  // ----------------------------------------------------------------------
972 
976  Fw::Enabled enabled
977  ) const
978  {
979  // Get the time
980  Fw::Time _logTime;
981  if (this->m_timeCaller_OutputPort[0].isConnected()) {
982  this->m_timeCaller_OutputPort[0].invoke(_logTime);
983  }
984 
985  FwEventIdType _id = static_cast<FwEventIdType>(0);
986 
987  _id = this->getIdBase() + EVENTID_FILEDISPATCHSTATE;
988 
989  // Emit the event on the log port
990  if (this->m_logOut_OutputPort[0].isConnected()) {
991  Fw::LogBuffer _logBuff;
993 
994 #if FW_AMPCS_COMPATIBLE
995  // Serialize the number of arguments
996  _status = _logBuff.serializeFrom(static_cast<U8>(2));
997  FW_ASSERT(
998  _status == Fw::FW_SERIALIZE_OK,
999  static_cast<FwAssertArgType>(_status)
1000  );
1001 #endif
1002 
1003 #if FW_AMPCS_COMPATIBLE
1004  // Serialize the argument size
1005  _status = _logBuff.serializeFrom(
1007  );
1008  FW_ASSERT(
1009  _status == Fw::FW_SERIALIZE_OK,
1010  static_cast<FwAssertArgType>(_status)
1011  );
1012 #endif
1013  _status = _logBuff.serializeFrom(file_type);
1014  FW_ASSERT(
1015  _status == Fw::FW_SERIALIZE_OK,
1016  static_cast<FwAssertArgType>(_status)
1017  );
1018 
1019 #if FW_AMPCS_COMPATIBLE
1020  // Serialize the argument size
1021  _status = _logBuff.serializeFrom(
1022  static_cast<U8>(Fw::Enabled::SERIALIZED_SIZE)
1023  );
1024  FW_ASSERT(
1025  _status == Fw::FW_SERIALIZE_OK,
1026  static_cast<FwAssertArgType>(_status)
1027  );
1028 #endif
1029  _status = _logBuff.serializeFrom(enabled);
1030  FW_ASSERT(
1031  _status == Fw::FW_SERIALIZE_OK,
1032  static_cast<FwAssertArgType>(_status)
1033  );
1034 
1035  this->m_logOut_OutputPort[0].invoke(
1036  _id,
1037  _logTime,
1039  _logBuff
1040  );
1041  }
1042 
1043  // Emit the event on the text log port
1044 #if FW_ENABLE_TEXT_LOGGING
1045  if (this->m_logTextOut_OutputPort[0].isConnected()) {
1046 #if FW_OBJECT_NAMES == 1
1047  const char* _formatString =
1048  "(%s) %s: File dispatch %s state changed: to %s";
1049 #else
1050  const char* _formatString =
1051  "%s: File dispatch %s state changed: to %s";
1052 #endif
1053 
1054  Fw::String file_typeStr;
1055  file_type.toString(file_typeStr);
1056  Fw::String enabledStr;
1057  enabled.toString(enabledStr);
1058 
1059  Fw::TextLogString _logString;
1060  _logString.format(
1061  _formatString,
1062 #if FW_OBJECT_NAMES == 1
1063  this->m_objName.toChar(),
1064 #endif
1065  "FileDispatchState ",
1066  file_typeStr.toChar(),
1067  enabledStr.toChar()
1068  );
1069 
1070  this->m_logTextOut_OutputPort[0].invoke(
1071  _id,
1072  _logTime,
1074  _logString
1075  );
1076  }
1077 #endif
1078  }
1079 
1082  const Fw::StringBase& file_name,
1084  ) const
1085  {
1086  // Get the time
1087  Fw::Time _logTime;
1088  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1089  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1090  }
1091 
1092  FwEventIdType _id = static_cast<FwEventIdType>(0);
1093 
1094  _id = this->getIdBase() + EVENTID_FILEDISPATCHED;
1095 
1096  // Emit the event on the log port
1097  if (this->m_logOut_OutputPort[0].isConnected()) {
1098  Fw::LogBuffer _logBuff;
1100 
1101 #if FW_AMPCS_COMPATIBLE
1102  // Serialize the number of arguments
1103  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1104  FW_ASSERT(
1105  _status == Fw::FW_SERIALIZE_OK,
1106  static_cast<FwAssertArgType>(_status)
1107  );
1108 #endif
1109 
1110  _status = file_name.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 200));
1111  FW_ASSERT(
1112  _status == Fw::FW_SERIALIZE_OK,
1113  static_cast<FwAssertArgType>(_status)
1114  );
1115 
1116 #if FW_AMPCS_COMPATIBLE
1117  // Serialize the argument size
1118  _status = _logBuff.serializeFrom(
1120  );
1121  FW_ASSERT(
1122  _status == Fw::FW_SERIALIZE_OK,
1123  static_cast<FwAssertArgType>(_status)
1124  );
1125 #endif
1126  _status = _logBuff.serializeFrom(file_type);
1127  FW_ASSERT(
1128  _status == Fw::FW_SERIALIZE_OK,
1129  static_cast<FwAssertArgType>(_status)
1130  );
1131 
1132  this->m_logOut_OutputPort[0].invoke(
1133  _id,
1134  _logTime,
1136  _logBuff
1137  );
1138  }
1139 
1140  // Emit the event on the text log port
1141 #if FW_ENABLE_TEXT_LOGGING
1142  if (this->m_logTextOut_OutputPort[0].isConnected()) {
1143 #if FW_OBJECT_NAMES == 1
1144  const char* _formatString =
1145  "(%s) %s: File %s dispatched to %s";
1146 #else
1147  const char* _formatString =
1148  "%s: File %s dispatched to %s";
1149 #endif
1150 
1151  Fw::String file_typeStr;
1152  file_type.toString(file_typeStr);
1153 
1154  Fw::TextLogString _logString;
1155  _logString.format(
1156  _formatString,
1157 #if FW_OBJECT_NAMES == 1
1158  this->m_objName.toChar(),
1159 #endif
1160  "FileDispatched ",
1161  file_name.toChar(),
1162  file_typeStr.toChar()
1163  );
1164 
1165  this->m_logTextOut_OutputPort[0].invoke(
1166  _id,
1167  _logTime,
1169  _logString
1170  );
1171  }
1172 #endif
1173  }
1174 
1175  // ----------------------------------------------------------------------
1176  // Time
1177  // ----------------------------------------------------------------------
1178 
1180  getTime() const
1181  {
1182  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1183  Fw::Time _time;
1184  this->m_timeCaller_OutputPort[0].invoke(_time);
1185  return _time;
1186  }
1187  else {
1188  return Fw::Time(TimeBase::TB_NONE, 0, 0);
1189  }
1190  }
1191 
1192  // ----------------------------------------------------------------------
1193  // Message dispatch functions
1194  // ----------------------------------------------------------------------
1195 
1196  Fw::QueuedComponentBase::MsgDispatchStatus FileDispatcherComponentBase ::
1197  doDispatch()
1198  {
1199  ComponentIpcSerializableBuffer _msg;
1200  FwQueuePriorityType _priority = 0;
1201 
1202  Os::Queue::Status _msgStatus = this->m_queue.receive(
1203  _msg,
1205  _priority
1206  );
1207  FW_ASSERT(
1208  _msgStatus == Os::Queue::OP_OK,
1209  static_cast<FwAssertArgType>(_msgStatus)
1210  );
1211 
1212  // Reset to beginning of buffer
1213  _msg.resetDeser();
1214 
1215  FwEnumStoreType _desMsg = 0;
1216  Fw::SerializeStatus _deserStatus = _msg.deserializeTo(_desMsg);
1217  FW_ASSERT(
1218  _deserStatus == Fw::FW_SERIALIZE_OK,
1219  static_cast<FwAssertArgType>(_deserStatus)
1220  );
1221 
1222  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
1223 
1224  if (_msgType == FILEDISPATCHER_COMPONENT_EXIT) {
1225  return MSG_DISPATCH_EXIT;
1226  }
1227 
1228  FwIndexType portNum = 0;
1229  _deserStatus = _msg.deserializeTo(portNum);
1230  FW_ASSERT(
1231  _deserStatus == Fw::FW_SERIALIZE_OK,
1232  static_cast<FwAssertArgType>(_deserStatus)
1233  );
1234 
1235  switch (_msgType) {
1236  // Handle async input port fileAnnounceRecv
1237  case FILEANNOUNCERECV_FILEANNOUNCE: {
1238  // Deserialize argument file_name
1239  char __fprime_ac_file_name_buffer[Fw::StringBase::BUFFER_SIZE(80)];
1240  Fw::ExternalString file_name(__fprime_ac_file_name_buffer, sizeof __fprime_ac_file_name_buffer);
1241  _deserStatus = _msg.deserializeTo(file_name);
1242  FW_ASSERT(
1243  _deserStatus == Fw::FW_SERIALIZE_OK,
1244  static_cast<FwAssertArgType>(_deserStatus)
1245  );
1246  // Call handler function
1248  portNum,
1249  file_name
1250  );
1251 
1252  break;
1253  }
1254 
1255  // Handle async input port pingIn
1256  case PINGIN_PING: {
1257  // Deserialize argument key
1258  U32 key;
1259  _deserStatus = _msg.deserializeTo(key);
1260  FW_ASSERT(
1261  _deserStatus == Fw::FW_SERIALIZE_OK,
1262  static_cast<FwAssertArgType>(_deserStatus)
1263  );
1264  // Call handler function
1265  this->pingIn_handler(
1266  portNum,
1267  key
1268  );
1269 
1270  break;
1271  }
1272 
1273  // Handle command ENABLE_DISPATCH
1274  case CMD_ENABLE_DISPATCH: {
1275  // Deserialize opcode
1276  FwOpcodeType _opCode = 0;
1277  _deserStatus = _msg.deserializeTo(_opCode);
1278  FW_ASSERT (
1279  _deserStatus == Fw::FW_SERIALIZE_OK,
1280  static_cast<FwAssertArgType>(_deserStatus)
1281  );
1282 
1283  // Deserialize command sequence
1284  U32 _cmdSeq = 0;
1285  _deserStatus = _msg.deserializeTo(_cmdSeq);
1286  FW_ASSERT (
1287  _deserStatus == Fw::FW_SERIALIZE_OK,
1288  static_cast<FwAssertArgType>(_deserStatus)
1289  );
1290 
1291  // Deserialize command argument buffer
1292  Fw::CmdArgBuffer args;
1293  _deserStatus = _msg.deserializeTo(args);
1294  FW_ASSERT (
1295  _deserStatus == Fw::FW_SERIALIZE_OK,
1296  static_cast<FwAssertArgType>(_deserStatus)
1297  );
1298 
1299  // Reset buffer
1300  args.resetDeser();
1301 
1302  // Deserialize argument file_type
1304  _deserStatus = args.deserializeTo(file_type);
1305  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
1306  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
1307  this->cmdResponse_out(
1308  _opCode,
1309  _cmdSeq,
1311  );
1312  }
1313  // Don't crash the task if bad arguments were passed from the ground
1314  break;
1315  }
1316 
1317  // Deserialize argument enable
1318  Fw::Enabled enable;
1319  _deserStatus = args.deserializeTo(enable);
1320  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
1321  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
1322  this->cmdResponse_out(
1323  _opCode,
1324  _cmdSeq,
1326  );
1327  }
1328  // Don't crash the task if bad arguments were passed from the ground
1329  break;
1330  }
1331 
1332  // Make sure there was no data left over.
1333  // That means the argument buffer size was incorrect.
1334 #if FW_CMD_CHECK_RESIDUAL
1335  if (args.getDeserializeSizeLeft() != 0) {
1336  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
1337  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
1338  }
1339  // Don't crash the task if bad arguments were passed from the ground
1340  break;
1341  }
1342 #endif
1343 
1344  // Call handler function
1346  _opCode, _cmdSeq,
1347  file_type,
1348  enable
1349  );
1350 
1351  break;
1352  }
1353 
1354  default:
1355  return MSG_DISPATCH_ERROR;
1356  }
1357 
1358  return MSG_DISPATCH_OK;
1359  }
1360 
1361  // ----------------------------------------------------------------------
1362  // Calls for messages received on special input ports
1363  // ----------------------------------------------------------------------
1364 
1365  void FileDispatcherComponentBase ::
1366  m_p_cmdIn_in(
1367  Fw::PassiveComponentBase* callComp,
1368  FwIndexType portNum,
1369  FwOpcodeType opCode,
1370  U32 cmdSeq,
1371  Fw::CmdArgBuffer& args
1372  )
1373  {
1374  FW_ASSERT(callComp);
1375  FileDispatcherComponentBase* compPtr = static_cast<FileDispatcherComponentBase*>(callComp);
1376 
1377  const U32 idBase = callComp->getIdBase();
1378  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
1379 
1380  // Select base class function based on opcode
1381  switch (opCode - idBase) {
1382  case OPCODE_ENABLE_DISPATCH: {
1383  compPtr->ENABLE_DISPATCH_cmdHandlerBase(
1384  opCode,
1385  cmdSeq,
1386  args
1387  );
1388  break;
1389  }
1390  }
1391  }
1392 
1393  // ----------------------------------------------------------------------
1394  // Calls for messages received on typed input ports
1395  // ----------------------------------------------------------------------
1396 
1397  void FileDispatcherComponentBase ::
1398  m_p_fileAnnounceRecv_in(
1399  Fw::PassiveComponentBase* callComp,
1400  FwIndexType portNum,
1401  Fw::StringBase& file_name
1402  )
1403  {
1404  FW_ASSERT(callComp);
1405  FileDispatcherComponentBase* compPtr = static_cast<FileDispatcherComponentBase*>(callComp);
1406  compPtr->fileAnnounceRecv_handlerBase(
1407  portNum,
1408  file_name
1409  );
1410  }
1411 
1412  void FileDispatcherComponentBase ::
1413  m_p_pingIn_in(
1414  Fw::PassiveComponentBase* callComp,
1415  FwIndexType portNum,
1416  U32 key
1417  )
1418  {
1419  FW_ASSERT(callComp);
1420  FileDispatcherComponentBase* compPtr = static_cast<FileDispatcherComponentBase*>(callComp);
1421  compPtr->pingIn_handlerBase(
1422  portNum,
1423  key
1424  );
1425  }
1426 
1427 }
Serialization/Deserialization operation was successful.
void set_pingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:134
static constexpr FwIndexType getNum_cmdResponseOut_OutputPorts()
virtual void pingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port pingIn.
FwIdType FwOpcodeType
The type of a command opcode.
Operation succeeded.
Definition: Os.hpp:26
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
static constexpr FwIndexType getNum_cmdRegOut_OutputPorts()
PlatformSizeType FwSizeType
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
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
static constexpr FwIndexType getNum_timeCaller_OutputPorts()
Status
status returned from the queue send function
Definition: Queue.hpp:30
const char * toChar() const
Convert to a C-style char*.
Definition: String.hpp:50
The size of the serial representations of the port arguments.
Definition: PingPortAc.hpp:36
void fileAnnounceRecv_handlerBase(FwIndexType portNum, Fw::StringBase &file_name)
Handler base-class function for input port fileAnnounceRecv.
void init()
Initialization function.
Definition: CmdPortAc.cpp:56
void invoke(U32 key) const
Invoke a port interface.
Definition: PingPortAc.cpp:147
virtual const CHAR * toChar() const =0
Convert to a C-style char*.
FileDispatcherComponentBase(const char *compName="")
Construct FileDispatcherComponentBase object.
Enum representing a command response.
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
No time base has been established (Required)
void init()
Initialization function.
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
Fw::InputCmdPort * get_cmdIn_InputPort(FwIndexType portNum)
virtual void fileAnnounceRecv_handler(FwIndexType portNum, Fw::StringBase &file_name)=0
Handler for input port fileAnnounceRecv.
void log_ACTIVITY_HI_FileDispatchState(Svc::FileDispatcherCfg::FileDispatchPort file_type, Fw::Enabled enabled) const
Log event FileDispatchState.
void init()
Initialization function.
Os::Queue m_queue
queue object for active component
void set_cmdResponseOut_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
bool isConnected_fileDispatch_OutputPort(FwIndexType portNum)
virtual void ENABLE_DISPATCH_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command ENABLE_DISPATCH.
void init()
Object initializer.
Definition: ObjBase.cpp:24
void regCommands()
Register commands with the Command Dispatcher.
SerializeStatus
forward declaration for string
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: CmdPortAc.cpp:62
Message will block until space is available.
Definition: Queue.hpp:47
static constexpr FwIndexType getNum_fileDispatch_OutputPorts()
FwIdType FwEventIdType
The type of an event identifier.
void fileDispatch_out(FwIndexType portNum, Fw::StringBase &file_name)
Invoke output port fileDispatch.
void invoke(FwOpcodeType opCode) const
Invoke a port interface.
bool isConnected_pingOut_OutputPort(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:26
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
void init()
Initialization function.
Definition: TimePortAc.cpp:128
bool isConnected_logOut_OutputPort(FwIndexType portNum)
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
The size of the serial representations of the port arguments.
#define FW_MIN(a, b)
MIN macro.
Definition: BasicTypes.h:92
static constexpr FwIndexType getNum_logOut_OutputPorts()
void init()
Initialization function.
Definition: PingPortAc.cpp:128
void invoke(Fw::Time &time) const
Invoke a port interface.
Definition: TimePortAc.cpp:147
Serializable::SizeType getDeserializeSizeLeft() const override
Get remaining deserialization buffer size.
static constexpr FwIndexType getNum_pingIn_InputPorts()
const char * toChar() const
Convert to a C-style char*.
Definition: ObjectName.hpp:50
virtual void ENABLE_DISPATCH_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, Svc::FileDispatcherCfg::FileDispatchPort file_type, Fw::Enabled enable)=0
Handler for command ENABLE_DISPATCH.
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke a port interface.
FwSizeType SizeType
void addCallPort(InputPingPort *callPort)
Register an input port.
Definition: PingPortAc.cpp:134
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
Definition: Queue.cpp:54
static constexpr FwIndexType getNum_cmdIn_InputPorts()
void resetDeser() override
Reset deserialization pointer to beginning of buffer.
A string backed by an external buffer.
void ENABLE_DISPATCH_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Base-class handler function for command ENABLE_DISPATCH.
bool isConnected() const
Definition: PortBase.cpp:38
bool isConnected_timeCaller_OutputPort(FwIndexType portNum)
The size of the serial representations of the port arguments.
Definition: CmdPortAc.hpp:38
virtual void fileAnnounceRecv_preMsgHook(FwIndexType portNum, Fw::StringBase &file_name)
Pre-message hook for async input port fileAnnounceRecv.
#define PRI_FwIndexType
Enabled and disabled states.
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:39
void init()
Initialization function.
Definition: LogPortAc.cpp:151
void pingOut_out(FwIndexType portNum, U32 key)
Invoke output port pingOut.
void setPortNum(FwIndexType portNum)
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:53
BlockingType
message type
Definition: Queue.hpp:46
Command failed to deserialize.
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
Important informational events.
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port interface.
Definition: LogPortAc.cpp:170
void set_fileDispatch_OutputPort(FwIndexType portNum, Svc::InputFileDispatchPort *port)
Connect port to fileDispatch[portNum].
A message was sent requesting an exit of the loop.
message to exit active component task
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
Svc::InputFileAnnouncePort * get_fileAnnounceRecv_InputPort(FwIndexType portNum)
virtual ~FileDispatcherComponentBase()
Destroy FileDispatcherComponentBase object.
PlatformIndexType FwIndexType
The size of the serial representation.
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:157
bool isConnected_cmdRegOut_OutputPort(FwIndexType portNum)
void init()
Initialization function.
void init()
Initialization function.
Definition: PingPortAc.cpp:56
bool isConnected_cmdResponseOut_OutputPort(FwIndexType portNum)
void addCallPort(InputFileDispatchPort *callPort)
Register an input port.
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:56
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: PingPortAc.cpp:62
Message will return with status when space is unavailable.
Definition: Queue.hpp:48
Implementation of malloc based allocator.
void set_cmdRegOut_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to cmdRegOut[portNum].
static constexpr SizeType BUFFER_SIZE(SizeType maxLength)
Get the size of a null-terminated string buffer.
static constexpr FwIndexType getNum_pingOut_OutputPorts()
void init()
Initialization function.
void log_ACTIVITY_HI_FileDispatched(const Fw::StringBase &file_name, Svc::FileDispatcherCfg::FileDispatchPort file_type) const
Log event FileDispatched.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
void invoke(Fw::StringBase &file_name) const
Invoke a port interface.
static constexpr FwIndexType getNum_fileAnnounceRecv_InputPorts()
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
SerializeStatus serializeTo(SerialBufferBase &buffer, Endianness mode=Endianness::BIG) const override
Serialize the contents of this object to a buffer.