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  // Connect input port cmdIn
27  for (
28  FwIndexType port = 0;
29  port < static_cast<FwIndexType>(this->getNum_cmdIn_InputPorts());
30  port++
31  ) {
32  this->m_cmdIn_InputPort[port].init();
33  this->m_cmdIn_InputPort[port].addCallComp(
34  this,
35  m_p_cmdIn_in
36  );
37  this->m_cmdIn_InputPort[port].setPortNum(port);
38 
39 #if FW_OBJECT_NAMES == 1
40  Fw::ObjectName portName;
41  portName.format(
42  "%s_cmdIn_InputPort[%" PRI_FwIndexType "]",
43  this->m_objName.toChar(),
44  port
45  );
46  this->m_cmdIn_InputPort[port].setObjName(portName.toChar());
47 #endif
48  }
49 
50  // Connect input port getVersion
51  for (
52  FwIndexType port = 0;
53  port < static_cast<FwIndexType>(this->getNum_getVersion_InputPorts());
54  port++
55  ) {
56  this->m_getVersion_InputPort[port].init();
57  this->m_getVersion_InputPort[port].addCallComp(
58  this,
59  m_p_getVersion_in
60  );
61  this->m_getVersion_InputPort[port].setPortNum(port);
62 
63 #if FW_OBJECT_NAMES == 1
64  Fw::ObjectName portName;
65  portName.format(
66  "%s_getVersion_InputPort[%" PRI_FwIndexType "]",
67  this->m_objName.toChar(),
68  port
69  );
70  this->m_getVersion_InputPort[port].setObjName(portName.toChar());
71 #endif
72  }
73 
74  // Connect input port setVersion
75  for (
76  FwIndexType port = 0;
77  port < static_cast<FwIndexType>(this->getNum_setVersion_InputPorts());
78  port++
79  ) {
80  this->m_setVersion_InputPort[port].init();
81  this->m_setVersion_InputPort[port].addCallComp(
82  this,
83  m_p_setVersion_in
84  );
85  this->m_setVersion_InputPort[port].setPortNum(port);
86 
87 #if FW_OBJECT_NAMES == 1
88  Fw::ObjectName portName;
89  portName.format(
90  "%s_setVersion_InputPort[%" PRI_FwIndexType "]",
91  this->m_objName.toChar(),
92  port
93  );
94  this->m_setVersion_InputPort[port].setObjName(portName.toChar());
95 #endif
96  }
97 
98  // Connect output port cmdRegOut
99  for (
100  FwIndexType port = 0;
101  port < static_cast<FwIndexType>(this->getNum_cmdRegOut_OutputPorts());
102  port++
103  ) {
104  this->m_cmdRegOut_OutputPort[port].init();
105 
106 #if FW_OBJECT_NAMES == 1
107  Fw::ObjectName portName;
108  portName.format(
109  "%s_cmdRegOut_OutputPort[%" PRI_FwIndexType "]",
110  this->m_objName.toChar(),
111  port
112  );
113  this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar());
114 #endif
115  }
116 
117  // Connect output port cmdResponseOut
118  for (
119  FwIndexType port = 0;
120  port < static_cast<FwIndexType>(this->getNum_cmdResponseOut_OutputPorts());
121  port++
122  ) {
123  this->m_cmdResponseOut_OutputPort[port].init();
124 
125 #if FW_OBJECT_NAMES == 1
126  Fw::ObjectName portName;
127  portName.format(
128  "%s_cmdResponseOut_OutputPort[%" PRI_FwIndexType "]",
129  this->m_objName.toChar(),
130  port
131  );
132  this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar());
133 #endif
134  }
135 
136  // Connect output port logOut
137  for (
138  FwIndexType port = 0;
139  port < static_cast<FwIndexType>(this->getNum_logOut_OutputPorts());
140  port++
141  ) {
142  this->m_logOut_OutputPort[port].init();
143 
144 #if FW_OBJECT_NAMES == 1
145  Fw::ObjectName portName;
146  portName.format(
147  "%s_logOut_OutputPort[%" PRI_FwIndexType "]",
148  this->m_objName.toChar(),
149  port
150  );
151  this->m_logOut_OutputPort[port].setObjName(portName.toChar());
152 #endif
153  }
154 
155 #if FW_ENABLE_TEXT_LOGGING == 1
156  // Connect output port logTextOut
157  for (
158  FwIndexType port = 0;
159  port < static_cast<FwIndexType>(this->getNum_logTextOut_OutputPorts());
160  port++
161  ) {
162  this->m_logTextOut_OutputPort[port].init();
163 
164 #if FW_OBJECT_NAMES == 1
165  Fw::ObjectName portName;
166  portName.format(
167  "%s_logTextOut_OutputPort[%" PRI_FwIndexType "]",
168  this->m_objName.toChar(),
169  port
170  );
171  this->m_logTextOut_OutputPort[port].setObjName(portName.toChar());
172 #endif
173  }
174 #endif
175 
176  // Connect output port timeCaller
177  for (
178  FwIndexType port = 0;
179  port < static_cast<FwIndexType>(this->getNum_timeCaller_OutputPorts());
180  port++
181  ) {
182  this->m_timeCaller_OutputPort[port].init();
183 
184 #if FW_OBJECT_NAMES == 1
185  Fw::ObjectName portName;
186  portName.format(
187  "%s_timeCaller_OutputPort[%" PRI_FwIndexType "]",
188  this->m_objName.toChar(),
189  port
190  );
191  this->m_timeCaller_OutputPort[port].setObjName(portName.toChar());
192 #endif
193  }
194 
195  // Connect output port tlmOut
196  for (
197  FwIndexType port = 0;
198  port < static_cast<FwIndexType>(this->getNum_tlmOut_OutputPorts());
199  port++
200  ) {
201  this->m_tlmOut_OutputPort[port].init();
202 
203 #if FW_OBJECT_NAMES == 1
204  Fw::ObjectName portName;
205  portName.format(
206  "%s_tlmOut_OutputPort[%" PRI_FwIndexType "]",
207  this->m_objName.toChar(),
208  port
209  );
210  this->m_tlmOut_OutputPort[port].setObjName(portName.toChar());
211 #endif
212  }
213  }
214 
215  // ----------------------------------------------------------------------
216  // Getters for special input ports
217  // ----------------------------------------------------------------------
218 
221  {
222  FW_ASSERT(
223  (0 <= portNum) && (portNum < this->getNum_cmdIn_InputPorts()),
224  static_cast<FwAssertArgType>(portNum)
225  );
226 
227  return &this->m_cmdIn_InputPort[portNum];
228  }
229 
230  // ----------------------------------------------------------------------
231  // Getters for typed input ports
232  // ----------------------------------------------------------------------
233 
236  {
237  FW_ASSERT(
238  (0 <= portNum) && (portNum < this->getNum_getVersion_InputPorts()),
239  static_cast<FwAssertArgType>(portNum)
240  );
241 
242  return &this->m_getVersion_InputPort[portNum];
243  }
244 
247  {
248  FW_ASSERT(
249  (0 <= portNum) && (portNum < this->getNum_setVersion_InputPorts()),
250  static_cast<FwAssertArgType>(portNum)
251  );
252 
253  return &this->m_setVersion_InputPort[portNum];
254  }
255 
256  // ----------------------------------------------------------------------
257  // Connect input ports to special output ports
258  // ----------------------------------------------------------------------
259 
262  FwIndexType portNum,
263  Fw::InputCmdRegPort* port
264  )
265  {
266  FW_ASSERT(
267  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
268  static_cast<FwAssertArgType>(portNum)
269  );
270 
271  this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
272  }
273 
276  FwIndexType portNum,
278  )
279  {
280  FW_ASSERT(
281  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
282  static_cast<FwAssertArgType>(portNum)
283  );
284 
285  this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
286  }
287 
290  FwIndexType portNum,
291  Fw::InputLogPort* port
292  )
293  {
294  FW_ASSERT(
295  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
296  static_cast<FwAssertArgType>(portNum)
297  );
298 
299  this->m_logOut_OutputPort[portNum].addCallPort(port);
300  }
301 
302 #if FW_ENABLE_TEXT_LOGGING == 1
303 
304  void VersionComponentBase ::
305  set_logTextOut_OutputPort(
306  FwIndexType portNum,
308  )
309  {
310  FW_ASSERT(
311  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
312  static_cast<FwAssertArgType>(portNum)
313  );
314 
315  this->m_logTextOut_OutputPort[portNum].addCallPort(port);
316  }
317 
318 #endif
319 
322  FwIndexType portNum,
323  Fw::InputTimePort* port
324  )
325  {
326  FW_ASSERT(
327  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
328  static_cast<FwAssertArgType>(portNum)
329  );
330 
331  this->m_timeCaller_OutputPort[portNum].addCallPort(port);
332  }
333 
336  FwIndexType portNum,
337  Fw::InputTlmPort* port
338  )
339  {
340  FW_ASSERT(
341  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
342  static_cast<FwAssertArgType>(portNum)
343  );
344 
345  this->m_tlmOut_OutputPort[portNum].addCallPort(port);
346  }
347 
348 #if FW_PORT_SERIALIZATION
349 
350  // ----------------------------------------------------------------------
351  // Connect serial input ports to special output ports
352  // ----------------------------------------------------------------------
353 
356  FwIndexType portNum,
357  Fw::InputSerializePort* port
358  )
359  {
360  FW_ASSERT(
361  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
362  static_cast<FwAssertArgType>(portNum)
363  );
364 
365  this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
366  }
367 
370  FwIndexType portNum,
371  Fw::InputSerializePort* port
372  )
373  {
374  FW_ASSERT(
375  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
376  static_cast<FwAssertArgType>(portNum)
377  );
378 
379  this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
380  }
381 
384  FwIndexType portNum,
385  Fw::InputSerializePort* port
386  )
387  {
388  FW_ASSERT(
389  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
390  static_cast<FwAssertArgType>(portNum)
391  );
392 
393  this->m_logOut_OutputPort[portNum].registerSerialPort(port);
394  }
395 
396 #if FW_ENABLE_TEXT_LOGGING == 1
397 
398  void VersionComponentBase ::
399  set_logTextOut_OutputPort(
400  FwIndexType portNum,
401  Fw::InputSerializePort* port
402  )
403  {
404  FW_ASSERT(
405  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
406  static_cast<FwAssertArgType>(portNum)
407  );
408 
409  this->m_logTextOut_OutputPort[portNum].registerSerialPort(port);
410  }
411 
412 #endif
413 
416  FwIndexType portNum,
417  Fw::InputSerializePort* port
418  )
419  {
420  FW_ASSERT(
421  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
422  static_cast<FwAssertArgType>(portNum)
423  );
424 
425  this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
426  }
427 
430  FwIndexType portNum,
431  Fw::InputSerializePort* port
432  )
433  {
434  FW_ASSERT(
435  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
436  static_cast<FwAssertArgType>(portNum)
437  );
438 
439  this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
440  }
441 
442 #endif
443 
444  // ----------------------------------------------------------------------
445  // Command registration
446  // ----------------------------------------------------------------------
447 
450  {
451  FW_ASSERT(this->m_cmdRegOut_OutputPort[0].isConnected());
452 
453  this->m_cmdRegOut_OutputPort[0].invoke(
454  this->getIdBase() + OPCODE_ENABLE
455  );
456 
457  this->m_cmdRegOut_OutputPort[0].invoke(
458  this->getIdBase() + OPCODE_VERSION
459  );
460  }
461 
462  // ----------------------------------------------------------------------
463  // Component construction and destruction
464  // ----------------------------------------------------------------------
465 
467  VersionComponentBase(const char* compName) :
468  Fw::PassiveComponentBase(compName)
469  {
470 
471  }
472 
475  {
476 
477  }
478 
479  // ----------------------------------------------------------------------
480  // Connection status queries for special output ports
481  // ----------------------------------------------------------------------
482 
485  {
486  FW_ASSERT(
487  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
488  static_cast<FwAssertArgType>(portNum)
489  );
490 
491  return this->m_cmdRegOut_OutputPort[portNum].isConnected();
492  }
493 
496  {
497  FW_ASSERT(
498  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
499  static_cast<FwAssertArgType>(portNum)
500  );
501 
502  return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
503  }
504 
507  {
508  FW_ASSERT(
509  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
510  static_cast<FwAssertArgType>(portNum)
511  );
512 
513  return this->m_logOut_OutputPort[portNum].isConnected();
514  }
515 
516 #if FW_ENABLE_TEXT_LOGGING == 1
517 
518  bool VersionComponentBase ::
519  isConnected_logTextOut_OutputPort(FwIndexType portNum)
520  {
521  FW_ASSERT(
522  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
523  static_cast<FwAssertArgType>(portNum)
524  );
525 
526  return this->m_logTextOut_OutputPort[portNum].isConnected();
527  }
528 
529 #endif
530 
533  {
534  FW_ASSERT(
535  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
536  static_cast<FwAssertArgType>(portNum)
537  );
538 
539  return this->m_timeCaller_OutputPort[portNum].isConnected();
540  }
541 
544  {
545  FW_ASSERT(
546  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
547  static_cast<FwAssertArgType>(portNum)
548  );
549 
550  return this->m_tlmOut_OutputPort[portNum].isConnected();
551  }
552 
553  // ----------------------------------------------------------------------
554  // Port handler base-class functions for typed input ports
555  //
556  // Call these functions directly to bypass the corresponding ports
557  // ----------------------------------------------------------------------
558 
561  FwIndexType portNum,
562  const Svc::VersionCfg::VersionEnum& version_id,
563  Fw::StringBase& version_string,
564  Svc::VersionStatus& status
565  )
566  {
567  // Make sure port number is valid
568  FW_ASSERT(
569  (0 <= portNum) && (portNum < this->getNum_getVersion_InputPorts()),
570  static_cast<FwAssertArgType>(portNum)
571  );
572 
573  // Lock guard mutex before calling
574  this->lock();
575 
576  // Call handler function
577  this->getVersion_handler(
578  portNum,
579  version_id,
580  version_string,
581  status
582  );
583 
584  // Unlock guard mutex
585  this->unLock();
586  }
587 
590  FwIndexType portNum,
591  const Svc::VersionCfg::VersionEnum& version_id,
592  Fw::StringBase& version_string,
593  Svc::VersionStatus& status
594  )
595  {
596  // Make sure port number is valid
597  FW_ASSERT(
598  (0 <= portNum) && (portNum < this->getNum_setVersion_InputPorts()),
599  static_cast<FwAssertArgType>(portNum)
600  );
601 
602  // Lock guard mutex before calling
603  this->lock();
604 
605  // Call handler function
606  this->setVersion_handler(
607  portNum,
608  version_id,
609  version_string,
610  status
611  );
612 
613  // Unlock guard mutex
614  this->unLock();
615  }
616 
617  // ----------------------------------------------------------------------
618  // Command response
619  // ----------------------------------------------------------------------
620 
623  FwOpcodeType opCode,
624  U32 cmdSeq,
625  Fw::CmdResponse response
626  )
627  {
628  FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
629  this->m_cmdResponseOut_OutputPort[0].invoke(opCode, cmdSeq, response);
630  }
631 
632  // ----------------------------------------------------------------------
633  // Command handler base-class functions
634  //
635  // Call these functions directly to bypass the command input port
636  // ----------------------------------------------------------------------
637 
640  FwOpcodeType opCode,
641  U32 cmdSeq,
642  Fw::CmdArgBuffer& args
643  )
644  {
645  // Deserialize the arguments
647 
648  // Reset the buffer
649  args.resetDeser();
650 
651  Svc::VersionEnabled enable;
652  _status = args.deserializeTo(enable);
653  if (_status != Fw::FW_SERIALIZE_OK) {
654  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
655  this->m_cmdResponseOut_OutputPort[0].invoke(
656  opCode,
657  cmdSeq,
659  );
660  }
661  return;
662  }
663 
664 #if FW_CMD_CHECK_RESIDUAL
665  // Make sure there was no data left over.
666  // That means the argument buffer size was incorrect.
667  if (args.getDeserializeSizeLeft() != 0) {
668  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
669  this->m_cmdResponseOut_OutputPort[0].invoke(
670  opCode,
671  cmdSeq,
673  );
674  }
675  return;
676  }
677 #endif
678 
679  this->lock();
680 
681  this->ENABLE_cmdHandler(
682  opCode, cmdSeq,
683  enable
684  );
685 
686  this->unLock();
687  }
688 
691  FwOpcodeType opCode,
692  U32 cmdSeq,
693  Fw::CmdArgBuffer& args
694  )
695  {
696  // Deserialize the arguments
698 
699  // Reset the buffer
700  args.resetDeser();
701 
702  Svc::VersionType version_type;
703  _status = args.deserializeTo(version_type);
704  if (_status != Fw::FW_SERIALIZE_OK) {
705  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
706  this->m_cmdResponseOut_OutputPort[0].invoke(
707  opCode,
708  cmdSeq,
710  );
711  }
712  return;
713  }
714 
715 #if FW_CMD_CHECK_RESIDUAL
716  // Make sure there was no data left over.
717  // That means the argument buffer size was incorrect.
718  if (args.getDeserializeSizeLeft() != 0) {
719  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
720  this->m_cmdResponseOut_OutputPort[0].invoke(
721  opCode,
722  cmdSeq,
724  );
725  }
726  return;
727  }
728 #endif
729 
730  this->lock();
731 
732  this->VERSION_cmdHandler(
733  opCode, cmdSeq,
734  version_type
735  );
736 
737  this->unLock();
738  }
739 
740  // ----------------------------------------------------------------------
741  // Event logging functions
742  // ----------------------------------------------------------------------
743 
746  {
747  // Get the time
748  Fw::Time _logTime;
749  if (this->m_timeCaller_OutputPort[0].isConnected()) {
750  this->m_timeCaller_OutputPort[0].invoke(_logTime);
751  }
752 
753  FwEventIdType _id = static_cast<FwEventIdType>(0);
754 
755  _id = this->getIdBase() + EVENTID_FRAMEWORKVERSION;
756 
757  // Emit the event on the log port
758  if (this->m_logOut_OutputPort[0].isConnected()) {
759  Fw::LogBuffer _logBuff;
761 
762 #if FW_AMPCS_COMPATIBLE
763  // Serialize the number of arguments
764  _status = _logBuff.serializeFrom(static_cast<U8>(1));
765  FW_ASSERT(
766  _status == Fw::FW_SERIALIZE_OK,
767  static_cast<FwAssertArgType>(_status)
768  );
769 #endif
770 
771  _status = version.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
772  FW_ASSERT(
773  _status == Fw::FW_SERIALIZE_OK,
774  static_cast<FwAssertArgType>(_status)
775  );
776 
777  this->m_logOut_OutputPort[0].invoke(
778  _id,
779  _logTime,
781  _logBuff
782  );
783  }
784 
785  // Emit the event on the text log port
786 #if FW_ENABLE_TEXT_LOGGING
787  if (this->m_logTextOut_OutputPort[0].isConnected()) {
788 #if FW_OBJECT_NAMES == 1
789  const char* _formatString =
790  "(%s) %s: Framework Version: [%s]";
791 #else
792  const char* _formatString =
793  "%s: Framework Version: [%s]";
794 #endif
795 
796  Fw::TextLogString _logString;
797  _logString.format(
798  _formatString,
799 #if FW_OBJECT_NAMES == 1
800  this->m_objName.toChar(),
801 #endif
802  "FrameworkVersion ",
803  version.toChar()
804  );
805 
806  this->m_logTextOut_OutputPort[0].invoke(
807  _id,
808  _logTime,
810  _logString
811  );
812  }
813 #endif
814  }
815 
818  {
819  // Get the time
820  Fw::Time _logTime;
821  if (this->m_timeCaller_OutputPort[0].isConnected()) {
822  this->m_timeCaller_OutputPort[0].invoke(_logTime);
823  }
824 
825  FwEventIdType _id = static_cast<FwEventIdType>(0);
826 
827  _id = this->getIdBase() + EVENTID_PROJECTVERSION;
828 
829  // Emit the event on the log port
830  if (this->m_logOut_OutputPort[0].isConnected()) {
831  Fw::LogBuffer _logBuff;
833 
834 #if FW_AMPCS_COMPATIBLE
835  // Serialize the number of arguments
836  _status = _logBuff.serializeFrom(static_cast<U8>(1));
837  FW_ASSERT(
838  _status == Fw::FW_SERIALIZE_OK,
839  static_cast<FwAssertArgType>(_status)
840  );
841 #endif
842 
843  _status = version.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
844  FW_ASSERT(
845  _status == Fw::FW_SERIALIZE_OK,
846  static_cast<FwAssertArgType>(_status)
847  );
848 
849  this->m_logOut_OutputPort[0].invoke(
850  _id,
851  _logTime,
853  _logBuff
854  );
855  }
856 
857  // Emit the event on the text log port
858 #if FW_ENABLE_TEXT_LOGGING
859  if (this->m_logTextOut_OutputPort[0].isConnected()) {
860 #if FW_OBJECT_NAMES == 1
861  const char* _formatString =
862  "(%s) %s: Project Version: [%s]";
863 #else
864  const char* _formatString =
865  "%s: Project Version: [%s]";
866 #endif
867 
868  Fw::TextLogString _logString;
869  _logString.format(
870  _formatString,
871 #if FW_OBJECT_NAMES == 1
872  this->m_objName.toChar(),
873 #endif
874  "ProjectVersion ",
875  version.toChar()
876  );
877 
878  this->m_logTextOut_OutputPort[0].invoke(
879  _id,
880  _logTime,
882  _logString
883  );
884  }
885 #endif
886  }
887 
890  {
891  // Get the time
892  Fw::Time _logTime;
893  if (this->m_timeCaller_OutputPort[0].isConnected()) {
894  this->m_timeCaller_OutputPort[0].invoke(_logTime);
895  }
896 
897  FwEventIdType _id = static_cast<FwEventIdType>(0);
898 
899  _id = this->getIdBase() + EVENTID_LIBRARYVERSIONS;
900 
901  // Emit the event on the log port
902  if (this->m_logOut_OutputPort[0].isConnected()) {
903  Fw::LogBuffer _logBuff;
905 
906 #if FW_AMPCS_COMPATIBLE
907  // Serialize the number of arguments
908  _status = _logBuff.serializeFrom(static_cast<U8>(1));
909  FW_ASSERT(
910  _status == Fw::FW_SERIALIZE_OK,
911  static_cast<FwAssertArgType>(_status)
912  );
913 #endif
914 
915  _status = version.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
916  FW_ASSERT(
917  _status == Fw::FW_SERIALIZE_OK,
918  static_cast<FwAssertArgType>(_status)
919  );
920 
921  this->m_logOut_OutputPort[0].invoke(
922  _id,
923  _logTime,
925  _logBuff
926  );
927  }
928 
929  // Emit the event on the text log port
930 #if FW_ENABLE_TEXT_LOGGING
931  if (this->m_logTextOut_OutputPort[0].isConnected()) {
932 #if FW_OBJECT_NAMES == 1
933  const char* _formatString =
934  "(%s) %s: Library Versions: [%s]";
935 #else
936  const char* _formatString =
937  "%s: Library Versions: [%s]";
938 #endif
939 
940  Fw::TextLogString _logString;
941  _logString.format(
942  _formatString,
943 #if FW_OBJECT_NAMES == 1
944  this->m_objName.toChar(),
945 #endif
946  "LibraryVersions ",
947  version.toChar()
948  );
949 
950  this->m_logTextOut_OutputPort[0].invoke(
951  _id,
952  _logTime,
954  _logString
955  );
956  }
957 #endif
958  }
959 
962  Svc::VersionCfg::VersionEnum version_enum,
963  const Fw::StringBase& version_value
964  ) const
965  {
966  // Get the time
967  Fw::Time _logTime;
968  if (this->m_timeCaller_OutputPort[0].isConnected()) {
969  this->m_timeCaller_OutputPort[0].invoke(_logTime);
970  }
971 
972  FwEventIdType _id = static_cast<FwEventIdType>(0);
973 
974  _id = this->getIdBase() + EVENTID_CUSTOMVERSIONS;
975 
976  // Emit the event on the log port
977  if (this->m_logOut_OutputPort[0].isConnected()) {
978  Fw::LogBuffer _logBuff;
980 
981 #if FW_AMPCS_COMPATIBLE
982  // Serialize the number of arguments
983  _status = _logBuff.serializeFrom(static_cast<U8>(2));
984  FW_ASSERT(
985  _status == Fw::FW_SERIALIZE_OK,
986  static_cast<FwAssertArgType>(_status)
987  );
988 #endif
989 
990 #if FW_AMPCS_COMPATIBLE
991  // Serialize the argument size
992  _status = _logBuff.serializeFrom(
994  );
995  FW_ASSERT(
996  _status == Fw::FW_SERIALIZE_OK,
997  static_cast<FwAssertArgType>(_status)
998  );
999 #endif
1000  _status = _logBuff.serializeFrom(version_enum);
1001  FW_ASSERT(
1002  _status == Fw::FW_SERIALIZE_OK,
1003  static_cast<FwAssertArgType>(_status)
1004  );
1005 
1006  _status = version_value.serializeTo(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1007  FW_ASSERT(
1008  _status == Fw::FW_SERIALIZE_OK,
1009  static_cast<FwAssertArgType>(_status)
1010  );
1011 
1012  this->m_logOut_OutputPort[0].invoke(
1013  _id,
1014  _logTime,
1016  _logBuff
1017  );
1018  }
1019 
1020  // Emit the event on the text log port
1021 #if FW_ENABLE_TEXT_LOGGING
1022  if (this->m_logTextOut_OutputPort[0].isConnected()) {
1023 #if FW_OBJECT_NAMES == 1
1024  const char* _formatString =
1025  "(%s) %s: Custom Versions: [%s] [%s]";
1026 #else
1027  const char* _formatString =
1028  "%s: Custom Versions: [%s] [%s]";
1029 #endif
1030 
1031  Fw::String version_enumStr;
1032  version_enum.toString(version_enumStr);
1033 
1034  Fw::TextLogString _logString;
1035  _logString.format(
1036  _formatString,
1037 #if FW_OBJECT_NAMES == 1
1038  this->m_objName.toChar(),
1039 #endif
1040  "CustomVersions ",
1041  version_enumStr.toChar(),
1042  version_value.toChar()
1043  );
1044 
1045  this->m_logTextOut_OutputPort[0].invoke(
1046  _id,
1047  _logTime,
1049  _logString
1050  );
1051  }
1052 #endif
1053  }
1054 
1055  // ----------------------------------------------------------------------
1056  // Telemetry write functions
1057  // ----------------------------------------------------------------------
1058 
1061  const Fw::StringBase& arg,
1062  Fw::Time _tlmTime
1063  ) const
1064  {
1065  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1066  if (
1067  this->m_timeCaller_OutputPort[0].isConnected() &&
1068  (_tlmTime == Fw::ZERO_TIME)
1069  ) {
1070  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1071  }
1072 
1073  Fw::TlmBuffer _tlmBuff;
1074  Fw::SerializeStatus _stat = arg.serializeTo(_tlmBuff, FW_MIN(FW_TLM_STRING_MAX_SIZE, 40));
1075  FW_ASSERT(
1076  _stat == Fw::FW_SERIALIZE_OK,
1077  static_cast<FwAssertArgType>(_stat)
1078  );
1079 
1080  FwChanIdType _id;
1081 
1082  _id = this->getIdBase() + CHANNELID_FRAMEWORKVERSION;
1083 
1084  this->m_tlmOut_OutputPort[0].invoke(
1085  _id,
1086  _tlmTime,
1087  _tlmBuff
1088  );
1089  }
1090  }
1091 
1094  const Fw::StringBase& arg,
1095  Fw::Time _tlmTime
1096  ) const
1097  {
1098  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1099  if (
1100  this->m_timeCaller_OutputPort[0].isConnected() &&
1101  (_tlmTime == Fw::ZERO_TIME)
1102  ) {
1103  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1104  }
1105 
1106  Fw::TlmBuffer _tlmBuff;
1107  Fw::SerializeStatus _stat = arg.serializeTo(_tlmBuff, FW_MIN(FW_TLM_STRING_MAX_SIZE, 40));
1108  FW_ASSERT(
1109  _stat == Fw::FW_SERIALIZE_OK,
1110  static_cast<FwAssertArgType>(_stat)
1111  );
1112 
1113  FwChanIdType _id;
1114 
1115  _id = this->getIdBase() + CHANNELID_PROJECTVERSION;
1116 
1117  this->m_tlmOut_OutputPort[0].invoke(
1118  _id,
1119  _tlmTime,
1120  _tlmBuff
1121  );
1122  }
1123  }
1124 
1127  const Svc::CustomVersionDb& arg,
1128  Fw::Time _tlmTime
1129  ) const
1130  {
1131  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1132  if (
1133  this->m_timeCaller_OutputPort[0].isConnected() &&
1134  (_tlmTime == Fw::ZERO_TIME)
1135  ) {
1136  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1137  }
1138 
1139  Fw::TlmBuffer _tlmBuff;
1140  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1141  FW_ASSERT(
1142  _stat == Fw::FW_SERIALIZE_OK,
1143  static_cast<FwAssertArgType>(_stat)
1144  );
1145 
1146  FwChanIdType _id;
1147 
1148  _id = this->getIdBase() + CHANNELID_CUSTOMVERSION01;
1149 
1150  this->m_tlmOut_OutputPort[0].invoke(
1151  _id,
1152  _tlmTime,
1153  _tlmBuff
1154  );
1155  }
1156  }
1157 
1160  const Svc::CustomVersionDb& arg,
1161  Fw::Time _tlmTime
1162  ) const
1163  {
1164  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1165  if (
1166  this->m_timeCaller_OutputPort[0].isConnected() &&
1167  (_tlmTime == Fw::ZERO_TIME)
1168  ) {
1169  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1170  }
1171 
1172  Fw::TlmBuffer _tlmBuff;
1173  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1174  FW_ASSERT(
1175  _stat == Fw::FW_SERIALIZE_OK,
1176  static_cast<FwAssertArgType>(_stat)
1177  );
1178 
1179  FwChanIdType _id;
1180 
1181  _id = this->getIdBase() + CHANNELID_CUSTOMVERSION02;
1182 
1183  this->m_tlmOut_OutputPort[0].invoke(
1184  _id,
1185  _tlmTime,
1186  _tlmBuff
1187  );
1188  }
1189  }
1190 
1193  const Svc::CustomVersionDb& arg,
1194  Fw::Time _tlmTime
1195  ) const
1196  {
1197  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1198  if (
1199  this->m_timeCaller_OutputPort[0].isConnected() &&
1200  (_tlmTime == Fw::ZERO_TIME)
1201  ) {
1202  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1203  }
1204 
1205  Fw::TlmBuffer _tlmBuff;
1206  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1207  FW_ASSERT(
1208  _stat == Fw::FW_SERIALIZE_OK,
1209  static_cast<FwAssertArgType>(_stat)
1210  );
1211 
1212  FwChanIdType _id;
1213 
1214  _id = this->getIdBase() + CHANNELID_CUSTOMVERSION03;
1215 
1216  this->m_tlmOut_OutputPort[0].invoke(
1217  _id,
1218  _tlmTime,
1219  _tlmBuff
1220  );
1221  }
1222  }
1223 
1226  const Svc::CustomVersionDb& arg,
1227  Fw::Time _tlmTime
1228  ) const
1229  {
1230  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1231  if (
1232  this->m_timeCaller_OutputPort[0].isConnected() &&
1233  (_tlmTime == Fw::ZERO_TIME)
1234  ) {
1235  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1236  }
1237 
1238  Fw::TlmBuffer _tlmBuff;
1239  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1240  FW_ASSERT(
1241  _stat == Fw::FW_SERIALIZE_OK,
1242  static_cast<FwAssertArgType>(_stat)
1243  );
1244 
1245  FwChanIdType _id;
1246 
1247  _id = this->getIdBase() + CHANNELID_CUSTOMVERSION04;
1248 
1249  this->m_tlmOut_OutputPort[0].invoke(
1250  _id,
1251  _tlmTime,
1252  _tlmBuff
1253  );
1254  }
1255  }
1256 
1259  const Svc::CustomVersionDb& arg,
1260  Fw::Time _tlmTime
1261  ) const
1262  {
1263  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1264  if (
1265  this->m_timeCaller_OutputPort[0].isConnected() &&
1266  (_tlmTime == Fw::ZERO_TIME)
1267  ) {
1268  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1269  }
1270 
1271  Fw::TlmBuffer _tlmBuff;
1272  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1273  FW_ASSERT(
1274  _stat == Fw::FW_SERIALIZE_OK,
1275  static_cast<FwAssertArgType>(_stat)
1276  );
1277 
1278  FwChanIdType _id;
1279 
1280  _id = this->getIdBase() + CHANNELID_CUSTOMVERSION05;
1281 
1282  this->m_tlmOut_OutputPort[0].invoke(
1283  _id,
1284  _tlmTime,
1285  _tlmBuff
1286  );
1287  }
1288  }
1289 
1292  const Svc::CustomVersionDb& arg,
1293  Fw::Time _tlmTime
1294  ) const
1295  {
1296  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1297  if (
1298  this->m_timeCaller_OutputPort[0].isConnected() &&
1299  (_tlmTime == Fw::ZERO_TIME)
1300  ) {
1301  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1302  }
1303 
1304  Fw::TlmBuffer _tlmBuff;
1305  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1306  FW_ASSERT(
1307  _stat == Fw::FW_SERIALIZE_OK,
1308  static_cast<FwAssertArgType>(_stat)
1309  );
1310 
1311  FwChanIdType _id;
1312 
1313  _id = this->getIdBase() + CHANNELID_CUSTOMVERSION06;
1314 
1315  this->m_tlmOut_OutputPort[0].invoke(
1316  _id,
1317  _tlmTime,
1318  _tlmBuff
1319  );
1320  }
1321  }
1322 
1325  const Svc::CustomVersionDb& arg,
1326  Fw::Time _tlmTime
1327  ) const
1328  {
1329  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1330  if (
1331  this->m_timeCaller_OutputPort[0].isConnected() &&
1332  (_tlmTime == Fw::ZERO_TIME)
1333  ) {
1334  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1335  }
1336 
1337  Fw::TlmBuffer _tlmBuff;
1338  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1339  FW_ASSERT(
1340  _stat == Fw::FW_SERIALIZE_OK,
1341  static_cast<FwAssertArgType>(_stat)
1342  );
1343 
1344  FwChanIdType _id;
1345 
1346  _id = this->getIdBase() + CHANNELID_CUSTOMVERSION07;
1347 
1348  this->m_tlmOut_OutputPort[0].invoke(
1349  _id,
1350  _tlmTime,
1351  _tlmBuff
1352  );
1353  }
1354  }
1355 
1358  const Svc::CustomVersionDb& arg,
1359  Fw::Time _tlmTime
1360  ) const
1361  {
1362  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1363  if (
1364  this->m_timeCaller_OutputPort[0].isConnected() &&
1365  (_tlmTime == Fw::ZERO_TIME)
1366  ) {
1367  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1368  }
1369 
1370  Fw::TlmBuffer _tlmBuff;
1371  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1372  FW_ASSERT(
1373  _stat == Fw::FW_SERIALIZE_OK,
1374  static_cast<FwAssertArgType>(_stat)
1375  );
1376 
1377  FwChanIdType _id;
1378 
1379  _id = this->getIdBase() + CHANNELID_CUSTOMVERSION08;
1380 
1381  this->m_tlmOut_OutputPort[0].invoke(
1382  _id,
1383  _tlmTime,
1384  _tlmBuff
1385  );
1386  }
1387  }
1388 
1391  const Svc::CustomVersionDb& arg,
1392  Fw::Time _tlmTime
1393  ) const
1394  {
1395  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1396  if (
1397  this->m_timeCaller_OutputPort[0].isConnected() &&
1398  (_tlmTime == Fw::ZERO_TIME)
1399  ) {
1400  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1401  }
1402 
1403  Fw::TlmBuffer _tlmBuff;
1404  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1405  FW_ASSERT(
1406  _stat == Fw::FW_SERIALIZE_OK,
1407  static_cast<FwAssertArgType>(_stat)
1408  );
1409 
1410  FwChanIdType _id;
1411 
1412  _id = this->getIdBase() + CHANNELID_CUSTOMVERSION09;
1413 
1414  this->m_tlmOut_OutputPort[0].invoke(
1415  _id,
1416  _tlmTime,
1417  _tlmBuff
1418  );
1419  }
1420  }
1421 
1424  const Svc::CustomVersionDb& arg,
1425  Fw::Time _tlmTime
1426  ) const
1427  {
1428  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1429  if (
1430  this->m_timeCaller_OutputPort[0].isConnected() &&
1431  (_tlmTime == Fw::ZERO_TIME)
1432  ) {
1433  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1434  }
1435 
1436  Fw::TlmBuffer _tlmBuff;
1437  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1438  FW_ASSERT(
1439  _stat == Fw::FW_SERIALIZE_OK,
1440  static_cast<FwAssertArgType>(_stat)
1441  );
1442 
1443  FwChanIdType _id;
1444 
1445  _id = this->getIdBase() + CHANNELID_CUSTOMVERSION10;
1446 
1447  this->m_tlmOut_OutputPort[0].invoke(
1448  _id,
1449  _tlmTime,
1450  _tlmBuff
1451  );
1452  }
1453  }
1454 
1457  const Fw::StringBase& arg,
1458  Fw::Time _tlmTime
1459  ) const
1460  {
1461  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1462  if (
1463  this->m_timeCaller_OutputPort[0].isConnected() &&
1464  (_tlmTime == Fw::ZERO_TIME)
1465  ) {
1466  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1467  }
1468 
1469  Fw::TlmBuffer _tlmBuff;
1470  Fw::SerializeStatus _stat = arg.serializeTo(_tlmBuff, FW_MIN(FW_TLM_STRING_MAX_SIZE, 40));
1471  FW_ASSERT(
1472  _stat == Fw::FW_SERIALIZE_OK,
1473  static_cast<FwAssertArgType>(_stat)
1474  );
1475 
1476  FwChanIdType _id;
1477 
1478  _id = this->getIdBase() + CHANNELID_LIBRARYVERSION01;
1479 
1480  this->m_tlmOut_OutputPort[0].invoke(
1481  _id,
1482  _tlmTime,
1483  _tlmBuff
1484  );
1485  }
1486  }
1487 
1490  const Fw::StringBase& arg,
1491  Fw::Time _tlmTime
1492  ) const
1493  {
1494  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1495  if (
1496  this->m_timeCaller_OutputPort[0].isConnected() &&
1497  (_tlmTime == Fw::ZERO_TIME)
1498  ) {
1499  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1500  }
1501 
1502  Fw::TlmBuffer _tlmBuff;
1503  Fw::SerializeStatus _stat = arg.serializeTo(_tlmBuff, FW_MIN(FW_TLM_STRING_MAX_SIZE, 40));
1504  FW_ASSERT(
1505  _stat == Fw::FW_SERIALIZE_OK,
1506  static_cast<FwAssertArgType>(_stat)
1507  );
1508 
1509  FwChanIdType _id;
1510 
1511  _id = this->getIdBase() + CHANNELID_LIBRARYVERSION02;
1512 
1513  this->m_tlmOut_OutputPort[0].invoke(
1514  _id,
1515  _tlmTime,
1516  _tlmBuff
1517  );
1518  }
1519  }
1520 
1523  const Fw::StringBase& arg,
1524  Fw::Time _tlmTime
1525  ) const
1526  {
1527  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1528  if (
1529  this->m_timeCaller_OutputPort[0].isConnected() &&
1530  (_tlmTime == Fw::ZERO_TIME)
1531  ) {
1532  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1533  }
1534 
1535  Fw::TlmBuffer _tlmBuff;
1536  Fw::SerializeStatus _stat = arg.serializeTo(_tlmBuff, FW_MIN(FW_TLM_STRING_MAX_SIZE, 40));
1537  FW_ASSERT(
1538  _stat == Fw::FW_SERIALIZE_OK,
1539  static_cast<FwAssertArgType>(_stat)
1540  );
1541 
1542  FwChanIdType _id;
1543 
1544  _id = this->getIdBase() + CHANNELID_LIBRARYVERSION03;
1545 
1546  this->m_tlmOut_OutputPort[0].invoke(
1547  _id,
1548  _tlmTime,
1549  _tlmBuff
1550  );
1551  }
1552  }
1553 
1556  const Fw::StringBase& arg,
1557  Fw::Time _tlmTime
1558  ) const
1559  {
1560  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1561  if (
1562  this->m_timeCaller_OutputPort[0].isConnected() &&
1563  (_tlmTime == Fw::ZERO_TIME)
1564  ) {
1565  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1566  }
1567 
1568  Fw::TlmBuffer _tlmBuff;
1569  Fw::SerializeStatus _stat = arg.serializeTo(_tlmBuff, FW_MIN(FW_TLM_STRING_MAX_SIZE, 40));
1570  FW_ASSERT(
1571  _stat == Fw::FW_SERIALIZE_OK,
1572  static_cast<FwAssertArgType>(_stat)
1573  );
1574 
1575  FwChanIdType _id;
1576 
1577  _id = this->getIdBase() + CHANNELID_LIBRARYVERSION04;
1578 
1579  this->m_tlmOut_OutputPort[0].invoke(
1580  _id,
1581  _tlmTime,
1582  _tlmBuff
1583  );
1584  }
1585  }
1586 
1589  const Fw::StringBase& arg,
1590  Fw::Time _tlmTime
1591  ) const
1592  {
1593  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1594  if (
1595  this->m_timeCaller_OutputPort[0].isConnected() &&
1596  (_tlmTime == Fw::ZERO_TIME)
1597  ) {
1598  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1599  }
1600 
1601  Fw::TlmBuffer _tlmBuff;
1602  Fw::SerializeStatus _stat = arg.serializeTo(_tlmBuff, FW_MIN(FW_TLM_STRING_MAX_SIZE, 40));
1603  FW_ASSERT(
1604  _stat == Fw::FW_SERIALIZE_OK,
1605  static_cast<FwAssertArgType>(_stat)
1606  );
1607 
1608  FwChanIdType _id;
1609 
1610  _id = this->getIdBase() + CHANNELID_LIBRARYVERSION05;
1611 
1612  this->m_tlmOut_OutputPort[0].invoke(
1613  _id,
1614  _tlmTime,
1615  _tlmBuff
1616  );
1617  }
1618  }
1619 
1622  const Fw::StringBase& arg,
1623  Fw::Time _tlmTime
1624  ) const
1625  {
1626  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1627  if (
1628  this->m_timeCaller_OutputPort[0].isConnected() &&
1629  (_tlmTime == Fw::ZERO_TIME)
1630  ) {
1631  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1632  }
1633 
1634  Fw::TlmBuffer _tlmBuff;
1635  Fw::SerializeStatus _stat = arg.serializeTo(_tlmBuff, FW_MIN(FW_TLM_STRING_MAX_SIZE, 40));
1636  FW_ASSERT(
1637  _stat == Fw::FW_SERIALIZE_OK,
1638  static_cast<FwAssertArgType>(_stat)
1639  );
1640 
1641  FwChanIdType _id;
1642 
1643  _id = this->getIdBase() + CHANNELID_LIBRARYVERSION06;
1644 
1645  this->m_tlmOut_OutputPort[0].invoke(
1646  _id,
1647  _tlmTime,
1648  _tlmBuff
1649  );
1650  }
1651  }
1652 
1655  const Fw::StringBase& arg,
1656  Fw::Time _tlmTime
1657  ) const
1658  {
1659  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1660  if (
1661  this->m_timeCaller_OutputPort[0].isConnected() &&
1662  (_tlmTime == Fw::ZERO_TIME)
1663  ) {
1664  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1665  }
1666 
1667  Fw::TlmBuffer _tlmBuff;
1668  Fw::SerializeStatus _stat = arg.serializeTo(_tlmBuff, FW_MIN(FW_TLM_STRING_MAX_SIZE, 40));
1669  FW_ASSERT(
1670  _stat == Fw::FW_SERIALIZE_OK,
1671  static_cast<FwAssertArgType>(_stat)
1672  );
1673 
1674  FwChanIdType _id;
1675 
1676  _id = this->getIdBase() + CHANNELID_LIBRARYVERSION07;
1677 
1678  this->m_tlmOut_OutputPort[0].invoke(
1679  _id,
1680  _tlmTime,
1681  _tlmBuff
1682  );
1683  }
1684  }
1685 
1688  const Fw::StringBase& arg,
1689  Fw::Time _tlmTime
1690  ) const
1691  {
1692  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1693  if (
1694  this->m_timeCaller_OutputPort[0].isConnected() &&
1695  (_tlmTime == Fw::ZERO_TIME)
1696  ) {
1697  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1698  }
1699 
1700  Fw::TlmBuffer _tlmBuff;
1701  Fw::SerializeStatus _stat = arg.serializeTo(_tlmBuff, FW_MIN(FW_TLM_STRING_MAX_SIZE, 40));
1702  FW_ASSERT(
1703  _stat == Fw::FW_SERIALIZE_OK,
1704  static_cast<FwAssertArgType>(_stat)
1705  );
1706 
1707  FwChanIdType _id;
1708 
1709  _id = this->getIdBase() + CHANNELID_LIBRARYVERSION08;
1710 
1711  this->m_tlmOut_OutputPort[0].invoke(
1712  _id,
1713  _tlmTime,
1714  _tlmBuff
1715  );
1716  }
1717  }
1718 
1721  const Fw::StringBase& arg,
1722  Fw::Time _tlmTime
1723  ) const
1724  {
1725  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1726  if (
1727  this->m_timeCaller_OutputPort[0].isConnected() &&
1728  (_tlmTime == Fw::ZERO_TIME)
1729  ) {
1730  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1731  }
1732 
1733  Fw::TlmBuffer _tlmBuff;
1734  Fw::SerializeStatus _stat = arg.serializeTo(_tlmBuff, FW_MIN(FW_TLM_STRING_MAX_SIZE, 40));
1735  FW_ASSERT(
1736  _stat == Fw::FW_SERIALIZE_OK,
1737  static_cast<FwAssertArgType>(_stat)
1738  );
1739 
1740  FwChanIdType _id;
1741 
1742  _id = this->getIdBase() + CHANNELID_LIBRARYVERSION09;
1743 
1744  this->m_tlmOut_OutputPort[0].invoke(
1745  _id,
1746  _tlmTime,
1747  _tlmBuff
1748  );
1749  }
1750  }
1751 
1754  const Fw::StringBase& arg,
1755  Fw::Time _tlmTime
1756  ) const
1757  {
1758  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1759  if (
1760  this->m_timeCaller_OutputPort[0].isConnected() &&
1761  (_tlmTime == Fw::ZERO_TIME)
1762  ) {
1763  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1764  }
1765 
1766  Fw::TlmBuffer _tlmBuff;
1767  Fw::SerializeStatus _stat = arg.serializeTo(_tlmBuff, FW_MIN(FW_TLM_STRING_MAX_SIZE, 40));
1768  FW_ASSERT(
1769  _stat == Fw::FW_SERIALIZE_OK,
1770  static_cast<FwAssertArgType>(_stat)
1771  );
1772 
1773  FwChanIdType _id;
1774 
1775  _id = this->getIdBase() + CHANNELID_LIBRARYVERSION10;
1776 
1777  this->m_tlmOut_OutputPort[0].invoke(
1778  _id,
1779  _tlmTime,
1780  _tlmBuff
1781  );
1782  }
1783  }
1784 
1785  // ----------------------------------------------------------------------
1786  // Time
1787  // ----------------------------------------------------------------------
1788 
1790  getTime() const
1791  {
1792  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1793  Fw::Time _time;
1794  this->m_timeCaller_OutputPort[0].invoke(_time);
1795  return _time;
1796  }
1797  else {
1798  return Fw::Time(TimeBase::TB_NONE, 0, 0);
1799  }
1800  }
1801 
1802  // ----------------------------------------------------------------------
1803  // Mutex operations for guarded ports
1804  //
1805  // You can override these operations to provide more sophisticated
1806  // synchronization
1807  // ----------------------------------------------------------------------
1808 
1811  {
1812  this->m_guardedPortMutex.lock();
1813  }
1814 
1817  {
1818  this->m_guardedPortMutex.unLock();
1819  }
1820 
1821  // ----------------------------------------------------------------------
1822  // Calls for messages received on special input ports
1823  // ----------------------------------------------------------------------
1824 
1825  void VersionComponentBase ::
1826  m_p_cmdIn_in(
1827  Fw::PassiveComponentBase* callComp,
1828  FwIndexType portNum,
1829  FwOpcodeType opCode,
1830  U32 cmdSeq,
1831  Fw::CmdArgBuffer& args
1832  )
1833  {
1834  FW_ASSERT(callComp);
1835  VersionComponentBase* compPtr = static_cast<VersionComponentBase*>(callComp);
1836 
1837  const U32 idBase = callComp->getIdBase();
1838  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
1839 
1840  // Select base class function based on opcode
1841  switch (opCode - idBase) {
1842  case OPCODE_ENABLE: {
1843  compPtr->ENABLE_cmdHandlerBase(
1844  opCode,
1845  cmdSeq,
1846  args
1847  );
1848  break;
1849  }
1850 
1851  case OPCODE_VERSION: {
1852  compPtr->VERSION_cmdHandlerBase(
1853  opCode,
1854  cmdSeq,
1855  args
1856  );
1857  break;
1858  }
1859  }
1860  }
1861 
1862  // ----------------------------------------------------------------------
1863  // Calls for messages received on typed input ports
1864  // ----------------------------------------------------------------------
1865 
1866  void VersionComponentBase ::
1867  m_p_getVersion_in(
1868  Fw::PassiveComponentBase* callComp,
1869  FwIndexType portNum,
1870  const Svc::VersionCfg::VersionEnum& version_id,
1871  Fw::StringBase& version_string,
1872  Svc::VersionStatus& status
1873  )
1874  {
1875  FW_ASSERT(callComp);
1876  VersionComponentBase* compPtr = static_cast<VersionComponentBase*>(callComp);
1877  compPtr->getVersion_handlerBase(
1878  portNum,
1879  version_id,
1880  version_string,
1881  status
1882  );
1883  }
1884 
1885  void VersionComponentBase ::
1886  m_p_setVersion_in(
1887  Fw::PassiveComponentBase* callComp,
1888  FwIndexType portNum,
1889  const Svc::VersionCfg::VersionEnum& version_id,
1890  Fw::StringBase& version_string,
1891  Svc::VersionStatus& status
1892  )
1893  {
1894  FW_ASSERT(callComp);
1895  VersionComponentBase* compPtr = static_cast<VersionComponentBase*>(callComp);
1896  compPtr->setVersion_handlerBase(
1897  portNum,
1898  version_id,
1899  version_string,
1900  status
1901  );
1902  }
1903 
1904 }
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:134
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_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.
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
static constexpr FwIndexType getNum_cmdRegOut_OutputPorts()
bool isConnected_logOut_OutputPort(FwIndexType portNum)
void tlmWrite_CustomVersion02(const Svc::CustomVersionDb &arg, Fw::Time _tlmTime=Fw::Time()) const
Write telemetry channel CustomVersion02.
I32 FwEnumStoreType
The size of the serial representation.
void tlmWrite_CustomVersion10(const Svc::CustomVersionDb &arg, Fw::Time _tlmTime=Fw::Time()) const
Write telemetry channel CustomVersion10.
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 tlmWrite_LibraryVersion06(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time()) const
Write telemetry channel LibraryVersion06.
const char * toChar() const
Convert to a C-style char*.
Definition: String.hpp:50
static constexpr FwIndexType getNum_cmdIn_InputPorts()
void init()
Initialization function.
Definition: CmdPortAc.cpp:56
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.
Fw::InputCmdPort * get_cmdIn_InputPort(FwIndexType portNum)
A command to enable or disable Event verbosity and Telemetry.
void tlmWrite_CustomVersion03(const Svc::CustomVersionDb &arg, Fw::Time _tlmTime=Fw::Time()) const
Write telemetry channel CustomVersion03.
void unLock()
unlock the mutex and assert success
Definition: Mutex.cpp:41
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:144
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)
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.
virtual void ENABLE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, Svc::VersionEnabled enable)=0
static constexpr FwIndexType getNum_tlmOut_OutputPorts()
bool isConnected_timeCaller_OutputPort(FwIndexType portNum)
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:150
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:62
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 interface.
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:26
void init()
Initialization function.
Definition: TimePortAc.cpp:128
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.
Definition: BasicTypes.h:92
void invoke(Fw::Time &time) const
Invoke a port interface.
Definition: TimePortAc.cpp:147
Serializable::SizeType getDeserializeSizeLeft() const override
Get remaining deserialization buffer size.
const char * toChar() const
Convert to a C-style char*.
Definition: ObjectName.hpp:50
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke a port interface.
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 interface.
Definition: TlmPortAc.cpp:163
bool isConnected() const
Definition: PortBase.cpp:38
#define PRI_FwIndexType
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:39
Data Structure for custom version Tlm.
void init()
Initialization function.
Definition: LogPortAc.cpp:151
void set_cmdResponseOut_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
void setPortNum(FwIndexType portNum)
virtual void lock()
Lock the guarded mutex.
Command failed to deserialize.
void log_ACTIVITY_LO_CustomVersions(Svc::VersionCfg::VersionEnum version_enum, const Fw::StringBase &version_value) const
bool isConnected_cmdRegOut_OutputPort(FwIndexType portNum)
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port interface.
Definition: LogPortAc.cpp:170
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:157
static constexpr FwIndexType getNum_cmdResponseOut_OutputPorts()
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.
bool isConnected_tlmOut_OutputPort(FwIndexType portNum)
SerializeStatus deserializeTo(U8 &val, Endianness mode=Endianness::BIG) override
Deserialize an 8-bit unsigned integer value.
void ENABLE_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void init()
Initialization function.
void tlmWrite_CustomVersion04(const Svc::CustomVersionDb &arg, Fw::Time _tlmTime=Fw::Time()) const
Write telemetry channel CustomVersion04.
void tlmWrite_CustomVersion01(const Svc::CustomVersionDb &arg, Fw::Time _tlmTime=Fw::Time()) const
Implementation of malloc based allocator.
bool isConnected_cmdResponseOut_OutputPort(FwIndexType portNum)
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.
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].
virtual void VERSION_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, Svc::VersionType version_type)=0
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
void lock()
lock the mutex and assert success
Definition: Mutex.cpp:34
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