F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
TlmPacketizerComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title TlmPacketizerComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for TlmPacketizer component base class
5 // ======================================================================
6 
7 #ifndef Svc_TlmPacketizerComponentAc_HPP
8 #define Svc_TlmPacketizerComponentAc_HPP
9 
10 #include <atomic>
11 
12 #include "Fw/Cmd/CmdPortAc.hpp"
13 #include "Fw/Cmd/CmdRegPortAc.hpp"
15 #include "Fw/Cmd/CmdString.hpp"
16 #include "Fw/Com/ComPortAc.hpp"
18 #include "Fw/FPrimeBasicTypes.hpp"
19 #include "Fw/Log/LogPortAc.hpp"
20 #include "Fw/Log/LogString.hpp"
21 #include "Fw/Log/LogTextPortAc.hpp"
22 #if !FW_DIRECT_PORT_CALLS
24 #endif
25 #if !FW_DIRECT_PORT_CALLS
27 #endif
29 #include "Fw/Prm/PrmGetPortAc.hpp"
30 #include "Fw/Prm/PrmSetPortAc.hpp"
31 #include "Fw/Prm/PrmString.hpp"
32 #include "Fw/Time/TimePortAc.hpp"
33 #include "Fw/Tlm/TlmGetPortAc.hpp"
34 #include "Fw/Tlm/TlmPortAc.hpp"
35 #include "Fw/Tlm/TlmString.hpp"
37 #include "Os/Mutex.hpp"
38 #include "Svc/Ping/PingPortAc.hpp"
52 
53 namespace Svc {
54 
61  {
62 
63  // ----------------------------------------------------------------------
64  // Friend classes
65  // ----------------------------------------------------------------------
66 
70  friend class TlmPacketizerTester;
71 
72  protected:
73 
74  // ----------------------------------------------------------------------
75  // Constants
76  // ----------------------------------------------------------------------
77 
79  enum {
81  };
82 
84  enum {
91  };
92 
94  enum {
103  };
104 
106  enum {
109  };
110 
112  enum {
123  };
124 
126  enum {
134  };
135 
137  enum {
139  };
140 
142  enum {
145  };
146 
148  enum {
151  };
152 
153  public:
154 
155  // ----------------------------------------------------------------------
156  // Component initialization
157  // ----------------------------------------------------------------------
158 
160  void init(
161  FwSizeType queueDepth,
162  FwEnumStoreType instance = 0
163  );
164 
165 #if !FW_DIRECT_PORT_CALLS
166 
167  public:
168 
169  // ----------------------------------------------------------------------
170  // Getters for special input ports
171  // ----------------------------------------------------------------------
172 
177  FwIndexType portNum
178  );
179 
180 #endif
181 
182 #if !FW_DIRECT_PORT_CALLS
183 
184  public:
185 
186  // ----------------------------------------------------------------------
187  // Getters for typed input ports
188  // ----------------------------------------------------------------------
189 
194  FwIndexType portNum
195  );
196 
201  FwIndexType portNum
202  );
203 
208  FwIndexType portNum
209  );
210 
215  FwIndexType portNum
216  );
217 
222  FwIndexType portNum
223  );
224 
229  FwIndexType portNum
230  );
231 
232 #endif
233 
234 #if !FW_DIRECT_PORT_CALLS
235 
236  public:
237 
238  // ----------------------------------------------------------------------
239  // Connect input ports to special output ports
240  // ----------------------------------------------------------------------
241 
244  FwIndexType portNum,
245  Fw::InputCmdRegPort* port
246  );
247 
250  FwIndexType portNum,
252  );
253 
256  FwIndexType portNum,
257  Fw::InputLogPort* port
258  );
259 
262  FwIndexType portNum,
263  Fw::InputPrmGetPort* port
264  );
265 
268  FwIndexType portNum,
269  Fw::InputPrmSetPort* port
270  );
271 
272 #if FW_ENABLE_TEXT_LOGGING == 1
273 
275  void set_textEventOut_OutputPort(
276  FwIndexType portNum,
277  Fw::InputLogTextPort* port
278  );
279 
280 #endif
281 
284  FwIndexType portNum,
285  Fw::InputTimePort* port
286  );
287 
290  FwIndexType portNum,
291  Fw::InputTlmPort* port
292  );
293 
294 #endif
295 
296 #if !FW_DIRECT_PORT_CALLS
297 
298  public:
299 
300  // ----------------------------------------------------------------------
301  // Connect typed input ports to typed output ports
302  // ----------------------------------------------------------------------
303 
306  FwIndexType portNum,
307  Fw::InputComPort* port
308  );
309 
312  FwIndexType portNum,
313  Svc::InputPingPort* port
314  );
315 
316 #endif
317 
318 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
319 
320  public:
321 
322  // ----------------------------------------------------------------------
323  // Connect serial input ports to special output ports
324  // ----------------------------------------------------------------------
325 
328  FwIndexType portNum,
329  Fw::InputSerializePort* port
330  );
331 
334  FwIndexType portNum,
335  Fw::InputSerializePort* port
336  );
337 
340  FwIndexType portNum,
341  Fw::InputSerializePort* port
342  );
343 
346  FwIndexType portNum,
347  Fw::InputSerializePort* port
348  );
349 
350 #if FW_ENABLE_TEXT_LOGGING == 1
351 
353  void set_textEventOut_OutputPort(
354  FwIndexType portNum,
355  Fw::InputSerializePort* port
356  );
357 
358 #endif
359 
362  FwIndexType portNum,
363  Fw::InputSerializePort* port
364  );
365 
368  FwIndexType portNum,
369  Fw::InputSerializePort* port
370  );
371 
372 #endif
373 
374 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
375 
376  public:
377 
378  // ----------------------------------------------------------------------
379  // Connect serial input ports to typed output ports
380  // ----------------------------------------------------------------------
381 
384  FwIndexType portNum,
385  Fw::InputSerializePort* port
386  );
387 
390  FwIndexType portNum,
391  Fw::InputSerializePort* port
392  );
393 
394 #endif
395 
396  public:
397 
398  // ----------------------------------------------------------------------
399  // Command registration
400  // ----------------------------------------------------------------------
401 
405  void regCommands();
406 
407  public:
408 
409  // ----------------------------------------------------------------------
410  // Parameter loading
411  // ----------------------------------------------------------------------
412 
416  void loadParameters();
417 
418  protected:
419 
420  // ----------------------------------------------------------------------
421  // Component construction and destruction
422  // ----------------------------------------------------------------------
423 
426  const char* compName = ""
427  );
428 
430  virtual ~TlmPacketizerComponentBase();
431 
432  protected:
433 
434  // ----------------------------------------------------------------------
435  // Getters for numbers of special input ports
436  // ----------------------------------------------------------------------
437 
442  return NUM_CMDIN_INPUT_PORTS;
443  }
444 
445  protected:
446 
447  // ----------------------------------------------------------------------
448  // Getters for numbers of typed input ports
449  // ----------------------------------------------------------------------
450 
454  static constexpr FwIndexType getNum_Run_InputPorts() {
455  return NUM_RUN_INPUT_PORTS;
456  }
457 
462  return NUM_TLMGET_INPUT_PORTS;
463  }
464 
470  }
471 
477  }
478 
484  }
485 
490  return NUM_PINGIN_INPUT_PORTS;
491  }
492 
493  protected:
494 
495  // ----------------------------------------------------------------------
496  // Getters for numbers of special output ports
497  // ----------------------------------------------------------------------
498 
504  }
505 
511  }
512 
518  }
519 
525  }
526 
532  }
533 
534 #if FW_ENABLE_TEXT_LOGGING == 1
535 
539  static constexpr FwIndexType getNum_textEventOut_OutputPorts() {
541  }
542 
543 #endif
544 
550  }
551 
557  }
558 
559  protected:
560 
561  // ----------------------------------------------------------------------
562  // Getters for numbers of typed output ports
563  // ----------------------------------------------------------------------
564 
570  }
571 
577  }
578 
579  protected:
580 
581  // ----------------------------------------------------------------------
582  // Connection status queries for special output ports
583  // ----------------------------------------------------------------------
584 
589  FwIndexType portNum
590  ) const;
591 
596  FwIndexType portNum
597  ) const;
598 
603  FwIndexType portNum
604  ) const;
605 
610  FwIndexType portNum
611  ) const;
612 
617  FwIndexType portNum
618  ) const;
619 
620 #if FW_ENABLE_TEXT_LOGGING == 1
621 
625  bool isConnected_textEventOut_OutputPort(
626  FwIndexType portNum
627  ) const;
628 
629 #endif
630 
635  FwIndexType portNum
636  ) const;
637 
642  FwIndexType portNum
643  ) const;
644 
645  protected:
646 
647  // ----------------------------------------------------------------------
648  // Connection status queries for typed output ports
649  // ----------------------------------------------------------------------
650 
655  FwIndexType portNum
656  ) const;
657 
662  FwIndexType portNum
663  ) const;
664 
665 #if FW_DIRECT_PORT_CALLS
666  public:
667 #else
668  protected:
669 #endif
670 
671  // ----------------------------------------------------------------------
672  // Port handler base-class functions for special input ports
673  //
674  // Call these functions directly to bypass the corresponding ports
675  // ----------------------------------------------------------------------
676 
678  void cmdIn_handlerBase(
679  FwIndexType portNum,
680  FwOpcodeType opCode,
681  U32 cmdSeq,
682  Fw::CmdArgBuffer& args
683  );
684 
685  protected:
686 
687  // ----------------------------------------------------------------------
688  // Handlers to implement for typed input ports
689  // ----------------------------------------------------------------------
690 
692  virtual void Run_handler(
693  FwIndexType portNum,
694  U32 context
695  ) = 0;
696 
699  FwIndexType portNum,
700  FwChanIdType id,
701  Fw::Time& timeTag,
702  Fw::TlmBuffer& val
703  ) = 0;
706 
708  virtual void TlmRecv_handler(
709  FwIndexType portNum,
710  FwChanIdType id,
711  Fw::Time& timeTag,
712  Fw::TlmBuffer& val
713  ) = 0;
714 
717  FwIndexType portNum,
718  const Svc::TelemetrySection& section,
719  FwChanIdType tlmGroup,
720  const Svc::RateLogic& rateLogic,
721  U32 minDelta,
722  U32 maxDelta
723  ) = 0;
724 
726  virtual void controlIn_handler(
727  FwIndexType portNum,
728  const Svc::TelemetrySection& section,
729  const Fw::Enabled& enabled
730  ) = 0;
731 
733  virtual void pingIn_handler(
734  FwIndexType portNum,
735  U32 key
736  ) = 0;
737 
738 #if FW_DIRECT_PORT_CALLS
739  public:
740 #else
741  protected:
742 #endif
743 
744  // ----------------------------------------------------------------------
745  // Port handler base-class functions for typed input ports
746  //
747  // Call these functions directly to bypass the corresponding ports
748  // ----------------------------------------------------------------------
749 
751  void Run_handlerBase(
752  FwIndexType portNum,
753  U32 context
754  );
755 
758  FwIndexType portNum,
759  FwChanIdType id,
760  Fw::Time& timeTag,
761  Fw::TlmBuffer& val
762  );
765 
767  void TlmRecv_handlerBase(
768  FwIndexType portNum,
769  FwChanIdType id,
770  Fw::Time& timeTag,
771  Fw::TlmBuffer& val
772  );
773 
776  FwIndexType portNum,
777  const Svc::TelemetrySection& section,
778  FwChanIdType tlmGroup,
779  const Svc::RateLogic& rateLogic,
780  U32 minDelta,
781  U32 maxDelta
782  );
783 
786  FwIndexType portNum,
787  const Svc::TelemetrySection& section,
788  const Fw::Enabled& enabled
789  );
790 
792  void pingIn_handlerBase(
793  FwIndexType portNum,
794  U32 key
795  );
796 
797  protected:
798 
799  // ----------------------------------------------------------------------
800  // Pre-message hooks for typed async input ports
801  //
802  // Each of these functions is invoked just before processing a message
803  // on the corresponding port. By default, they do nothing. You can
804  // override them to provide specific pre-message behavior.
805  // ----------------------------------------------------------------------
806 
808  virtual void Run_preMsgHook(
809  FwIndexType portNum,
810  U32 context
811  );
812 
815  FwIndexType portNum,
816  const Svc::TelemetrySection& section,
817  FwChanIdType tlmGroup,
818  const Svc::RateLogic& rateLogic,
819  U32 minDelta,
820  U32 maxDelta
821  );
822 
824  virtual void controlIn_preMsgHook(
825  FwIndexType portNum,
826  const Svc::TelemetrySection& section,
827  const Fw::Enabled& enabled
828  );
829 
831  virtual void pingIn_preMsgHook(
832  FwIndexType portNum,
833  U32 key
834  );
835 
836  protected:
837 
838  // ----------------------------------------------------------------------
839  // Invocation functions for typed output ports
840  // ----------------------------------------------------------------------
841 
843  void PktSend_out(
844  FwIndexType portNum,
845  Fw::ComBuffer& data,
846  U32 context
847  ) const;
848 
850  void pingOut_out(
851  FwIndexType portNum,
852  U32 key
853  ) const;
854 
855  protected:
856 
857  // ----------------------------------------------------------------------
858  // Command response
859  // ----------------------------------------------------------------------
860 
862  void cmdResponse_out(
863  FwOpcodeType opCode,
864  U32 cmdSeq,
865  Fw::CmdResponse response
866  );
867 
868  protected:
869 
870  // ----------------------------------------------------------------------
871  // Command handlers to implement
872  // ----------------------------------------------------------------------
873 
877  virtual void SET_LEVEL_cmdHandler(
878  FwOpcodeType opCode,
879  U32 cmdSeq,
880  FwChanIdType level
881  ) = 0;
882 
886  virtual void SEND_PKT_cmdHandler(
887  FwOpcodeType opCode,
888  U32 cmdSeq,
889  U32 id,
890  const Svc::TelemetrySection& section
891  ) = 0;
892 
896  virtual void ENABLE_SECTION_cmdHandler(
897  FwOpcodeType opCode,
898  U32 cmdSeq,
899  const Svc::TelemetrySection& section,
900  const Fw::Enabled& enable
901  ) = 0;
902 
906  virtual void ENABLE_GROUP_cmdHandler(
907  FwOpcodeType opCode,
908  U32 cmdSeq,
909  const Svc::TelemetrySection& section,
910  FwChanIdType tlmGroup,
911  const Fw::Enabled& enable
912  ) = 0;
913 
917  virtual void FORCE_GROUP_cmdHandler(
918  FwOpcodeType opCode,
919  U32 cmdSeq,
920  const Svc::TelemetrySection& section,
921  FwChanIdType tlmGroup,
922  const Fw::Enabled& enable
923  ) = 0;
924 
929  FwOpcodeType opCode,
930  U32 cmdSeq,
931  const Svc::TelemetrySection& section,
932  FwChanIdType tlmGroup,
933  const Svc::RateLogic& rateLogic,
934  U32 minDelta,
935  U32 maxDelta
936  ) = 0;
937 
938  protected:
939 
940  // ----------------------------------------------------------------------
941  // Command handler base-class functions
942  //
943  // Call these functions directly to bypass the command input port
944  // ----------------------------------------------------------------------
945 
950  FwOpcodeType opCode,
951  U32 cmdSeq,
952  Fw::CmdArgBuffer& args
953  );
954 
959  FwOpcodeType opCode,
960  U32 cmdSeq,
961  Fw::CmdArgBuffer& args
962  );
963 
968  FwOpcodeType opCode,
969  U32 cmdSeq,
970  Fw::CmdArgBuffer& args
971  );
972 
977  FwOpcodeType opCode,
978  U32 cmdSeq,
979  Fw::CmdArgBuffer& args
980  );
981 
986  FwOpcodeType opCode,
987  U32 cmdSeq,
988  Fw::CmdArgBuffer& args
989  );
990 
995  FwOpcodeType opCode,
996  U32 cmdSeq,
997  Fw::CmdArgBuffer& args
998  );
999 
1000  protected:
1001 
1002  // ----------------------------------------------------------------------
1003  // Pre-message hooks for async commands
1004  //
1005  // Each of these functions is invoked just before processing the
1006  // corresponding command. By default they do nothing. You can
1007  // override them to provide specific pre-command behavior.
1008  // ----------------------------------------------------------------------
1009 
1011  virtual void SET_LEVEL_preMsgHook(
1012  FwOpcodeType opCode,
1013  U32 cmdSeq
1014  );
1015 
1017  virtual void SEND_PKT_preMsgHook(
1018  FwOpcodeType opCode,
1019  U32 cmdSeq
1020  );
1021 
1023  virtual void ENABLE_SECTION_preMsgHook(
1024  FwOpcodeType opCode,
1025  U32 cmdSeq
1026  );
1027 
1029  virtual void ENABLE_GROUP_preMsgHook(
1030  FwOpcodeType opCode,
1031  U32 cmdSeq
1032  );
1033 
1035  virtual void FORCE_GROUP_preMsgHook(
1036  FwOpcodeType opCode,
1037  U32 cmdSeq
1038  );
1039 
1041  virtual void CONFIGURE_GROUP_RATES_preMsgHook(
1042  FwOpcodeType opCode,
1043  U32 cmdSeq
1044  );
1045 
1046  protected:
1047 
1048  // ----------------------------------------------------------------------
1049  // Event logging functions
1050  // ----------------------------------------------------------------------
1051 
1055  void log_WARNING_LO_NoChan(
1056  FwChanIdType Id
1057  ) const;
1058 
1063  FwChanIdType level
1064  ) const;
1065 
1070  FwChanIdType level,
1071  FwChanIdType max
1072  ) const;
1073 
1078  U32 packetId
1079  ) const;
1080 
1085  U32 packetId
1086  ) const;
1087 
1090  const Svc::TelemetrySection& section,
1091  const Fw::Enabled& enable
1092  ) const;
1093 
1098  FwChanIdType Id,
1099  FwSizeType valSize,
1100  FwSizeType expected
1101  );
1102 
1103  protected:
1104 
1105  // ----------------------------------------------------------------------
1106  // Event throttle reset functions
1107  // ----------------------------------------------------------------------
1108 
1111 
1112  protected:
1113 
1114  // ----------------------------------------------------------------------
1115  // Telemetry serialized write
1116  // ----------------------------------------------------------------------
1117 
1122  void tlmWrite(
1123  FwChanIdType id,
1124  Fw::TlmBuffer& _tlmBuff,
1125  Fw::Time _tlmTime = Fw::Time()
1126  ) const;
1127 
1128  protected:
1129 
1130  // ----------------------------------------------------------------------
1131  // Telemetry write functions
1132  // ----------------------------------------------------------------------
1133 
1137  void tlmWrite_GroupConfigs(
1139  Fw::Time _tlmTime = Fw::Time()
1140  ) const;
1141 
1145  Fw::Time _tlmTime = Fw::Time()
1146  ) const;
1147 
1148  protected:
1149 
1150  // ----------------------------------------------------------------------
1151  // Parameter hook functions
1152  // ----------------------------------------------------------------------
1153 
1157  virtual void parameterUpdated(
1158  FwPrmIdType id
1159  );
1160 
1164  virtual void parametersLoaded();
1165 
1166  protected:
1167 
1168  // ----------------------------------------------------------------------
1169  // Parameter get functions
1170  // ----------------------------------------------------------------------
1171 
1178  Fw::ParamValid& valid
1179  );
1180 
1187  Fw::ParamValid& valid
1188  );
1189 
1190  protected:
1191 
1192  // ----------------------------------------------------------------------
1193  // External parameter delegate initialization
1194  // ----------------------------------------------------------------------
1195 
1198  Fw::ParamExternalDelegate* paramExternalDelegatePtr
1199  );
1200 
1201  protected:
1202 
1203  // ----------------------------------------------------------------------
1204  // Time
1205  // ----------------------------------------------------------------------
1206 
1210  Fw::Time getTime() const;
1211 
1212  private:
1213 
1214  // ----------------------------------------------------------------------
1215  // Message dispatch functions
1216  // ----------------------------------------------------------------------
1217 
1219  virtual MsgDispatchStatus doDispatch();
1220 
1221  private:
1222 
1223  // ----------------------------------------------------------------------
1224  // Calls for messages received on special input ports
1225  // ----------------------------------------------------------------------
1226 
1228  static void m_p_cmdIn_in(
1229  Fw::PassiveComponentBase* callComp,
1230  FwIndexType portNum,
1231  FwOpcodeType opCode,
1232  U32 cmdSeq,
1233  Fw::CmdArgBuffer& args
1234  );
1235 
1236  private:
1237 
1238  // ----------------------------------------------------------------------
1239  // Calls for messages received on typed input ports
1240  // ----------------------------------------------------------------------
1241 
1243  static void m_p_Run_in(
1244  Fw::PassiveComponentBase* callComp,
1245  FwIndexType portNum,
1246  U32 context
1247  );
1248 
1250  static Fw::TlmValid m_p_TlmGet_in(
1251  Fw::PassiveComponentBase* callComp,
1252  FwIndexType portNum,
1253  FwChanIdType id,
1254  Fw::Time& timeTag,
1255  Fw::TlmBuffer& val
1256  );
1259 
1261  static void m_p_TlmRecv_in(
1262  Fw::PassiveComponentBase* callComp,
1263  FwIndexType portNum,
1264  FwChanIdType id,
1265  Fw::Time& timeTag,
1266  Fw::TlmBuffer& val
1267  );
1268 
1270  static void m_p_configureSectionGroupRate_in(
1271  Fw::PassiveComponentBase* callComp,
1272  FwIndexType portNum,
1273  const Svc::TelemetrySection& section,
1274  FwChanIdType tlmGroup,
1275  const Svc::RateLogic& rateLogic,
1276  U32 minDelta,
1277  U32 maxDelta
1278  );
1279 
1281  static void m_p_controlIn_in(
1282  Fw::PassiveComponentBase* callComp,
1283  FwIndexType portNum,
1284  const Svc::TelemetrySection& section,
1285  const Fw::Enabled& enabled
1286  );
1287 
1289  static void m_p_pingIn_in(
1290  Fw::PassiveComponentBase* callComp,
1291  FwIndexType portNum,
1292  U32 key
1293  );
1294 
1295  private:
1296 
1297  // ----------------------------------------------------------------------
1298  // Invocation functions for special output ports
1299  // ----------------------------------------------------------------------
1300 
1302  void cmdRegOut_out(
1303  FwIndexType portNum,
1304  FwOpcodeType opCode
1305  ) const;
1306 
1308  void cmdResponseOut_out(
1309  FwIndexType portNum,
1310  FwOpcodeType opCode,
1311  U32 cmdSeq,
1312  const Fw::CmdResponse& response
1313  ) const;
1314 
1316  void eventOut_out(
1317  FwIndexType portNum,
1318  FwEventIdType id,
1319  Fw::Time& timeTag,
1320  const Fw::LogSeverity& severity,
1321  Fw::LogBuffer& args
1322  ) const;
1323 
1325  Fw::ParamValid paramGetOut_out(
1326  FwIndexType portNum,
1327  FwPrmIdType id,
1328  Fw::ParamBuffer& val
1329  ) const;
1331 
1333  void paramSetOut_out(
1334  FwIndexType portNum,
1335  FwPrmIdType id,
1336  Fw::ParamBuffer& val
1337  ) const;
1338 
1339 #if FW_ENABLE_TEXT_LOGGING
1340 
1342  void textEventOut_out(
1343  FwIndexType portNum,
1344  FwEventIdType id,
1345  Fw::Time& timeTag,
1346  const Fw::LogSeverity& severity,
1347  Fw::TextLogString& text
1348  ) const;
1349 
1350 #endif
1351 
1353  void timeGetOut_out(
1354  FwIndexType portNum,
1355  Fw::Time& time
1356  ) const;
1357 
1359  void tlmOut_out(
1360  FwIndexType portNum,
1361  FwChanIdType id,
1362  Fw::Time& timeTag,
1363  Fw::TlmBuffer& val
1364  ) const;
1365 
1366  private:
1367 
1368  // ----------------------------------------------------------------------
1369  // Parameter set functions
1370  // ----------------------------------------------------------------------
1371 
1375  Fw::CmdResponse paramSet_SECTION_ENABLED(
1376  Fw::SerialBufferBase& val
1377  );
1378 
1382  Fw::CmdResponse paramSet_SECTION_CONFIGS(
1383  Fw::SerialBufferBase& val
1384  );
1385 
1386  private:
1387 
1388  // ----------------------------------------------------------------------
1389  // Parameter save functions
1390  // ----------------------------------------------------------------------
1391 
1395  Fw::CmdResponse paramSave_SECTION_ENABLED();
1396 
1400  Fw::CmdResponse paramSave_SECTION_CONFIGS();
1401 
1402 #if !FW_DIRECT_PORT_CALLS
1403 
1404  private:
1405 
1406  // ----------------------------------------------------------------------
1407  // Special input ports
1408  // ----------------------------------------------------------------------
1409 
1411  Fw::InputCmdPort m_cmdIn_InputPort[NUM_CMDIN_INPUT_PORTS];
1412 
1413 #endif
1414 
1415 #if !FW_DIRECT_PORT_CALLS
1416 
1417  private:
1418 
1419  // ----------------------------------------------------------------------
1420  // Typed input ports
1421  // ----------------------------------------------------------------------
1422 
1424  Svc::InputSchedPort m_Run_InputPort[NUM_RUN_INPUT_PORTS];
1425 
1427  Fw::InputTlmGetPort m_TlmGet_InputPort[NUM_TLMGET_INPUT_PORTS];
1428 
1430  Fw::InputTlmPort m_TlmRecv_InputPort[NUM_TLMRECV_INPUT_PORTS];
1431 
1433  Svc::InputConfigureGroupRatePort m_configureSectionGroupRate_InputPort[NUM_CONFIGURESECTIONGROUPRATE_INPUT_PORTS];
1434 
1437 
1439  Svc::InputPingPort m_pingIn_InputPort[NUM_PINGIN_INPUT_PORTS];
1440 
1441 #endif
1442 
1443 #if !FW_DIRECT_PORT_CALLS
1444 
1445  private:
1446 
1447  // ----------------------------------------------------------------------
1448  // Special output ports
1449  // ----------------------------------------------------------------------
1450 
1452  Fw::OutputCmdRegPort m_cmdRegOut_OutputPort[NUM_CMDREGOUT_OUTPUT_PORTS];
1453 
1455  Fw::OutputCmdResponsePort m_cmdResponseOut_OutputPort[NUM_CMDRESPONSEOUT_OUTPUT_PORTS];
1456 
1458  Fw::OutputLogPort m_eventOut_OutputPort[NUM_EVENTOUT_OUTPUT_PORTS];
1459 
1461  Fw::OutputPrmGetPort m_paramGetOut_OutputPort[NUM_PARAMGETOUT_OUTPUT_PORTS];
1462 
1464  Fw::OutputPrmSetPort m_paramSetOut_OutputPort[NUM_PARAMSETOUT_OUTPUT_PORTS];
1465 
1466 #if FW_ENABLE_TEXT_LOGGING == 1
1467 
1469  Fw::OutputLogTextPort m_textEventOut_OutputPort[NUM_TEXTEVENTOUT_OUTPUT_PORTS];
1470 
1471 #endif
1472 
1474  Fw::OutputTimePort m_timeGetOut_OutputPort[NUM_TIMEGETOUT_OUTPUT_PORTS];
1475 
1477  Fw::OutputTlmPort m_tlmOut_OutputPort[NUM_TLMOUT_OUTPUT_PORTS];
1478 
1479 #endif
1480 
1481 #if !FW_DIRECT_PORT_CALLS
1482 
1483  private:
1484 
1485  // ----------------------------------------------------------------------
1486  // Typed output ports
1487  // ----------------------------------------------------------------------
1488 
1490  Fw::OutputComPort m_PktSend_OutputPort[NUM_PKTSEND_OUTPUT_PORTS];
1491 
1493  Svc::OutputPingPort m_pingOut_OutputPort[NUM_PINGOUT_OUTPUT_PORTS];
1494 
1495 #endif
1496 
1497  private:
1498 
1499  // ----------------------------------------------------------------------
1500  // Counter values for event throttling
1501  // ----------------------------------------------------------------------
1502 
1504  std::atomic<FwIndexType> m_OversizedChannelThrottle;
1505 
1506  private:
1507 
1508  // ----------------------------------------------------------------------
1509  // Parameter validity flags
1510  // ----------------------------------------------------------------------
1511 
1513  Fw::ParamValid m_param_SECTION_ENABLED_valid = Fw::ParamValid::UNINIT;
1514 
1516  Fw::ParamValid m_param_SECTION_CONFIGS_valid = Fw::ParamValid::UNINIT;
1517 
1518  private:
1519 
1520  // ----------------------------------------------------------------------
1521  // Parameter delegate
1522  // ----------------------------------------------------------------------
1523 
1525  Fw::ParamExternalDelegate* paramDelegatePtr = nullptr;
1526 
1527  private:
1528 
1529  // ----------------------------------------------------------------------
1530  // Mutexes
1531  // ----------------------------------------------------------------------
1532 
1534  Os::Mutex m_paramLock;
1535 
1536  };
1537 
1538 }
1539 
1540 #endif
bool isConnected_PktSend_OutputPort(FwIndexType portNum) const
void SEND_PKT_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Svc::InputEnableSectionPort * get_controlIn_InputPort(FwIndexType portNum)
friend class TlmPacketizerTesterBase
Friend class tester to support autocoded test harness.
void set_PktSend_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to PktSend[portNum].
FwIdType FwOpcodeType
The type of a command opcode.
bool isConnected_eventOut_OutputPort(FwIndexType portNum) const
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
PlatformSizeType FwSizeType
void tlmWrite_GroupConfigs(const Svc::TlmPacketizer_SectionConfigs &arg, Fw::Time _tlmTime=Fw::Time()) const
bool isConnected_tlmOut_OutputPort(FwIndexType portNum) const
void FORCE_GROUP_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Fw::InputCmdPort * get_cmdIn_InputPort(FwIndexType portNum)
I32 FwEnumStoreType
static constexpr FwIndexType getNum_cmdResponseOut_OutputPorts()
bool isConnected_paramGetOut_OutputPort(FwIndexType portNum) const
void log_ACTIVITY_HI_LevelSet(FwChanIdType level) const
Svc::InputConfigureGroupRatePort * get_configureSectionGroupRate_InputPort(FwIndexType portNum)
virtual void TlmRecv_handler(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)=0
Handler for input port TlmRecv.
void Run_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port Run.
void log_ACTIVITY_LO_PacketSent(U32 packetId) const
static constexpr FwIndexType getNum_PktSend_OutputPorts()
Enable / disable telemetry of a group on a section.
FwIdType FwPrmIdType
The type of a parameter identifier.
void log_WARNING_LO_NoChan(FwChanIdType Id) const
static constexpr FwIndexType getNum_pingIn_InputPorts()
virtual void configureSectionGroupRate_handler(FwIndexType portNum, const Svc::TelemetrySection &section, FwChanIdType tlmGroup, const Svc::RateLogic &rateLogic, U32 minDelta, U32 maxDelta)=0
Handler for input port configureSectionGroupRate.
void TlmRecv_handlerBase(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Handler base-class function for input port TlmRecv.
void controlIn_handlerBase(FwIndexType portNum, const Svc::TelemetrySection &section, const Fw::Enabled &enabled)
Handler base-class function for input port controlIn.
virtual void SEND_PKT_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, U32 id, const Svc::TelemetrySection &section)=0
bool isConnected_pingOut_OutputPort(FwIndexType portNum) const
virtual void controlIn_handler(FwIndexType portNum, const Svc::TelemetrySection &section, const Fw::Enabled &enabled)=0
Handler for input port controlIn.
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
Enum representing a command response.
bool isConnected_paramSetOut_OutputPort(FwIndexType portNum) const
void cmdIn_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Handler base-class function for input port cmdIn.
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
virtual void SET_LEVEL_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, FwChanIdType level)=0
void log_WARNING_LO_PacketNotFound(U32 packetId) const
void loadParameters()
Load the parameters from a parameter source.
void set_paramSetOut_OutputPort(FwIndexType portNum, Fw::InputPrmSetPort *port)
Connect port to paramSetOut[portNum].
virtual ~TlmPacketizerComponentBase()
Destroy TlmPacketizerComponentBase object.
void tlmWrite_SectionEnabled(const Svc::TlmPacketizer_SectionEnabled &arg, Fw::Time _tlmTime=Fw::Time()) const
Write telemetry channel SectionEnabled.
void set_pingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
void init()
Object initializer.
Definition: ObjBase.cpp:24
void registerExternalParameters(Fw::ParamExternalDelegate *paramExternalDelegatePtr)
Initialize the external parameter delegate.
virtual void configureSectionGroupRate_preMsgHook(FwIndexType portNum, const Svc::TelemetrySection &section, FwChanIdType tlmGroup, const Svc::RateLogic &rateLogic, U32 minDelta, U32 maxDelta)
Pre-message hook for async input port configureSectionGroupRate.
FwIdType FwEventIdType
The type of an event identifier.
virtual void FORCE_GROUP_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command FORCE_GROUP.
virtual void ENABLE_SECTION_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Svc::TelemetrySection &section, const Fw::Enabled &enable)=0
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_cmdRegOut_OutputPorts()
Fw::InputTlmGetPort * get_TlmGet_InputPort(FwIndexType portNum)
void log_WARNING_LO_SectionUnconfigurable(const Svc::TelemetrySection &section, const Fw::Enabled &enable) const
Log event SectionUnconfigurable.
bool isConnected_timeGetOut_OutputPort(FwIndexType portNum) const
virtual void CONFIGURE_GROUP_RATES_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CONFIGURE_GROUP_RATES.
void log_WARNING_HI_OversizedChannel_ThrottleClear()
Reset throttle value for OversizedChannel.
virtual void Run_preMsgHook(FwIndexType portNum, U32 context)
Pre-message hook for async input port Run.
Enumeration for rate logic types for telemetry groups.
void tlmWrite(FwChanIdType id, Fw::TlmBuffer &_tlmBuff, Fw::Time _tlmTime=Fw::Time()) const
bool isConnected_cmdResponseOut_OutputPort(FwIndexType portNum) const
static constexpr FwIndexType getNum_timeGetOut_OutputPorts()
static constexpr FwIndexType getNum_paramGetOut_OutputPorts()
FwIdType FwChanIdType
The type of a telemetry channel identifier.
Telemetry channel is not part of a telemetry packet.
virtual void pingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port pingIn.
virtual void ENABLE_GROUP_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command ENABLE_GROUP.
void set_eventOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to eventOut[portNum].
Enum representing event severity.
static constexpr FwIndexType getNum_tlmOut_OutputPorts()
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
Enabled and disabled states.
friend class TlmPacketizerTester
Friend class tester implementation to support white-box testing.
Fw::TlmValid TlmGet_handlerBase(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Handler base-class function for input port TlmGet.
virtual void Run_handler(FwIndexType portNum, U32 context)=0
Handler for input port Run.
static constexpr FwIndexType getNum_eventOut_OutputPorts()
void ENABLE_GROUP_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
virtual void ENABLE_GROUP_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Svc::TelemetrySection &section, FwChanIdType tlmGroup, const Fw::Enabled &enable)=0
Svc::TlmPacketizer_SectionEnabled paramGet_SECTION_ENABLED(Fw::ParamValid &valid)
void PktSend_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context) const
Invoke output port PktSend.
static constexpr FwIndexType getNum_paramSetOut_OutputPorts()
void log_WARNING_LO_MaxLevelExceed(FwChanIdType level, FwChanIdType max) const
virtual void controlIn_preMsgHook(FwIndexType portNum, const Svc::TelemetrySection &section, const Fw::Enabled &enabled)
Pre-message hook for async input port controlIn.
PlatformIndexType FwIndexType
TlmPacketizerComponentBase(const char *compName="")
Construct TlmPacketizerComponentBase object.
static constexpr FwIndexType getNum_configureSectionGroupRate_InputPorts()
virtual void parametersLoaded()
Called whenever parameters are loaded.
void set_timeGetOut_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeGetOut[portNum].
void log_WARNING_HI_OversizedChannel(FwChanIdType Id, FwSizeType valSize, FwSizeType expected)
void ENABLE_SECTION_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
virtual void SEND_PKT_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command SEND_PKT.
void configureSectionGroupRate_handlerBase(FwIndexType portNum, const Svc::TelemetrySection &section, FwChanIdType tlmGroup, const Svc::RateLogic &rateLogic, U32 minDelta, U32 maxDelta)
Handler base-class function for input port configureSectionGroupRate.
RateGroupDivider component implementation.
virtual void parameterUpdated(FwPrmIdType id)
Called whenever a parameter is updated.
Enum representing parameter validity.
bool isConnected_cmdRegOut_OutputPort(FwIndexType portNum) const
Force telemetering a group on a section, even if disabled.
Svc::InputSchedPort * get_Run_InputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_TlmGet_InputPorts()
Fw::InputTlmPort * get_TlmRecv_InputPort(FwIndexType portNum)
virtual void CONFIGURE_GROUP_RATES_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Svc::TelemetrySection &section, FwChanIdType tlmGroup, const Svc::RateLogic &rateLogic, U32 minDelta, U32 maxDelta)=0
Svc::TlmPacketizer_SectionConfigs paramGet_SECTION_CONFIGS(Fw::ParamValid &valid)
static constexpr FwIndexType getNum_controlIn_InputPorts()
virtual void ENABLE_SECTION_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command ENABLE_SECTION.
void regCommands()
Register commands with the Command Dispatcher.
void pingOut_out(FwIndexType portNum, U32 key) const
Invoke output port pingOut.
void CONFIGURE_GROUP_RATES_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void SET_LEVEL_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
virtual void SET_LEVEL_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command SET_LEVEL.
virtual void FORCE_GROUP_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Svc::TelemetrySection &section, FwChanIdType tlmGroup, const Fw::Enabled &enable)=0
static constexpr FwIndexType getNum_pingOut_OutputPorts()
void set_paramGetOut_OutputPort(FwIndexType portNum, Fw::InputPrmGetPort *port)
Connect port to paramGetOut[portNum].
Telemetry value larger than the configured channel size.
static constexpr FwIndexType getNum_Run_InputPorts()
Set Min and Max Deltas between successive packets.
void set_cmdResponseOut_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
virtual Fw::TlmValid TlmGet_handler(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)=0
Handler for input port TlmGet.
static constexpr FwIndexType getNum_TlmRecv_InputPorts()
void set_cmdRegOut_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to cmdRegOut[portNum].
Auto-generated base for TlmPacketizer component.
static constexpr FwIndexType getNum_cmdIn_InputPorts()