F´ Flight Software - C/C++ Documentation  NASA-v1.5.0
A framework for building embedded system applications to NASA flight quality standards.
FileDownlinkComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FileDownlinkComponentAc.cpp
3 // \author Auto-generated
4 // \brief cpp file for FileDownlink component base class
5 //
6 // \copyright
7 // Copyright 2009-2015, by the California Institute of Technology.
8 // ALL RIGHTS RESERVED. United States Government Sponsorship
9 // acknowledged.
10 //
11 // ======================================================================
12 
13 #include <stdio.h>
14 #include <FpConfig.hpp>
16 #include <Fw/Types/Assert.hpp>
17 #if FW_ENABLE_TEXT_LOGGING
19 #endif
20 
21 
22 namespace Svc {
23 
24  // ----------------------------------------------------------------------
25  // Anonymous namespace to prevent name collisions
26  // ----------------------------------------------------------------------
27 
28  namespace {
29 
30  typedef enum {
31  FILEDOWNLINK_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT,
32  PINGIN_PING,
33  CMD_FILEDOWNLINK_SENDFILE
34  } MsgTypeEnum;
35 
36  // Get the max size by doing a union of the input port serialization sizes.
37 
38  typedef union {
41  } BuffUnion;
42 
43  // Define a message buffer class large enough to handle all the
44  // asynchronous inputs to the component
45 
46  class ComponentIpcSerializableBuffer :
48  {
49 
50  public:
51 
52  enum {
53  // Max. message size = size of data + message id + port
54  SERIALIZATION_SIZE =
55  sizeof(BuffUnion) +
56  sizeof(NATIVE_INT_TYPE) +
57  sizeof(NATIVE_INT_TYPE)
58  };
59 
60  NATIVE_UINT_TYPE getBuffCapacity(void) const {
61  return sizeof(m_buff);
62  }
63 
64  U8* getBuffAddr(void) {
65  return m_buff;
66  }
67 
68  const U8* getBuffAddr(void) const {
69  return m_buff;
70  }
71 
72  private:
73  // Should be the max of all the input ports serialized sizes...
74  U8 m_buff[SERIALIZATION_SIZE];
75 
76  };
77 
78  }
79 
80  // ----------------------------------------------------------------------
81  // Getters for numbers of input ports
82  // ----------------------------------------------------------------------
83 
86  {
87  FW_ASSERT(portNum < this->getNum_cmdIn_InputPorts(),static_cast<AssertArg>(portNum));
88  return &this->m_cmdIn_InputPort[portNum];
89  }
90 
93  {
94  FW_ASSERT(portNum < this->getNum_pingIn_InputPorts(),static_cast<AssertArg>(portNum));
95  return &this->m_pingIn_InputPort[portNum];
96  }
97 
98  // ----------------------------------------------------------------------
99  // Typed connectors for output ports
100  // ----------------------------------------------------------------------
101 
104  NATIVE_INT_TYPE portNum,
106  )
107  {
108  FW_ASSERT(portNum < this->getNum_bufferGetCaller_OutputPorts(),static_cast<AssertArg>(portNum));
109  this->m_bufferGetCaller_OutputPort[portNum].addCallPort(port);
110  }
111 
114  NATIVE_INT_TYPE portNum,
115  Fw::InputTimePort* port
116  )
117  {
118  FW_ASSERT(portNum < this->getNum_timeCaller_OutputPorts(),static_cast<AssertArg>(portNum));
120  }
121 
124  NATIVE_INT_TYPE portNum,
126  )
127  {
128  FW_ASSERT(portNum < this->getNum_bufferSendOut_OutputPorts(),static_cast<AssertArg>(portNum));
130  }
131 
134  NATIVE_INT_TYPE portNum,
135  Fw::InputTlmPort* port
136  )
137  {
138  FW_ASSERT(portNum < this->getNum_tlmOut_OutputPorts(),static_cast<AssertArg>(portNum));
140  }
141 
144  NATIVE_INT_TYPE portNum,
146  )
147  {
148  FW_ASSERT(portNum < this->getNum_cmdResponseOut_OutputPorts(),static_cast<AssertArg>(portNum));
150  }
151 
154  NATIVE_INT_TYPE portNum,
155  Fw::InputCmdRegPort* port
156  )
157  {
158  FW_ASSERT(portNum < this->getNum_cmdRegOut_OutputPorts(),static_cast<AssertArg>(portNum));
160  }
161 
164  NATIVE_INT_TYPE portNum,
165  Fw::InputLogPort* port
166  )
167  {
168  FW_ASSERT(portNum < this->getNum_eventOut_OutputPorts(),static_cast<AssertArg>(portNum));
170  }
171 
174  NATIVE_INT_TYPE portNum,
175  Svc::InputPingPort* port
176  )
177  {
178  FW_ASSERT(portNum < this->getNum_pingOut_OutputPorts(),static_cast<AssertArg>(portNum));
180  }
181 
182 #if FW_ENABLE_TEXT_LOGGING == 1
183  void FileDownlinkComponentBase ::
184  set_LogText_OutputPort(
185  NATIVE_INT_TYPE portNum,
187  )
188  {
189  FW_ASSERT(portNum < this->getNum_LogText_OutputPorts(),static_cast<AssertArg>(portNum));
190  this->m_LogText_OutputPort[portNum].addCallPort(port);
191  }
192 #endif
193 
194  // ----------------------------------------------------------------------
195  // Serialization connectors for output ports
196  // ----------------------------------------------------------------------
197 
198 #if FW_PORT_SERIALIZATION
199 
202  NATIVE_INT_TYPE portNum,
203  Fw::InputSerializePort *port
204  )
205  {
206  FW_ASSERT(portNum < this->getNum_bufferGetCaller_OutputPorts(),static_cast<AssertArg>(portNum));
207  return this->m_bufferGetCaller_OutputPort[portNum].registerSerialPort(port);
208  }
209 
212  NATIVE_INT_TYPE portNum,
213  Fw::InputSerializePort *port
214  )
215  {
216  FW_ASSERT(portNum < this->getNum_timeCaller_OutputPorts(),static_cast<AssertArg>(portNum));
217  return this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
218  }
219 
222  NATIVE_INT_TYPE portNum,
223  Fw::InputSerializePort *port
224  )
225  {
226  FW_ASSERT(portNum < this->getNum_bufferSendOut_OutputPorts(),static_cast<AssertArg>(portNum));
227  return this->m_bufferSendOut_OutputPort[portNum].registerSerialPort(port);
228  }
229 
232  NATIVE_INT_TYPE portNum,
233  Fw::InputSerializePort *port
234  )
235  {
236  FW_ASSERT(portNum < this->getNum_tlmOut_OutputPorts(),static_cast<AssertArg>(portNum));
237  return this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
238  }
239 
242  NATIVE_INT_TYPE portNum,
243  Fw::InputSerializePort *port
244  )
245  {
246  FW_ASSERT(portNum < this->getNum_cmdResponseOut_OutputPorts(),static_cast<AssertArg>(portNum));
247  return this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
248  }
249 
252  NATIVE_INT_TYPE portNum,
253  Fw::InputSerializePort *port
254  )
255  {
256  FW_ASSERT(portNum < this->getNum_cmdRegOut_OutputPorts(),static_cast<AssertArg>(portNum));
257  return this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
258  }
259 
262  NATIVE_INT_TYPE portNum,
263  Fw::InputSerializePort *port
264  )
265  {
266  FW_ASSERT(portNum < this->getNum_eventOut_OutputPorts(),static_cast<AssertArg>(portNum));
267  return this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
268  }
269 
272  NATIVE_INT_TYPE portNum,
273  Fw::InputSerializePort *port
274  )
275  {
276  FW_ASSERT(portNum < this->getNum_pingOut_OutputPorts(),static_cast<AssertArg>(portNum));
277  return this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
278  }
279 
280 #if FW_ENABLE_TEXT_LOGGING == 1
281  void FileDownlinkComponentBase ::
282  set_LogText_OutputPort(
283  NATIVE_INT_TYPE portNum,
284  Fw::InputSerializePort *port
285  )
286  {
287  FW_ASSERT(portNum < this->getNum_LogText_OutputPorts(),static_cast<AssertArg>(portNum));
288  return this->m_LogText_OutputPort[portNum].registerSerialPort(port);
289  }
290 #endif
291 
292 #endif
293 
294  // ----------------------------------------------------------------------
295  // Command registration
296  // ----------------------------------------------------------------------
297 
299  regCommands(void)
300  {
301  FW_ASSERT(this->m_cmdRegOut_OutputPort[0].isConnected());
303  this->getIdBase() + OPCODE_FILEDOWNLINK_SENDFILE
304  );
307  );
308  }
309 
310  // ----------------------------------------------------------------------
311  // Component construction, initialization, and destruction
312  // ----------------------------------------------------------------------
313 
315 #if FW_OBJECT_NAMES == 1
316  FileDownlinkComponentBase(const char* compName) :
317  Fw::ActiveComponentBase(compName)
318 #else
320  Fw::ActiveComponentBase()
321 #endif
322  {
323 
324 
325 
326  }
327 
329  init(
330  NATIVE_INT_TYPE queueDepth,
331  NATIVE_INT_TYPE instance
332  )
333  {
334 
335  // Initialize base class
337 
338  // Connect input port cmdIn
339  for (
340  NATIVE_INT_TYPE port = 0;
341  port < this->getNum_cmdIn_InputPorts();
342  port++
343  ) {
344 
345  this->m_cmdIn_InputPort[port].init();
346  this->m_cmdIn_InputPort[port].addCallComp(
347  this,
348  m_p_cmdIn_in
349  );
350  this->m_cmdIn_InputPort[port].setPortNum(port);
351 
352 #if FW_OBJECT_NAMES == 1
353  char portName[120];
354  (void) snprintf(
355  portName,
356  sizeof(portName),
357  "%s_cmdIn_InputPort[%d]",
358  this->m_objName,
359  port
360  );
361  this->m_cmdIn_InputPort[port].setObjName(portName);
362 #endif
363 
364  }
365 
366  // Connect input port pingIn
367  for (
368  NATIVE_INT_TYPE port = 0;
369  port < this->getNum_pingIn_InputPorts();
370  port++
371  ) {
372 
373  this->m_pingIn_InputPort[port].init();
374  this->m_pingIn_InputPort[port].addCallComp(
375  this,
377  );
378  this->m_pingIn_InputPort[port].setPortNum(port);
379 
380 #if FW_OBJECT_NAMES == 1
381  char portName[120];
382  (void) snprintf(
383  portName,
384  sizeof(portName),
385  "%s_pingIn_InputPort[%d]",
386  this->m_objName,
387  port
388  );
389  this->m_pingIn_InputPort[port].setObjName(portName);
390 #endif
391 
392  }
393 
394  // Initialize output port bufferGetCaller
395  for (
396  NATIVE_INT_TYPE port = 0;
397  port < this->getNum_bufferGetCaller_OutputPorts();
398  port++
399  ) {
400  this->m_bufferGetCaller_OutputPort[port].init();
401 
402 #if FW_OBJECT_NAMES == 1
403  char portName[120];
404  (void) snprintf(
405  portName,
406  sizeof(portName),
407  "%s_bufferGetCaller_OutputPort[%d]",
408  this->m_objName,
409  port
410  );
411  this->m_bufferGetCaller_OutputPort[port].setObjName(portName);
412 #endif
413 
414  }
415 
416  // Initialize output port timeCaller
417  for (
418  NATIVE_INT_TYPE port = 0;
419  port < this->getNum_timeCaller_OutputPorts();
420  port++
421  ) {
422  this->m_timeCaller_OutputPort[port].init();
423 
424 #if FW_OBJECT_NAMES == 1
425  char portName[120];
426  (void) snprintf(
427  portName,
428  sizeof(portName),
429  "%s_timeCaller_OutputPort[%d]",
430  this->m_objName,
431  port
432  );
433  this->m_timeCaller_OutputPort[port].setObjName(portName);
434 #endif
435 
436  }
437 
438  // Initialize output port bufferSendOut
439  for (
440  NATIVE_INT_TYPE port = 0;
441  port < this->getNum_bufferSendOut_OutputPorts();
442  port++
443  ) {
444  this->m_bufferSendOut_OutputPort[port].init();
445 
446 #if FW_OBJECT_NAMES == 1
447  char portName[120];
448  (void) snprintf(
449  portName,
450  sizeof(portName),
451  "%s_bufferSendOut_OutputPort[%d]",
452  this->m_objName,
453  port
454  );
455  this->m_bufferSendOut_OutputPort[port].setObjName(portName);
456 #endif
457 
458  }
459 
460  // Initialize output port tlmOut
461  for (
462  NATIVE_INT_TYPE port = 0;
463  port < this->getNum_tlmOut_OutputPorts();
464  port++
465  ) {
466  this->m_tlmOut_OutputPort[port].init();
467 
468 #if FW_OBJECT_NAMES == 1
469  char portName[120];
470  (void) snprintf(
471  portName,
472  sizeof(portName),
473  "%s_tlmOut_OutputPort[%d]",
474  this->m_objName,
475  port
476  );
477  this->m_tlmOut_OutputPort[port].setObjName(portName);
478 #endif
479 
480  }
481 
482  // Initialize output port cmdResponseOut
483  for (
484  NATIVE_INT_TYPE port = 0;
485  port < this->getNum_cmdResponseOut_OutputPorts();
486  port++
487  ) {
488  this->m_cmdResponseOut_OutputPort[port].init();
489 
490 #if FW_OBJECT_NAMES == 1
491  char portName[120];
492  (void) snprintf(
493  portName,
494  sizeof(portName),
495  "%s_cmdResponseOut_OutputPort[%d]",
496  this->m_objName,
497  port
498  );
499  this->m_cmdResponseOut_OutputPort[port].setObjName(portName);
500 #endif
501 
502  }
503 
504  // Initialize output port cmdRegOut
505  for (
506  NATIVE_INT_TYPE port = 0;
507  port < this->getNum_cmdRegOut_OutputPorts();
508  port++
509  ) {
510  this->m_cmdRegOut_OutputPort[port].init();
511 
512 #if FW_OBJECT_NAMES == 1
513  char portName[120];
514  (void) snprintf(
515  portName,
516  sizeof(portName),
517  "%s_cmdRegOut_OutputPort[%d]",
518  this->m_objName,
519  port
520  );
521  this->m_cmdRegOut_OutputPort[port].setObjName(portName);
522 #endif
523 
524  }
525 
526  // Initialize output port eventOut
527  for (
528  NATIVE_INT_TYPE port = 0;
529  port < this->getNum_eventOut_OutputPorts();
530  port++
531  ) {
532  this->m_eventOut_OutputPort[port].init();
533 
534 #if FW_OBJECT_NAMES == 1
535  char portName[120];
536  (void) snprintf(
537  portName,
538  sizeof(portName),
539  "%s_eventOut_OutputPort[%d]",
540  this->m_objName,
541  port
542  );
543  this->m_eventOut_OutputPort[port].setObjName(portName);
544 #endif
545 
546  }
547 
548  // Initialize output port pingOut
549  for (
550  NATIVE_INT_TYPE port = 0;
551  port < this->getNum_pingOut_OutputPorts();
552  port++
553  ) {
554  this->m_pingOut_OutputPort[port].init();
555 
556 #if FW_OBJECT_NAMES == 1
557  char portName[120];
558  (void) snprintf(
559  portName,
560  sizeof(portName),
561  "%s_pingOut_OutputPort[%d]",
562  this->m_objName,
563  port
564  );
565  this->m_pingOut_OutputPort[port].setObjName(portName);
566 #endif
567 
568  }
569 
570  // Initialize output port LogText
571 #if FW_ENABLE_TEXT_LOGGING == 1
572  for (
573  NATIVE_INT_TYPE port = 0;
574  port < this->getNum_LogText_OutputPorts();
575  port++
576  ) {
577  this->m_LogText_OutputPort[port].init();
578 
579 #if FW_OBJECT_NAMES == 1
580  char portName[120];
581  (void) snprintf(
582  portName,
583  sizeof(portName),
584  "%s_LogText_OutputPort[%d]",
585  this->m_objName,
586  port
587  );
588  this->m_LogText_OutputPort[port].setObjName(portName);
589 #endif
590 
591  }
592 #endif
593 
594  Os::Queue::QueueStatus qStat =
595  this->createQueue(
596  queueDepth,
597  ComponentIpcSerializableBuffer::SERIALIZATION_SIZE
598  );
599  FW_ASSERT(
600  Os::Queue::QUEUE_OK == qStat,
601  static_cast<AssertArg>(qStat)
602  );
603 
604  }
605 
608 
609  }
610 
611  // ----------------------------------------------------------------------
612  // Invocation functions for output ports
613  // ----------------------------------------------------------------------
614 
615  Fw::Buffer FileDownlinkComponentBase ::
616  bufferGetCaller_out(
617  NATIVE_INT_TYPE portNum,
618  U32 size
619  )
620  {
621  FW_ASSERT(portNum < this->getNum_bufferGetCaller_OutputPorts(),static_cast<AssertArg>(portNum));
622  return this->m_bufferGetCaller_OutputPort[portNum].invoke(size);
623  }
624 
627  NATIVE_INT_TYPE portNum,
628  Fw::Buffer &fwBuffer
629  )
630  {
631  FW_ASSERT(portNum < this->getNum_bufferSendOut_OutputPorts(),static_cast<AssertArg>(portNum));
632  this->m_bufferSendOut_OutputPort[portNum].invoke(fwBuffer);
633  }
634 
637  NATIVE_INT_TYPE portNum,
638  U32 key
639  )
640  {
641  FW_ASSERT(portNum < this->getNum_pingOut_OutputPorts(),static_cast<AssertArg>(portNum));
642  this->m_pingOut_OutputPort[portNum].invoke(key);
643  }
644 
645  // ----------------------------------------------------------------------
646  // Getters for numbers of ports
647  // ----------------------------------------------------------------------
648 
649  NATIVE_INT_TYPE FileDownlinkComponentBase ::
650  getNum_bufferGetCaller_OutputPorts(void)
651  {
653  this->m_bufferGetCaller_OutputPort
654  );
655  }
656 
659  {
662  );
663  }
664 
665  NATIVE_INT_TYPE FileDownlinkComponentBase ::
666  getNum_cmdIn_InputPorts(void)
667  {
669  this->m_cmdIn_InputPort
670  );
671  }
672 
675  {
678  );
679  }
680 
683  {
685  this->m_tlmOut_OutputPort
686  );
687  }
688 
691  {
694  );
695  }
696 
699  {
702  );
703  }
704 
707  {
710  );
711  }
712 
715  {
717  this->m_pingIn_InputPort
718  );
719  }
720 
723  {
726  );
727  }
728 
729 #if FW_ENABLE_TEXT_LOGGING == 1
730  NATIVE_INT_TYPE FileDownlinkComponentBase ::
731  getNum_LogText_OutputPorts(void)
732  {
734  this->m_LogText_OutputPort
735  );
736  }
737 #endif
738 
739  // ----------------------------------------------------------------------
740  // Port connection status queries
741  // ----------------------------------------------------------------------
742 
743  bool FileDownlinkComponentBase ::
744  isConnected_bufferGetCaller_OutputPort(NATIVE_INT_TYPE portNum)
745  {
746  FW_ASSERT(
747  portNum < this->getNum_bufferGetCaller_OutputPorts(),
748  static_cast<AssertArg>(portNum)
749  );
750  return this->m_bufferGetCaller_OutputPort[portNum].isConnected();
751  }
752 
755  {
756  FW_ASSERT(
757  portNum < this->getNum_timeCaller_OutputPorts(),
758  static_cast<AssertArg>(portNum)
759  );
761  }
762 
765  {
766  FW_ASSERT(
767  portNum < this->getNum_bufferSendOut_OutputPorts(),
768  static_cast<AssertArg>(portNum)
769  );
771  }
772 
775  {
776  FW_ASSERT(
777  portNum < this->getNum_tlmOut_OutputPorts(),
778  static_cast<AssertArg>(portNum)
779  );
780  return this->m_tlmOut_OutputPort[portNum].isConnected();
781  }
782 
785  {
786  FW_ASSERT(
787  portNum < this->getNum_cmdResponseOut_OutputPorts(),
788  static_cast<AssertArg>(portNum)
789  );
791  }
792 
795  {
796  FW_ASSERT(
797  portNum < this->getNum_cmdRegOut_OutputPorts(),
798  static_cast<AssertArg>(portNum)
799  );
801  }
802 
805  {
806  FW_ASSERT(
807  portNum < this->getNum_eventOut_OutputPorts(),
808  static_cast<AssertArg>(portNum)
809  );
810  return this->m_eventOut_OutputPort[portNum].isConnected();
811  }
812 
815  {
816  FW_ASSERT(
817  portNum < this->getNum_pingOut_OutputPorts(),
818  static_cast<AssertArg>(portNum)
819  );
820  return this->m_pingOut_OutputPort[portNum].isConnected();
821  }
822 
823 #if FW_ENABLE_TEXT_LOGGING == 1
824  bool FileDownlinkComponentBase ::
825  isConnected_LogText_OutputPort(NATIVE_INT_TYPE portNum)
826  {
827  FW_ASSERT(
828  portNum < this->getNum_LogText_OutputPorts(),
829  static_cast<AssertArg>(portNum)
830  );
831  return this->m_LogText_OutputPort[portNum].isConnected();
832  }
833 #endif
834 
835  // ----------------------------------------------------------------------
836  // Calls for messages received on command input ports
837  // ----------------------------------------------------------------------
838 
839  void FileDownlinkComponentBase ::
840  m_p_cmdIn_in(
841  Fw::PassiveComponentBase* callComp,
842  NATIVE_INT_TYPE portNum,
843  FwOpcodeType opCode,
844  U32 cmdSeq,
845  Fw::CmdArgBuffer &args
846  )
847  {
848 
849  // Select base class function based on opcode
850  FW_ASSERT(callComp);
851  FileDownlinkComponentBase* compPtr =
852  (FileDownlinkComponentBase*) callComp;
853 
854  const U32 idBase = callComp->getIdBase();
855  FW_ASSERT(opCode >= idBase, opCode, idBase);
856  switch (opCode - idBase) {
857 
858  case OPCODE_FILEDOWNLINK_SENDFILE:
859  compPtr->FileDownlink_SendFile_cmdHandlerBase(
860  opCode,
861  cmdSeq,
862  args
863  );
864  break;
865 
867  compPtr->FileDownlink_Cancel_cmdHandlerBase(
868  opCode,
869  cmdSeq,
870  args
871  );
872  break;
873 
874  default: {
875  compPtr->cmdResponse_out(
876  opCode,cmdSeq,
878  );
879  break;
880  }
881 
882  }
883 
884  }
885 
886  void FileDownlinkComponentBase ::
887  cmdResponse_out(
888  FwOpcodeType opCode,
889  U32 cmdSeq,
890  Fw::CommandResponse response
891  )
892  {
893  FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
895  }
896 
897  // ----------------------------------------------------------------------
898  // Base class command functions
899  // ----------------------------------------------------------------------
900 
901  void FileDownlinkComponentBase ::
902  FileDownlink_SendFile_cmdHandlerBase(
903  FwOpcodeType opCode,
904  U32 cmdSeq,
905  Fw::CmdArgBuffer &args
906  )
907  {
908 
909  // Call pre-message hook
910  this->FileDownlink_SendFile_preMsgHook(opCode,cmdSeq);
911 
912  // Defer deserializing arguments to the message dispatcher
913  // to avoid deserializing and reserializing just for IPC
914  ComponentIpcSerializableBuffer msg;
916 
917  // Serialize for IPC
918  _status = msg.serialize((NATIVE_INT_TYPE)CMD_FILEDOWNLINK_SENDFILE);
919  FW_ASSERT (
920  _status == Fw::FW_SERIALIZE_OK,
921  static_cast<AssertArg>(_status)
922  );
923 
924  // Fake port number to make message dequeue work
925  NATIVE_INT_TYPE port = 0;
926  _status = msg.serialize(port);
927  FW_ASSERT (
928  _status == Fw::FW_SERIALIZE_OK,
929  static_cast<AssertArg>(_status)
930  );
931 
932  _status = msg.serialize(opCode);
933  FW_ASSERT (
934  _status == Fw::FW_SERIALIZE_OK,
935  static_cast<AssertArg>(_status)
936  );
937 
938  _status = msg.serialize(cmdSeq);
939  FW_ASSERT (
940  _status == Fw::FW_SERIALIZE_OK,
941  static_cast<AssertArg>(_status)
942  );
943 
944  _status = msg.serialize(args);
945  FW_ASSERT (
946  _status == Fw::FW_SERIALIZE_OK,
947  static_cast<AssertArg>(_status)
948  );
949 
950  // send message
951  Os::Queue::QueueBlocking _block =
953  Os::Queue::QueueStatus qStatus =
954  this->m_queue.send(msg, 0,_block);
955  FW_ASSERT(
956  qStatus == Os::Queue::QUEUE_OK,
957  static_cast<AssertArg>(qStatus)
958  );
959 
960  }
961 
962  void FileDownlinkComponentBase::
963  FileDownlink_SendFile_preMsgHook(
964  FwOpcodeType opCode,
965  U32 cmdSeq
966  )
967  {
968  // Defaults to no-op; can be overridden
969  }
970 
973  FwOpcodeType opCode,
974  U32 cmdSeq,
975  Fw::CmdArgBuffer &args
976  )
977  {
978 
979 #if FW_CMD_CHECK_RESIDUAL
980  // Make sure there was no data left over.
981  // That means the argument buffer size was incorrect.
982  if (args.getBuffLeft() != 0) {
983  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
985  opCode,
987  );
988  }
989  return;
990  }
991 #endif
993 
994  }
995 
996  // ----------------------------------------------------------------------
997  // Telemetry write functions
998  // ----------------------------------------------------------------------
999 
1000  void FileDownlinkComponentBase ::
1001  tlmWrite_FileDownlink_FilesSent(U32 arg)
1002  {
1003 
1004  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1005  Fw::Time _tlmTime;
1006  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1007  this->m_timeCaller_OutputPort[0].invoke( _tlmTime);
1008  }
1009  Fw::TlmBuffer _tlmBuff;
1010  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1011  FW_ASSERT(
1012  _stat == Fw::FW_SERIALIZE_OK,
1013  static_cast<AssertArg>(_stat)
1014  );
1015 
1016  FwChanIdType _id;
1017 
1018  _id = this->getIdBase() + CHANNELID_FILEDOWNLINK_FILESSENT;
1019 
1020  this->m_tlmOut_OutputPort[0].invoke(
1021  _id,
1022  _tlmTime,
1023  _tlmBuff
1024  );
1025  }
1026 
1027  }
1028 
1031  {
1032 
1033  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1034  Fw::Time _tlmTime;
1035  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1036  this->m_timeCaller_OutputPort[0].invoke( _tlmTime);
1037  }
1038  Fw::TlmBuffer _tlmBuff;
1039  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1040  FW_ASSERT(
1041  _stat == Fw::FW_SERIALIZE_OK,
1042  static_cast<AssertArg>(_stat)
1043  );
1044 
1045  FwChanIdType _id;
1046 
1048 
1049  this->m_tlmOut_OutputPort[0].invoke(
1050  _id,
1051  _tlmTime,
1052  _tlmBuff
1053  );
1054  }
1055 
1056  }
1057 
1060  {
1061 
1062  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1063  Fw::Time _tlmTime;
1064  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1065  this->m_timeCaller_OutputPort[0].invoke( _tlmTime);
1066  }
1067  Fw::TlmBuffer _tlmBuff;
1068  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1069  FW_ASSERT(
1070  _stat == Fw::FW_SERIALIZE_OK,
1071  static_cast<AssertArg>(_stat)
1072  );
1073 
1074  FwChanIdType _id;
1075 
1077 
1078  this->m_tlmOut_OutputPort[0].invoke(
1079  _id,
1080  _tlmTime,
1081  _tlmBuff
1082  );
1083  }
1084 
1085  }
1086 
1087  // ----------------------------------------------------------------------
1088  // Time
1089  // ----------------------------------------------------------------------
1090 
1091  Fw::Time FileDownlinkComponentBase ::
1092  getTime(void)
1093  {
1094  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1095  Fw::Time _time;
1096  this->m_timeCaller_OutputPort[0].invoke(_time);
1097  return _time;
1098  } else {
1099  return Fw::Time(TB_NONE,0,0);
1100  }
1101  }
1102 
1103  // ----------------------------------------------------------------------
1104  // Event handling functions
1105  // ----------------------------------------------------------------------
1106 
1107  void FileDownlinkComponentBase ::
1108  log_WARNING_HI_FileDownlink_FileOpenError(
1109  Fw::LogStringArg& fileName
1110  )
1111  {
1112 
1113 
1114  // Get the time
1115  Fw::Time _logTime;
1116  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1117  this->m_timeCaller_OutputPort[0].invoke( _logTime);
1118  }
1119 
1120  FwEventIdType _id = static_cast<FwEventIdType>(0);
1121 
1122  _id = this->getIdBase() + EVENTID_FILEDOWNLINK_FILEOPENERROR;
1123 
1124  // Emit the event on the log port
1125  if (this->m_eventOut_OutputPort[0].isConnected()) {
1126 
1127  Fw::LogBuffer _logBuff;
1129 
1130 #if FW_AMPCS_COMPATIBLE
1131  // Serialize the number of arguments
1132  _status = _logBuff.serialize(static_cast<U8>(1));
1133  FW_ASSERT(
1134  _status == Fw::FW_SERIALIZE_OK,
1135  static_cast<AssertArg>(_status)
1136  );
1137 #endif
1138 
1139  fileName.setMaxSerialize(60);
1140  _status = _logBuff.serialize(fileName);
1141  FW_ASSERT(
1142  _status == Fw::FW_SERIALIZE_OK,
1143  static_cast<AssertArg>(_status)
1144  );
1145 
1146 
1147  this->m_eventOut_OutputPort[0].invoke(
1148  _id,
1149  _logTime,Fw::LOG_WARNING_HI,
1150  _logBuff
1151  );
1152 
1153  }
1154 
1155  // Emit the event on the text log port
1156 #if FW_ENABLE_TEXT_LOGGING
1157  if (this->m_LogText_OutputPort[0].isConnected()) {
1158 
1159 #if FW_OBJECT_NAMES == 1
1160  const char* _formatString =
1161  "(%s) %s: Could not open file %s";
1162 #else
1163  const char* _formatString =
1164  "%s: Could not open file %s";
1165 #endif
1166 
1167  char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
1168 
1169  (void) snprintf(
1170  _textBuffer,
1172  _formatString,
1173 #if FW_OBJECT_NAMES == 1
1174  this->m_objName,
1175 #endif
1176  "FileDownlink_FileOpenError "
1177  , fileName.toChar()
1178  );
1179 
1180  // Null terminate
1181  _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
1182  Fw::TextLogString _logString = _textBuffer;
1183  this->m_LogText_OutputPort[0].invoke(
1184  _id,
1185  _logTime,Fw::TEXT_LOG_WARNING_HI,
1186  _logString
1187  );
1188 
1189  }
1190 #endif
1191 
1192  }
1193 
1194 
1197  Fw::LogStringArg& fileName
1198  )
1199  {
1200 
1201 
1202  // Get the time
1203  Fw::Time _logTime;
1204  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1205  this->m_timeCaller_OutputPort[0].invoke( _logTime);
1206  }
1207 
1208  FwEventIdType _id = static_cast<FwEventIdType>(0);
1209 
1211 
1212  // Emit the event on the log port
1213  if (this->m_eventOut_OutputPort[0].isConnected()) {
1214 
1215  Fw::LogBuffer _logBuff;
1217 
1218 #if FW_AMPCS_COMPATIBLE
1219  // Serialize the number of arguments
1220  _status = _logBuff.serialize(static_cast<U8>(1));
1221  FW_ASSERT(
1222  _status == Fw::FW_SERIALIZE_OK,
1223  static_cast<AssertArg>(_status)
1224  );
1225 #endif
1226 
1227  fileName.setMaxSerialize(60);
1228  _status = _logBuff.serialize(fileName);
1229  FW_ASSERT(
1230  _status == Fw::FW_SERIALIZE_OK,
1231  static_cast<AssertArg>(_status)
1232  );
1233 
1234 
1235  this->m_eventOut_OutputPort[0].invoke(
1236  _id,
1237  _logTime,Fw::LOG_WARNING_HI,
1238  _logBuff
1239  );
1240 
1241  }
1242 
1243  // Emit the event on the text log port
1244 #if FW_ENABLE_TEXT_LOGGING
1245  if (this->m_LogText_OutputPort[0].isConnected()) {
1246 
1247 #if FW_OBJECT_NAMES == 1
1248  const char* _formatString =
1249  "(%s) %s: Could not read file %s";
1250 #else
1251  const char* _formatString =
1252  "%s: Could not read file %s";
1253 #endif
1254 
1255  char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
1256 
1257  (void) snprintf(
1258  _textBuffer,
1260  _formatString,
1261 #if FW_OBJECT_NAMES == 1
1262  this->m_objName,
1263 #endif
1264  "FileDownlink_FileReadError "
1265  , fileName.toChar()
1266  );
1267 
1268  // Null terminate
1269  _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
1270  Fw::TextLogString _logString = _textBuffer;
1271  this->m_LogText_OutputPort[0].invoke(
1272  _id,
1273  _logTime,Fw::TEXT_LOG_WARNING_HI,
1274  _logString
1275  );
1276 
1277  }
1278 #endif
1279 
1280  }
1281 
1282 
1285  Fw::LogStringArg& sourceFileName, Fw::LogStringArg& destFileName
1286  )
1287  {
1288 
1289 
1290  // Get the time
1291  Fw::Time _logTime;
1292  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1293  this->m_timeCaller_OutputPort[0].invoke( _logTime);
1294  }
1295 
1296  FwEventIdType _id = static_cast<FwEventIdType>(0);
1297 
1298  _id = this->getIdBase() + EVENTID_FILEDOWNLINK_FILESENT;
1299 
1300  // Emit the event on the log port
1301  if (this->m_eventOut_OutputPort[0].isConnected()) {
1302 
1303  Fw::LogBuffer _logBuff;
1305 
1306 #if FW_AMPCS_COMPATIBLE
1307  // Serialize the number of arguments
1308  _status = _logBuff.serialize(static_cast<U8>(2));
1309  FW_ASSERT(
1310  _status == Fw::FW_SERIALIZE_OK,
1311  static_cast<AssertArg>(_status)
1312  );
1313 #endif
1314 
1315  sourceFileName.setMaxSerialize(60);
1316  _status = _logBuff.serialize(sourceFileName);
1317  FW_ASSERT(
1318  _status == Fw::FW_SERIALIZE_OK,
1319  static_cast<AssertArg>(_status)
1320  );
1321 
1322  destFileName.setMaxSerialize(60);
1323  _status = _logBuff.serialize(destFileName);
1324  FW_ASSERT(
1325  _status == Fw::FW_SERIALIZE_OK,
1326  static_cast<AssertArg>(_status)
1327  );
1328 
1329 
1330  this->m_eventOut_OutputPort[0].invoke(
1331  _id,
1332  _logTime,Fw::LOG_ACTIVITY_HI,
1333  _logBuff
1334  );
1335 
1336  }
1337 
1338  // Emit the event on the text log port
1339 #if FW_ENABLE_TEXT_LOGGING
1340  if (this->m_LogText_OutputPort[0].isConnected()) {
1341 
1342 #if FW_OBJECT_NAMES == 1
1343  const char* _formatString =
1344  "(%s) %s: Sent file %s to file %s";
1345 #else
1346  const char* _formatString =
1347  "%s: Sent file %s to file %s";
1348 #endif
1349 
1350  char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
1351 
1352  (void) snprintf(
1353  _textBuffer,
1355  _formatString,
1356 #if FW_OBJECT_NAMES == 1
1357  this->m_objName,
1358 #endif
1359  "FileDownlink_FileSent "
1361  , destFileName.toChar()
1362  );
1363 
1364  // Null terminate
1365  _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
1366  Fw::TextLogString _logString = _textBuffer;
1367  this->m_LogText_OutputPort[0].invoke(
1368  _id,
1369  _logTime,Fw::TEXT_LOG_ACTIVITY_HI,
1370  _logString
1371  );
1372 
1373  }
1374 #endif
1375 
1376  }
1377 
1378 
1381  Fw::LogStringArg& sourceFileName, Fw::LogStringArg& destFileName
1382  )
1383  {
1384 
1385 
1386  // Get the time
1387  Fw::Time _logTime;
1388  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1389  this->m_timeCaller_OutputPort[0].invoke( _logTime);
1390  }
1391 
1392  FwEventIdType _id = static_cast<FwEventIdType>(0);
1393 
1395 
1396  // Emit the event on the log port
1397  if (this->m_eventOut_OutputPort[0].isConnected()) {
1398 
1399  Fw::LogBuffer _logBuff;
1401 
1402 #if FW_AMPCS_COMPATIBLE
1403  // Serialize the number of arguments
1404  _status = _logBuff.serialize(static_cast<U8>(2));
1405  FW_ASSERT(
1406  _status == Fw::FW_SERIALIZE_OK,
1407  static_cast<AssertArg>(_status)
1408  );
1409 #endif
1410 
1411  sourceFileName.setMaxSerialize(60);
1412  _status = _logBuff.serialize(sourceFileName);
1413  FW_ASSERT(
1414  _status == Fw::FW_SERIALIZE_OK,
1415  static_cast<AssertArg>(_status)
1416  );
1417 
1418  destFileName.setMaxSerialize(60);
1419  _status = _logBuff.serialize(destFileName);
1420  FW_ASSERT(
1421  _status == Fw::FW_SERIALIZE_OK,
1422  static_cast<AssertArg>(_status)
1423  );
1424 
1425 
1426  this->m_eventOut_OutputPort[0].invoke(
1427  _id,
1428  _logTime,Fw::LOG_ACTIVITY_HI,
1429  _logBuff
1430  );
1431 
1432  }
1433 
1434  // Emit the event on the text log port
1435 #if FW_ENABLE_TEXT_LOGGING
1436  if (this->m_LogText_OutputPort[0].isConnected()) {
1437 
1438 #if FW_OBJECT_NAMES == 1
1439  const char* _formatString =
1440  "(%s) %s: Canceled downlink of file %s to file %s";
1441 #else
1442  const char* _formatString =
1443  "%s: Canceled downlink of file %s to file %s";
1444 #endif
1445 
1446  char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
1447 
1448  (void) snprintf(
1449  _textBuffer,
1451  _formatString,
1452 #if FW_OBJECT_NAMES == 1
1453  this->m_objName,
1454 #endif
1455  "FileDownlink_DownlinkCanceled "
1457  , destFileName.toChar()
1458  );
1459 
1460  // Null terminate
1461  _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
1462  Fw::TextLogString _logString = _textBuffer;
1463  this->m_LogText_OutputPort[0].invoke(
1464  _id,
1465  _logTime,Fw::TEXT_LOG_ACTIVITY_HI,
1466  _logString
1467  );
1468 
1469  }
1470 #endif
1471 
1472  }
1473 
1474 
1475  // ----------------------------------------------------------------------
1476  // Calls for invocations received on typed input ports
1477  // ----------------------------------------------------------------------
1478 
1481  Fw::PassiveComponentBase* callComp,
1482  NATIVE_INT_TYPE portNum,
1483  U32 key
1484  )
1485  {
1486  FW_ASSERT(callComp);
1487  FileDownlinkComponentBase* compPtr =
1488  (FileDownlinkComponentBase*) callComp;
1489  compPtr->pingIn_handlerBase(portNum, key);
1490  }
1491 
1492  // ----------------------------------------------------------------------
1493  // Port handler base-class functions for typed input ports
1494  // ----------------------------------------------------------------------
1495 
1496  void FileDownlinkComponentBase ::
1497  pingIn_handlerBase(
1498  NATIVE_INT_TYPE portNum,
1499  U32 key
1500  )
1501  {
1502 
1503  // Make sure port number is valid
1504  FW_ASSERT(portNum < this->getNum_pingIn_InputPorts(),static_cast<AssertArg>(portNum));
1505 
1506  // Call pre-message hook
1507  pingIn_preMsgHook(
1508  portNum,
1509  key
1510  );
1511 
1512  ComponentIpcSerializableBuffer msg;
1514 
1515  _status = msg.serialize(
1516  static_cast<NATIVE_INT_TYPE>(PINGIN_PING)
1517  );
1518  FW_ASSERT (
1519  _status == Fw::FW_SERIALIZE_OK,
1520  static_cast<AssertArg>(_status)
1521  );
1522 
1523  _status = msg.serialize(portNum);
1524  FW_ASSERT (
1525  _status == Fw::FW_SERIALIZE_OK,
1526  static_cast<AssertArg>(_status)
1527  );
1528 
1529  // Serialize argument key
1530  _status = msg.serialize(key);
1531  FW_ASSERT(
1532  _status == Fw::FW_SERIALIZE_OK,
1533  static_cast<AssertArg>(_status)
1534  );
1535 
1536 
1537  // send message
1538  Os::Queue::QueueBlocking _block =
1540  Os::Queue::QueueStatus qStatus =
1541  this->m_queue.send(msg, 0,_block);
1542  FW_ASSERT(
1543  qStatus == Os::Queue::QUEUE_OK,
1544  static_cast<AssertArg>(qStatus)
1545  );
1546 
1547  }
1548 
1549  // ----------------------------------------------------------------------
1550  // Pre-message hooks for async input ports
1551  // ----------------------------------------------------------------------
1552 
1553  void FileDownlinkComponentBase ::
1554  pingIn_preMsgHook(
1555  NATIVE_INT_TYPE portNum,
1556  U32 key
1557  )
1558  {
1559  // Default: no-op
1560  }
1561 
1562  // ----------------------------------------------------------------------
1563  // Message dispatch method for active and queued components. Called
1564  // by active component thread or implementation code for queued components
1565  // ----------------------------------------------------------------------
1566 
1568  doDispatch(void)
1569  {
1570  ComponentIpcSerializableBuffer msg;
1571  NATIVE_INT_TYPE priority;
1572 
1573  Os::Queue::QueueStatus msgStatus = this->m_queue.receive(msg,priority,Os::Queue::QUEUE_BLOCKING);
1574  FW_ASSERT(
1575  msgStatus == Os::Queue::QUEUE_OK,
1576  static_cast<AssertArg>(msgStatus)
1577  );
1578 
1579  // Reset to beginning of buffer
1580  msg.resetDeser();
1581 
1582  NATIVE_INT_TYPE desMsg;
1583  Fw::SerializeStatus deserStatus = msg.deserialize(desMsg);
1584  FW_ASSERT(
1585  deserStatus == Fw::FW_SERIALIZE_OK,
1586  static_cast<AssertArg>(deserStatus)
1587  );
1588 
1589  MsgTypeEnum msgType = static_cast<MsgTypeEnum>(desMsg);
1590 
1591  if (msgType == FILEDOWNLINK_COMPONENT_EXIT) {
1592  return MSG_DISPATCH_EXIT;
1593  }
1594 
1596  deserStatus = msg.deserialize(portNum);
1597  FW_ASSERT(
1598  deserStatus == Fw::FW_SERIALIZE_OK,
1599  static_cast<AssertArg>(deserStatus)
1600  );
1601 
1602  switch (msgType) {
1603 
1604  // Handle async input port pingIn
1605  case PINGIN_PING: {
1606 
1607  // Deserialize argument key
1608  U32 key;
1609  deserStatus = msg.deserialize(key);
1610  FW_ASSERT(
1611  deserStatus == Fw::FW_SERIALIZE_OK,
1612  static_cast<AssertArg>(deserStatus)
1613  );
1614 
1615  // Call handler function
1616  this->pingIn_handler(
1617  portNum,
1618  key
1619  );
1620 
1621  break;
1622 
1623  }
1624 
1625  // Handle command FileDownlink_SendFile
1626  case CMD_FILEDOWNLINK_SENDFILE: {
1627  // Deserialize opcode
1629  deserStatus = msg.deserialize(opCode);
1630  FW_ASSERT (
1631  deserStatus == Fw::FW_SERIALIZE_OK,
1632  static_cast<AssertArg>(deserStatus)
1633  );
1634 
1635  // Deserialize command sequence
1636  U32 cmdSeq;
1637  deserStatus = msg.deserialize(cmdSeq);
1638  FW_ASSERT (
1639  deserStatus == Fw::FW_SERIALIZE_OK,
1640  static_cast<AssertArg>(deserStatus)
1641  );
1642 
1643  // Deserialize command argument buffer
1645  deserStatus = msg.deserialize(args);
1646  FW_ASSERT (
1647  deserStatus == Fw::FW_SERIALIZE_OK,
1648  static_cast<AssertArg>(deserStatus)
1649  );
1650 
1651  // Reset buffer
1652  args.resetDeser();
1653 
1654  // Deserialize argument sourceFileName
1656  deserStatus = args.deserialize(sourceFileName);
1657  if (deserStatus != Fw::FW_SERIALIZE_OK) {
1658  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
1659  this->cmdResponse_out(
1660  opCode,
1661  cmdSeq,
1663  );
1664  }
1665  // Don't crash the task if bad arguments were passed from the ground
1666  break;
1667  }
1668 
1669  // Deserialize argument destFileName
1671  deserStatus = args.deserialize(destFileName);
1672  if (deserStatus != Fw::FW_SERIALIZE_OK) {
1673  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
1674  this->cmdResponse_out(
1675  opCode,
1676  cmdSeq,
1678  );
1679  }
1680  // Don't crash the task if bad arguments were passed from the ground
1681  break;
1682  }
1683 
1684  // Make sure there was no data left over.
1685  // That means the argument buffer size was incorrect.
1686 #if FW_CMD_CHECK_RESIDUAL
1687  if (args.getBuffLeft() != 0) {
1688  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
1689  this->cmdResponse_out(opCode,cmdSeq,Fw::COMMAND_FORMAT_ERROR);
1690  }
1691  // Don't crash the task if bad arguments were passed from the ground
1692  break;
1693  }
1694 #endif
1695  // Call handler function
1696  this->FileDownlink_SendFile_cmdHandler(
1697  opCode,
1698  cmdSeq,
1700  );
1701 
1702  break;
1703 
1704  }
1705 
1706  default:
1707  return MSG_DISPATCH_ERROR;
1708 
1709  }
1710 
1711  return MSG_DISPATCH_OK;
1712 
1713  }
1714 
1715 } // end namespace Svc
Fw::TEXT_LOG_ACTIVITY_HI
@ TEXT_LOG_ACTIVITY_HI
Definition: LogTextPortAc.hpp:31
Fw::OutputCmdRegPort::init
void init(void)
Definition: CmdRegPortAc.cpp:89
Fw::TextLogString
Definition: TextLogString.hpp:11
Fw::InputTimePort
Definition: TimePortAc.hpp:28
Svc::InputPingPort::SERIALIZED_SIZE
@ SERIALIZED_SIZE
serialized size of port arguments
Definition: PingPortAc.hpp:30
Fw::InputTlmPort
Definition: TlmPortAc.hpp:29
Fw::PassiveComponentBase::getIdBase
U32 getIdBase(void) const
Definition: PassiveComponentBase.cpp:40
Fw::Time
Definition: Time.hpp:10
Fw::QueuedComponentBase::doDispatch
virtual MsgDispatchStatus doDispatch(void)=0
method to dispatch a single message in the queue.
Fw::OutputCmdResponsePort::addCallPort
void addCallPort(InputCmdResponsePort *callPort)
Definition: CmdResponsePortAc.cpp:105
Fw::SerializeBufferBase
Definition: Serializable.hpp:43
Fw::SerializeStatus
SerializeStatus
forward declaration for string
Definition: Serializable.hpp:14
Fw::TlmBuffer
Definition: TlmBuffer.hpp:21
Fw::CommandResponse
CommandResponse
Definition: CmdResponsePortAc.hpp:24
FwChanIdType
#define FwChanIdType
Type representation for a channel id.
Definition: FpConfig.hpp:66
Fw::SerializeBufferBase::resetDeser
void resetDeser(void)
reset deserialization to beginning
Definition: Serializable.cpp:575
Fw::PortBase::isConnected
bool isConnected(void)
Definition: PortBase.cpp:40
Fw::CmdStringArg::toChar
const char * toChar(void) const
Definition: CmdString.cpp:34
Fw::OutputLogPort::invoke
void invoke(FwEventIdType id, Fw::Time &timeTag, LogSeverity severity, LogBuffer &args)
Definition: LogPortAc.cpp:121
Fw::OutputCmdRegPort::addCallPort
void addCallPort(InputCmdRegPort *callPort)
Definition: CmdRegPortAc.cpp:93
Fw::LOG_WARNING_HI
@ LOG_WARNING_HI
Definition: LogPortAc.hpp:28
FW_OBJECT_NAMES
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects)
Definition: FpConfig.hpp:91
Fw::SerializeBufferBase::serialize
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
Definition: Serializable.cpp:67
FW_NUM_ARRAY_ELEMENTS
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition: BasicTypes.hpp:103
Fw::LogStringArg
Definition: LogString.hpp:11
U8
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.hpp:76
Svc::InputPingPort::init
void init(void)
initialization function
Definition: PingPortAc.cpp:38
Fw::OutputBufferSendPort::init
void init(void)
Definition: BufferSendPortAc.cpp:89
Fw::InputCmdRegPort
Definition: CmdRegPortAc.hpp:27
Svc::OutputPingPort::init
void init(void)
Definition: PingPortAc.cpp:89
Os::Queue::QueueStatus
QueueStatus
Definition: Queue.hpp:27
Fw::COMMAND_FORMAT_ERROR
@ COMMAND_FORMAT_ERROR
Definition: CmdResponsePortAc.hpp:28
Fw::QueuedComponentBase::m_queue
Os::Queue m_queue
queue object for active component
Definition: QueuedComponentBase.hpp:36
Fw::LogBuffer
Definition: LogBuffer.hpp:22
Svc::OutputPingPort::invoke
void invoke(U32 key)
Definition: PingPortAc.cpp:103
Fw::OutputBufferSendPort::addCallPort
void addCallPort(InputBufferSendPort *callPort)
Definition: BufferSendPortAc.cpp:93
Fw::Buffer
Definition: BufferSerializableAc.hpp:24
Fw::CmdStringArg
Definition: CmdString.hpp:11
Fw::TEXT_LOG_WARNING_HI
@ TEXT_LOG_WARNING_HI
Definition: LogTextPortAc.hpp:28
Assert.hpp
Fw::FW_SERIALIZE_OK
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.
Definition: Serializable.hpp:15
Os::Queue::send
QueueStatus send(const Fw::SerializeBufferBase &buffer, NATIVE_INT_TYPE priority, QueueBlocking block)
send a message
Definition: QueueCommon.cpp:13
Fw::SerializeBufferBase::getBuffLeft
NATIVE_UINT_TYPE getBuffLeft() const
returns how much deserialization buffer is left
Definition: Serializable.cpp:619
Fw::LogStringArg::toChar
const char * toChar(void) const
Definition: LogString.cpp:38
Svc::OutputPingPort::addCallPort
void addCallPort(InputPingPort *callPort)
Definition: PingPortAc.cpp:93
EightyCharString.hpp
Fw::PassiveComponentBase
Definition: PassiveComponentBase.hpp:10
Fw::OutputLogPort::init
void init(void)
Definition: LogPortAc.cpp:107
Fw::OutputTimePort::init
void init(void)
Definition: TimePortAc.cpp:89
Fw::ObjBase::init
void init(void)
Object initializer.
Definition: ObjBase.cpp:26
Os::Queue::QueueBlocking
QueueBlocking
Definition: Queue.hpp:40
Fw::QueuedComponentBase::MSG_DISPATCH_OK
@ MSG_DISPATCH_OK
Dispatch was normal.
Definition: QueuedComponentBase.hpp:26
BYTE
U8 BYTE
byte type
Definition: BasicTypes.hpp:77
Os::Queue::receive
QueueStatus receive(Fw::SerializeBufferBase &buffer, NATIVE_INT_TYPE &priority, QueueBlocking block)
receive a message
Definition: QueueCommon.cpp:22
Svc::InputPingPort
Definition: PingPortAc.hpp:27
Fw::OutputTlmPort::addCallPort
void addCallPort(InputTlmPort *callPort)
Definition: TlmPortAc.cpp:105
Fw::OutputCmdRegPort::invoke
void invoke(FwOpcodeType opCode)
Definition: CmdRegPortAc.cpp:103
Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT
@ ACTIVE_COMPONENT_EXIT
message to exit active component task
Definition: ActiveComponentBase.hpp:27
Fw::InputBufferGetPort
Definition: BufferGetPortAc.hpp:28
FwOpcodeType
#define FwOpcodeType
Type representation for a command opcode.
Definition: FpConfig.hpp:62
Fw::OutputBufferSendPort::invoke
void invoke(Fw::Buffer &fwBuffer)
Definition: BufferSendPortAc.cpp:103
Fw::QueuedComponentBase::MsgDispatchStatus
MsgDispatchStatus
Definition: QueuedComponentBase.hpp:25
NATIVE_UINT_TYPE
unsigned int NATIVE_UINT_TYPE
native unsigned integer type declaration
Definition: BasicTypes.hpp:30
Fw::OutputTimePort::invoke
void invoke(Fw::Time &time)
Definition: TimePortAc.cpp:103
Fw::OutputTlmPort::invoke
void invoke(FwChanIdType id, Fw::Time &timeTag, TlmBuffer &val)
Definition: TlmPortAc.cpp:115
Fw::CmdArgBuffer
Definition: CmdArgBuffer.hpp:22
Fw::InputBufferSendPort
Definition: BufferSendPortAc.hpp:28
Fw::OutputCmdResponsePort::init
void init(void)
Definition: CmdResponsePortAc.cpp:101
Fw::COMMAND_INVALID_OPCODE
@ COMMAND_INVALID_OPCODE
Definition: CmdResponsePortAc.hpp:26
FW_ASSERT
#define FW_ASSERT(...)
Definition: Assert.hpp:9
Fw::OutputCmdResponsePort::invoke
void invoke(FwOpcodeType opCode, U32 cmdSeq, CommandResponse response)
Definition: CmdResponsePortAc.cpp:115
Fw::QueuedComponentBase::MSG_DISPATCH_ERROR
@ MSG_DISPATCH_ERROR
Errors dispatching messages.
Definition: QueuedComponentBase.hpp:28
Fw::LOG_ACTIVITY_HI
@ LOG_ACTIVITY_HI
Definition: LogPortAc.hpp:31
Os::Queue::QUEUE_OK
@ QUEUE_OK
message sent/received okay
Definition: Queue.hpp:28
Fw::LogStringArg::setMaxSerialize
void setMaxSerialize(NATIVE_UINT_TYPE size)
Definition: LogString.cpp:106
Fw::SerializeBufferBase::deserialize
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
Definition: Serializable.cpp:292
Fw::OutputTlmPort::init
void init(void)
Definition: TlmPortAc.cpp:101
Fw::InputCmdPort
Definition: CmdPortAc.hpp:28
FpConfig.hpp
ISF configuration file.
Fw::InputPortBase::setPortNum
void setPortNum(NATIVE_INT_TYPE portNum)
Definition: InputPortBase.cpp:25
Fw::OutputLogPort::addCallPort
void addCallPort(InputLogPort *callPort)
Definition: LogPortAc.cpp:111
Fw::QueuedComponentBase::MSG_DISPATCH_EXIT
@ MSG_DISPATCH_EXIT
A message was sent requesting an exit of the loop.
Definition: QueuedComponentBase.hpp:29
Svc
Definition: ActiveLoggerComponentAc.cpp:22
Os::Queue::QUEUE_NONBLOCKING
@ QUEUE_NONBLOCKING
Queue receive always returns even if there is no message.
Definition: Queue.hpp:42
Fw::InputCmdResponsePort
Definition: CmdResponsePortAc.hpp:37
Fw::InputLogPort
Definition: LogPortAc.hpp:40
FwEventIdType
#define FwEventIdType
Type representation for a event id.
Definition: FpConfig.hpp:70
NATIVE_INT_TYPE
int NATIVE_INT_TYPE
native integer type declaration
Definition: BasicTypes.hpp:29
AssertArg
#define AssertArg
Definition: FpConfig.hpp:51
Fw::QueuedComponentBase::createQueue
Os::Queue::QueueStatus createQueue(NATIVE_INT_TYPE depth, NATIVE_INT_TYPE msgSize)
Definition: QueuedComponentBase.cpp:29
TB_NONE
@ TB_NONE
No time base has been established.
Definition: FpConfig.hpp:324
Fw::InputCmdPort::SERIALIZED_SIZE
@ SERIALIZED_SIZE
serialized size of port arguments
Definition: CmdPortAc.hpp:31
Fw
Definition: BufferGetPortAc.cpp:6
Fw::OutputTimePort::addCallPort
void addCallPort(InputTimePort *callPort)
Definition: TimePortAc.cpp:93
FW_LOG_TEXT_BUFFER_SIZE
#define FW_LOG_TEXT_BUFFER_SIZE
Max size of string for text log message.
Definition: FpConfig.hpp:291
Os::Queue::QUEUE_BLOCKING
@ QUEUE_BLOCKING
Queue receive blocks until a message arrives.
Definition: Queue.hpp:41
Fw::InputLogTextPort
Definition: LogTextPortAc.hpp:40
Svc::InputPingPort::addCallComp
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
call to register a component
Definition: PingPortAc.cpp:42