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