F´ Flight Software - C/C++ Documentation  devel
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 
8 #include "Fw/Types/Assert.hpp"
10 #if FW_ENABLE_TEXT_LOGGING
11 #include "Fw/Types/String.hpp"
12 #endif
13 
14 namespace Svc {
15 
16  // ----------------------------------------------------------------------
17  // Component initialization
18  // ----------------------------------------------------------------------
19 
21  init(FwEnumStoreType instance)
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_PlatformIntType "]",
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_PlatformIntType "]",
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_PlatformIntType "]",
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_PlatformIntType "]",
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_PlatformIntType "]",
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_PlatformIntType "]",
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_PlatformIntType "]",
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_PlatformIntType "]",
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_PlatformIntType "]",
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  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  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  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  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  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  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  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  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  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  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  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  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  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  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  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 
449  regCommands()
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  // Getters for numbers of special input ports
481  // ----------------------------------------------------------------------
482 
485  {
486  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdIn_InputPort));
487  }
488 
489  // ----------------------------------------------------------------------
490  // Getters for numbers of typed input ports
491  // ----------------------------------------------------------------------
492 
495  {
496  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_getVersion_InputPort));
497  }
498 
501  {
502  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_setVersion_InputPort));
503  }
504 
505  // ----------------------------------------------------------------------
506  // Getters for numbers of special output ports
507  // ----------------------------------------------------------------------
508 
511  {
512  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdRegOut_OutputPort));
513  }
514 
517  {
518  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_cmdResponseOut_OutputPort));
519  }
520 
523  {
524  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_logOut_OutputPort));
525  }
526 
527 #if FW_ENABLE_TEXT_LOGGING == 1
528 
529  FwIndexType VersionComponentBase ::
530  getNum_logTextOut_OutputPorts() const
531  {
532  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_logTextOut_OutputPort));
533  }
534 
535 #endif
536 
539  {
540  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_timeCaller_OutputPort));
541  }
542 
545  {
546  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_tlmOut_OutputPort));
547  }
548 
549  // ----------------------------------------------------------------------
550  // Connection status queries for special output ports
551  // ----------------------------------------------------------------------
552 
555  {
556  FW_ASSERT(
557  portNum < this->getNum_cmdRegOut_OutputPorts(),
558  static_cast<FwAssertArgType>(portNum)
559  );
560 
561  return this->m_cmdRegOut_OutputPort[portNum].isConnected();
562  }
563 
566  {
567  FW_ASSERT(
568  portNum < this->getNum_cmdResponseOut_OutputPorts(),
569  static_cast<FwAssertArgType>(portNum)
570  );
571 
572  return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
573  }
574 
577  {
578  FW_ASSERT(
579  portNum < this->getNum_logOut_OutputPorts(),
580  static_cast<FwAssertArgType>(portNum)
581  );
582 
583  return this->m_logOut_OutputPort[portNum].isConnected();
584  }
585 
586 #if FW_ENABLE_TEXT_LOGGING == 1
587 
588  bool VersionComponentBase ::
589  isConnected_logTextOut_OutputPort(FwIndexType portNum)
590  {
591  FW_ASSERT(
592  portNum < this->getNum_logTextOut_OutputPorts(),
593  static_cast<FwAssertArgType>(portNum)
594  );
595 
596  return this->m_logTextOut_OutputPort[portNum].isConnected();
597  }
598 
599 #endif
600 
603  {
604  FW_ASSERT(
605  portNum < this->getNum_timeCaller_OutputPorts(),
606  static_cast<FwAssertArgType>(portNum)
607  );
608 
609  return this->m_timeCaller_OutputPort[portNum].isConnected();
610  }
611 
614  {
615  FW_ASSERT(
616  portNum < this->getNum_tlmOut_OutputPorts(),
617  static_cast<FwAssertArgType>(portNum)
618  );
619 
620  return this->m_tlmOut_OutputPort[portNum].isConnected();
621  }
622 
623  // ----------------------------------------------------------------------
624  // Port handler base-class functions for typed input ports
625  //
626  // Call these functions directly to bypass the corresponding ports
627  // ----------------------------------------------------------------------
628 
631  FwIndexType portNum,
632  const Svc::VersionCfg::VersionEnum& version_id,
633  Fw::StringBase& version_string,
634  Svc::VersionStatus& status
635  )
636  {
637  // Make sure port number is valid
638  FW_ASSERT(
639  portNum < this->getNum_getVersion_InputPorts(),
640  static_cast<FwAssertArgType>(portNum)
641  );
642 
643  // Lock guard mutex before calling
644  this->lock();
645 
646  // Call handler function
647  this->getVersion_handler(
648  portNum,
649  version_id,
650  version_string,
651  status
652  );
653 
654  // Unlock guard mutex
655  this->unLock();
656  }
657 
660  FwIndexType portNum,
661  const Svc::VersionCfg::VersionEnum& version_id,
662  Fw::StringBase& version_string,
663  Svc::VersionStatus& status
664  )
665  {
666  // Make sure port number is valid
667  FW_ASSERT(
668  portNum < this->getNum_setVersion_InputPorts(),
669  static_cast<FwAssertArgType>(portNum)
670  );
671 
672  // Lock guard mutex before calling
673  this->lock();
674 
675  // Call handler function
676  this->setVersion_handler(
677  portNum,
678  version_id,
679  version_string,
680  status
681  );
682 
683  // Unlock guard mutex
684  this->unLock();
685  }
686 
687  // ----------------------------------------------------------------------
688  // Command response
689  // ----------------------------------------------------------------------
690 
693  FwOpcodeType opCode,
694  U32 cmdSeq,
695  Fw::CmdResponse response
696  )
697  {
698  FW_ASSERT(this->m_cmdResponseOut_OutputPort[0].isConnected());
699  this->m_cmdResponseOut_OutputPort[0].invoke(opCode, cmdSeq, response);
700  }
701 
702  // ----------------------------------------------------------------------
703  // Command handler base-class functions
704  //
705  // Call these functions directly to bypass the command input port
706  // ----------------------------------------------------------------------
707 
710  FwOpcodeType opCode,
711  U32 cmdSeq,
712  Fw::CmdArgBuffer& args
713  )
714  {
715  // Deserialize the arguments
717 
718  // Reset the buffer
719  args.resetDeser();
720 
721  Svc::VersionEnabled enable;
722  _status = args.deserialize(enable);
723  if (_status != Fw::FW_SERIALIZE_OK) {
724  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
725  this->m_cmdResponseOut_OutputPort[0].invoke(
726  opCode,
727  cmdSeq,
729  );
730  }
731  return;
732  }
733 
734 #if FW_CMD_CHECK_RESIDUAL
735  // Make sure there was no data left over.
736  // That means the argument buffer size was incorrect.
737  if (args.getBuffLeft() != 0) {
738  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
739  this->m_cmdResponseOut_OutputPort[0].invoke(
740  opCode,
741  cmdSeq,
743  );
744  }
745  return;
746  }
747 #endif
748 
749  this->lock();
750 
751  this->ENABLE_cmdHandler(
752  opCode, cmdSeq,
753  enable
754  );
755 
756  this->unLock();
757  }
758 
761  FwOpcodeType opCode,
762  U32 cmdSeq,
763  Fw::CmdArgBuffer& args
764  )
765  {
766  // Deserialize the arguments
768 
769  // Reset the buffer
770  args.resetDeser();
771 
772  Svc::VersionType version_type;
773  _status = args.deserialize(version_type);
774  if (_status != Fw::FW_SERIALIZE_OK) {
775  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
776  this->m_cmdResponseOut_OutputPort[0].invoke(
777  opCode,
778  cmdSeq,
780  );
781  }
782  return;
783  }
784 
785 #if FW_CMD_CHECK_RESIDUAL
786  // Make sure there was no data left over.
787  // That means the argument buffer size was incorrect.
788  if (args.getBuffLeft() != 0) {
789  if (this->m_cmdResponseOut_OutputPort[0].isConnected()) {
790  this->m_cmdResponseOut_OutputPort[0].invoke(
791  opCode,
792  cmdSeq,
794  );
795  }
796  return;
797  }
798 #endif
799 
800  this->lock();
801 
802  this->VERSION_cmdHandler(
803  opCode, cmdSeq,
804  version_type
805  );
806 
807  this->unLock();
808  }
809 
810  // ----------------------------------------------------------------------
811  // Event logging functions
812  // ----------------------------------------------------------------------
813 
816  {
817  // Get the time
818  Fw::Time _logTime;
819  if (this->m_timeCaller_OutputPort[0].isConnected()) {
820  this->m_timeCaller_OutputPort[0].invoke(_logTime);
821  }
822 
823  FwEventIdType _id = static_cast<FwEventIdType>(0);
824 
825  _id = this->getIdBase() + EVENTID_FRAMEWORKVERSION;
826 
827  // Emit the event on the log port
828  if (this->m_logOut_OutputPort[0].isConnected()) {
829  Fw::LogBuffer _logBuff;
831 
832 #if FW_AMPCS_COMPATIBLE
833  // Serialize the number of arguments
834  _status = _logBuff.serialize(static_cast<U8>(1));
835  FW_ASSERT(
836  _status == Fw::FW_SERIALIZE_OK,
837  static_cast<FwAssertArgType>(_status)
838  );
839 #endif
840 
841  _status = version.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
842  FW_ASSERT(
843  _status == Fw::FW_SERIALIZE_OK,
844  static_cast<FwAssertArgType>(_status)
845  );
846 
847  this->m_logOut_OutputPort[0].invoke(
848  _id,
849  _logTime,
851  _logBuff
852  );
853  }
854 
855  // Emit the event on the text log port
856 #if FW_ENABLE_TEXT_LOGGING
857  if (this->m_logTextOut_OutputPort[0].isConnected()) {
858 #if FW_OBJECT_NAMES == 1
859  const char* _formatString =
860  "(%s) %s: Framework Version: [%s]";
861 #else
862  const char* _formatString =
863  "%s: Framework Version: [%s]";
864 #endif
865 
866  Fw::TextLogString _logString;
867  _logString.format(
868  _formatString,
869 #if FW_OBJECT_NAMES == 1
870  this->m_objName.toChar(),
871 #endif
872  "FrameworkVersion ",
873  version.toChar()
874  );
875 
876  this->m_logTextOut_OutputPort[0].invoke(
877  _id,
878  _logTime,
880  _logString
881  );
882  }
883 #endif
884  }
885 
888  {
889  // Get the time
890  Fw::Time _logTime;
891  if (this->m_timeCaller_OutputPort[0].isConnected()) {
892  this->m_timeCaller_OutputPort[0].invoke(_logTime);
893  }
894 
895  FwEventIdType _id = static_cast<FwEventIdType>(0);
896 
897  _id = this->getIdBase() + EVENTID_PROJECTVERSION;
898 
899  // Emit the event on the log port
900  if (this->m_logOut_OutputPort[0].isConnected()) {
901  Fw::LogBuffer _logBuff;
903 
904 #if FW_AMPCS_COMPATIBLE
905  // Serialize the number of arguments
906  _status = _logBuff.serialize(static_cast<U8>(1));
907  FW_ASSERT(
908  _status == Fw::FW_SERIALIZE_OK,
909  static_cast<FwAssertArgType>(_status)
910  );
911 #endif
912 
913  _status = version.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
914  FW_ASSERT(
915  _status == Fw::FW_SERIALIZE_OK,
916  static_cast<FwAssertArgType>(_status)
917  );
918 
919  this->m_logOut_OutputPort[0].invoke(
920  _id,
921  _logTime,
923  _logBuff
924  );
925  }
926 
927  // Emit the event on the text log port
928 #if FW_ENABLE_TEXT_LOGGING
929  if (this->m_logTextOut_OutputPort[0].isConnected()) {
930 #if FW_OBJECT_NAMES == 1
931  const char* _formatString =
932  "(%s) %s: Project Version: [%s]";
933 #else
934  const char* _formatString =
935  "%s: Project Version: [%s]";
936 #endif
937 
938  Fw::TextLogString _logString;
939  _logString.format(
940  _formatString,
941 #if FW_OBJECT_NAMES == 1
942  this->m_objName.toChar(),
943 #endif
944  "ProjectVersion ",
945  version.toChar()
946  );
947 
948  this->m_logTextOut_OutputPort[0].invoke(
949  _id,
950  _logTime,
952  _logString
953  );
954  }
955 #endif
956  }
957 
960  {
961  // Get the time
962  Fw::Time _logTime;
963  if (this->m_timeCaller_OutputPort[0].isConnected()) {
964  this->m_timeCaller_OutputPort[0].invoke(_logTime);
965  }
966 
967  FwEventIdType _id = static_cast<FwEventIdType>(0);
968 
969  _id = this->getIdBase() + EVENTID_LIBRARYVERSIONS;
970 
971  // Emit the event on the log port
972  if (this->m_logOut_OutputPort[0].isConnected()) {
973  Fw::LogBuffer _logBuff;
975 
976 #if FW_AMPCS_COMPATIBLE
977  // Serialize the number of arguments
978  _status = _logBuff.serialize(static_cast<U8>(1));
979  FW_ASSERT(
980  _status == Fw::FW_SERIALIZE_OK,
981  static_cast<FwAssertArgType>(_status)
982  );
983 #endif
984 
985  _status = version.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
986  FW_ASSERT(
987  _status == Fw::FW_SERIALIZE_OK,
988  static_cast<FwAssertArgType>(_status)
989  );
990 
991  this->m_logOut_OutputPort[0].invoke(
992  _id,
993  _logTime,
995  _logBuff
996  );
997  }
998 
999  // Emit the event on the text log port
1000 #if FW_ENABLE_TEXT_LOGGING
1001  if (this->m_logTextOut_OutputPort[0].isConnected()) {
1002 #if FW_OBJECT_NAMES == 1
1003  const char* _formatString =
1004  "(%s) %s: Library Versions: [%s]";
1005 #else
1006  const char* _formatString =
1007  "%s: Library Versions: [%s]";
1008 #endif
1009 
1010  Fw::TextLogString _logString;
1011  _logString.format(
1012  _formatString,
1013 #if FW_OBJECT_NAMES == 1
1014  this->m_objName.toChar(),
1015 #endif
1016  "LibraryVersions ",
1017  version.toChar()
1018  );
1019 
1020  this->m_logTextOut_OutputPort[0].invoke(
1021  _id,
1022  _logTime,
1024  _logString
1025  );
1026  }
1027 #endif
1028  }
1029 
1032  Svc::VersionCfg::VersionEnum version_enum,
1033  const Fw::StringBase& version_value
1034  )
1035  {
1036  // Get the time
1037  Fw::Time _logTime;
1038  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1039  this->m_timeCaller_OutputPort[0].invoke(_logTime);
1040  }
1041 
1042  FwEventIdType _id = static_cast<FwEventIdType>(0);
1043 
1044  _id = this->getIdBase() + EVENTID_CUSTOMVERSIONS;
1045 
1046  // Emit the event on the log port
1047  if (this->m_logOut_OutputPort[0].isConnected()) {
1048  Fw::LogBuffer _logBuff;
1050 
1051 #if FW_AMPCS_COMPATIBLE
1052  // Serialize the number of arguments
1053  _status = _logBuff.serialize(static_cast<U8>(2));
1054  FW_ASSERT(
1055  _status == Fw::FW_SERIALIZE_OK,
1056  static_cast<FwAssertArgType>(_status)
1057  );
1058 #endif
1059 
1060 #if FW_AMPCS_COMPATIBLE
1061  // Serialize the argument size
1062  _status = _logBuff.serialize(
1064  );
1065  FW_ASSERT(
1066  _status == Fw::FW_SERIALIZE_OK,
1067  static_cast<FwAssertArgType>(_status)
1068  );
1069 #endif
1070  _status = _logBuff.serialize(version_enum);
1071  FW_ASSERT(
1072  _status == Fw::FW_SERIALIZE_OK,
1073  static_cast<FwAssertArgType>(_status)
1074  );
1075 
1076  _status = version_value.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1077  FW_ASSERT(
1078  _status == Fw::FW_SERIALIZE_OK,
1079  static_cast<FwAssertArgType>(_status)
1080  );
1081 
1082  this->m_logOut_OutputPort[0].invoke(
1083  _id,
1084  _logTime,
1086  _logBuff
1087  );
1088  }
1089 
1090  // Emit the event on the text log port
1091 #if FW_ENABLE_TEXT_LOGGING
1092  if (this->m_logTextOut_OutputPort[0].isConnected()) {
1093 #if FW_OBJECT_NAMES == 1
1094  const char* _formatString =
1095  "(%s) %s: Custom Versions: [%s] [%s]";
1096 #else
1097  const char* _formatString =
1098  "%s: Custom Versions: [%s] [%s]";
1099 #endif
1100 
1101  Fw::String version_enumStr;
1102  version_enum.toString(version_enumStr);
1103 
1104  Fw::TextLogString _logString;
1105  _logString.format(
1106  _formatString,
1107 #if FW_OBJECT_NAMES == 1
1108  this->m_objName.toChar(),
1109 #endif
1110  "CustomVersions ",
1111  version_enumStr.toChar(),
1112  version_value.toChar()
1113  );
1114 
1115  this->m_logTextOut_OutputPort[0].invoke(
1116  _id,
1117  _logTime,
1119  _logString
1120  );
1121  }
1122 #endif
1123  }
1124 
1125  // ----------------------------------------------------------------------
1126  // Telemetry write functions
1127  // ----------------------------------------------------------------------
1128 
1131  const Fw::StringBase& arg,
1132  Fw::Time _tlmTime
1133  )
1134  {
1135  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1136  if (
1137  this->m_timeCaller_OutputPort[0].isConnected() &&
1138  (_tlmTime == Fw::ZERO_TIME)
1139  ) {
1140  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1141  }
1142 
1143  Fw::TlmBuffer _tlmBuff;
1144  Fw::SerializeStatus _stat = arg.serialize(_tlmBuff, FW_MIN(FW_TLM_STRING_MAX_SIZE, 40));
1145  FW_ASSERT(
1146  _stat == Fw::FW_SERIALIZE_OK,
1147  static_cast<FwAssertArgType>(_stat)
1148  );
1149 
1150  FwChanIdType _id;
1151 
1152  _id = this->getIdBase() + CHANNELID_FRAMEWORKVERSION;
1153 
1154  this->m_tlmOut_OutputPort[0].invoke(
1155  _id,
1156  _tlmTime,
1157  _tlmBuff
1158  );
1159  }
1160  }
1161 
1164  const Fw::StringBase& arg,
1165  Fw::Time _tlmTime
1166  )
1167  {
1168  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1169  if (
1170  this->m_timeCaller_OutputPort[0].isConnected() &&
1171  (_tlmTime == Fw::ZERO_TIME)
1172  ) {
1173  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1174  }
1175 
1176  Fw::TlmBuffer _tlmBuff;
1177  Fw::SerializeStatus _stat = arg.serialize(_tlmBuff, FW_MIN(FW_TLM_STRING_MAX_SIZE, 40));
1178  FW_ASSERT(
1179  _stat == Fw::FW_SERIALIZE_OK,
1180  static_cast<FwAssertArgType>(_stat)
1181  );
1182 
1183  FwChanIdType _id;
1184 
1185  _id = this->getIdBase() + CHANNELID_PROJECTVERSION;
1186 
1187  this->m_tlmOut_OutputPort[0].invoke(
1188  _id,
1189  _tlmTime,
1190  _tlmBuff
1191  );
1192  }
1193  }
1194 
1197  const Svc::CustomVersionDb& arg,
1198  Fw::Time _tlmTime
1199  )
1200  {
1201  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1202  if (
1203  this->m_timeCaller_OutputPort[0].isConnected() &&
1204  (_tlmTime == Fw::ZERO_TIME)
1205  ) {
1206  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1207  }
1208 
1209  Fw::TlmBuffer _tlmBuff;
1210  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1211  FW_ASSERT(
1212  _stat == Fw::FW_SERIALIZE_OK,
1213  static_cast<FwAssertArgType>(_stat)
1214  );
1215 
1216  FwChanIdType _id;
1217 
1218  _id = this->getIdBase() + CHANNELID_CUSTOMVERSION01;
1219 
1220  this->m_tlmOut_OutputPort[0].invoke(
1221  _id,
1222  _tlmTime,
1223  _tlmBuff
1224  );
1225  }
1226  }
1227 
1230  const Svc::CustomVersionDb& arg,
1231  Fw::Time _tlmTime
1232  )
1233  {
1234  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1235  if (
1236  this->m_timeCaller_OutputPort[0].isConnected() &&
1237  (_tlmTime == Fw::ZERO_TIME)
1238  ) {
1239  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1240  }
1241 
1242  Fw::TlmBuffer _tlmBuff;
1243  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1244  FW_ASSERT(
1245  _stat == Fw::FW_SERIALIZE_OK,
1246  static_cast<FwAssertArgType>(_stat)
1247  );
1248 
1249  FwChanIdType _id;
1250 
1251  _id = this->getIdBase() + CHANNELID_CUSTOMVERSION02;
1252 
1253  this->m_tlmOut_OutputPort[0].invoke(
1254  _id,
1255  _tlmTime,
1256  _tlmBuff
1257  );
1258  }
1259  }
1260 
1263  const Svc::CustomVersionDb& arg,
1264  Fw::Time _tlmTime
1265  )
1266  {
1267  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1268  if (
1269  this->m_timeCaller_OutputPort[0].isConnected() &&
1270  (_tlmTime == Fw::ZERO_TIME)
1271  ) {
1272  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1273  }
1274 
1275  Fw::TlmBuffer _tlmBuff;
1276  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1277  FW_ASSERT(
1278  _stat == Fw::FW_SERIALIZE_OK,
1279  static_cast<FwAssertArgType>(_stat)
1280  );
1281 
1282  FwChanIdType _id;
1283 
1284  _id = this->getIdBase() + CHANNELID_CUSTOMVERSION03;
1285 
1286  this->m_tlmOut_OutputPort[0].invoke(
1287  _id,
1288  _tlmTime,
1289  _tlmBuff
1290  );
1291  }
1292  }
1293 
1296  const Svc::CustomVersionDb& arg,
1297  Fw::Time _tlmTime
1298  )
1299  {
1300  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1301  if (
1302  this->m_timeCaller_OutputPort[0].isConnected() &&
1303  (_tlmTime == Fw::ZERO_TIME)
1304  ) {
1305  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1306  }
1307 
1308  Fw::TlmBuffer _tlmBuff;
1309  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1310  FW_ASSERT(
1311  _stat == Fw::FW_SERIALIZE_OK,
1312  static_cast<FwAssertArgType>(_stat)
1313  );
1314 
1315  FwChanIdType _id;
1316 
1317  _id = this->getIdBase() + CHANNELID_CUSTOMVERSION04;
1318 
1319  this->m_tlmOut_OutputPort[0].invoke(
1320  _id,
1321  _tlmTime,
1322  _tlmBuff
1323  );
1324  }
1325  }
1326 
1329  const Svc::CustomVersionDb& arg,
1330  Fw::Time _tlmTime
1331  )
1332  {
1333  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1334  if (
1335  this->m_timeCaller_OutputPort[0].isConnected() &&
1336  (_tlmTime == Fw::ZERO_TIME)
1337  ) {
1338  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1339  }
1340 
1341  Fw::TlmBuffer _tlmBuff;
1342  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1343  FW_ASSERT(
1344  _stat == Fw::FW_SERIALIZE_OK,
1345  static_cast<FwAssertArgType>(_stat)
1346  );
1347 
1348  FwChanIdType _id;
1349 
1350  _id = this->getIdBase() + CHANNELID_CUSTOMVERSION05;
1351 
1352  this->m_tlmOut_OutputPort[0].invoke(
1353  _id,
1354  _tlmTime,
1355  _tlmBuff
1356  );
1357  }
1358  }
1359 
1362  const Svc::CustomVersionDb& arg,
1363  Fw::Time _tlmTime
1364  )
1365  {
1366  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1367  if (
1368  this->m_timeCaller_OutputPort[0].isConnected() &&
1369  (_tlmTime == Fw::ZERO_TIME)
1370  ) {
1371  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1372  }
1373 
1374  Fw::TlmBuffer _tlmBuff;
1375  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1376  FW_ASSERT(
1377  _stat == Fw::FW_SERIALIZE_OK,
1378  static_cast<FwAssertArgType>(_stat)
1379  );
1380 
1381  FwChanIdType _id;
1382 
1383  _id = this->getIdBase() + CHANNELID_CUSTOMVERSION06;
1384 
1385  this->m_tlmOut_OutputPort[0].invoke(
1386  _id,
1387  _tlmTime,
1388  _tlmBuff
1389  );
1390  }
1391  }
1392 
1395  const Svc::CustomVersionDb& arg,
1396  Fw::Time _tlmTime
1397  )
1398  {
1399  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1400  if (
1401  this->m_timeCaller_OutputPort[0].isConnected() &&
1402  (_tlmTime == Fw::ZERO_TIME)
1403  ) {
1404  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1405  }
1406 
1407  Fw::TlmBuffer _tlmBuff;
1408  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1409  FW_ASSERT(
1410  _stat == Fw::FW_SERIALIZE_OK,
1411  static_cast<FwAssertArgType>(_stat)
1412  );
1413 
1414  FwChanIdType _id;
1415 
1416  _id = this->getIdBase() + CHANNELID_CUSTOMVERSION07;
1417 
1418  this->m_tlmOut_OutputPort[0].invoke(
1419  _id,
1420  _tlmTime,
1421  _tlmBuff
1422  );
1423  }
1424  }
1425 
1428  const Svc::CustomVersionDb& arg,
1429  Fw::Time _tlmTime
1430  )
1431  {
1432  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1433  if (
1434  this->m_timeCaller_OutputPort[0].isConnected() &&
1435  (_tlmTime == Fw::ZERO_TIME)
1436  ) {
1437  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1438  }
1439 
1440  Fw::TlmBuffer _tlmBuff;
1441  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1442  FW_ASSERT(
1443  _stat == Fw::FW_SERIALIZE_OK,
1444  static_cast<FwAssertArgType>(_stat)
1445  );
1446 
1447  FwChanIdType _id;
1448 
1449  _id = this->getIdBase() + CHANNELID_CUSTOMVERSION08;
1450 
1451  this->m_tlmOut_OutputPort[0].invoke(
1452  _id,
1453  _tlmTime,
1454  _tlmBuff
1455  );
1456  }
1457  }
1458 
1461  const Svc::CustomVersionDb& arg,
1462  Fw::Time _tlmTime
1463  )
1464  {
1465  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1466  if (
1467  this->m_timeCaller_OutputPort[0].isConnected() &&
1468  (_tlmTime == Fw::ZERO_TIME)
1469  ) {
1470  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1471  }
1472 
1473  Fw::TlmBuffer _tlmBuff;
1474  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1475  FW_ASSERT(
1476  _stat == Fw::FW_SERIALIZE_OK,
1477  static_cast<FwAssertArgType>(_stat)
1478  );
1479 
1480  FwChanIdType _id;
1481 
1482  _id = this->getIdBase() + CHANNELID_CUSTOMVERSION09;
1483 
1484  this->m_tlmOut_OutputPort[0].invoke(
1485  _id,
1486  _tlmTime,
1487  _tlmBuff
1488  );
1489  }
1490  }
1491 
1494  const Svc::CustomVersionDb& arg,
1495  Fw::Time _tlmTime
1496  )
1497  {
1498  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1499  if (
1500  this->m_timeCaller_OutputPort[0].isConnected() &&
1501  (_tlmTime == Fw::ZERO_TIME)
1502  ) {
1503  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1504  }
1505 
1506  Fw::TlmBuffer _tlmBuff;
1507  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1508  FW_ASSERT(
1509  _stat == Fw::FW_SERIALIZE_OK,
1510  static_cast<FwAssertArgType>(_stat)
1511  );
1512 
1513  FwChanIdType _id;
1514 
1515  _id = this->getIdBase() + CHANNELID_CUSTOMVERSION10;
1516 
1517  this->m_tlmOut_OutputPort[0].invoke(
1518  _id,
1519  _tlmTime,
1520  _tlmBuff
1521  );
1522  }
1523  }
1524 
1527  const Fw::StringBase& arg,
1528  Fw::Time _tlmTime
1529  )
1530  {
1531  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1532  if (
1533  this->m_timeCaller_OutputPort[0].isConnected() &&
1534  (_tlmTime == Fw::ZERO_TIME)
1535  ) {
1536  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1537  }
1538 
1539  Fw::TlmBuffer _tlmBuff;
1540  Fw::SerializeStatus _stat = arg.serialize(_tlmBuff, FW_MIN(FW_TLM_STRING_MAX_SIZE, 40));
1541  FW_ASSERT(
1542  _stat == Fw::FW_SERIALIZE_OK,
1543  static_cast<FwAssertArgType>(_stat)
1544  );
1545 
1546  FwChanIdType _id;
1547 
1548  _id = this->getIdBase() + CHANNELID_LIBRARYVERSION01;
1549 
1550  this->m_tlmOut_OutputPort[0].invoke(
1551  _id,
1552  _tlmTime,
1553  _tlmBuff
1554  );
1555  }
1556  }
1557 
1560  const Fw::StringBase& arg,
1561  Fw::Time _tlmTime
1562  )
1563  {
1564  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1565  if (
1566  this->m_timeCaller_OutputPort[0].isConnected() &&
1567  (_tlmTime == Fw::ZERO_TIME)
1568  ) {
1569  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1570  }
1571 
1572  Fw::TlmBuffer _tlmBuff;
1573  Fw::SerializeStatus _stat = arg.serialize(_tlmBuff, FW_MIN(FW_TLM_STRING_MAX_SIZE, 40));
1574  FW_ASSERT(
1575  _stat == Fw::FW_SERIALIZE_OK,
1576  static_cast<FwAssertArgType>(_stat)
1577  );
1578 
1579  FwChanIdType _id;
1580 
1581  _id = this->getIdBase() + CHANNELID_LIBRARYVERSION02;
1582 
1583  this->m_tlmOut_OutputPort[0].invoke(
1584  _id,
1585  _tlmTime,
1586  _tlmBuff
1587  );
1588  }
1589  }
1590 
1593  const Fw::StringBase& arg,
1594  Fw::Time _tlmTime
1595  )
1596  {
1597  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1598  if (
1599  this->m_timeCaller_OutputPort[0].isConnected() &&
1600  (_tlmTime == Fw::ZERO_TIME)
1601  ) {
1602  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1603  }
1604 
1605  Fw::TlmBuffer _tlmBuff;
1606  Fw::SerializeStatus _stat = arg.serialize(_tlmBuff, FW_MIN(FW_TLM_STRING_MAX_SIZE, 40));
1607  FW_ASSERT(
1608  _stat == Fw::FW_SERIALIZE_OK,
1609  static_cast<FwAssertArgType>(_stat)
1610  );
1611 
1612  FwChanIdType _id;
1613 
1614  _id = this->getIdBase() + CHANNELID_LIBRARYVERSION03;
1615 
1616  this->m_tlmOut_OutputPort[0].invoke(
1617  _id,
1618  _tlmTime,
1619  _tlmBuff
1620  );
1621  }
1622  }
1623 
1626  const Fw::StringBase& arg,
1627  Fw::Time _tlmTime
1628  )
1629  {
1630  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1631  if (
1632  this->m_timeCaller_OutputPort[0].isConnected() &&
1633  (_tlmTime == Fw::ZERO_TIME)
1634  ) {
1635  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1636  }
1637 
1638  Fw::TlmBuffer _tlmBuff;
1639  Fw::SerializeStatus _stat = arg.serialize(_tlmBuff, FW_MIN(FW_TLM_STRING_MAX_SIZE, 40));
1640  FW_ASSERT(
1641  _stat == Fw::FW_SERIALIZE_OK,
1642  static_cast<FwAssertArgType>(_stat)
1643  );
1644 
1645  FwChanIdType _id;
1646 
1647  _id = this->getIdBase() + CHANNELID_LIBRARYVERSION04;
1648 
1649  this->m_tlmOut_OutputPort[0].invoke(
1650  _id,
1651  _tlmTime,
1652  _tlmBuff
1653  );
1654  }
1655  }
1656 
1659  const Fw::StringBase& arg,
1660  Fw::Time _tlmTime
1661  )
1662  {
1663  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1664  if (
1665  this->m_timeCaller_OutputPort[0].isConnected() &&
1666  (_tlmTime == Fw::ZERO_TIME)
1667  ) {
1668  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1669  }
1670 
1671  Fw::TlmBuffer _tlmBuff;
1672  Fw::SerializeStatus _stat = arg.serialize(_tlmBuff, FW_MIN(FW_TLM_STRING_MAX_SIZE, 40));
1673  FW_ASSERT(
1674  _stat == Fw::FW_SERIALIZE_OK,
1675  static_cast<FwAssertArgType>(_stat)
1676  );
1677 
1678  FwChanIdType _id;
1679 
1680  _id = this->getIdBase() + CHANNELID_LIBRARYVERSION05;
1681 
1682  this->m_tlmOut_OutputPort[0].invoke(
1683  _id,
1684  _tlmTime,
1685  _tlmBuff
1686  );
1687  }
1688  }
1689 
1692  const Fw::StringBase& arg,
1693  Fw::Time _tlmTime
1694  )
1695  {
1696  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1697  if (
1698  this->m_timeCaller_OutputPort[0].isConnected() &&
1699  (_tlmTime == Fw::ZERO_TIME)
1700  ) {
1701  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1702  }
1703 
1704  Fw::TlmBuffer _tlmBuff;
1705  Fw::SerializeStatus _stat = arg.serialize(_tlmBuff, FW_MIN(FW_TLM_STRING_MAX_SIZE, 40));
1706  FW_ASSERT(
1707  _stat == Fw::FW_SERIALIZE_OK,
1708  static_cast<FwAssertArgType>(_stat)
1709  );
1710 
1711  FwChanIdType _id;
1712 
1713  _id = this->getIdBase() + CHANNELID_LIBRARYVERSION06;
1714 
1715  this->m_tlmOut_OutputPort[0].invoke(
1716  _id,
1717  _tlmTime,
1718  _tlmBuff
1719  );
1720  }
1721  }
1722 
1725  const Fw::StringBase& arg,
1726  Fw::Time _tlmTime
1727  )
1728  {
1729  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1730  if (
1731  this->m_timeCaller_OutputPort[0].isConnected() &&
1732  (_tlmTime == Fw::ZERO_TIME)
1733  ) {
1734  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1735  }
1736 
1737  Fw::TlmBuffer _tlmBuff;
1738  Fw::SerializeStatus _stat = arg.serialize(_tlmBuff, FW_MIN(FW_TLM_STRING_MAX_SIZE, 40));
1739  FW_ASSERT(
1740  _stat == Fw::FW_SERIALIZE_OK,
1741  static_cast<FwAssertArgType>(_stat)
1742  );
1743 
1744  FwChanIdType _id;
1745 
1746  _id = this->getIdBase() + CHANNELID_LIBRARYVERSION07;
1747 
1748  this->m_tlmOut_OutputPort[0].invoke(
1749  _id,
1750  _tlmTime,
1751  _tlmBuff
1752  );
1753  }
1754  }
1755 
1758  const Fw::StringBase& arg,
1759  Fw::Time _tlmTime
1760  )
1761  {
1762  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1763  if (
1764  this->m_timeCaller_OutputPort[0].isConnected() &&
1765  (_tlmTime == Fw::ZERO_TIME)
1766  ) {
1767  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1768  }
1769 
1770  Fw::TlmBuffer _tlmBuff;
1771  Fw::SerializeStatus _stat = arg.serialize(_tlmBuff, FW_MIN(FW_TLM_STRING_MAX_SIZE, 40));
1772  FW_ASSERT(
1773  _stat == Fw::FW_SERIALIZE_OK,
1774  static_cast<FwAssertArgType>(_stat)
1775  );
1776 
1777  FwChanIdType _id;
1778 
1779  _id = this->getIdBase() + CHANNELID_LIBRARYVERSION08;
1780 
1781  this->m_tlmOut_OutputPort[0].invoke(
1782  _id,
1783  _tlmTime,
1784  _tlmBuff
1785  );
1786  }
1787  }
1788 
1791  const Fw::StringBase& arg,
1792  Fw::Time _tlmTime
1793  )
1794  {
1795  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1796  if (
1797  this->m_timeCaller_OutputPort[0].isConnected() &&
1798  (_tlmTime == Fw::ZERO_TIME)
1799  ) {
1800  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1801  }
1802 
1803  Fw::TlmBuffer _tlmBuff;
1804  Fw::SerializeStatus _stat = arg.serialize(_tlmBuff, FW_MIN(FW_TLM_STRING_MAX_SIZE, 40));
1805  FW_ASSERT(
1806  _stat == Fw::FW_SERIALIZE_OK,
1807  static_cast<FwAssertArgType>(_stat)
1808  );
1809 
1810  FwChanIdType _id;
1811 
1812  _id = this->getIdBase() + CHANNELID_LIBRARYVERSION09;
1813 
1814  this->m_tlmOut_OutputPort[0].invoke(
1815  _id,
1816  _tlmTime,
1817  _tlmBuff
1818  );
1819  }
1820  }
1821 
1824  const Fw::StringBase& arg,
1825  Fw::Time _tlmTime
1826  )
1827  {
1828  if (this->m_tlmOut_OutputPort[0].isConnected()) {
1829  if (
1830  this->m_timeCaller_OutputPort[0].isConnected() &&
1831  (_tlmTime == Fw::ZERO_TIME)
1832  ) {
1833  this->m_timeCaller_OutputPort[0].invoke(_tlmTime);
1834  }
1835 
1836  Fw::TlmBuffer _tlmBuff;
1837  Fw::SerializeStatus _stat = arg.serialize(_tlmBuff, FW_MIN(FW_TLM_STRING_MAX_SIZE, 40));
1838  FW_ASSERT(
1839  _stat == Fw::FW_SERIALIZE_OK,
1840  static_cast<FwAssertArgType>(_stat)
1841  );
1842 
1843  FwChanIdType _id;
1844 
1845  _id = this->getIdBase() + CHANNELID_LIBRARYVERSION10;
1846 
1847  this->m_tlmOut_OutputPort[0].invoke(
1848  _id,
1849  _tlmTime,
1850  _tlmBuff
1851  );
1852  }
1853  }
1854 
1855  // ----------------------------------------------------------------------
1856  // Time
1857  // ----------------------------------------------------------------------
1858 
1860  getTime()
1861  {
1862  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1863  Fw::Time _time;
1864  this->m_timeCaller_OutputPort[0].invoke(_time);
1865  return _time;
1866  }
1867  else {
1868  return Fw::Time(TB_NONE, 0, 0);
1869  }
1870  }
1871 
1872  // ----------------------------------------------------------------------
1873  // Mutex operations for guarded ports
1874  //
1875  // You can override these operations to provide more sophisticated
1876  // synchronization
1877  // ----------------------------------------------------------------------
1878 
1880  lock()
1881  {
1882  this->m_guardedPortMutex.lock();
1883  }
1884 
1886  unLock()
1887  {
1888  this->m_guardedPortMutex.unLock();
1889  }
1890 
1891  // ----------------------------------------------------------------------
1892  // Calls for messages received on special input ports
1893  // ----------------------------------------------------------------------
1894 
1895  void VersionComponentBase ::
1896  m_p_cmdIn_in(
1897  Fw::PassiveComponentBase* callComp,
1898  FwIndexType portNum,
1899  FwOpcodeType opCode,
1900  U32 cmdSeq,
1901  Fw::CmdArgBuffer& args
1902  )
1903  {
1904  FW_ASSERT(callComp);
1905  VersionComponentBase* compPtr = static_cast<VersionComponentBase*>(callComp);
1906 
1907  const U32 idBase = callComp->getIdBase();
1908  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
1909 
1910  // Select base class function based on opcode
1911  switch (opCode - idBase) {
1912  case OPCODE_ENABLE: {
1913  compPtr->ENABLE_cmdHandlerBase(
1914  opCode,
1915  cmdSeq,
1916  args
1917  );
1918  break;
1919  }
1920 
1921  case OPCODE_VERSION: {
1922  compPtr->VERSION_cmdHandlerBase(
1923  opCode,
1924  cmdSeq,
1925  args
1926  );
1927  break;
1928  }
1929  }
1930  }
1931 
1932  // ----------------------------------------------------------------------
1933  // Calls for messages received on typed input ports
1934  // ----------------------------------------------------------------------
1935 
1936  void VersionComponentBase ::
1937  m_p_getVersion_in(
1938  Fw::PassiveComponentBase* callComp,
1939  FwIndexType portNum,
1940  const Svc::VersionCfg::VersionEnum& version_id,
1941  Fw::StringBase& version_string,
1942  Svc::VersionStatus& status
1943  )
1944  {
1945  FW_ASSERT(callComp);
1946  VersionComponentBase* compPtr = static_cast<VersionComponentBase*>(callComp);
1947  compPtr->getVersion_handlerBase(
1948  portNum,
1949  version_id,
1950  version_string,
1951  status
1952  );
1953  }
1954 
1955  void VersionComponentBase ::
1956  m_p_setVersion_in(
1957  Fw::PassiveComponentBase* callComp,
1958  FwIndexType portNum,
1959  const Svc::VersionCfg::VersionEnum& version_id,
1960  Fw::StringBase& version_string,
1961  Svc::VersionStatus& status
1962  )
1963  {
1964  FW_ASSERT(callComp);
1965  VersionComponentBase* compPtr = static_cast<VersionComponentBase*>(callComp);
1966  compPtr->setVersion_handlerBase(
1967  portNum,
1968  version_id,
1969  version_string,
1970  status
1971  );
1972  }
1973 
1974 }
#define FW_ASSERT(...)
Definition: Assert.hpp:14
#define FW_MIN(a, b)
MIN macro.
Definition: BasicTypes.h:72
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:30
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition: BasicTypes.h:70
#define PRI_PlatformIntType
@ TB_NONE
No time base has been established.
Definition: FpConfig.h:70
I32 FwEnumStoreType
Definition: FpConfig.h:64
PlatformAssertArgType FwAssertArgType
Definition: FpConfig.h:39
U32 FwChanIdType
Definition: FpConfig.h:95
U32 FwEventIdType
Definition: FpConfig.h:103
#define FW_TLM_STRING_MAX_SIZE
Max size of channelized telemetry string type.
Definition: FpConfig.h:329
U32 FwOpcodeType
Definition: FpConfig.h:91
#define FW_LOG_STRING_MAX_SIZE
Max size of log string parameter type.
Definition: FpConfig.h:319
PlatformIndexType FwIndexType
Definition: FpConfig.h:25
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects)
Definition: FpConfig.h:148
Enum representing a command response.
@ FORMAT_ERROR
Command failed to deserialize.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: CmdPortAc.cpp:62
void init()
Initialization function.
Definition: CmdPortAc.cpp:56
void setPortNum(NATIVE_INT_TYPE portNum)
@ ACTIVITY_LO
Less important informational events.
void init()
Object initializer.
Definition: ObjBase.cpp:27
const char * toChar() const
Definition: ObjectName.hpp:50
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
void invoke(FwOpcodeType opCode)
Invoke a port interface.
void init()
Initialization function.
void init()
Initialization function.
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Invoke a port interface.
void init()
Initialization function.
Definition: LogPortAc.cpp:151
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Invoke a port interface.
Definition: LogPortAc.cpp:170
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:157
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:134
void invoke(Fw::Time &time)
Invoke a port interface.
Definition: TimePortAc.cpp:147
void init()
Initialization function.
Definition: TimePortAc.cpp:128
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:150
void init()
Initialization function.
Definition: TlmPortAc.cpp:144
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Invoke a port interface.
Definition: TlmPortAc.cpp:163
bool isConnected()
Definition: PortBase.cpp:41
void resetDeser()
reset deserialization to beginning
Serializable::SizeType getBuffLeft() const
returns how much deserialization buffer is left
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
virtual const CHAR * toChar() const =0
void format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:56
virtual SerializeStatus serialize(SerializeBufferBase &buffer) const
serialization function
Definition: StringBase.cpp:146
const char * toChar() const
Definition: String.hpp:50
Definition: Time.hpp:9
void unLock()
unlock the mutex and assert success
Definition: Mutex.cpp:40
void lock()
lock the mutex and assert success
Definition: Mutex.cpp:34
Data Structure for custom version Tlm.
void init()
Initialization function.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
@ SERIALIZED_SIZE
The size of the serial representation.
Auto-generated base for Version component.
virtual void ENABLE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, Svc::VersionEnabled enable)=0
Fw::InputCmdPort * get_cmdIn_InputPort(FwIndexType portNum)
void tlmWrite_CustomVersion04(const Svc::CustomVersionDb &arg, Fw::Time _tlmTime=Fw::Time())
Write telemetry channel CustomVersion04.
bool isConnected_logOut_OutputPort(FwIndexType portNum)
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.
FwIndexType getNum_setVersion_InputPorts() const
void log_ACTIVITY_LO_CustomVersions(Svc::VersionCfg::VersionEnum version_enum, const Fw::StringBase &version_value)
void tlmWrite_ProjectVersion(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time())
void tlmWrite_FrameworkVersion(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time())
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
void tlmWrite_CustomVersion03(const Svc::CustomVersionDb &arg, Fw::Time _tlmTime=Fw::Time())
Write telemetry channel CustomVersion03.
void set_cmdResponseOut_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
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.
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.
void tlmWrite_LibraryVersion09(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time())
Write telemetry channel LibraryVersion09.
void tlmWrite_LibraryVersion03(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time())
Write telemetry channel LibraryVersion03.
void tlmWrite_CustomVersion07(const Svc::CustomVersionDb &arg, Fw::Time _tlmTime=Fw::Time())
Write telemetry channel CustomVersion07.
void ENABLE_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void VERSION_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void tlmWrite_LibraryVersion05(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time())
Write telemetry channel LibraryVersion05.
void log_ACTIVITY_LO_FrameworkVersion(const Fw::StringBase &version)
FwIndexType getNum_timeCaller_OutputPorts() const
@ CHANNELID_LIBRARYVERSION03
Channel ID for LibraryVersion03.
@ CHANNELID_LIBRARYVERSION09
Channel ID for LibraryVersion09.
@ CHANNELID_CUSTOMVERSION05
Channel ID for CustomVersion05.
@ CHANNELID_CUSTOMVERSION09
Channel ID for CustomVersion09.
@ CHANNELID_CUSTOMVERSION03
Channel ID for CustomVersion03.
@ CHANNELID_CUSTOMVERSION06
Channel ID for CustomVersion06.
@ CHANNELID_CUSTOMVERSION07
Channel ID for CustomVersion07.
@ CHANNELID_CUSTOMVERSION04
Channel ID for CustomVersion04.
@ CHANNELID_LIBRARYVERSION05
Channel ID for LibraryVersion05.
@ CHANNELID_CUSTOMVERSION08
Channel ID for CustomVersion08.
@ CHANNELID_CUSTOMVERSION01
Channel ID for CustomVersion01.
@ CHANNELID_LIBRARYVERSION08
Channel ID for LibraryVersion08.
@ CHANNELID_CUSTOMVERSION10
Channel ID for CustomVersion10.
@ CHANNELID_LIBRARYVERSION02
Channel ID for LibraryVersion02.
@ CHANNELID_LIBRARYVERSION07
Channel ID for LibraryVersion07.
@ CHANNELID_LIBRARYVERSION10
Channel ID for LibraryVersion10.
@ CHANNELID_PROJECTVERSION
Channel ID for ProjectVersion.
@ CHANNELID_LIBRARYVERSION06
Channel ID for LibraryVersion06.
@ CHANNELID_LIBRARYVERSION01
Channel ID for LibraryVersion01.
@ CHANNELID_LIBRARYVERSION04
Channel ID for LibraryVersion04.
@ CHANNELID_CUSTOMVERSION02
Channel ID for CustomVersion02.
@ CHANNELID_FRAMEWORKVERSION
Channel ID for FrameworkVersion.
FwIndexType getNum_cmdRegOut_OutputPorts() const
void tlmWrite_CustomVersion01(const Svc::CustomVersionDb &arg, Fw::Time _tlmTime=Fw::Time())
void set_cmdRegOut_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to cmdRegOut[portNum].
void regCommands()
Register commands with the Command Dispatcher.
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
void tlmWrite_LibraryVersion04(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time())
Write telemetry channel LibraryVersion04.
virtual void lock()
Lock the guarded mutex.
virtual void VERSION_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, Svc::VersionType version_type)=0
void tlmWrite_CustomVersion08(const Svc::CustomVersionDb &arg, Fw::Time _tlmTime=Fw::Time())
Write telemetry channel CustomVersion08.
void log_ACTIVITY_LO_LibraryVersions(const Fw::StringBase &version)
void tlmWrite_LibraryVersion08(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time())
Write telemetry channel LibraryVersion08.
bool isConnected_timeCaller_OutputPort(FwIndexType portNum)
bool isConnected_cmdResponseOut_OutputPort(FwIndexType portNum)
FwIndexType getNum_getVersion_InputPorts() const
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
FwIndexType getNum_tlmOut_OutputPorts() const
void tlmWrite_LibraryVersion07(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time())
Write telemetry channel LibraryVersion07.
@ OPCODE_ENABLE
A command to enable or disable Event verbosity and Telemetry.
@ OPCODE_VERSION
Report version as Event.
void tlmWrite_CustomVersion09(const Svc::CustomVersionDb &arg, Fw::Time _tlmTime=Fw::Time())
Write telemetry channel CustomVersion09.
void tlmWrite_LibraryVersion01(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time())
void log_ACTIVITY_LO_ProjectVersion(const Fw::StringBase &version)
void tlmWrite_LibraryVersion06(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time())
Write telemetry channel LibraryVersion06.
bool isConnected_cmdRegOut_OutputPort(FwIndexType portNum)
void tlmWrite_CustomVersion02(const Svc::CustomVersionDb &arg, Fw::Time _tlmTime=Fw::Time())
Write telemetry channel CustomVersion02.
virtual void unLock()
Unlock the guarded mutex.
Svc::InputVersionPort * get_getVersion_InputPort(FwIndexType portNum)
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
@ EVENTID_PROJECTVERSION
Version of the git repository.
@ EVENTID_CUSTOMVERSIONS
Version of the git repository.
@ EVENTID_FRAMEWORKVERSION
Version of the git repository.
@ EVENTID_LIBRARYVERSIONS
Version of the git repository.
void tlmWrite_LibraryVersion02(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time())
Write telemetry channel LibraryVersion02.
virtual ~VersionComponentBase()
Destroy VersionComponentBase object.
bool isConnected_tlmOut_OutputPort(FwIndexType portNum)
void tlmWrite_CustomVersion05(const Svc::CustomVersionDb &arg, Fw::Time _tlmTime=Fw::Time())
Write telemetry channel CustomVersion05.
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.
FwIndexType getNum_cmdIn_InputPorts() const
void tlmWrite_LibraryVersion10(const Fw::StringBase &arg, Fw::Time _tlmTime=Fw::Time())
Write telemetry channel LibraryVersion10.
FwIndexType getNum_cmdResponseOut_OutputPorts() const
Svc::InputVersionPort * get_setVersion_InputPort(FwIndexType portNum)
FwIndexType getNum_logOut_OutputPorts() const
void tlmWrite_CustomVersion06(const Svc::CustomVersionDb &arg, Fw::Time _tlmTime=Fw::Time())
Write telemetry channel CustomVersion06.
void tlmWrite_CustomVersion10(const Svc::CustomVersionDb &arg, Fw::Time _tlmTime=Fw::Time())
Write telemetry channel CustomVersion10.
VersionComponentBase(const char *compName="")
Construct VersionComponentBase object.
Tracks versions for project, framework and user defined versions etc.
An enumeration for version status.
An enumeration for Version Type.
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.
const Time ZERO_TIME
Definition: Time.cpp:5