F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
VersionComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title VersionComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for Version 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  // ----------------------------------------------------------------------
17  // Component initialization
18  // ----------------------------------------------------------------------
19 
22  {
23  // Initialize base class
25 
26 #if !FW_DIRECT_PORT_CALLS
27  // Connect input port cmdIn
28  for (
29  FwIndexType port = 0;
30  port < static_cast<FwIndexType>(this->getNum_cmdIn_InputPorts());
31  port++
32  ) {
33  this->m_cmdIn_InputPort[port].init();
34  this->m_cmdIn_InputPort[port].addCallComp(
35  this,
36  m_p_cmdIn_in
37  );
38  this->m_cmdIn_InputPort[port].setPortNum(port);
39 
40 #if FW_OBJECT_NAMES == 1
41  Fw::ObjectName portName;
42  portName.format(
43  "%s_cmdIn_InputPort[%" PRI_FwIndexType "]",
44  this->m_objName.toChar(),
45  port
46  );
47  this->m_cmdIn_InputPort[port].setObjName(portName.toChar());
48 #endif
49  }
50 #endif
51 
52 #if !FW_DIRECT_PORT_CALLS
53  // Connect input port getVersion
54  for (
55  FwIndexType port = 0;
56  port < static_cast<FwIndexType>(this->getNum_getVersion_InputPorts());
57  port++
58  ) {
59  this->m_getVersion_InputPort[port].init();
60  this->m_getVersion_InputPort[port].addCallComp(
61  this,
62  m_p_getVersion_in
63  );
64  this->m_getVersion_InputPort[port].setPortNum(port);
65 
66 #if FW_OBJECT_NAMES == 1
67  Fw::ObjectName portName;
68  portName.format(
69  "%s_getVersion_InputPort[%" PRI_FwIndexType "]",
70  this->m_objName.toChar(),
71  port
72  );
73  this->m_getVersion_InputPort[port].setObjName(portName.toChar());
74 #endif
75  }
76 #endif
77 
78 #if !FW_DIRECT_PORT_CALLS
79  // Connect input port schedIn
80  for (
81  FwIndexType port = 0;
82  port < static_cast<FwIndexType>(this->getNum_schedIn_InputPorts());
83  port++
84  ) {
85  this->m_schedIn_InputPort[port].init();
86  this->m_schedIn_InputPort[port].addCallComp(
87  this,
88  m_p_schedIn_in
89  );
90  this->m_schedIn_InputPort[port].setPortNum(port);
91 
92 #if FW_OBJECT_NAMES == 1
93  Fw::ObjectName portName;
94  portName.format(
95  "%s_schedIn_InputPort[%" PRI_FwIndexType "]",
96  this->m_objName.toChar(),
97  port
98  );
99  this->m_schedIn_InputPort[port].setObjName(portName.toChar());
100 #endif
101  }
102 #endif
103 
104 #if !FW_DIRECT_PORT_CALLS
105  // Connect input port setVersion
106  for (
107  FwIndexType port = 0;
108  port < static_cast<FwIndexType>(this->getNum_setVersion_InputPorts());
109  port++
110  ) {
111  this->m_setVersion_InputPort[port].init();
112  this->m_setVersion_InputPort[port].addCallComp(
113  this,
114  m_p_setVersion_in
115  );
116  this->m_setVersion_InputPort[port].setPortNum(port);
117 
118 #if FW_OBJECT_NAMES == 1
119  Fw::ObjectName portName;
120  portName.format(
121  "%s_setVersion_InputPort[%" PRI_FwIndexType "]",
122  this->m_objName.toChar(),
123  port
124  );
125  this->m_setVersion_InputPort[port].setObjName(portName.toChar());
126 #endif
127  }
128 #endif
129 
130 #if !FW_DIRECT_PORT_CALLS
131  // Connect output port cmdRegOut
132  for (
133  FwIndexType port = 0;
134  port < static_cast<FwIndexType>(this->getNum_cmdRegOut_OutputPorts());
135  port++
136  ) {
137  this->m_cmdRegOut_OutputPort[port].init();
138 
139 #if FW_OBJECT_NAMES == 1
140  Fw::ObjectName portName;
141  portName.format(
142  "%s_cmdRegOut_OutputPort[%" PRI_FwIndexType "]",
143  this->m_objName.toChar(),
144  port
145  );
146  this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar());
147 #endif
148  }
149 #endif
150 
151 #if !FW_DIRECT_PORT_CALLS
152  // Connect output port cmdResponseOut
153  for (
154  FwIndexType port = 0;
155  port < static_cast<FwIndexType>(this->getNum_cmdResponseOut_OutputPorts());
156  port++
157  ) {
158  this->m_cmdResponseOut_OutputPort[port].init();
159 
160 #if FW_OBJECT_NAMES == 1
161  Fw::ObjectName portName;
162  portName.format(
163  "%s_cmdResponseOut_OutputPort[%" PRI_FwIndexType "]",
164  this->m_objName.toChar(),
165  port
166  );
167  this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar());
168 #endif
169  }
170 #endif
171 
172 #if !FW_DIRECT_PORT_CALLS
173  // Connect output port logOut
174  for (
175  FwIndexType port = 0;
176  port < static_cast<FwIndexType>(this->getNum_logOut_OutputPorts());
177  port++
178  ) {
179  this->m_logOut_OutputPort[port].init();
180 
181 #if FW_OBJECT_NAMES == 1
182  Fw::ObjectName portName;
183  portName.format(
184  "%s_logOut_OutputPort[%" PRI_FwIndexType "]",
185  this->m_objName.toChar(),
186  port
187  );
188  this->m_logOut_OutputPort[port].setObjName(portName.toChar());
189 #endif
190  }
191 #endif
192 
193 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING
194  // Connect output port logTextOut
195  for (
196  FwIndexType port = 0;
197  port < static_cast<FwIndexType>(this->getNum_logTextOut_OutputPorts());
198  port++
199  ) {
200  this->m_logTextOut_OutputPort[port].init();
201 
202 #if FW_OBJECT_NAMES == 1
203  Fw::ObjectName portName;
204  portName.format(
205  "%s_logTextOut_OutputPort[%" PRI_FwIndexType "]",
206  this->m_objName.toChar(),
207  port
208  );
209  this->m_logTextOut_OutputPort[port].setObjName(portName.toChar());
210 #endif
211  }
212 #endif
213 
214 #if !FW_DIRECT_PORT_CALLS
215  // Connect output port timeCaller
216  for (
217  FwIndexType port = 0;
218  port < static_cast<FwIndexType>(this->getNum_timeCaller_OutputPorts());
219  port++
220  ) {
221  this->m_timeCaller_OutputPort[port].init();
222 
223 #if FW_OBJECT_NAMES == 1
224  Fw::ObjectName portName;
225  portName.format(
226  "%s_timeCaller_OutputPort[%" PRI_FwIndexType "]",
227  this->m_objName.toChar(),
228  port
229  );
230  this->m_timeCaller_OutputPort[port].setObjName(portName.toChar());
231 #endif
232  }
233 #endif
234 
235 #if !FW_DIRECT_PORT_CALLS
236  // Connect output port tlmOut
237  for (
238  FwIndexType port = 0;
239  port < static_cast<FwIndexType>(this->getNum_tlmOut_OutputPorts());
240  port++
241  ) {
242  this->m_tlmOut_OutputPort[port].init();
243 
244 #if FW_OBJECT_NAMES == 1
245  Fw::ObjectName portName;
246  portName.format(
247  "%s_tlmOut_OutputPort[%" PRI_FwIndexType "]",
248  this->m_objName.toChar(),
249  port
250  );
251  this->m_tlmOut_OutputPort[port].setObjName(portName.toChar());
252 #endif
253  }
254 #endif
255  }
256 
257 #if !FW_DIRECT_PORT_CALLS
258 
259  // ----------------------------------------------------------------------
260  // Getters for special input ports
261  // ----------------------------------------------------------------------
262 
265  {
266  FW_ASSERT(
267  (0 <= portNum) && (portNum < this->getNum_cmdIn_InputPorts()),
268  static_cast<FwAssertArgType>(portNum)
269  );
270 
271  return &this->m_cmdIn_InputPort[portNum];
272  }
273 
274 #endif
275 
276 #if !FW_DIRECT_PORT_CALLS
277 
278  // ----------------------------------------------------------------------
279  // Getters for typed input ports
280  // ----------------------------------------------------------------------
281 
284  {
285  FW_ASSERT(
286  (0 <= portNum) && (portNum < this->getNum_getVersion_InputPorts()),
287  static_cast<FwAssertArgType>(portNum)
288  );
289 
290  return &this->m_getVersion_InputPort[portNum];
291  }
292 
295  {
296  FW_ASSERT(
297  (0 <= portNum) && (portNum < this->getNum_schedIn_InputPorts()),
298  static_cast<FwAssertArgType>(portNum)
299  );
300 
301  return &this->m_schedIn_InputPort[portNum];
302  }
303 
306  {
307  FW_ASSERT(
308  (0 <= portNum) && (portNum < this->getNum_setVersion_InputPorts()),
309  static_cast<FwAssertArgType>(portNum)
310  );
311 
312  return &this->m_setVersion_InputPort[portNum];
313  }
314 
315 #endif
316 
317 #if !FW_DIRECT_PORT_CALLS
318 
319  // ----------------------------------------------------------------------
320  // Connect input ports to special output ports
321  // ----------------------------------------------------------------------
322 
325  FwIndexType portNum,
326  Fw::InputCmdRegPort* port
327  )
328  {
329  FW_ASSERT(
330  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
331  static_cast<FwAssertArgType>(portNum)
332  );
333 
334  this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
335  }
336 
339  FwIndexType portNum,
341  )
342  {
343  FW_ASSERT(
344  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
345  static_cast<FwAssertArgType>(portNum)
346  );
347 
348  this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
349  }
350 
353  FwIndexType portNum,
354  Fw::InputLogPort* port
355  )
356  {
357  FW_ASSERT(
358  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
359  static_cast<FwAssertArgType>(portNum)
360  );
361 
362  this->m_logOut_OutputPort[portNum].addCallPort(port);
363  }
364 
365 #if FW_ENABLE_TEXT_LOGGING == 1
366 
367  void VersionComponentBase ::
368  set_logTextOut_OutputPort(
369  FwIndexType portNum,
371  )
372  {
373  FW_ASSERT(
374  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
375  static_cast<FwAssertArgType>(portNum)
376  );
377 
378  this->m_logTextOut_OutputPort[portNum].addCallPort(port);
379  }
380 
381 #endif
382 
385  FwIndexType portNum,
386  Fw::InputTimePort* port
387  )
388  {
389  FW_ASSERT(
390  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
391  static_cast<FwAssertArgType>(portNum)
392  );
393 
394  this->m_timeCaller_OutputPort[portNum].addCallPort(port);
395  }
396 
399  FwIndexType portNum,
400  Fw::InputTlmPort* port
401  )
402  {
403  FW_ASSERT(
404  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
405  static_cast<FwAssertArgType>(portNum)
406  );
407 
408  this->m_tlmOut_OutputPort[portNum].addCallPort(port);
409  }
410 
411 #endif
412 
413 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
414 
415  // ----------------------------------------------------------------------
416  // Connect serial input ports to special output ports
417  // ----------------------------------------------------------------------
418 
421  FwIndexType portNum,
422  Fw::InputSerializePort* port
423  )
424  {
425  FW_ASSERT(
426  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
427  static_cast<FwAssertArgType>(portNum)
428  );
429 
430  this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
431  }
432 
435  FwIndexType portNum,
436  Fw::InputSerializePort* port
437  )
438  {
439  FW_ASSERT(
440  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
441  static_cast<FwAssertArgType>(portNum)
442  );
443 
444  this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
445  }
446 
449  FwIndexType portNum,
450  Fw::InputSerializePort* port
451  )
452  {
453  FW_ASSERT(
454  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
455  static_cast<FwAssertArgType>(portNum)
456  );
457 
458  this->m_logOut_OutputPort[portNum].registerSerialPort(port);
459  }
460 
461 #if FW_ENABLE_TEXT_LOGGING == 1
462 
463  void VersionComponentBase ::
464  set_logTextOut_OutputPort(
465  FwIndexType portNum,
466  Fw::InputSerializePort* port
467  )
468  {
469  FW_ASSERT(
470  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
471  static_cast<FwAssertArgType>(portNum)
472  );
473 
474  this->m_logTextOut_OutputPort[portNum].registerSerialPort(port);
475  }
476 
477 #endif
478 
481  FwIndexType portNum,
482  Fw::InputSerializePort* port
483  )
484  {
485  FW_ASSERT(
486  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
487  static_cast<FwAssertArgType>(portNum)
488  );
489 
490  this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
491  }
492 
495  FwIndexType portNum,
496  Fw::InputSerializePort* port
497  )
498  {
499  FW_ASSERT(
500  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
501  static_cast<FwAssertArgType>(portNum)
502  );
503 
504  this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
505  }
506 
507 #endif
508 
509  // ----------------------------------------------------------------------
510  // Command registration
511  // ----------------------------------------------------------------------
512 
515  {
517 
518  this->cmdRegOut_out(
519  0,
520  this->getIdBase() + OPCODE_ENABLE
521  );
522 
523  this->cmdRegOut_out(
524  0,
525  this->getIdBase() + OPCODE_VERSION
526  );
527  }
528 
529  // ----------------------------------------------------------------------
530  // Component construction and destruction
531  // ----------------------------------------------------------------------
532 
534  VersionComponentBase(const char* compName) :
535  Fw::PassiveComponentBase(compName)
536  {
537 
538  }
539 
542  {
543 
544  }
545 
546 #if !FW_DIRECT_PORT_CALLS
547 
548  // ----------------------------------------------------------------------
549  // Connection status queries for special output ports
550  // ----------------------------------------------------------------------
551 
554  {
555  FW_ASSERT(
556  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
557  static_cast<FwAssertArgType>(portNum)
558  );
559 
560  return this->m_cmdRegOut_OutputPort[portNum].isConnected();
561  }
562 
565  {
566  FW_ASSERT(
567  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
568  static_cast<FwAssertArgType>(portNum)
569  );
570 
571  return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
572  }
573 
576  {
577  FW_ASSERT(
578  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
579  static_cast<FwAssertArgType>(portNum)
580  );
581 
582  return this->m_logOut_OutputPort[portNum].isConnected();
583  }
584 
585 #if FW_ENABLE_TEXT_LOGGING == 1
586 
587  bool VersionComponentBase ::
588  isConnected_logTextOut_OutputPort(FwIndexType portNum) const
589  {
590  FW_ASSERT(
591  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
592  static_cast<FwAssertArgType>(portNum)
593  );
594 
595  return this->m_logTextOut_OutputPort[portNum].isConnected();
596  }
597 
598 #endif
599 
602  {
603  FW_ASSERT(
604  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
605  static_cast<FwAssertArgType>(portNum)
606  );
607 
608  return this->m_timeCaller_OutputPort[portNum].isConnected();
609  }
610 
613  {
614  FW_ASSERT(
615  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
616  static_cast<FwAssertArgType>(portNum)
617  );
618 
619  return this->m_tlmOut_OutputPort[portNum].isConnected();
620  }
621 
622 #endif
623 
624  // ----------------------------------------------------------------------
625  // Port handler base-class functions for special input ports
626  //
627  // Call these functions directly to bypass the corresponding ports
628  // ----------------------------------------------------------------------
629 
632  FwIndexType portNum,
633  FwOpcodeType opCode,
634  U32 cmdSeq,
635  Fw::CmdArgBuffer& args
636  )
637  {
638 
639  const U32 idBase = this->getIdBase();
640  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
641 
642  // Select base class function based on opcode
643  switch (opCode - idBase) {
644  case OPCODE_ENABLE: {
645  this->ENABLE_cmdHandlerBase(
646  opCode,
647  cmdSeq,
648  args
649  );
650  break;
651  }
652 
653  case OPCODE_VERSION: {
655  opCode,
656  cmdSeq,
657  args
658  );
659  break;
660  }
661  default:
662  // Unknown opcode: ignore it
663  break;
664  }
665  }
666 
667  // ----------------------------------------------------------------------
668  // Port handler base-class functions for typed input ports
669  //
670  // Call these functions directly to bypass the corresponding ports
671  // ----------------------------------------------------------------------
672 
675  FwIndexType portNum,
676  const Svc::VersionCfg::VersionEnum& version_id,
677  Fw::StringBase& version_string,
678  Svc::VersionStatus& status
679  )
680  {
681  // Make sure port number is valid
682  FW_ASSERT(
683  (0 <= portNum) && (portNum < this->getNum_getVersion_InputPorts()),
684  static_cast<FwAssertArgType>(portNum)
685  );
686 
687  // Lock guard mutex before calling
688  this->lock();
689 
690  // Call handler function
691  this->getVersion_handler(
692  portNum,
693  version_id,
694  version_string,
695  status
696  );
697 
698  // Unlock guard mutex
699  this->unLock();
700  }
701 
704  FwIndexType portNum,
705  U32 context
706  )
707  {
708  // Make sure port number is valid
709  FW_ASSERT(
710  (0 <= portNum) && (portNum < this->getNum_schedIn_InputPorts()),
711  static_cast<FwAssertArgType>(portNum)
712  );
713 
714  // Lock guard mutex before calling
715  this->lock();
716 
717  // Call handler function
718  this->schedIn_handler(
719  portNum,
720  context
721  );
722 
723  // Unlock guard mutex
724  this->unLock();
725  }
726 
729  FwIndexType portNum,
730  const Svc::VersionCfg::VersionEnum& version_id,
731  Fw::StringBase& version_string,
732  Svc::VersionStatus& status
733  )
734  {
735  // Make sure port number is valid
736  FW_ASSERT(
737  (0 <= portNum) && (portNum < this->getNum_setVersion_InputPorts()),
738  static_cast<FwAssertArgType>(portNum)
739  );
740 
741  // Lock guard mutex before calling
742  this->lock();
743 
744  // Call handler function
745  this->setVersion_handler(
746  portNum,
747  version_id,
748  version_string,
749  status
750  );
751 
752  // Unlock guard mutex
753  this->unLock();
754  }
755 
756  // ----------------------------------------------------------------------
757  // Command response
758  // ----------------------------------------------------------------------
759 
762  FwOpcodeType opCode,
763  U32 cmdSeq,
764  Fw::CmdResponse response
765  )
766  {
768  this->cmdResponseOut_out(0, opCode, cmdSeq, response);
769  }
770 
771  // ----------------------------------------------------------------------
772  // Command handler base-class functions
773  //
774  // Call these functions directly to bypass the command input port
775  // ----------------------------------------------------------------------
776 
779  FwOpcodeType opCode,
780  U32 cmdSeq,
781  Fw::CmdArgBuffer& args
782  )
783  {
784  // Deserialize the arguments
786 
787  // Reset the buffer
788  args.resetDeser();
789 
790  Svc::VersionEnabled enable;
791  _status = args.deserializeTo(enable);
792  if (_status != Fw::FW_SERIALIZE_OK) {
794  this->cmdResponseOut_out(
795  0,
796  opCode,
797  cmdSeq,
799  );
800  }
801  return;
802  }
803 
804 #if FW_CMD_CHECK_RESIDUAL
805  // Make sure there was no data left over.
806  // That means the argument buffer size was incorrect.
807  if (args.getDeserializeSizeLeft() != 0) {
809  this->cmdResponseOut_out(
810  0,
811  opCode,
812  cmdSeq,
814  );
815  }
816  return;
817  }
818 #endif
819 
820  this->lock();
821 
822  this->ENABLE_cmdHandler(
823  opCode, cmdSeq,
824  enable
825  );
826 
827  this->unLock();
828  }
829 
832  FwOpcodeType opCode,
833  U32 cmdSeq,
834  Fw::CmdArgBuffer& args
835  )
836  {
837  // Deserialize the arguments
839 
840  // Reset the buffer
841  args.resetDeser();
842 
843  Svc::VersionType version_type;
844  _status = args.deserializeTo(version_type);
845  if (_status != Fw::FW_SERIALIZE_OK) {
847  this->cmdResponseOut_out(
848  0,
849  opCode,
850  cmdSeq,
852  );
853  }
854  return;
855  }
856 
857 #if FW_CMD_CHECK_RESIDUAL
858  // Make sure there was no data left over.
859  // That means the argument buffer size was incorrect.
860  if (args.getDeserializeSizeLeft() != 0) {
862  this->cmdResponseOut_out(
863  0,
864  opCode,
865  cmdSeq,
867  );
868  }
869  return;
870  }
871 #endif
872 
873  this->lock();
874 
875  this->VERSION_cmdHandler(
876  opCode, cmdSeq,
877  version_type
878  );
879 
880  this->unLock();
881  }
882 
883  // ----------------------------------------------------------------------
884  // Event logging functions
885  // ----------------------------------------------------------------------
886 
889  {
890  // Get the time
891  Fw::Time _logTime;
892  if (this->isConnected_timeCaller_OutputPort(0)) {
893  this->timeCaller_out(0, _logTime);
894  }
895 
896  const FwEventIdType _id = this->getIdBase() + EVENTID_FRAMEWORKVERSION;
897 
898  // Emit the event on the log port
899  if (this->isConnected_logOut_OutputPort(0)) {
900  Fw::LogBuffer _logBuff;
902 
903 #if FW_AMPCS_COMPATIBLE
904  // Serialize the number of arguments
905  _status = _logBuff.serializeFrom(static_cast<U8>(1));
906  FW_ASSERT(
907  _status == Fw::FW_SERIALIZE_OK,
908  static_cast<FwAssertArgType>(_status)
909  );
910 #endif
911 
912  _status = version.serializeTo(
913  _logBuff,
914  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 40)
915  );
916  FW_ASSERT(
917  _status == Fw::FW_SERIALIZE_OK,
918  static_cast<FwAssertArgType>(_status)
919  );
920 
921  this->logOut_out(
922  0,
923  _id,
924  _logTime,
926  _logBuff
927  );
928  }
929 
930  // Emit the event on the text log port
931 #if FW_ENABLE_TEXT_LOGGING
932  if (this->isConnected_logTextOut_OutputPort(0)) {
933 #if FW_OBJECT_NAMES == 1
934  const char* _formatString =
935  "(%s) %s: Framework Version: [%s]";
936 #else
937  const char* _formatString =
938  "%s: Framework Version: [%s]";
939 #endif
940 
941  Fw::TextLogString _logString;
942  (void) _logString.format(
943  _formatString,
944 #if FW_OBJECT_NAMES == 1
945  this->m_objName.toChar(),
946 #endif
947  "FrameworkVersion ",
948  version.toChar()
949  );
950 
951  this->logTextOut_out(
952  0,
953  _id,
954  _logTime,
956  _logString
957  );
958  }
959 #endif
960  }
961 
964  {
965  // Get the time
966  Fw::Time _logTime;
967  if (this->isConnected_timeCaller_OutputPort(0)) {
968  this->timeCaller_out(0, _logTime);
969  }
970 
971  const FwEventIdType _id = this->getIdBase() + EVENTID_PROJECTVERSION;
972 
973  // Emit the event on the log port
974  if (this->isConnected_logOut_OutputPort(0)) {
975  Fw::LogBuffer _logBuff;
977 
978 #if FW_AMPCS_COMPATIBLE
979  // Serialize the number of arguments
980  _status = _logBuff.serializeFrom(static_cast<U8>(1));
981  FW_ASSERT(
982  _status == Fw::FW_SERIALIZE_OK,
983  static_cast<FwAssertArgType>(_status)
984  );
985 #endif
986 
987  _status = version.serializeTo(
988  _logBuff,
989  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 40)
990  );
991  FW_ASSERT(
992  _status == Fw::FW_SERIALIZE_OK,
993  static_cast<FwAssertArgType>(_status)
994  );
995 
996  this->logOut_out(
997  0,
998  _id,
999  _logTime,
1001  _logBuff
1002  );
1003  }
1004 
1005  // Emit the event on the text log port
1006 #if FW_ENABLE_TEXT_LOGGING
1007  if (this->isConnected_logTextOut_OutputPort(0)) {
1008 #if FW_OBJECT_NAMES == 1
1009  const char* _formatString =
1010  "(%s) %s: Project Version: [%s]";
1011 #else
1012  const char* _formatString =
1013  "%s: Project Version: [%s]";
1014 #endif
1015 
1016  Fw::TextLogString _logString;
1017  (void) _logString.format(
1018  _formatString,
1019 #if FW_OBJECT_NAMES == 1
1020  this->m_objName.toChar(),
1021 #endif
1022  "ProjectVersion ",
1023  version.toChar()
1024  );
1025 
1026  this->logTextOut_out(
1027  0,
1028  _id,
1029  _logTime,
1031  _logString
1032  );
1033  }
1034 #endif
1035  }
1036 
1039  {
1040  // Get the time
1041  Fw::Time _logTime;
1042  if (this->isConnected_timeCaller_OutputPort(0)) {
1043  this->timeCaller_out(0, _logTime);
1044  }
1045 
1046  const FwEventIdType _id = this->getIdBase() + EVENTID_LIBRARYVERSIONS;
1047 
1048  // Emit the event on the log port
1049  if (this->isConnected_logOut_OutputPort(0)) {
1050  Fw::LogBuffer _logBuff;
1052 
1053 #if FW_AMPCS_COMPATIBLE
1054  // Serialize the number of arguments
1055  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1056  FW_ASSERT(
1057  _status == Fw::FW_SERIALIZE_OK,
1058  static_cast<FwAssertArgType>(_status)
1059  );
1060 #endif
1061 
1062  _status = version.serializeTo(
1063  _logBuff,
1064  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 40)
1065  );
1066  FW_ASSERT(
1067  _status == Fw::FW_SERIALIZE_OK,
1068  static_cast<FwAssertArgType>(_status)
1069  );
1070 
1071  this->logOut_out(
1072  0,
1073  _id,
1074  _logTime,
1076  _logBuff
1077  );
1078  }
1079 
1080  // Emit the event on the text log port
1081 #if FW_ENABLE_TEXT_LOGGING
1082  if (this->isConnected_logTextOut_OutputPort(0)) {
1083 #if FW_OBJECT_NAMES == 1
1084  const char* _formatString =
1085  "(%s) %s: Library Versions: [%s]";
1086 #else
1087  const char* _formatString =
1088  "%s: Library Versions: [%s]";
1089 #endif
1090 
1091  Fw::TextLogString _logString;
1092  (void) _logString.format(
1093  _formatString,
1094 #if FW_OBJECT_NAMES == 1
1095  this->m_objName.toChar(),
1096 #endif
1097  "LibraryVersions ",
1098  version.toChar()
1099  );
1100 
1101  this->logTextOut_out(
1102  0,
1103  _id,
1104  _logTime,
1106  _logString
1107  );
1108  }
1109 #endif
1110  }
1111 
1114  const Svc::VersionCfg::VersionEnum& version_enum,
1115  const Fw::StringBase& version_value
1116  ) const
1117  {
1118  // Get the time
1119  Fw::Time _logTime;
1120  if (this->isConnected_timeCaller_OutputPort(0)) {
1121  this->timeCaller_out(0, _logTime);
1122  }
1123 
1124  const FwEventIdType _id = this->getIdBase() + EVENTID_CUSTOMVERSIONS;
1125 
1126  // Emit the event on the log port
1127  if (this->isConnected_logOut_OutputPort(0)) {
1128  Fw::LogBuffer _logBuff;
1130 
1131 #if FW_AMPCS_COMPATIBLE
1132  // Serialize the number of arguments
1133  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1134  FW_ASSERT(
1135  _status == Fw::FW_SERIALIZE_OK,
1136  static_cast<FwAssertArgType>(_status)
1137  );
1138 #endif
1139 
1140 #if FW_AMPCS_COMPATIBLE
1141  // Serialize the argument size
1142  _status = _logBuff.serializeFrom(
1144  );
1145  FW_ASSERT(
1146  _status == Fw::FW_SERIALIZE_OK,
1147  static_cast<FwAssertArgType>(_status)
1148  );
1149 #endif
1150  _status = _logBuff.serializeFrom(version_enum);
1151  FW_ASSERT(
1152  _status == Fw::FW_SERIALIZE_OK,
1153  static_cast<FwAssertArgType>(_status)
1154  );
1155 
1156  _status = version_value.serializeTo(
1157  _logBuff,
1158  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 40)
1159  );
1160  FW_ASSERT(
1161  _status == Fw::FW_SERIALIZE_OK,
1162  static_cast<FwAssertArgType>(_status)
1163  );
1164 
1165  this->logOut_out(
1166  0,
1167  _id,
1168  _logTime,
1170  _logBuff
1171  );
1172  }
1173 
1174  // Emit the event on the text log port
1175 #if FW_ENABLE_TEXT_LOGGING
1176  if (this->isConnected_logTextOut_OutputPort(0)) {
1177 #if FW_OBJECT_NAMES == 1
1178  const char* _formatString =
1179  "(%s) %s: Custom Versions: [%s] [%s]";
1180 #else
1181  const char* _formatString =
1182  "%s: Custom Versions: [%s] [%s]";
1183 #endif
1184 
1185  Fw::String version_enumStr;
1186  version_enum.toString(version_enumStr);
1187 
1188  Fw::TextLogString _logString;
1189  (void) _logString.format(
1190  _formatString,
1191 #if FW_OBJECT_NAMES == 1
1192  this->m_objName.toChar(),
1193 #endif
1194  "CustomVersions ",
1195  version_enumStr.toChar(),
1196  version_value.toChar()
1197  );
1198 
1199  this->logTextOut_out(
1200  0,
1201  _id,
1202  _logTime,
1204  _logString
1205  );
1206  }
1207 #endif
1208  }
1209 
1210  // ----------------------------------------------------------------------
1211  // Telemetry serialized write
1212  // ----------------------------------------------------------------------
1213 
1216  FwChanIdType id,
1217  Fw::TlmBuffer& _tlmBuff,
1218  Fw::Time _tlmTime
1219  ) const
1220  {
1221  if (this->isConnected_tlmOut_OutputPort(0)) {
1222  if (
1224  (_tlmTime == Fw::ZERO_TIME)
1225  ) {
1226  this->timeCaller_out(0, _tlmTime);
1227  }
1228 
1229  FwChanIdType _id;
1230  _id = this->getIdBase() + id;
1231 
1232  this->tlmOut_out(
1233  0,
1234  _id,
1235  _tlmTime,
1236  _tlmBuff
1237  );
1238  }
1239  }
1240 
1241  // ----------------------------------------------------------------------
1242  // Telemetry write functions
1243  // ----------------------------------------------------------------------
1244 
1247  const Fw::StringBase& arg,
1248  Fw::Time _tlmTime
1249  ) const
1250  {
1251  if (this->isConnected_tlmOut_OutputPort(0)) {
1252  Fw::TlmBuffer _tlmBuff;
1253  Fw::SerializeStatus _stat = arg.serializeTo(
1254  _tlmBuff,
1255  FW_MIN(static_cast<FwSizeType>(FW_TLM_STRING_MAX_SIZE), 40)
1256  );
1257  FW_ASSERT(
1258  _stat == Fw::FW_SERIALIZE_OK,
1259  static_cast<FwAssertArgType>(_stat)
1260  );
1261 
1262  this->tlmWrite(
1264  _tlmBuff,
1265  _tlmTime
1266  );
1267  }
1268  }
1269 
1272  const Fw::StringBase& arg,
1273  Fw::Time _tlmTime
1274  ) const
1275  {
1276  if (this->isConnected_tlmOut_OutputPort(0)) {
1277  Fw::TlmBuffer _tlmBuff;
1278  Fw::SerializeStatus _stat = arg.serializeTo(
1279  _tlmBuff,
1280  FW_MIN(static_cast<FwSizeType>(FW_TLM_STRING_MAX_SIZE), 40)
1281  );
1282  FW_ASSERT(
1283  _stat == Fw::FW_SERIALIZE_OK,
1284  static_cast<FwAssertArgType>(_stat)
1285  );
1286 
1287  this->tlmWrite(
1289  _tlmBuff,
1290  _tlmTime
1291  );
1292  }
1293  }
1294 
1297  const Svc::CustomVersionDb& arg,
1298  Fw::Time _tlmTime
1299  ) const
1300  {
1301  if (this->isConnected_tlmOut_OutputPort(0)) {
1302  Fw::TlmBuffer _tlmBuff;
1303  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1304  FW_ASSERT(
1305  _stat == Fw::FW_SERIALIZE_OK,
1306  static_cast<FwAssertArgType>(_stat)
1307  );
1308 
1309  this->tlmWrite(
1311  _tlmBuff,
1312  _tlmTime
1313  );
1314  }
1315  }
1316 
1319  const Svc::CustomVersionDb& arg,
1320  Fw::Time _tlmTime
1321  ) const
1322  {
1323  if (this->isConnected_tlmOut_OutputPort(0)) {
1324  Fw::TlmBuffer _tlmBuff;
1325  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1326  FW_ASSERT(
1327  _stat == Fw::FW_SERIALIZE_OK,
1328  static_cast<FwAssertArgType>(_stat)
1329  );
1330 
1331  this->tlmWrite(
1333  _tlmBuff,
1334  _tlmTime
1335  );
1336  }
1337  }
1338 
1341  const Svc::CustomVersionDb& arg,
1342  Fw::Time _tlmTime
1343  ) const
1344  {
1345  if (this->isConnected_tlmOut_OutputPort(0)) {
1346  Fw::TlmBuffer _tlmBuff;
1347  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1348  FW_ASSERT(
1349  _stat == Fw::FW_SERIALIZE_OK,
1350  static_cast<FwAssertArgType>(_stat)
1351  );
1352 
1353  this->tlmWrite(
1355  _tlmBuff,
1356  _tlmTime
1357  );
1358  }
1359  }
1360 
1363  const Svc::CustomVersionDb& arg,
1364  Fw::Time _tlmTime
1365  ) const
1366  {
1367  if (this->isConnected_tlmOut_OutputPort(0)) {
1368  Fw::TlmBuffer _tlmBuff;
1369  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1370  FW_ASSERT(
1371  _stat == Fw::FW_SERIALIZE_OK,
1372  static_cast<FwAssertArgType>(_stat)
1373  );
1374 
1375  this->tlmWrite(
1377  _tlmBuff,
1378  _tlmTime
1379  );
1380  }
1381  }
1382 
1385  const Svc::CustomVersionDb& arg,
1386  Fw::Time _tlmTime
1387  ) const
1388  {
1389  if (this->isConnected_tlmOut_OutputPort(0)) {
1390  Fw::TlmBuffer _tlmBuff;
1391  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1392  FW_ASSERT(
1393  _stat == Fw::FW_SERIALIZE_OK,
1394  static_cast<FwAssertArgType>(_stat)
1395  );
1396 
1397  this->tlmWrite(
1399  _tlmBuff,
1400  _tlmTime
1401  );
1402  }
1403  }
1404 
1407  const Svc::CustomVersionDb& arg,
1408  Fw::Time _tlmTime
1409  ) const
1410  {
1411  if (this->isConnected_tlmOut_OutputPort(0)) {
1412  Fw::TlmBuffer _tlmBuff;
1413  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1414  FW_ASSERT(
1415  _stat == Fw::FW_SERIALIZE_OK,
1416  static_cast<FwAssertArgType>(_stat)
1417  );
1418 
1419  this->tlmWrite(
1421  _tlmBuff,
1422  _tlmTime
1423  );
1424  }
1425  }
1426 
1429  const Svc::CustomVersionDb& arg,
1430  Fw::Time _tlmTime
1431  ) const
1432  {
1433  if (this->isConnected_tlmOut_OutputPort(0)) {
1434  Fw::TlmBuffer _tlmBuff;
1435  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1436  FW_ASSERT(
1437  _stat == Fw::FW_SERIALIZE_OK,
1438  static_cast<FwAssertArgType>(_stat)
1439  );
1440 
1441  this->tlmWrite(
1443  _tlmBuff,
1444  _tlmTime
1445  );
1446  }
1447  }
1448 
1451  const Svc::CustomVersionDb& arg,
1452  Fw::Time _tlmTime
1453  ) const
1454  {
1455  if (this->isConnected_tlmOut_OutputPort(0)) {
1456  Fw::TlmBuffer _tlmBuff;
1457  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1458  FW_ASSERT(
1459  _stat == Fw::FW_SERIALIZE_OK,
1460  static_cast<FwAssertArgType>(_stat)
1461  );
1462 
1463  this->tlmWrite(
1465  _tlmBuff,
1466  _tlmTime
1467  );
1468  }
1469  }
1470 
1473  const Svc::CustomVersionDb& arg,
1474  Fw::Time _tlmTime
1475  ) const
1476  {
1477  if (this->isConnected_tlmOut_OutputPort(0)) {
1478  Fw::TlmBuffer _tlmBuff;
1479  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1480  FW_ASSERT(
1481  _stat == Fw::FW_SERIALIZE_OK,
1482  static_cast<FwAssertArgType>(_stat)
1483  );
1484 
1485  this->tlmWrite(
1487  _tlmBuff,
1488  _tlmTime
1489  );
1490  }
1491  }
1492 
1495  const Svc::CustomVersionDb& arg,
1496  Fw::Time _tlmTime
1497  ) const
1498  {
1499  if (this->isConnected_tlmOut_OutputPort(0)) {
1500  Fw::TlmBuffer _tlmBuff;
1501  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1502  FW_ASSERT(
1503  _stat == Fw::FW_SERIALIZE_OK,
1504  static_cast<FwAssertArgType>(_stat)
1505  );
1506 
1507  this->tlmWrite(
1509  _tlmBuff,
1510  _tlmTime
1511  );
1512  }
1513  }
1514 
1517  const Fw::StringBase& arg,
1518  Fw::Time _tlmTime
1519  ) const
1520  {
1521  if (this->isConnected_tlmOut_OutputPort(0)) {
1522  Fw::TlmBuffer _tlmBuff;
1523  Fw::SerializeStatus _stat = arg.serializeTo(
1524  _tlmBuff,
1525  FW_MIN(static_cast<FwSizeType>(FW_TLM_STRING_MAX_SIZE), 40)
1526  );
1527  FW_ASSERT(
1528  _stat == Fw::FW_SERIALIZE_OK,
1529  static_cast<FwAssertArgType>(_stat)
1530  );
1531 
1532  this->tlmWrite(
1534  _tlmBuff,
1535  _tlmTime
1536  );
1537  }
1538  }
1539 
1542  const Fw::StringBase& arg,
1543  Fw::Time _tlmTime
1544  ) const
1545  {
1546  if (this->isConnected_tlmOut_OutputPort(0)) {
1547  Fw::TlmBuffer _tlmBuff;
1548  Fw::SerializeStatus _stat = arg.serializeTo(
1549  _tlmBuff,
1550  FW_MIN(static_cast<FwSizeType>(FW_TLM_STRING_MAX_SIZE), 40)
1551  );
1552  FW_ASSERT(
1553  _stat == Fw::FW_SERIALIZE_OK,
1554  static_cast<FwAssertArgType>(_stat)
1555  );
1556 
1557  this->tlmWrite(
1559  _tlmBuff,
1560  _tlmTime
1561  );
1562  }
1563  }
1564 
1567  const Fw::StringBase& arg,
1568  Fw::Time _tlmTime
1569  ) const
1570  {
1571  if (this->isConnected_tlmOut_OutputPort(0)) {
1572  Fw::TlmBuffer _tlmBuff;
1573  Fw::SerializeStatus _stat = arg.serializeTo(
1574  _tlmBuff,
1575  FW_MIN(static_cast<FwSizeType>(FW_TLM_STRING_MAX_SIZE), 40)
1576  );
1577  FW_ASSERT(
1578  _stat == Fw::FW_SERIALIZE_OK,
1579  static_cast<FwAssertArgType>(_stat)
1580  );
1581 
1582  this->tlmWrite(
1584  _tlmBuff,
1585  _tlmTime
1586  );
1587  }
1588  }
1589 
1592  const Fw::StringBase& arg,
1593  Fw::Time _tlmTime
1594  ) const
1595  {
1596  if (this->isConnected_tlmOut_OutputPort(0)) {
1597  Fw::TlmBuffer _tlmBuff;
1598  Fw::SerializeStatus _stat = arg.serializeTo(
1599  _tlmBuff,
1600  FW_MIN(static_cast<FwSizeType>(FW_TLM_STRING_MAX_SIZE), 40)
1601  );
1602  FW_ASSERT(
1603  _stat == Fw::FW_SERIALIZE_OK,
1604  static_cast<FwAssertArgType>(_stat)
1605  );
1606 
1607  this->tlmWrite(
1609  _tlmBuff,
1610  _tlmTime
1611  );
1612  }
1613  }
1614 
1617  const Fw::StringBase& arg,
1618  Fw::Time _tlmTime
1619  ) const
1620  {
1621  if (this->isConnected_tlmOut_OutputPort(0)) {
1622  Fw::TlmBuffer _tlmBuff;
1623  Fw::SerializeStatus _stat = arg.serializeTo(
1624  _tlmBuff,
1625  FW_MIN(static_cast<FwSizeType>(FW_TLM_STRING_MAX_SIZE), 40)
1626  );
1627  FW_ASSERT(
1628  _stat == Fw::FW_SERIALIZE_OK,
1629  static_cast<FwAssertArgType>(_stat)
1630  );
1631 
1632  this->tlmWrite(
1634  _tlmBuff,
1635  _tlmTime
1636  );
1637  }
1638  }
1639 
1642  const Fw::StringBase& arg,
1643  Fw::Time _tlmTime
1644  ) const
1645  {
1646  if (this->isConnected_tlmOut_OutputPort(0)) {
1647  Fw::TlmBuffer _tlmBuff;
1648  Fw::SerializeStatus _stat = arg.serializeTo(
1649  _tlmBuff,
1650  FW_MIN(static_cast<FwSizeType>(FW_TLM_STRING_MAX_SIZE), 40)
1651  );
1652  FW_ASSERT(
1653  _stat == Fw::FW_SERIALIZE_OK,
1654  static_cast<FwAssertArgType>(_stat)
1655  );
1656 
1657  this->tlmWrite(
1659  _tlmBuff,
1660  _tlmTime
1661  );
1662  }
1663  }
1664 
1667  const Fw::StringBase& arg,
1668  Fw::Time _tlmTime
1669  ) const
1670  {
1671  if (this->isConnected_tlmOut_OutputPort(0)) {
1672  Fw::TlmBuffer _tlmBuff;
1673  Fw::SerializeStatus _stat = arg.serializeTo(
1674  _tlmBuff,
1675  FW_MIN(static_cast<FwSizeType>(FW_TLM_STRING_MAX_SIZE), 40)
1676  );
1677  FW_ASSERT(
1678  _stat == Fw::FW_SERIALIZE_OK,
1679  static_cast<FwAssertArgType>(_stat)
1680  );
1681 
1682  this->tlmWrite(
1684  _tlmBuff,
1685  _tlmTime
1686  );
1687  }
1688  }
1689 
1692  const Fw::StringBase& arg,
1693  Fw::Time _tlmTime
1694  ) const
1695  {
1696  if (this->isConnected_tlmOut_OutputPort(0)) {
1697  Fw::TlmBuffer _tlmBuff;
1698  Fw::SerializeStatus _stat = arg.serializeTo(
1699  _tlmBuff,
1700  FW_MIN(static_cast<FwSizeType>(FW_TLM_STRING_MAX_SIZE), 40)
1701  );
1702  FW_ASSERT(
1703  _stat == Fw::FW_SERIALIZE_OK,
1704  static_cast<FwAssertArgType>(_stat)
1705  );
1706 
1707  this->tlmWrite(
1709  _tlmBuff,
1710  _tlmTime
1711  );
1712  }
1713  }
1714 
1717  const Fw::StringBase& arg,
1718  Fw::Time _tlmTime
1719  ) const
1720  {
1721  if (this->isConnected_tlmOut_OutputPort(0)) {
1722  Fw::TlmBuffer _tlmBuff;
1723  Fw::SerializeStatus _stat = arg.serializeTo(
1724  _tlmBuff,
1725  FW_MIN(static_cast<FwSizeType>(FW_TLM_STRING_MAX_SIZE), 40)
1726  );
1727  FW_ASSERT(
1728  _stat == Fw::FW_SERIALIZE_OK,
1729  static_cast<FwAssertArgType>(_stat)
1730  );
1731 
1732  this->tlmWrite(
1734  _tlmBuff,
1735  _tlmTime
1736  );
1737  }
1738  }
1739 
1742  const Fw::StringBase& arg,
1743  Fw::Time _tlmTime
1744  ) const
1745  {
1746  if (this->isConnected_tlmOut_OutputPort(0)) {
1747  Fw::TlmBuffer _tlmBuff;
1748  Fw::SerializeStatus _stat = arg.serializeTo(
1749  _tlmBuff,
1750  FW_MIN(static_cast<FwSizeType>(FW_TLM_STRING_MAX_SIZE), 40)
1751  );
1752  FW_ASSERT(
1753  _stat == Fw::FW_SERIALIZE_OK,
1754  static_cast<FwAssertArgType>(_stat)
1755  );
1756 
1757  this->tlmWrite(
1759  _tlmBuff,
1760  _tlmTime
1761  );
1762  }
1763  }
1764 
1765  // ----------------------------------------------------------------------
1766  // Time
1767  // ----------------------------------------------------------------------
1768 
1770  getTime() const
1771  {
1772  if (this->isConnected_timeCaller_OutputPort(0)) {
1773  Fw::Time _time;
1774  this->timeCaller_out(0, _time);
1775  return _time;
1776  }
1777  else {
1778  return Fw::Time(TimeBase::TB_NONE, 0, 0);
1779  }
1780  }
1781 
1782  // ----------------------------------------------------------------------
1783  // Mutex operations for guarded ports
1784  //
1785  // You can override these operations to provide more sophisticated
1786  // synchronization
1787  // ----------------------------------------------------------------------
1788 
1791  {
1792  this->m_guardedPortMutex.lock();
1793  }
1794 
1797  {
1798  this->m_guardedPortMutex.unLock();
1799  }
1800 
1801  // ----------------------------------------------------------------------
1802  // Calls for messages received on special input ports
1803  // ----------------------------------------------------------------------
1804 
1805  void VersionComponentBase ::
1806  m_p_cmdIn_in(
1807  Fw::PassiveComponentBase* callComp,
1808  FwIndexType portNum,
1809  FwOpcodeType opCode,
1810  U32 cmdSeq,
1811  Fw::CmdArgBuffer& args
1812  )
1813  {
1814  FW_ASSERT(callComp != nullptr);
1815  VersionComponentBase* compPtr = static_cast<VersionComponentBase*>(callComp);
1816  compPtr->cmdIn_handlerBase(
1817  portNum,
1818  opCode,
1819  cmdSeq,
1820  args
1821  );
1822  }
1823 
1824  // ----------------------------------------------------------------------
1825  // Calls for messages received on typed input ports
1826  // ----------------------------------------------------------------------
1827 
1828  void VersionComponentBase ::
1829  m_p_getVersion_in(
1830  Fw::PassiveComponentBase* callComp,
1831  FwIndexType portNum,
1832  const Svc::VersionCfg::VersionEnum& version_id,
1833  Fw::StringBase& version_string,
1834  Svc::VersionStatus& status
1835  )
1836  {
1837  FW_ASSERT(callComp != nullptr);
1838  VersionComponentBase* compPtr = static_cast<VersionComponentBase*>(callComp);
1839  compPtr->getVersion_handlerBase(
1840  portNum,
1841  version_id,
1842  version_string,
1843  status
1844  );
1845  }
1846 
1847  void VersionComponentBase ::
1848  m_p_schedIn_in(
1849  Fw::PassiveComponentBase* callComp,
1850  FwIndexType portNum,
1851  U32 context
1852  )
1853  {
1854  FW_ASSERT(callComp != nullptr);
1855  VersionComponentBase* compPtr = static_cast<VersionComponentBase*>(callComp);
1856  compPtr->schedIn_handlerBase(
1857  portNum,
1858  context
1859  );
1860  }
1861 
1862  void VersionComponentBase ::
1863  m_p_setVersion_in(
1864  Fw::PassiveComponentBase* callComp,
1865  FwIndexType portNum,
1866  const Svc::VersionCfg::VersionEnum& version_id,
1867  Fw::StringBase& version_string,
1868  Svc::VersionStatus& status
1869  )
1870  {
1871  FW_ASSERT(callComp != nullptr);
1872  VersionComponentBase* compPtr = static_cast<VersionComponentBase*>(callComp);
1873  compPtr->setVersion_handlerBase(
1874  portNum,
1875  version_id,
1876  version_string,
1877  status
1878  );
1879  }
1880 
1881 #if !FW_DIRECT_PORT_CALLS
1882 
1883  // ----------------------------------------------------------------------
1884  // Invocation functions for special output ports
1885  // ----------------------------------------------------------------------
1886 
1887  void VersionComponentBase ::
1888  cmdRegOut_out(
1889  FwIndexType portNum,
1890  FwOpcodeType opCode
1891  ) const
1892  {
1893  FW_ASSERT(
1894  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
1895  static_cast<FwAssertArgType>(portNum)
1896  );
1897 
1898  FW_ASSERT(
1899  this->m_cmdRegOut_OutputPort[portNum].isConnected(),
1900  static_cast<FwAssertArgType>(portNum)
1901  );
1902  this->m_cmdRegOut_OutputPort[portNum].invoke(
1903  opCode
1904  );
1905  }
1906 
1907  void VersionComponentBase ::
1908  cmdResponseOut_out(
1909  FwIndexType portNum,
1910  FwOpcodeType opCode,
1911  U32 cmdSeq,
1912  const Fw::CmdResponse& response
1913  ) const
1914  {
1915  FW_ASSERT(
1916  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
1917  static_cast<FwAssertArgType>(portNum)
1918  );
1919 
1920  FW_ASSERT(
1921  this->m_cmdResponseOut_OutputPort[portNum].isConnected(),
1922  static_cast<FwAssertArgType>(portNum)
1923  );
1924  this->m_cmdResponseOut_OutputPort[portNum].invoke(
1925  opCode,
1926  cmdSeq,
1927  response
1928  );
1929  }
1930 
1931  void VersionComponentBase ::
1932  logOut_out(
1933  FwIndexType portNum,
1934  FwEventIdType id,
1935  Fw::Time& timeTag,
1936  const Fw::LogSeverity& severity,
1937  Fw::LogBuffer& args
1938  ) const
1939  {
1940  FW_ASSERT(
1941  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
1942  static_cast<FwAssertArgType>(portNum)
1943  );
1944 
1945  FW_ASSERT(
1946  this->m_logOut_OutputPort[portNum].isConnected(),
1947  static_cast<FwAssertArgType>(portNum)
1948  );
1949  this->m_logOut_OutputPort[portNum].invoke(
1950  id,
1951  timeTag,
1952  severity,
1953  args
1954  );
1955  }
1956 
1957 #if FW_ENABLE_TEXT_LOGGING
1958 
1959  void VersionComponentBase ::
1960  logTextOut_out(
1961  FwIndexType portNum,
1962  FwEventIdType id,
1963  Fw::Time& timeTag,
1964  const Fw::LogSeverity& severity,
1965  Fw::TextLogString& text
1966  ) const
1967  {
1968  FW_ASSERT(
1969  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
1970  static_cast<FwAssertArgType>(portNum)
1971  );
1972 
1973  FW_ASSERT(
1974  this->m_logTextOut_OutputPort[portNum].isConnected(),
1975  static_cast<FwAssertArgType>(portNum)
1976  );
1977  this->m_logTextOut_OutputPort[portNum].invoke(
1978  id,
1979  timeTag,
1980  severity,
1981  text
1982  );
1983  }
1984 
1985 #endif
1986 
1987  void VersionComponentBase ::
1988  timeCaller_out(
1989  FwIndexType portNum,
1990  Fw::Time& time
1991  ) const
1992  {
1993  FW_ASSERT(
1994  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
1995  static_cast<FwAssertArgType>(portNum)
1996  );
1997 
1998  FW_ASSERT(
1999  this->m_timeCaller_OutputPort[portNum].isConnected(),
2000  static_cast<FwAssertArgType>(portNum)
2001  );
2002  this->m_timeCaller_OutputPort[portNum].invoke(
2003  time
2004  );
2005  }
2006 
2007  void VersionComponentBase ::
2008  tlmOut_out(
2009  FwIndexType portNum,
2010  FwChanIdType id,
2011  Fw::Time& timeTag,
2012  Fw::TlmBuffer& val
2013  ) const
2014  {
2015  FW_ASSERT(
2016  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
2017  static_cast<FwAssertArgType>(portNum)
2018  );
2019 
2020  FW_ASSERT(
2021  this->m_tlmOut_OutputPort[portNum].isConnected(),
2022  static_cast<FwAssertArgType>(portNum)
2023  );
2024  this->m_tlmOut_OutputPort[portNum].invoke(
2025  id,
2026  timeTag,
2027  val
2028  );
2029  }
2030 
2031 #endif
2032 
2033 }
Serialization/Deserialization operation was successful.
void tlmWrite_LibraryVersion10(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time()) const
Write telemetry channel LibraryVersion10.
void tlmWrite_CustomVersion07(const Svc::CustomVersionDb &arg, Fw::Time _tlmTime=Fw::Time()) const
Write telemetry channel CustomVersion07.
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:157
The size of the serial representation.
void tlmWrite_LibraryVersion04(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time()) const
Write telemetry channel LibraryVersion04.
void regCommands()
Register commands with the Command Dispatcher.
FwIdType FwOpcodeType
The type of a command opcode.
void tlmWrite(FwChanIdType id, Fw::TlmBuffer &_tlmBuff, Fw::Time _tlmTime=Fw::Time()) const
void tlmWrite_LibraryVersion01(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time()) const
virtual void getVersion_handler(FwIndexType portNum, const Svc::VersionCfg::VersionEnum &version_id, Fw::StringBase &version_string, Svc::VersionStatus &status)=0
Handler for input port getVersion.
static constexpr FwIndexType getNum_cmdRegOut_OutputPorts()
void tlmWrite_CustomVersion02(const Svc::CustomVersionDb &arg, Fw::Time _tlmTime=Fw::Time()) const
Write telemetry channel CustomVersion02.
I32 FwEnumStoreType
bool isConnected_tlmOut_OutputPort(FwIndexType portNum) const
void tlmWrite_CustomVersion10(const Svc::CustomVersionDb &arg, Fw::Time _tlmTime=Fw::Time()) const
Write telemetry channel CustomVersion10.
virtual void ENABLE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Svc::VersionEnabled &enable)=0
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
void init()
Initialization function.
Definition: SchedPortAc.cpp:73
void tlmWrite_LibraryVersion06(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time()) const
Write telemetry channel LibraryVersion06.
static constexpr FwIndexType getNum_cmdIn_InputPorts()
void init()
Initialization function.
Definition: CmdPortAc.cpp:89
SerializeStatus deserializeTo(U8 &val, Endianness mode=Endianness::BIG) override
Deserialize an 8-bit unsigned integer value.
virtual void setVersion_handler(FwIndexType portNum, const Svc::VersionCfg::VersionEnum &version_id, Fw::StringBase &version_string, Svc::VersionStatus &status)=0
Handler for input port setVersion.
bool isConnected_cmdRegOut_OutputPort(FwIndexType portNum) const
Fw::InputCmdPort * get_cmdIn_InputPort(FwIndexType portNum)
void tlmWrite_CustomVersion03(const Svc::CustomVersionDb &arg, Fw::Time _tlmTime=Fw::Time()) const
Write telemetry channel CustomVersion03.
A command to enable or disable Event verbosity and Telemetry.
virtual const CHAR * toChar() const =0
Convert to a C-style char*.
const Time ZERO_TIME
Definition: Time.cpp:5
void VERSION_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
virtual void unLock()
Unlock the guarded mutex.
void init()
Initialization function.
Definition: TlmPortAc.cpp:171
void tlmWrite_LibraryVersion03(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time()) const
Write telemetry channel LibraryVersion03.
Enum representing a command response.
No time base has been established (Required)
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
static constexpr FwIndexType getNum_getVersion_InputPorts()
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
static constexpr FwIndexType getNum_tlmOut_OutputPorts()
void tlmWrite_LibraryVersion08(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time()) const
Write telemetry channel LibraryVersion08.
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:177
void init()
Object initializer.
Definition: ObjBase.cpp:24
virtual ~VersionComponentBase()
Destroy VersionComponentBase object.
SerializeStatus
forward declaration for string
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: CmdPortAc.cpp:95
void setVersion_handlerBase(FwIndexType portNum, const Svc::VersionCfg::VersionEnum &version_id, Fw::StringBase &version_string, Svc::VersionStatus &status)
Handler base-class function for input port setVersion.
void tlmWrite_CustomVersion05(const Svc::CustomVersionDb &arg, Fw::Time _tlmTime=Fw::Time()) const
Write telemetry channel CustomVersion05.
FwIdType FwEventIdType
The type of an event identifier.
Auto-generated base for Version component.
void log_ACTIVITY_LO_ProjectVersion(const Fw::StringBase &version) const
An enumeration for version status.
void invoke(FwOpcodeType opCode) const
Invoke a port connection.
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:40
void init()
Initialization function.
Definition: TimePortAc.cpp:151
Svc::InputVersionPort * get_getVersion_InputPort(FwIndexType portNum)
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Less important informational events.
static constexpr FwIndexType getNum_timeCaller_OutputPorts()
#define FW_MIN(a, b)
MIN macro (deprecated in C++, use std::min)
Definition: BasicTypes.h:99
void schedIn_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port schedIn.
virtual void schedIn_handler(FwIndexType portNum, U32 context)=0
Handler for input port schedIn.
void invoke(Fw::Time &time) const
Invoke a port connection.
Definition: TimePortAc.cpp:170
Serializable::SizeType getDeserializeSizeLeft() const override
Get remaining deserialization buffer size.
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke a port connection.
void unLock()
unlock the mutex and assert success
FwIdType FwChanIdType
The type of a telemetry channel identifier.
void tlmWrite_LibraryVersion05(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time()) const
Write telemetry channel LibraryVersion05.
Svc::InputVersionPort * get_setVersion_InputPort(FwIndexType portNum)
void resetDeser() override
Reset deserialization pointer to beginning of buffer.
void getVersion_handlerBase(FwIndexType portNum, const Svc::VersionCfg::VersionEnum &version_id, Fw::StringBase &version_string, Svc::VersionStatus &status)
Handler base-class function for input port getVersion.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port connection.
Definition: TlmPortAc.cpp:190
const char * toChar() const
Convert to a C-style char*.
bool isConnected() const
Definition: PortBase.cpp:38
Enum representing event severity.
#define PRI_FwIndexType
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:58
Data Structure for custom version Tlm.
void init()
Initialization function.
Definition: LogPortAc.cpp:180
void set_cmdResponseOut_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
void setPortNum(FwIndexType portNum)
void log_ACTIVITY_LO_CustomVersions(const Svc::VersionCfg::VersionEnum &version_enum, const Fw::StringBase &version_value) const
virtual void lock()
Lock the guarded mutex.
Command failed to deserialize.
void lock()
lock the mutex and assert success
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: SchedPortAc.cpp:79
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port connection.
Definition: LogPortAc.cpp:199
Svc::InputSchedPort * get_schedIn_InputPort(FwIndexType portNum)
bool isConnected_logOut_OutputPort(FwIndexType portNum) const
void tlmWrite_CustomVersion09(const Svc::CustomVersionDb &arg, Fw::Time _tlmTime=Fw::Time()) const
Write telemetry channel CustomVersion09.
PlatformIndexType FwIndexType
void tlmWrite_CustomVersion06(const Svc::CustomVersionDb &arg, Fw::Time _tlmTime=Fw::Time()) const
Write telemetry channel CustomVersion06.
void tlmWrite_LibraryVersion07(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time()) const
Write telemetry channel LibraryVersion07.
static constexpr FwIndexType getNum_logOut_OutputPorts()
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:186
static constexpr FwIndexType getNum_cmdResponseOut_OutputPorts()
void cmdIn_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Handler base-class function for input port cmdIn.
void init()
Initialization function.
RateGroupDivider component implementation.
An enumeration for Version Type.
void tlmWrite_LibraryVersion02(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time()) const
Write telemetry channel LibraryVersion02.
void ENABLE_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
virtual void VERSION_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Svc::VersionType &version_type)=0
void init()
Initialization function.
void tlmWrite_CustomVersion04(const Svc::CustomVersionDb &arg, Fw::Time _tlmTime=Fw::Time()) const
Write telemetry channel CustomVersion04.
bool isConnected_timeCaller_OutputPort(FwIndexType portNum) const
void tlmWrite_CustomVersion01(const Svc::CustomVersionDb &arg, Fw::Time _tlmTime=Fw::Time()) const
static constexpr FwIndexType getNum_schedIn_InputPorts()
Implementation of malloc based allocator.
void log_ACTIVITY_LO_FrameworkVersion(const Fw::StringBase &version) const
VersionComponentBase(const char *compName="")
Construct VersionComponentBase object.
void init()
Initialization function.
void log_ACTIVITY_LO_LibraryVersions(const Fw::StringBase &version) const
Tracks versions for project, framework and user defined versions etc.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
void tlmWrite_CustomVersion08(const Svc::CustomVersionDb &arg, Fw::Time _tlmTime=Fw::Time()) const
Write telemetry channel CustomVersion08.
bool isConnected_cmdResponseOut_OutputPort(FwIndexType portNum) const
void tlmWrite_LibraryVersion09(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time()) const
Write telemetry channel LibraryVersion09.
static constexpr FwIndexType getNum_setVersion_InputPorts()
void tlmWrite_FrameworkVersion(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time()) const
void set_cmdRegOut_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to cmdRegOut[portNum].
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[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.
void tlmWrite_ProjectVersion(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time()) const