F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
CommandDispatcherComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title CommandDispatcherComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for CommandDispatcher component base class
5 // ======================================================================
6 
7 #ifndef Svc_CommandDispatcherComponentAc_HPP
8 #define Svc_CommandDispatcherComponentAc_HPP
9 
10 #include <atomic>
11 
12 #include "Fw/Cmd/CmdPortAc.hpp"
13 #include "Fw/Cmd/CmdRegPortAc.hpp"
16 #include "Fw/Cmd/CmdString.hpp"
17 #include "Fw/Com/ComPortAc.hpp"
19 #include "Fw/FPrimeBasicTypes.hpp"
20 #include "Fw/Log/LogPortAc.hpp"
21 #include "Fw/Log/LogString.hpp"
22 #include "Fw/Log/LogTextPortAc.hpp"
23 #if !FW_DIRECT_PORT_CALLS
25 #endif
26 #if !FW_DIRECT_PORT_CALLS
28 #endif
29 #include "Fw/Time/TimePortAc.hpp"
30 #include "Fw/Tlm/TlmPortAc.hpp"
31 #include "Fw/Tlm/TlmString.hpp"
33 #include "Os/Mutex.hpp"
34 #include "Svc/Ping/PingPortAc.hpp"
38 
39 namespace Svc {
40 
47  {
48 
49  // ----------------------------------------------------------------------
50  // Friend classes
51  // ----------------------------------------------------------------------
52 
57 
58  protected:
59 
60  // ----------------------------------------------------------------------
61  // Constants
62  // ----------------------------------------------------------------------
63 
65  enum {
67  };
68 
70  enum {
76  };
77 
79  enum {
86  };
87 
89  enum {
93  };
94 
96  enum {
101  };
102 
104  enum {
117  };
118 
120  enum {
122  };
123 
125  enum {
129  };
130 
131  public:
132 
133  // ----------------------------------------------------------------------
134  // Component initialization
135  // ----------------------------------------------------------------------
136 
138  void init(
139  FwSizeType queueDepth,
140  FwEnumStoreType instance = 0
141  );
142 
143 #if !FW_DIRECT_PORT_CALLS
144 
145  public:
146 
147  // ----------------------------------------------------------------------
148  // Getters for special input ports
149  // ----------------------------------------------------------------------
150 
155  FwIndexType portNum
156  );
157 
158 #endif
159 
160 #if !FW_DIRECT_PORT_CALLS
161 
162  public:
163 
164  // ----------------------------------------------------------------------
165  // Getters for typed input ports
166  // ----------------------------------------------------------------------
167 
172  FwIndexType portNum
173  );
174 
179  FwIndexType portNum
180  );
181 
186  FwIndexType portNum
187  );
188 
193  FwIndexType portNum
194  );
195 
200  FwIndexType portNum
201  );
202 
203 #endif
204 
205 #if !FW_DIRECT_PORT_CALLS
206 
207  public:
208 
209  // ----------------------------------------------------------------------
210  // Connect input ports to special output ports
211  // ----------------------------------------------------------------------
212 
215  FwIndexType portNum,
216  Fw::InputCmdRegPort* port
217  );
218 
221  FwIndexType portNum,
223  );
224 
226  void set_Log_OutputPort(
227  FwIndexType portNum,
228  Fw::InputLogPort* port
229  );
230 
231 #if FW_ENABLE_TEXT_LOGGING == 1
232 
234  void set_LogText_OutputPort(
235  FwIndexType portNum,
236  Fw::InputLogTextPort* port
237  );
238 
239 #endif
240 
242  void set_Time_OutputPort(
243  FwIndexType portNum,
244  Fw::InputTimePort* port
245  );
246 
248  void set_Tlm_OutputPort(
249  FwIndexType portNum,
250  Fw::InputTlmPort* port
251  );
252 
253 #endif
254 
255 #if !FW_DIRECT_PORT_CALLS
256 
257  public:
258 
259  // ----------------------------------------------------------------------
260  // Connect typed input ports to typed output ports
261  // ----------------------------------------------------------------------
262 
265  FwIndexType portNum,
266  Fw::InputCmdPort* port
267  );
268 
271  FwIndexType portNum,
272  Svc::InputPingPort* port
273  );
274 
277  FwIndexType portNum,
279  );
280 
281 #endif
282 
283 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
284 
285  public:
286 
287  // ----------------------------------------------------------------------
288  // Connect serial input ports to special output ports
289  // ----------------------------------------------------------------------
290 
293  FwIndexType portNum,
294  Fw::InputSerializePort* port
295  );
296 
299  FwIndexType portNum,
300  Fw::InputSerializePort* port
301  );
302 
304  void set_Log_OutputPort(
305  FwIndexType portNum,
306  Fw::InputSerializePort* port
307  );
308 
309 #if FW_ENABLE_TEXT_LOGGING == 1
310 
312  void set_LogText_OutputPort(
313  FwIndexType portNum,
314  Fw::InputSerializePort* port
315  );
316 
317 #endif
318 
320  void set_Time_OutputPort(
321  FwIndexType portNum,
322  Fw::InputSerializePort* port
323  );
324 
326  void set_Tlm_OutputPort(
327  FwIndexType portNum,
328  Fw::InputSerializePort* port
329  );
330 
331 #endif
332 
333 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
334 
335  public:
336 
337  // ----------------------------------------------------------------------
338  // Connect serial input ports to typed output ports
339  // ----------------------------------------------------------------------
340 
343  FwIndexType portNum,
344  Fw::InputSerializePort* port
345  );
346 
349  FwIndexType portNum,
350  Fw::InputSerializePort* port
351  );
352 
355  FwIndexType portNum,
356  Fw::InputSerializePort* port
357  );
358 
359 #endif
360 
361  public:
362 
363  // ----------------------------------------------------------------------
364  // Command registration
365  // ----------------------------------------------------------------------
366 
370  void regCommands();
371 
372  protected:
373 
374  // ----------------------------------------------------------------------
375  // Component construction and destruction
376  // ----------------------------------------------------------------------
377 
380  const char* compName = ""
381  );
382 
385 
386  protected:
387 
388  // ----------------------------------------------------------------------
389  // Getters for numbers of special input ports
390  // ----------------------------------------------------------------------
391 
397  }
398 
399  protected:
400 
401  // ----------------------------------------------------------------------
402  // Getters for numbers of typed input ports
403  // ----------------------------------------------------------------------
404 
410  }
411 
417  }
418 
423  return NUM_PINGIN_INPUT_PORTS;
424  }
425 
429  static constexpr FwIndexType getNum_run_InputPorts() {
430  return NUM_RUN_INPUT_PORTS;
431  }
432 
438  }
439 
440  protected:
441 
442  // ----------------------------------------------------------------------
443  // Getters for numbers of special output ports
444  // ----------------------------------------------------------------------
445 
451  }
452 
458  }
459 
463  static constexpr FwIndexType getNum_Log_OutputPorts() {
464  return NUM_LOG_OUTPUT_PORTS;
465  }
466 
467 #if FW_ENABLE_TEXT_LOGGING == 1
468 
472  static constexpr FwIndexType getNum_LogText_OutputPorts() {
474  }
475 
476 #endif
477 
482  return NUM_TIME_OUTPUT_PORTS;
483  }
484 
488  static constexpr FwIndexType getNum_Tlm_OutputPorts() {
489  return NUM_TLM_OUTPUT_PORTS;
490  }
491 
492  protected:
493 
494  // ----------------------------------------------------------------------
495  // Getters for numbers of typed output ports
496  // ----------------------------------------------------------------------
497 
503  }
504 
510  }
511 
517  }
518 
519  protected:
520 
521  // ----------------------------------------------------------------------
522  // Connection status queries for special output ports
523  // ----------------------------------------------------------------------
524 
529  FwIndexType portNum
530  ) const;
531 
536  FwIndexType portNum
537  ) const;
538 
543  FwIndexType portNum
544  ) const;
545 
546 #if FW_ENABLE_TEXT_LOGGING == 1
547 
551  bool isConnected_LogText_OutputPort(
552  FwIndexType portNum
553  ) const;
554 
555 #endif
556 
561  FwIndexType portNum
562  ) const;
563 
568  FwIndexType portNum
569  ) const;
570 
571  protected:
572 
573  // ----------------------------------------------------------------------
574  // Connection status queries for typed output ports
575  // ----------------------------------------------------------------------
576 
581  FwIndexType portNum
582  ) const;
583 
588  FwIndexType portNum
589  ) const;
590 
595  FwIndexType portNum
596  ) const;
597 
598 #if FW_DIRECT_PORT_CALLS
599  public:
600 #else
601  protected:
602 #endif
603 
604  // ----------------------------------------------------------------------
605  // Port handler base-class functions for special input ports
606  //
607  // Call these functions directly to bypass the corresponding ports
608  // ----------------------------------------------------------------------
609 
611  void CmdDisp_handlerBase(
612  FwIndexType portNum,
613  FwOpcodeType opCode,
614  U32 cmdSeq,
615  Fw::CmdArgBuffer& args
616  );
617 
618  protected:
619 
620  // ----------------------------------------------------------------------
621  // Handlers to implement for typed input ports
622  // ----------------------------------------------------------------------
623 
625  virtual void compCmdReg_handler(
626  FwIndexType portNum,
627  FwOpcodeType opCode
628  ) = 0;
629 
631  virtual void compCmdStat_handler(
632  FwIndexType portNum,
633  FwOpcodeType opCode,
634  U32 cmdSeq,
635  const Fw::CmdResponse& response
636  ) = 0;
637 
639  virtual void pingIn_handler(
640  FwIndexType portNum,
641  U32 key
642  ) = 0;
643 
645  virtual void run_handler(
646  FwIndexType portNum,
647  U32 context
648  ) = 0;
649 
651  virtual void seqCmdBuff_handler(
652  FwIndexType portNum,
653  Fw::ComBuffer& data,
654  U32 context
655  ) = 0;
656 
657 #if FW_DIRECT_PORT_CALLS
658  public:
659 #else
660  protected:
661 #endif
662 
663  // ----------------------------------------------------------------------
664  // Port handler base-class functions for typed input ports
665  //
666  // Call these functions directly to bypass the corresponding ports
667  // ----------------------------------------------------------------------
668 
671  FwIndexType portNum,
672  FwOpcodeType opCode
673  );
674 
677  FwIndexType portNum,
678  FwOpcodeType opCode,
679  U32 cmdSeq,
680  const Fw::CmdResponse& response
681  );
682 
684  void pingIn_handlerBase(
685  FwIndexType portNum,
686  U32 key
687  );
688 
690  void run_handlerBase(
691  FwIndexType portNum,
692  U32 context
693  );
694 
697  FwIndexType portNum,
698  Fw::ComBuffer& data,
699  U32 context
700  );
701 
702  protected:
703 
704  // ----------------------------------------------------------------------
705  // Pre-message hooks for typed async input ports
706  //
707  // Each of these functions is invoked just before processing a message
708  // on the corresponding port. By default, they do nothing. You can
709  // override them to provide specific pre-message behavior.
710  // ----------------------------------------------------------------------
711 
713  virtual void compCmdStat_preMsgHook(
714  FwIndexType portNum,
715  FwOpcodeType opCode,
716  U32 cmdSeq,
717  const Fw::CmdResponse& response
718  );
719 
721  virtual void pingIn_preMsgHook(
722  FwIndexType portNum,
723  U32 key
724  );
725 
727  virtual void run_preMsgHook(
728  FwIndexType portNum,
729  U32 context
730  );
731 
733  virtual void seqCmdBuff_preMsgHook(
734  FwIndexType portNum,
735  Fw::ComBuffer& data,
736  U32 context
737  );
738 
739  protected:
740 
741  // ----------------------------------------------------------------------
742  // Hooks for typed async input ports
743  //
744  // Each of these functions is invoked when placing a message on the
745  // queue would cause the queue to overlow. You should override them to provide
746  // specific overflow behavior.
747  // ----------------------------------------------------------------------
748 
750  virtual void seqCmdBuff_overflowHook(
751  FwIndexType portNum,
752  Fw::ComBuffer& data,
753  U32 context
754  ) = 0;
755 
756  protected:
757 
758  // ----------------------------------------------------------------------
759  // Invocation functions for typed output ports
760  // ----------------------------------------------------------------------
761 
763  void compCmdSend_out(
764  FwIndexType portNum,
765  FwOpcodeType opCode,
766  U32 cmdSeq,
767  Fw::CmdArgBuffer& args
768  ) const;
769 
771  void pingOut_out(
772  FwIndexType portNum,
773  U32 key
774  ) const;
775 
777  void seqCmdStatus_out(
778  FwIndexType portNum,
779  FwOpcodeType opCode,
780  U32 cmdSeq,
781  const Fw::CmdResponse& response
782  ) const;
783 
784  protected:
785 
786  // ----------------------------------------------------------------------
787  // Command response
788  // ----------------------------------------------------------------------
789 
791  void cmdResponse_out(
792  FwOpcodeType opCode,
793  U32 cmdSeq,
794  Fw::CmdResponse response
795  );
796 
797  protected:
798 
799  // ----------------------------------------------------------------------
800  // Command handlers to implement
801  // ----------------------------------------------------------------------
802 
806  virtual void CMD_NO_OP_cmdHandler(
807  FwOpcodeType opCode,
808  U32 cmdSeq
809  ) = 0;
810 
814  virtual void CMD_NO_OP_STRING_cmdHandler(
815  FwOpcodeType opCode,
816  U32 cmdSeq,
817  const Fw::CmdStringArg& arg1
818  ) = 0;
819 
823  virtual void CMD_TEST_CMD_1_cmdHandler(
824  FwOpcodeType opCode,
825  U32 cmdSeq,
826  I32 arg1,
827  F32 arg2,
828  U8 arg3
829  ) = 0;
830 
834  virtual void CMD_CLEAR_TRACKING_cmdHandler(
835  FwOpcodeType opCode,
836  U32 cmdSeq
837  ) = 0;
838 
839  protected:
840 
841  // ----------------------------------------------------------------------
842  // Command handler base-class functions
843  //
844  // Call these functions directly to bypass the command input port
845  // ----------------------------------------------------------------------
846 
851  FwOpcodeType opCode,
852  U32 cmdSeq,
853  Fw::CmdArgBuffer& args
854  );
855 
860  FwOpcodeType opCode,
861  U32 cmdSeq,
862  Fw::CmdArgBuffer& args
863  );
864 
869  FwOpcodeType opCode,
870  U32 cmdSeq,
871  Fw::CmdArgBuffer& args
872  );
873 
878  FwOpcodeType opCode,
879  U32 cmdSeq,
880  Fw::CmdArgBuffer& args
881  );
882 
883  protected:
884 
885  // ----------------------------------------------------------------------
886  // Pre-message hooks for async commands
887  //
888  // Each of these functions is invoked just before processing the
889  // corresponding command. By default they do nothing. You can
890  // override them to provide specific pre-command behavior.
891  // ----------------------------------------------------------------------
892 
894  virtual void CMD_NO_OP_preMsgHook(
895  FwOpcodeType opCode,
896  U32 cmdSeq
897  );
898 
900  virtual void CMD_NO_OP_STRING_preMsgHook(
901  FwOpcodeType opCode,
902  U32 cmdSeq
903  );
904 
906  virtual void CMD_TEST_CMD_1_preMsgHook(
907  FwOpcodeType opCode,
908  U32 cmdSeq
909  );
910 
912  virtual void CMD_CLEAR_TRACKING_preMsgHook(
913  FwOpcodeType opCode,
914  U32 cmdSeq
915  );
916 
917  protected:
918 
919  // ----------------------------------------------------------------------
920  // Event logging functions
921  // ----------------------------------------------------------------------
922 
925  FwOpcodeType Opcode,
926  I32 port,
927  I32 slot
928  ) const;
929 
934  FwOpcodeType Opcode,
935  I32 port
936  ) const;
937 
942  FwOpcodeType Opcode
943  ) const;
944 
949  FwOpcodeType Opcode,
950  Fw::CmdResponse error
951  ) const;
952 
958  ) const;
959 
964  FwOpcodeType Opcode
965  ) const;
966 
971  FwOpcodeType Opcode
972  ) const;
973 
977  void log_ACTIVITY_HI_NoOpReceived() const;
978 
983  const Fw::StringBase& message
984  ) const;
985 
990  I32 arg1,
991  F32 arg2,
992  U8 arg3
993  ) const;
994 
999  FwOpcodeType Opcode,
1000  I32 port
1001  ) const;
1002 
1007  FwOpcodeType OpCode,
1008  U32 Context
1009  );
1010 
1011  protected:
1012 
1013  // ----------------------------------------------------------------------
1014  // Event throttle reset functions
1015  // ----------------------------------------------------------------------
1016 
1019 
1020  protected:
1021 
1022  // ----------------------------------------------------------------------
1023  // Telemetry serialized write
1024  // ----------------------------------------------------------------------
1025 
1030  void tlmWrite(
1031  FwChanIdType id,
1032  Fw::TlmBuffer& _tlmBuff,
1033  Fw::Time _tlmTime = Fw::Time()
1034  ) const;
1035 
1036  protected:
1037 
1038  // ----------------------------------------------------------------------
1039  // Telemetry write functions
1040  // ----------------------------------------------------------------------
1041 
1046  U32 arg,
1047  Fw::Time _tlmTime = Fw::Time()
1048  );
1049 
1054  U32 arg,
1055  Fw::Time _tlmTime = Fw::Time()
1056  );
1057 
1062  U32 arg,
1063  Fw::Time _tlmTime = Fw::Time()
1064  );
1065 
1066  protected:
1067 
1068  // ----------------------------------------------------------------------
1069  // Time
1070  // ----------------------------------------------------------------------
1071 
1075  Fw::Time getTime() const;
1076 
1077  protected:
1078 
1079  // ----------------------------------------------------------------------
1080  // Mutex operations for guarded ports
1081  //
1082  // You can override these operations to provide more sophisticated
1083  // synchronization
1084  // ----------------------------------------------------------------------
1085 
1087  virtual void lock();
1088 
1090  virtual void unLock();
1091 
1092  private:
1093 
1094  // ----------------------------------------------------------------------
1095  // Message dispatch functions
1096  // ----------------------------------------------------------------------
1097 
1099  virtual MsgDispatchStatus doDispatch();
1100 
1101  private:
1102 
1103  // ----------------------------------------------------------------------
1104  // Calls for messages received on special input ports
1105  // ----------------------------------------------------------------------
1106 
1108  static void m_p_CmdDisp_in(
1109  Fw::PassiveComponentBase* callComp,
1110  FwIndexType portNum,
1111  FwOpcodeType opCode,
1112  U32 cmdSeq,
1113  Fw::CmdArgBuffer& args
1114  );
1115 
1116  private:
1117 
1118  // ----------------------------------------------------------------------
1119  // Calls for messages received on typed input ports
1120  // ----------------------------------------------------------------------
1121 
1123  static void m_p_compCmdReg_in(
1124  Fw::PassiveComponentBase* callComp,
1125  FwIndexType portNum,
1126  FwOpcodeType opCode
1127  );
1128 
1130  static void m_p_compCmdStat_in(
1131  Fw::PassiveComponentBase* callComp,
1132  FwIndexType portNum,
1133  FwOpcodeType opCode,
1134  U32 cmdSeq,
1135  const Fw::CmdResponse& response
1136  );
1137 
1139  static void m_p_pingIn_in(
1140  Fw::PassiveComponentBase* callComp,
1141  FwIndexType portNum,
1142  U32 key
1143  );
1144 
1146  static void m_p_run_in(
1147  Fw::PassiveComponentBase* callComp,
1148  FwIndexType portNum,
1149  U32 context
1150  );
1151 
1153  static void m_p_seqCmdBuff_in(
1154  Fw::PassiveComponentBase* callComp,
1155  FwIndexType portNum,
1156  Fw::ComBuffer& data,
1157  U32 context
1158  );
1159 
1160  private:
1161 
1162  // ----------------------------------------------------------------------
1163  // Invocation functions for special output ports
1164  // ----------------------------------------------------------------------
1165 
1167  void CmdReg_out(
1168  FwIndexType portNum,
1169  FwOpcodeType opCode
1170  ) const;
1171 
1173  void CmdStatus_out(
1174  FwIndexType portNum,
1175  FwOpcodeType opCode,
1176  U32 cmdSeq,
1177  const Fw::CmdResponse& response
1178  ) const;
1179 
1181  void Log_out(
1182  FwIndexType portNum,
1183  FwEventIdType id,
1184  Fw::Time& timeTag,
1185  const Fw::LogSeverity& severity,
1186  Fw::LogBuffer& args
1187  ) const;
1188 
1189 #if FW_ENABLE_TEXT_LOGGING
1190 
1192  void LogText_out(
1193  FwIndexType portNum,
1194  FwEventIdType id,
1195  Fw::Time& timeTag,
1196  const Fw::LogSeverity& severity,
1197  Fw::TextLogString& text
1198  ) const;
1199 
1200 #endif
1201 
1203  void Time_out(
1204  FwIndexType portNum,
1205  Fw::Time& time
1206  ) const;
1207 
1209  void Tlm_out(
1210  FwIndexType portNum,
1211  FwChanIdType id,
1212  Fw::Time& timeTag,
1213  Fw::TlmBuffer& val
1214  ) const;
1215 
1216 #if !FW_DIRECT_PORT_CALLS
1217 
1218  private:
1219 
1220  // ----------------------------------------------------------------------
1221  // Special input ports
1222  // ----------------------------------------------------------------------
1223 
1225  Fw::InputCmdPort m_CmdDisp_InputPort[NUM_CMDDISP_INPUT_PORTS];
1226 
1227 #endif
1228 
1229 #if !FW_DIRECT_PORT_CALLS
1230 
1231  private:
1232 
1233  // ----------------------------------------------------------------------
1234  // Typed input ports
1235  // ----------------------------------------------------------------------
1236 
1238  Fw::InputCmdRegPort m_compCmdReg_InputPort[NUM_COMPCMDREG_INPUT_PORTS];
1239 
1241  Fw::InputCmdResponsePort m_compCmdStat_InputPort[NUM_COMPCMDSTAT_INPUT_PORTS];
1242 
1244  Svc::InputPingPort m_pingIn_InputPort[NUM_PINGIN_INPUT_PORTS];
1245 
1247  Svc::InputSchedPort m_run_InputPort[NUM_RUN_INPUT_PORTS];
1248 
1250  Fw::InputComPort m_seqCmdBuff_InputPort[NUM_SEQCMDBUFF_INPUT_PORTS];
1251 
1252 #endif
1253 
1254 #if !FW_DIRECT_PORT_CALLS
1255 
1256  private:
1257 
1258  // ----------------------------------------------------------------------
1259  // Special output ports
1260  // ----------------------------------------------------------------------
1261 
1263  Fw::OutputCmdRegPort m_CmdReg_OutputPort[NUM_CMDREG_OUTPUT_PORTS];
1264 
1266  Fw::OutputCmdResponsePort m_CmdStatus_OutputPort[NUM_CMDSTATUS_OUTPUT_PORTS];
1267 
1269  Fw::OutputLogPort m_Log_OutputPort[NUM_LOG_OUTPUT_PORTS];
1270 
1271 #if FW_ENABLE_TEXT_LOGGING == 1
1272 
1274  Fw::OutputLogTextPort m_LogText_OutputPort[NUM_LOGTEXT_OUTPUT_PORTS];
1275 
1276 #endif
1277 
1279  Fw::OutputTimePort m_Time_OutputPort[NUM_TIME_OUTPUT_PORTS];
1280 
1282  Fw::OutputTlmPort m_Tlm_OutputPort[NUM_TLM_OUTPUT_PORTS];
1283 
1284 #endif
1285 
1286 #if !FW_DIRECT_PORT_CALLS
1287 
1288  private:
1289 
1290  // ----------------------------------------------------------------------
1291  // Typed output ports
1292  // ----------------------------------------------------------------------
1293 
1295  Fw::OutputCmdPort m_compCmdSend_OutputPort[NUM_COMPCMDSEND_OUTPUT_PORTS];
1296 
1298  Svc::OutputPingPort m_pingOut_OutputPort[NUM_PINGOUT_OUTPUT_PORTS];
1299 
1301  Fw::OutputCmdResponsePort m_seqCmdStatus_OutputPort[NUM_SEQCMDSTATUS_OUTPUT_PORTS];
1302 
1303 #endif
1304 
1305  private:
1306 
1307  // ----------------------------------------------------------------------
1308  // Counter values for event throttling
1309  // ----------------------------------------------------------------------
1310 
1312  std::atomic<FwIndexType> m_CommandDroppedQueueOverflowThrottle;
1313 
1314  private:
1315 
1316  // ----------------------------------------------------------------------
1317  // First update flags for telemetry channels
1318  // ----------------------------------------------------------------------
1319 
1321  bool m_first_update_CommandsDispatched = true;
1322 
1324  bool m_first_update_CommandErrors = true;
1325 
1327  bool m_first_update_CommandsDropped = true;
1328 
1329  private:
1330 
1331  // ----------------------------------------------------------------------
1332  // Last value storage for telemetry channels
1333  // ----------------------------------------------------------------------
1334 
1336  U32 m_last_CommandsDispatched = {};
1337 
1339  U32 m_last_CommandErrors = {};
1340 
1342  U32 m_last_CommandsDropped = {};
1343 
1344  private:
1345 
1346  // ----------------------------------------------------------------------
1347  // Mutexes
1348  // ----------------------------------------------------------------------
1349 
1351  Os::Mutex m_guardedPortMutex;
1352 
1353  };
1354 
1355 }
1356 
1357 #endif
void set_seqCmdStatus_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to seqCmdStatus[portNum].
static constexpr FwIndexType getNum_run_InputPorts()
virtual void CMD_NO_OP_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CMD_NO_OP.
void seqCmdStatus_out(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke output port seqCmdStatus.
FwIdType FwOpcodeType
The type of a command opcode.
static constexpr FwIndexType getNum_Log_OutputPorts()
PlatformSizeType FwSizeType
Svc::InputSchedPort * get_run_InputPort(FwIndexType portNum)
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
CommandDispatcherComponentBase(const char *compName="")
Construct CommandDispatcherComponentBase object.
I32 FwEnumStoreType
void regCommands()
Register commands with the Command Dispatcher.
void log_WARNING_HI_CommandDroppedQueueOverflow(FwOpcodeType OpCode, U32 Context)
Fw::InputCmdRegPort * get_compCmdReg_InputPort(FwIndexType portNum)
void CMD_NO_OP_STRING_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Deserialization status.
virtual void run_preMsgHook(FwIndexType portNum, U32 context)
Pre-message hook for async input port run.
virtual void unLock()
Unlock the guarded mutex.
Fw::InputCmdPort * get_CmdDisp_InputPort(FwIndexType portNum)
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
virtual void compCmdStat_handler(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)=0
Handler for input port compCmdStat.
bool isConnected_CmdReg_OutputPort(FwIndexType portNum) const
virtual void run_handler(FwIndexType portNum, U32 context)=0
Handler for input port run.
void log_ACTIVITY_HI_TestCmd1Args(I32 arg1, F32 arg2, U8 arg3) const
virtual void CMD_NO_OP_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
void compCmdSend_out(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args) const
Invoke output port compCmdSend.
Enum representing a command response.
static constexpr FwIndexType getNum_CmdDisp_InputPorts()
friend class CommandDispatcherTester
Friend class tester implementation to support white-box testing.
virtual void pingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port pingIn.
static constexpr FwIndexType getNum_pingIn_InputPorts()
bool isConnected_Time_OutputPort(FwIndexType portNum) const
Exceeded the number of commands that can be simultaneously executed.
static constexpr FwIndexType getNum_pingOut_OutputPorts()
void log_DIAGNOSTIC_OpCodeReregistered(FwOpcodeType Opcode, I32 port) const
static constexpr FwIndexType getNum_CmdStatus_OutputPorts()
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_Tlm_OutputPorts()
void init()
Object initializer.
Definition: ObjBase.cpp:24
virtual void CMD_TEST_CMD_1_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CMD_TEST_CMD_1.
float F32
32-bit floating point
Definition: BasicTypes.h:84
This log event message returns the TEST_CMD_1 arguments.
The command dispatcher has successfully received a NO-OP command.
void log_COMMAND_OpCodeCompleted(FwOpcodeType Opcode) const
FwIdType FwEventIdType
The type of an event identifier.
void log_ACTIVITY_HI_NoOpStringReceived(const Fw::StringBase &message) const
void tlmWrite_CommandsDispatched(U32 arg, Fw::Time _tlmTime=Fw::Time())
static constexpr FwIndexType getNum_CmdReg_OutputPorts()
void set_CmdReg_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to CmdReg[portNum].
friend class CommandDispatcherTesterBase
Friend class tester to support autocoded test harness.
void set_compCmdSend_OutputPort(FwIndexType portNum, Fw::InputCmdPort *port)
Connect port to compCmdSend[portNum].
void log_WARNING_HI_MalformedCommand(Fw::DeserialStatus Status) const
void tlmWrite_CommandsDropped(U32 arg, Fw::Time _tlmTime=Fw::Time())
virtual ~CommandDispatcherComponentBase()
Destroy CommandDispatcherComponentBase object.
Status
Generic OK/ERROR status.
Definition: Os.hpp:26
Fw::InputCmdResponsePort * get_compCmdStat_InputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_Time_OutputPorts()
FwIdType FwChanIdType
The type of a telemetry channel identifier.
bool isConnected_compCmdSend_OutputPort(FwIndexType portNum) const
void log_WARNING_HI_CommandDroppedQueueOverflow_ThrottleClear()
Reset throttle value for CommandDroppedQueueOverflow.
virtual void CMD_TEST_CMD_1_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, I32 arg1, F32 arg2, U8 arg3)=0
virtual void compCmdReg_handler(FwIndexType portNum, FwOpcodeType opCode)=0
Handler for input port compCmdReg.
void tlmWrite_CommandErrors(U32 arg, Fw::Time _tlmTime=Fw::Time())
void pingOut_out(FwIndexType portNum, U32 key) const
Invoke output port pingOut.
virtual void compCmdStat_preMsgHook(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Pre-message hook for async input port compCmdStat.
static constexpr FwIndexType getNum_compCmdReg_InputPorts()
Enum representing event severity.
void log_WARNING_HI_InvalidCommand(FwOpcodeType Opcode) const
void tlmWrite(FwChanIdType id, Fw::TlmBuffer &_tlmBuff, Fw::Time _tlmTime=Fw::Time()) const
void compCmdStat_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Handler base-class function for input port compCmdStat.
bool isConnected_pingOut_OutputPort(FwIndexType portNum) const
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
void CmdDisp_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Handler base-class function for input port CmdDisp.
void log_COMMAND_OpCodeError(FwOpcodeType Opcode, Fw::CmdResponse error) const
The command dispatcher has successfully received a NO-OP command from GUI with a string.
bool isConnected_Tlm_OutputPort(FwIndexType portNum) const
bool isConnected_Log_OutputPort(FwIndexType portNum) const
bool isConnected_CmdStatus_OutputPort(FwIndexType portNum) const
PlatformIndexType FwIndexType
void run_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port run.
void log_DIAGNOSTIC_OpCodeRegistered(FwOpcodeType Opcode, I32 port, I32 slot) const
Log event OpCodeRegistered.
virtual void CMD_CLEAR_TRACKING_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CMD_CLEAR_TRACKING.
void set_Tlm_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to Tlm[portNum].
void CMD_CLEAR_TRACKING_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
bool isConnected_seqCmdStatus_OutputPort(FwIndexType portNum) const
void seqCmdBuff_handlerBase(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Handler base-class function for input port seqCmdBuff.
virtual void CMD_NO_OP_STRING_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &arg1)=0
Auto-generated base for CommandDispatcher component.
virtual void CMD_NO_OP_STRING_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CMD_NO_OP_STRING.
RateGroupDivider component implementation.
virtual void seqCmdBuff_overflowHook(FwIndexType portNum, Fw::ComBuffer &data, U32 context)=0
Overflow hook for async input port seqCmdBuff.
virtual void CMD_CLEAR_TRACKING_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
static constexpr FwIndexType getNum_seqCmdBuff_InputPorts()
void CMD_NO_OP_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
static constexpr FwIndexType getNum_compCmdSend_OutputPorts()
virtual void seqCmdBuff_handler(FwIndexType portNum, Fw::ComBuffer &data, U32 context)=0
Handler for input port seqCmdBuff.
static constexpr FwIndexType getNum_compCmdStat_InputPorts()
virtual void seqCmdBuff_preMsgHook(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Pre-message hook for async input port seqCmdBuff.
Fw::InputComPort * get_seqCmdBuff_InputPort(FwIndexType portNum)
void compCmdReg_handlerBase(FwIndexType portNum, FwOpcodeType opCode)
Handler base-class function for input port compCmdReg.
void set_pingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
static constexpr FwIndexType getNum_seqCmdStatus_OutputPorts()
void log_WARNING_HI_TooManyCommands(FwOpcodeType Opcode) const
virtual void lock()
Lock the guarded mutex.
This log event reports the Command Sequence Buffer port queue has overflowed.
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
void log_COMMAND_OpCodeDispatched(FwOpcodeType Opcode, I32 port) const
void set_Log_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
Clear command tracking info to recover from components not returning status.
void set_CmdStatus_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to CmdStatus[portNum].
void CMD_TEST_CMD_1_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)