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 #if FW_ENABLE_TEXT_LOGGING == 1
23 #include "Fw/Log/LogTextPortAc.hpp"
24 #endif
25 #if !FW_DIRECT_PORT_CALLS
27 #endif
28 #if !FW_DIRECT_PORT_CALLS
30 #endif
31 #include "Fw/Time/TimePortAc.hpp"
32 #include "Fw/Tlm/TlmPortAc.hpp"
33 #include "Fw/Tlm/TlmString.hpp"
35 #include "Os/Mutex.hpp"
36 #include "Svc/Ping/PingPortAc.hpp"
40 
41 namespace Svc {
42 
49  {
50 
51  // ----------------------------------------------------------------------
52  // Friend classes
53  // ----------------------------------------------------------------------
54 
59 
60  protected:
61 
62  // ----------------------------------------------------------------------
63  // Constants
64  // ----------------------------------------------------------------------
65 
67  enum {
69  };
70 
72  enum {
78  };
79 
81  enum {
88  };
89 
91  enum {
95  };
96 
98  enum {
103  };
104 
106  enum {
119  };
120 
122  enum {
124  };
125 
127  enum {
131  };
132 
133  public:
134 
135  // ----------------------------------------------------------------------
136  // Component initialization
137  // ----------------------------------------------------------------------
138 
140  void init(
141  FwSizeType queueDepth,
142  FwEnumStoreType instance = 0
143  );
144 
145 #if !FW_DIRECT_PORT_CALLS
146 
147  public:
148 
149  // ----------------------------------------------------------------------
150  // Getters for special input ports
151  // ----------------------------------------------------------------------
152 
157  FwIndexType portNum
158  );
159 
160 #endif
161 
162 #if !FW_DIRECT_PORT_CALLS
163 
164  public:
165 
166  // ----------------------------------------------------------------------
167  // Getters for typed input ports
168  // ----------------------------------------------------------------------
169 
174  FwIndexType portNum
175  );
176 
181  FwIndexType portNum
182  );
183 
188  FwIndexType portNum
189  );
190 
195  FwIndexType portNum
196  );
197 
202  FwIndexType portNum
203  );
204 
205 #endif
206 
207 #if !FW_DIRECT_PORT_CALLS
208 
209  public:
210 
211  // ----------------------------------------------------------------------
212  // Connect input ports to special output ports
213  // ----------------------------------------------------------------------
214 
217  FwIndexType portNum,
218  Fw::InputCmdRegPort* port
219  );
220 
223  FwIndexType portNum,
225  );
226 
228  void set_Log_OutputPort(
229  FwIndexType portNum,
230  Fw::InputLogPort* port
231  );
232 
233 #if FW_ENABLE_TEXT_LOGGING == 1
234 
236  void set_LogText_OutputPort(
237  FwIndexType portNum,
238  Fw::InputLogTextPort* port
239  );
240 
241 #endif
242 
244  void set_Time_OutputPort(
245  FwIndexType portNum,
246  Fw::InputTimePort* port
247  );
248 
250  void set_Tlm_OutputPort(
251  FwIndexType portNum,
252  Fw::InputTlmPort* port
253  );
254 
255 #endif
256 
257 #if !FW_DIRECT_PORT_CALLS
258 
259  public:
260 
261  // ----------------------------------------------------------------------
262  // Connect typed input ports to typed output ports
263  // ----------------------------------------------------------------------
264 
267  FwIndexType portNum,
268  Fw::InputCmdPort* port
269  );
270 
273  FwIndexType portNum,
274  Svc::InputPingPort* port
275  );
276 
279  FwIndexType portNum,
281  );
282 
283 #endif
284 
285 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
286 
287  public:
288 
289  // ----------------------------------------------------------------------
290  // Connect serial input ports to special output ports
291  // ----------------------------------------------------------------------
292 
295  FwIndexType portNum,
296  Fw::InputSerializePort* port
297  );
298 
301  FwIndexType portNum,
302  Fw::InputSerializePort* port
303  );
304 
306  void set_Log_OutputPort(
307  FwIndexType portNum,
308  Fw::InputSerializePort* port
309  );
310 
311 #if FW_ENABLE_TEXT_LOGGING == 1
312 
314  void set_LogText_OutputPort(
315  FwIndexType portNum,
316  Fw::InputSerializePort* port
317  );
318 
319 #endif
320 
322  void set_Time_OutputPort(
323  FwIndexType portNum,
324  Fw::InputSerializePort* port
325  );
326 
328  void set_Tlm_OutputPort(
329  FwIndexType portNum,
330  Fw::InputSerializePort* port
331  );
332 
333 #endif
334 
335 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
336 
337  public:
338 
339  // ----------------------------------------------------------------------
340  // Connect serial input ports to typed output ports
341  // ----------------------------------------------------------------------
342 
345  FwIndexType portNum,
346  Fw::InputSerializePort* port
347  );
348 
351  FwIndexType portNum,
352  Fw::InputSerializePort* port
353  );
354 
357  FwIndexType portNum,
358  Fw::InputSerializePort* port
359  );
360 
361 #endif
362 
363  public:
364 
365  // ----------------------------------------------------------------------
366  // Command registration
367  // ----------------------------------------------------------------------
368 
372  void regCommands();
373 
374  protected:
375 
376  // ----------------------------------------------------------------------
377  // Component construction and destruction
378  // ----------------------------------------------------------------------
379 
382  const char* compName = ""
383  );
384 
387 
388  protected:
389 
390  // ----------------------------------------------------------------------
391  // Getters for numbers of special input ports
392  // ----------------------------------------------------------------------
393 
399  }
400 
401  protected:
402 
403  // ----------------------------------------------------------------------
404  // Getters for numbers of typed input ports
405  // ----------------------------------------------------------------------
406 
412  }
413 
419  }
420 
425  return NUM_PINGIN_INPUT_PORTS;
426  }
427 
431  static constexpr FwIndexType getNum_run_InputPorts() {
432  return NUM_RUN_INPUT_PORTS;
433  }
434 
440  }
441 
442  protected:
443 
444  // ----------------------------------------------------------------------
445  // Getters for numbers of special output ports
446  // ----------------------------------------------------------------------
447 
453  }
454 
460  }
461 
465  static constexpr FwIndexType getNum_Log_OutputPorts() {
466  return NUM_LOG_OUTPUT_PORTS;
467  }
468 
469 #if FW_ENABLE_TEXT_LOGGING == 1
470 
474  static constexpr FwIndexType getNum_LogText_OutputPorts() {
476  }
477 
478 #endif
479 
484  return NUM_TIME_OUTPUT_PORTS;
485  }
486 
490  static constexpr FwIndexType getNum_Tlm_OutputPorts() {
491  return NUM_TLM_OUTPUT_PORTS;
492  }
493 
494  protected:
495 
496  // ----------------------------------------------------------------------
497  // Getters for numbers of typed output ports
498  // ----------------------------------------------------------------------
499 
505  }
506 
512  }
513 
519  }
520 
521  protected:
522 
523  // ----------------------------------------------------------------------
524  // Connection status queries for special output ports
525  // ----------------------------------------------------------------------
526 
531  FwIndexType portNum
532  ) const;
533 
538  FwIndexType portNum
539  ) const;
540 
545  FwIndexType portNum
546  ) const;
547 
548 #if FW_ENABLE_TEXT_LOGGING == 1
549 
553  bool isConnected_LogText_OutputPort(
554  FwIndexType portNum
555  ) const;
556 
557 #endif
558 
563  FwIndexType portNum
564  ) const;
565 
570  FwIndexType portNum
571  ) const;
572 
573  protected:
574 
575  // ----------------------------------------------------------------------
576  // Connection status queries for typed output ports
577  // ----------------------------------------------------------------------
578 
583  FwIndexType portNum
584  ) const;
585 
590  FwIndexType portNum
591  ) const;
592 
597  FwIndexType portNum
598  ) const;
599 
600 #if FW_DIRECT_PORT_CALLS
601  public:
602 #else
603  protected:
604 #endif
605 
606  // ----------------------------------------------------------------------
607  // Port handler base-class functions for special input ports
608  //
609  // Call these functions directly to bypass the corresponding ports
610  // ----------------------------------------------------------------------
611 
613  void CmdDisp_handlerBase(
614  FwIndexType portNum,
615  FwOpcodeType opCode,
616  U32 cmdSeq,
617  Fw::CmdArgBuffer& args
618  );
619 
620  protected:
621 
622  // ----------------------------------------------------------------------
623  // Handlers to implement for typed input ports
624  // ----------------------------------------------------------------------
625 
627  virtual void compCmdReg_handler(
628  FwIndexType portNum,
629  FwOpcodeType opCode
630  ) = 0;
631 
633  virtual void compCmdStat_handler(
634  FwIndexType portNum,
635  FwOpcodeType opCode,
636  U32 cmdSeq,
637  const Fw::CmdResponse& response
638  ) = 0;
639 
641  virtual void pingIn_handler(
642  FwIndexType portNum,
643  U32 key
644  ) = 0;
645 
647  virtual void run_handler(
648  FwIndexType portNum,
649  U32 context
650  ) = 0;
651 
653  virtual void seqCmdBuff_handler(
654  FwIndexType portNum,
655  Fw::ComBuffer& data,
656  U32 context
657  ) = 0;
658 
659 #if FW_DIRECT_PORT_CALLS
660  public:
661 #else
662  protected:
663 #endif
664 
665  // ----------------------------------------------------------------------
666  // Port handler base-class functions for typed input ports
667  //
668  // Call these functions directly to bypass the corresponding ports
669  // ----------------------------------------------------------------------
670 
673  FwIndexType portNum,
674  FwOpcodeType opCode
675  );
676 
679  FwIndexType portNum,
680  FwOpcodeType opCode,
681  U32 cmdSeq,
682  const Fw::CmdResponse& response
683  );
684 
686  void pingIn_handlerBase(
687  FwIndexType portNum,
688  U32 key
689  );
690 
692  void run_handlerBase(
693  FwIndexType portNum,
694  U32 context
695  );
696 
699  FwIndexType portNum,
700  Fw::ComBuffer& data,
701  U32 context
702  );
703 
704  protected:
705 
706  // ----------------------------------------------------------------------
707  // Pre-message hooks for typed async input ports
708  //
709  // Each of these functions is invoked just before processing a message
710  // on the corresponding port. By default, they do nothing. You can
711  // override them to provide specific pre-message behavior.
712  // ----------------------------------------------------------------------
713 
715  virtual void compCmdStat_preMsgHook(
716  FwIndexType portNum,
717  FwOpcodeType opCode,
718  U32 cmdSeq,
719  const Fw::CmdResponse& response
720  );
721 
723  virtual void pingIn_preMsgHook(
724  FwIndexType portNum,
725  U32 key
726  );
727 
729  virtual void run_preMsgHook(
730  FwIndexType portNum,
731  U32 context
732  );
733 
735  virtual void seqCmdBuff_preMsgHook(
736  FwIndexType portNum,
737  Fw::ComBuffer& data,
738  U32 context
739  );
740 
741  protected:
742 
743  // ----------------------------------------------------------------------
744  // Hooks for typed async input ports
745  //
746  // Each of these functions is invoked when placing a message on the
747  // queue would cause the queue to overlow. You should override them to provide
748  // specific overflow behavior.
749  // ----------------------------------------------------------------------
750 
752  virtual void seqCmdBuff_overflowHook(
753  FwIndexType portNum,
754  Fw::ComBuffer& data,
755  U32 context
756  ) = 0;
757 
758  protected:
759 
760  // ----------------------------------------------------------------------
761  // Invocation functions for typed output ports
762  // ----------------------------------------------------------------------
763 
765  void compCmdSend_out(
766  FwIndexType portNum,
767  FwOpcodeType opCode,
768  U32 cmdSeq,
769  Fw::CmdArgBuffer& args
770  ) const;
771 
773  void pingOut_out(
774  FwIndexType portNum,
775  U32 key
776  ) const;
777 
779  void seqCmdStatus_out(
780  FwIndexType portNum,
781  FwOpcodeType opCode,
782  U32 cmdSeq,
783  const Fw::CmdResponse& response
784  ) const;
785 
786  protected:
787 
788  // ----------------------------------------------------------------------
789  // Command response
790  // ----------------------------------------------------------------------
791 
793  void cmdResponse_out(
794  FwOpcodeType opCode,
795  U32 cmdSeq,
796  Fw::CmdResponse response
797  );
798 
799  protected:
800 
801  // ----------------------------------------------------------------------
802  // Command handlers to implement
803  // ----------------------------------------------------------------------
804 
808  virtual void CMD_NO_OP_cmdHandler(
809  FwOpcodeType opCode,
810  U32 cmdSeq
811  ) = 0;
812 
816  virtual void CMD_NO_OP_STRING_cmdHandler(
817  FwOpcodeType opCode,
818  U32 cmdSeq,
819  const Fw::CmdStringArg& arg1
820  ) = 0;
821 
825  virtual void CMD_TEST_CMD_1_cmdHandler(
826  FwOpcodeType opCode,
827  U32 cmdSeq,
828  I32 arg1,
829  F32 arg2,
830  U8 arg3
831  ) = 0;
832 
836  virtual void CMD_CLEAR_TRACKING_cmdHandler(
837  FwOpcodeType opCode,
838  U32 cmdSeq
839  ) = 0;
840 
841  protected:
842 
843  // ----------------------------------------------------------------------
844  // Command handler base-class functions
845  //
846  // Call these functions directly to bypass the command input port
847  // ----------------------------------------------------------------------
848 
853  FwOpcodeType opCode,
854  U32 cmdSeq,
855  Fw::CmdArgBuffer& args
856  );
857 
862  FwOpcodeType opCode,
863  U32 cmdSeq,
864  Fw::CmdArgBuffer& args
865  );
866 
871  FwOpcodeType opCode,
872  U32 cmdSeq,
873  Fw::CmdArgBuffer& args
874  );
875 
880  FwOpcodeType opCode,
881  U32 cmdSeq,
882  Fw::CmdArgBuffer& args
883  );
884 
885  protected:
886 
887  // ----------------------------------------------------------------------
888  // Pre-message hooks for async commands
889  //
890  // Each of these functions is invoked just before processing the
891  // corresponding command. By default they do nothing. You can
892  // override them to provide specific pre-command behavior.
893  // ----------------------------------------------------------------------
894 
896  virtual void CMD_NO_OP_preMsgHook(
897  FwOpcodeType opCode,
898  U32 cmdSeq
899  );
900 
902  virtual void CMD_NO_OP_STRING_preMsgHook(
903  FwOpcodeType opCode,
904  U32 cmdSeq
905  );
906 
908  virtual void CMD_TEST_CMD_1_preMsgHook(
909  FwOpcodeType opCode,
910  U32 cmdSeq
911  );
912 
914  virtual void CMD_CLEAR_TRACKING_preMsgHook(
915  FwOpcodeType opCode,
916  U32 cmdSeq
917  );
918 
919  protected:
920 
921  // ----------------------------------------------------------------------
922  // Event logging functions
923  // ----------------------------------------------------------------------
924 
927  FwOpcodeType Opcode,
928  I32 port,
929  I32 slot
930  ) const;
931 
936  FwOpcodeType Opcode,
937  I32 port
938  ) const;
939 
944  FwOpcodeType Opcode
945  ) const;
946 
951  FwOpcodeType Opcode,
952  Fw::CmdResponse error
953  ) const;
954 
960  ) const;
961 
966  FwOpcodeType Opcode
967  ) const;
968 
973  FwOpcodeType Opcode
974  ) const;
975 
979  void log_ACTIVITY_HI_NoOpReceived() const;
980 
985  const Fw::StringBase& message
986  ) const;
987 
992  I32 arg1,
993  F32 arg2,
994  U8 arg3
995  ) const;
996 
1001  FwOpcodeType Opcode,
1002  I32 port
1003  ) const;
1004 
1009  FwOpcodeType OpCode,
1010  U32 Context
1011  );
1012 
1013  protected:
1014 
1015  // ----------------------------------------------------------------------
1016  // Event throttle reset functions
1017  // ----------------------------------------------------------------------
1018 
1021 
1022  protected:
1023 
1024  // ----------------------------------------------------------------------
1025  // Telemetry serialized write
1026  // ----------------------------------------------------------------------
1027 
1032  void tlmWrite(
1033  FwChanIdType id,
1034  Fw::TlmBuffer& _tlmBuff,
1035  Fw::Time _tlmTime = Fw::Time()
1036  ) const;
1037 
1038  protected:
1039 
1040  // ----------------------------------------------------------------------
1041  // Telemetry write functions
1042  // ----------------------------------------------------------------------
1043 
1048  U32 arg,
1049  Fw::Time _tlmTime = Fw::Time()
1050  );
1051 
1056  U32 arg,
1057  Fw::Time _tlmTime = Fw::Time()
1058  );
1059 
1064  U32 arg,
1065  Fw::Time _tlmTime = Fw::Time()
1066  );
1067 
1068  protected:
1069 
1070  // ----------------------------------------------------------------------
1071  // Time
1072  // ----------------------------------------------------------------------
1073 
1077  Fw::Time getTime() const;
1078 
1079  protected:
1080 
1081  // ----------------------------------------------------------------------
1082  // Mutex operations for guarded ports
1083  //
1084  // You can override these operations to provide more sophisticated
1085  // synchronization
1086  // ----------------------------------------------------------------------
1087 
1089  virtual void lock();
1090 
1092  virtual void unLock();
1093 
1094  private:
1095 
1096  // ----------------------------------------------------------------------
1097  // Message dispatch functions
1098  // ----------------------------------------------------------------------
1099 
1101  virtual MsgDispatchStatus doDispatch();
1102 
1103  private:
1104 
1105  // ----------------------------------------------------------------------
1106  // Calls for messages received on special input ports
1107  // ----------------------------------------------------------------------
1108 
1110  static void m_p_CmdDisp_in(
1111  Fw::PassiveComponentBase* callComp,
1112  FwIndexType portNum,
1113  FwOpcodeType opCode,
1114  U32 cmdSeq,
1115  Fw::CmdArgBuffer& args
1116  );
1117 
1118  private:
1119 
1120  // ----------------------------------------------------------------------
1121  // Calls for messages received on typed input ports
1122  // ----------------------------------------------------------------------
1123 
1125  static void m_p_compCmdReg_in(
1126  Fw::PassiveComponentBase* callComp,
1127  FwIndexType portNum,
1128  FwOpcodeType opCode
1129  );
1130 
1132  static void m_p_compCmdStat_in(
1133  Fw::PassiveComponentBase* callComp,
1134  FwIndexType portNum,
1135  FwOpcodeType opCode,
1136  U32 cmdSeq,
1137  const Fw::CmdResponse& response
1138  );
1139 
1141  static void m_p_pingIn_in(
1142  Fw::PassiveComponentBase* callComp,
1143  FwIndexType portNum,
1144  U32 key
1145  );
1146 
1148  static void m_p_run_in(
1149  Fw::PassiveComponentBase* callComp,
1150  FwIndexType portNum,
1151  U32 context
1152  );
1153 
1155  static void m_p_seqCmdBuff_in(
1156  Fw::PassiveComponentBase* callComp,
1157  FwIndexType portNum,
1158  Fw::ComBuffer& data,
1159  U32 context
1160  );
1161 
1162  private:
1163 
1164  // ----------------------------------------------------------------------
1165  // Invocation functions for special output ports
1166  // ----------------------------------------------------------------------
1167 
1169  void CmdReg_out(
1170  FwIndexType portNum,
1171  FwOpcodeType opCode
1172  ) const;
1173 
1175  void CmdStatus_out(
1176  FwIndexType portNum,
1177  FwOpcodeType opCode,
1178  U32 cmdSeq,
1179  const Fw::CmdResponse& response
1180  ) const;
1181 
1183  void Log_out(
1184  FwIndexType portNum,
1185  FwEventIdType id,
1186  Fw::Time& timeTag,
1187  const Fw::LogSeverity& severity,
1188  Fw::LogBuffer& args
1189  ) const;
1190 
1191 #if FW_ENABLE_TEXT_LOGGING
1192 
1194  void LogText_out(
1195  FwIndexType portNum,
1196  FwEventIdType id,
1197  Fw::Time& timeTag,
1198  const Fw::LogSeverity& severity,
1199  Fw::TextLogString& text
1200  ) const;
1201 
1202 #endif
1203 
1205  void Time_out(
1206  FwIndexType portNum,
1207  Fw::Time& time
1208  ) const;
1209 
1211  void Tlm_out(
1212  FwIndexType portNum,
1213  FwChanIdType id,
1214  Fw::Time& timeTag,
1215  Fw::TlmBuffer& val
1216  ) const;
1217 
1218 #if !FW_DIRECT_PORT_CALLS
1219 
1220  private:
1221 
1222  // ----------------------------------------------------------------------
1223  // Special input ports
1224  // ----------------------------------------------------------------------
1225 
1227  Fw::InputCmdPort m_CmdDisp_InputPort[NUM_CMDDISP_INPUT_PORTS];
1228 
1229 #endif
1230 
1231 #if !FW_DIRECT_PORT_CALLS
1232 
1233  private:
1234 
1235  // ----------------------------------------------------------------------
1236  // Typed input ports
1237  // ----------------------------------------------------------------------
1238 
1240  Fw::InputCmdRegPort m_compCmdReg_InputPort[NUM_COMPCMDREG_INPUT_PORTS];
1241 
1243  Fw::InputCmdResponsePort m_compCmdStat_InputPort[NUM_COMPCMDSTAT_INPUT_PORTS];
1244 
1246  Svc::InputPingPort m_pingIn_InputPort[NUM_PINGIN_INPUT_PORTS];
1247 
1249  Svc::InputSchedPort m_run_InputPort[NUM_RUN_INPUT_PORTS];
1250 
1252  Fw::InputComPort m_seqCmdBuff_InputPort[NUM_SEQCMDBUFF_INPUT_PORTS];
1253 
1254 #endif
1255 
1256 #if !FW_DIRECT_PORT_CALLS
1257 
1258  private:
1259 
1260  // ----------------------------------------------------------------------
1261  // Special output ports
1262  // ----------------------------------------------------------------------
1263 
1265  Fw::OutputCmdRegPort m_CmdReg_OutputPort[NUM_CMDREG_OUTPUT_PORTS];
1266 
1268  Fw::OutputCmdResponsePort m_CmdStatus_OutputPort[NUM_CMDSTATUS_OUTPUT_PORTS];
1269 
1271  Fw::OutputLogPort m_Log_OutputPort[NUM_LOG_OUTPUT_PORTS];
1272 
1273 #if FW_ENABLE_TEXT_LOGGING == 1
1274 
1276  Fw::OutputLogTextPort m_LogText_OutputPort[NUM_LOGTEXT_OUTPUT_PORTS];
1277 
1278 #endif
1279 
1281  Fw::OutputTimePort m_Time_OutputPort[NUM_TIME_OUTPUT_PORTS];
1282 
1284  Fw::OutputTlmPort m_Tlm_OutputPort[NUM_TLM_OUTPUT_PORTS];
1285 
1286 #endif
1287 
1288 #if !FW_DIRECT_PORT_CALLS
1289 
1290  private:
1291 
1292  // ----------------------------------------------------------------------
1293  // Typed output ports
1294  // ----------------------------------------------------------------------
1295 
1297  Fw::OutputCmdPort m_compCmdSend_OutputPort[NUM_COMPCMDSEND_OUTPUT_PORTS];
1298 
1300  Svc::OutputPingPort m_pingOut_OutputPort[NUM_PINGOUT_OUTPUT_PORTS];
1301 
1303  Fw::OutputCmdResponsePort m_seqCmdStatus_OutputPort[NUM_SEQCMDSTATUS_OUTPUT_PORTS];
1304 
1305 #endif
1306 
1307  private:
1308 
1309  // ----------------------------------------------------------------------
1310  // Counter values for event throttling
1311  // ----------------------------------------------------------------------
1312 
1314  std::atomic<FwIndexType> m_CommandDroppedQueueOverflowThrottle;
1315 
1316  private:
1317 
1318  // ----------------------------------------------------------------------
1319  // First update flags for telemetry channels
1320  // ----------------------------------------------------------------------
1321 
1323  bool m_first_update_CommandsDispatched = true;
1324 
1326  bool m_first_update_CommandErrors = true;
1327 
1329  bool m_first_update_CommandsDropped = true;
1330 
1331  private:
1332 
1333  // ----------------------------------------------------------------------
1334  // Last value storage for telemetry channels
1335  // ----------------------------------------------------------------------
1336 
1338  U32 m_last_CommandsDispatched = {};
1339 
1341  U32 m_last_CommandErrors = {};
1342 
1344  U32 m_last_CommandsDropped = {};
1345 
1346  private:
1347 
1348  // ----------------------------------------------------------------------
1349  // Mutexes
1350  // ----------------------------------------------------------------------
1351 
1353  Os::Mutex m_guardedPortMutex;
1354 
1355  };
1356 
1357 }
1358 
1359 #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.
Exceeded the number of commands that can be simultaneously executed.
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()
This log event reports the Command Sequence Buffer port queue has overflowed.
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
The command dispatcher has successfully received a NO-OP command from GUI with a string.
static constexpr FwIndexType getNum_pingOut_OutputPorts()
void log_DIAGNOSTIC_OpCodeReregistered(FwOpcodeType Opcode, I32 port) const
static constexpr FwIndexType getNum_CmdStatus_OutputPorts()
The command dispatcher has successfully received a NO-OP command.
This log event message returns the TEST_CMD_1 arguments.
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:83
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:25
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:53
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
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.
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].
void set_CmdStatus_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to CmdStatus[portNum].
Clear command tracking info to recover from components not returning status.
void CMD_TEST_CMD_1_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)