F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
HealthComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title HealthComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for Health component base class
5 // ======================================================================
6 
7 #include "Fw/Types/Assert.hpp"
9 #if FW_ENABLE_TEXT_LOGGING
10 #include "Fw/Types/String.hpp"
11 #endif
13 
14 namespace Svc {
15 
16  namespace {
17  enum MsgTypeEnum {
18  HEALTH_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT,
19  PINGRETURN_PING,
20  CMD_HLTH_ENABLE,
21  CMD_HLTH_PING_ENABLE,
22  CMD_HLTH_CHNG_PING,
23  };
24 
25  // Get the max size by constructing a union of the async input, command, and
26  // internal port serialization sizes
27  union BuffUnion {
28  BYTE PingReturnPortSize[Svc::InputPingPort::SERIALIZED_SIZE];
30  };
31 
32  // Define a message buffer class large enough to handle all the
33  // asynchronous inputs to the component
34  class ComponentIpcSerializableBuffer :
36  {
37 
38  public:
39 
40  enum {
41  // Offset into data in buffer: Size of message ID and port number
42  DATA_OFFSET = sizeof(FwEnumStoreType) + sizeof(FwIndexType),
43  // Max data size
44  MAX_DATA_SIZE = sizeof(BuffUnion),
45  // Max message size: Size of message id + size of port + max data size
46  SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
47  };
48 
49  Fw::Serializable::SizeType getBuffCapacity() const {
50  return sizeof(m_buff);
51  }
52 
53  U8* getBuffAddr() {
54  return m_buff;
55  }
56 
57  const U8* getBuffAddr() const {
58  return m_buff;
59  }
60 
61  private:
62  // Should be the max of all the input ports serialized sizes...
63  U8 m_buff[SERIALIZATION_SIZE];
64 
65  };
66  }
67 
68  // ----------------------------------------------------------------------
69  // Component initialization
70  // ----------------------------------------------------------------------
71 
74  FwSizeType queueDepth,
75  FwEnumStoreType instance
76  )
77  {
78  // Initialize base class
80 
81  // Connect input port CmdDisp
82  for (
83  FwIndexType port = 0;
84  port < static_cast<FwIndexType>(this->getNum_CmdDisp_InputPorts());
85  port++
86  ) {
87  this->m_CmdDisp_InputPort[port].init();
88  this->m_CmdDisp_InputPort[port].addCallComp(
89  this,
90  m_p_CmdDisp_in
91  );
92  this->m_CmdDisp_InputPort[port].setPortNum(port);
93 
94 #if FW_OBJECT_NAMES == 1
95  Fw::ObjectName portName;
96  portName.format(
97  "%s_CmdDisp_InputPort[%" PRI_FwIndexType "]",
98  this->m_objName.toChar(),
99  port
100  );
101  this->m_CmdDisp_InputPort[port].setObjName(portName.toChar());
102 #endif
103  }
104 
105  // Connect input port PingReturn
106  for (
107  FwIndexType port = 0;
108  port < static_cast<FwIndexType>(this->getNum_PingReturn_InputPorts());
109  port++
110  ) {
111  this->m_PingReturn_InputPort[port].init();
112  this->m_PingReturn_InputPort[port].addCallComp(
113  this,
114  m_p_PingReturn_in
115  );
116  this->m_PingReturn_InputPort[port].setPortNum(port);
117 
118 #if FW_OBJECT_NAMES == 1
119  Fw::ObjectName portName;
120  portName.format(
121  "%s_PingReturn_InputPort[%" PRI_FwIndexType "]",
122  this->m_objName.toChar(),
123  port
124  );
125  this->m_PingReturn_InputPort[port].setObjName(portName.toChar());
126 #endif
127  }
128 
129  // Connect input port Run
130  for (
131  FwIndexType port = 0;
132  port < static_cast<FwIndexType>(this->getNum_Run_InputPorts());
133  port++
134  ) {
135  this->m_Run_InputPort[port].init();
136  this->m_Run_InputPort[port].addCallComp(
137  this,
138  m_p_Run_in
139  );
140  this->m_Run_InputPort[port].setPortNum(port);
141 
142 #if FW_OBJECT_NAMES == 1
143  Fw::ObjectName portName;
144  portName.format(
145  "%s_Run_InputPort[%" PRI_FwIndexType "]",
146  this->m_objName.toChar(),
147  port
148  );
149  this->m_Run_InputPort[port].setObjName(portName.toChar());
150 #endif
151  }
152 
153  // Connect output port CmdReg
154  for (
155  FwIndexType port = 0;
156  port < static_cast<FwIndexType>(this->getNum_CmdReg_OutputPorts());
157  port++
158  ) {
159  this->m_CmdReg_OutputPort[port].init();
160 
161 #if FW_OBJECT_NAMES == 1
162  Fw::ObjectName portName;
163  portName.format(
164  "%s_CmdReg_OutputPort[%" PRI_FwIndexType "]",
165  this->m_objName.toChar(),
166  port
167  );
168  this->m_CmdReg_OutputPort[port].setObjName(portName.toChar());
169 #endif
170  }
171 
172  // Connect output port CmdStatus
173  for (
174  FwIndexType port = 0;
175  port < static_cast<FwIndexType>(this->getNum_CmdStatus_OutputPorts());
176  port++
177  ) {
178  this->m_CmdStatus_OutputPort[port].init();
179 
180 #if FW_OBJECT_NAMES == 1
181  Fw::ObjectName portName;
182  portName.format(
183  "%s_CmdStatus_OutputPort[%" PRI_FwIndexType "]",
184  this->m_objName.toChar(),
185  port
186  );
187  this->m_CmdStatus_OutputPort[port].setObjName(portName.toChar());
188 #endif
189  }
190 
191  // Connect output port Log
192  for (
193  FwIndexType port = 0;
194  port < static_cast<FwIndexType>(this->getNum_Log_OutputPorts());
195  port++
196  ) {
197  this->m_Log_OutputPort[port].init();
198 
199 #if FW_OBJECT_NAMES == 1
200  Fw::ObjectName portName;
201  portName.format(
202  "%s_Log_OutputPort[%" PRI_FwIndexType "]",
203  this->m_objName.toChar(),
204  port
205  );
206  this->m_Log_OutputPort[port].setObjName(portName.toChar());
207 #endif
208  }
209 
210 #if FW_ENABLE_TEXT_LOGGING == 1
211  // Connect output port LogText
212  for (
213  FwIndexType port = 0;
214  port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
215  port++
216  ) {
217  this->m_LogText_OutputPort[port].init();
218 
219 #if FW_OBJECT_NAMES == 1
220  Fw::ObjectName portName;
221  portName.format(
222  "%s_LogText_OutputPort[%" PRI_FwIndexType "]",
223  this->m_objName.toChar(),
224  port
225  );
226  this->m_LogText_OutputPort[port].setObjName(portName.toChar());
227 #endif
228  }
229 #endif
230 
231  // Connect output port Time
232  for (
233  FwIndexType port = 0;
234  port < static_cast<FwIndexType>(this->getNum_Time_OutputPorts());
235  port++
236  ) {
237  this->m_Time_OutputPort[port].init();
238 
239 #if FW_OBJECT_NAMES == 1
240  Fw::ObjectName portName;
241  portName.format(
242  "%s_Time_OutputPort[%" PRI_FwIndexType "]",
243  this->m_objName.toChar(),
244  port
245  );
246  this->m_Time_OutputPort[port].setObjName(portName.toChar());
247 #endif
248  }
249 
250  // Connect output port Tlm
251  for (
252  FwIndexType port = 0;
253  port < static_cast<FwIndexType>(this->getNum_Tlm_OutputPorts());
254  port++
255  ) {
256  this->m_Tlm_OutputPort[port].init();
257 
258 #if FW_OBJECT_NAMES == 1
259  Fw::ObjectName portName;
260  portName.format(
261  "%s_Tlm_OutputPort[%" PRI_FwIndexType "]",
262  this->m_objName.toChar(),
263  port
264  );
265  this->m_Tlm_OutputPort[port].setObjName(portName.toChar());
266 #endif
267  }
268 
269  // Connect output port PingSend
270  for (
271  FwIndexType port = 0;
272  port < static_cast<FwIndexType>(this->getNum_PingSend_OutputPorts());
273  port++
274  ) {
275  this->m_PingSend_OutputPort[port].init();
276 
277 #if FW_OBJECT_NAMES == 1
278  Fw::ObjectName portName;
279  portName.format(
280  "%s_PingSend_OutputPort[%" PRI_FwIndexType "]",
281  this->m_objName.toChar(),
282  port
283  );
284  this->m_PingSend_OutputPort[port].setObjName(portName.toChar());
285 #endif
286  }
287 
288  // Connect output port WdogStroke
289  for (
290  FwIndexType port = 0;
291  port < static_cast<FwIndexType>(this->getNum_WdogStroke_OutputPorts());
292  port++
293  ) {
294  this->m_WdogStroke_OutputPort[port].init();
295 
296 #if FW_OBJECT_NAMES == 1
297  Fw::ObjectName portName;
298  portName.format(
299  "%s_WdogStroke_OutputPort[%" PRI_FwIndexType "]",
300  this->m_objName.toChar(),
301  port
302  );
303  this->m_WdogStroke_OutputPort[port].setObjName(portName.toChar());
304 #endif
305  }
306 
307  // Create the queue
308  Os::Queue::Status qStat = this->createQueue(
309  queueDepth,
310  static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
311  );
312  FW_ASSERT(
313  Os::Queue::Status::OP_OK == qStat,
314  static_cast<FwAssertArgType>(qStat)
315  );
316  }
317 
318  // ----------------------------------------------------------------------
319  // Getters for special input ports
320  // ----------------------------------------------------------------------
321 
324  {
325  FW_ASSERT(
326  (0 <= portNum) && (portNum < this->getNum_CmdDisp_InputPorts()),
327  static_cast<FwAssertArgType>(portNum)
328  );
329 
330  return &this->m_CmdDisp_InputPort[portNum];
331  }
332 
333  // ----------------------------------------------------------------------
334  // Getters for typed input ports
335  // ----------------------------------------------------------------------
336 
339  {
340  FW_ASSERT(
341  (0 <= portNum) && (portNum < this->getNum_PingReturn_InputPorts()),
342  static_cast<FwAssertArgType>(portNum)
343  );
344 
345  return &this->m_PingReturn_InputPort[portNum];
346  }
347 
350  {
351  FW_ASSERT(
352  (0 <= portNum) && (portNum < this->getNum_Run_InputPorts()),
353  static_cast<FwAssertArgType>(portNum)
354  );
355 
356  return &this->m_Run_InputPort[portNum];
357  }
358 
359  // ----------------------------------------------------------------------
360  // Connect input ports to special output ports
361  // ----------------------------------------------------------------------
362 
365  FwIndexType portNum,
366  Fw::InputCmdRegPort* port
367  )
368  {
369  FW_ASSERT(
370  (0 <= portNum) && (portNum < this->getNum_CmdReg_OutputPorts()),
371  static_cast<FwAssertArgType>(portNum)
372  );
373 
374  this->m_CmdReg_OutputPort[portNum].addCallPort(port);
375  }
376 
379  FwIndexType portNum,
381  )
382  {
383  FW_ASSERT(
384  (0 <= portNum) && (portNum < this->getNum_CmdStatus_OutputPorts()),
385  static_cast<FwAssertArgType>(portNum)
386  );
387 
388  this->m_CmdStatus_OutputPort[portNum].addCallPort(port);
389  }
390 
393  FwIndexType portNum,
394  Fw::InputLogPort* port
395  )
396  {
397  FW_ASSERT(
398  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
399  static_cast<FwAssertArgType>(portNum)
400  );
401 
402  this->m_Log_OutputPort[portNum].addCallPort(port);
403  }
404 
405 #if FW_ENABLE_TEXT_LOGGING == 1
406 
407  void HealthComponentBase ::
408  set_LogText_OutputPort(
409  FwIndexType portNum,
411  )
412  {
413  FW_ASSERT(
414  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
415  static_cast<FwAssertArgType>(portNum)
416  );
417 
418  this->m_LogText_OutputPort[portNum].addCallPort(port);
419  }
420 
421 #endif
422 
425  FwIndexType portNum,
426  Fw::InputTimePort* port
427  )
428  {
429  FW_ASSERT(
430  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
431  static_cast<FwAssertArgType>(portNum)
432  );
433 
434  this->m_Time_OutputPort[portNum].addCallPort(port);
435  }
436 
439  FwIndexType portNum,
440  Fw::InputTlmPort* port
441  )
442  {
443  FW_ASSERT(
444  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
445  static_cast<FwAssertArgType>(portNum)
446  );
447 
448  this->m_Tlm_OutputPort[portNum].addCallPort(port);
449  }
450 
451  // ----------------------------------------------------------------------
452  // Connect typed input ports to typed output ports
453  // ----------------------------------------------------------------------
454 
457  FwIndexType portNum,
458  Svc::InputPingPort* port
459  )
460  {
461  FW_ASSERT(
462  (0 <= portNum) && (portNum < this->getNum_PingSend_OutputPorts()),
463  static_cast<FwAssertArgType>(portNum)
464  );
465 
466  this->m_PingSend_OutputPort[portNum].addCallPort(port);
467  }
468 
471  FwIndexType portNum,
473  )
474  {
475  FW_ASSERT(
476  (0 <= portNum) && (portNum < this->getNum_WdogStroke_OutputPorts()),
477  static_cast<FwAssertArgType>(portNum)
478  );
479 
480  this->m_WdogStroke_OutputPort[portNum].addCallPort(port);
481  }
482 
483 #if FW_PORT_SERIALIZATION
484 
485  // ----------------------------------------------------------------------
486  // Connect serial input ports to special output ports
487  // ----------------------------------------------------------------------
488 
491  FwIndexType portNum,
492  Fw::InputSerializePort* port
493  )
494  {
495  FW_ASSERT(
496  (0 <= portNum) && (portNum < this->getNum_CmdReg_OutputPorts()),
497  static_cast<FwAssertArgType>(portNum)
498  );
499 
500  this->m_CmdReg_OutputPort[portNum].registerSerialPort(port);
501  }
502 
505  FwIndexType portNum,
506  Fw::InputSerializePort* port
507  )
508  {
509  FW_ASSERT(
510  (0 <= portNum) && (portNum < this->getNum_CmdStatus_OutputPorts()),
511  static_cast<FwAssertArgType>(portNum)
512  );
513 
514  this->m_CmdStatus_OutputPort[portNum].registerSerialPort(port);
515  }
516 
519  FwIndexType portNum,
520  Fw::InputSerializePort* port
521  )
522  {
523  FW_ASSERT(
524  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
525  static_cast<FwAssertArgType>(portNum)
526  );
527 
528  this->m_Log_OutputPort[portNum].registerSerialPort(port);
529  }
530 
531 #if FW_ENABLE_TEXT_LOGGING == 1
532 
533  void HealthComponentBase ::
534  set_LogText_OutputPort(
535  FwIndexType portNum,
536  Fw::InputSerializePort* port
537  )
538  {
539  FW_ASSERT(
540  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
541  static_cast<FwAssertArgType>(portNum)
542  );
543 
544  this->m_LogText_OutputPort[portNum].registerSerialPort(port);
545  }
546 
547 #endif
548 
551  FwIndexType portNum,
552  Fw::InputSerializePort* port
553  )
554  {
555  FW_ASSERT(
556  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
557  static_cast<FwAssertArgType>(portNum)
558  );
559 
560  this->m_Time_OutputPort[portNum].registerSerialPort(port);
561  }
562 
565  FwIndexType portNum,
566  Fw::InputSerializePort* port
567  )
568  {
569  FW_ASSERT(
570  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
571  static_cast<FwAssertArgType>(portNum)
572  );
573 
574  this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
575  }
576 
577 #endif
578 
579 #if FW_PORT_SERIALIZATION
580 
581  // ----------------------------------------------------------------------
582  // Connect serial input ports to typed output ports
583  // ----------------------------------------------------------------------
584 
587  FwIndexType portNum,
588  Fw::InputSerializePort* port
589  )
590  {
591  FW_ASSERT(
592  (0 <= portNum) && (portNum < this->getNum_PingSend_OutputPorts()),
593  static_cast<FwAssertArgType>(portNum)
594  );
595 
596  this->m_PingSend_OutputPort[portNum].registerSerialPort(port);
597  }
598 
601  FwIndexType portNum,
602  Fw::InputSerializePort* port
603  )
604  {
605  FW_ASSERT(
606  (0 <= portNum) && (portNum < this->getNum_WdogStroke_OutputPorts()),
607  static_cast<FwAssertArgType>(portNum)
608  );
609 
610  this->m_WdogStroke_OutputPort[portNum].registerSerialPort(port);
611  }
612 
613 #endif
614 
615  // ----------------------------------------------------------------------
616  // Command registration
617  // ----------------------------------------------------------------------
618 
621  {
622  FW_ASSERT(this->m_CmdReg_OutputPort[0].isConnected());
623 
624  this->m_CmdReg_OutputPort[0].invoke(
625  this->getIdBase() + OPCODE_HLTH_ENABLE
626  );
627 
628  this->m_CmdReg_OutputPort[0].invoke(
630  );
631 
632  this->m_CmdReg_OutputPort[0].invoke(
634  );
635  }
636 
637  // ----------------------------------------------------------------------
638  // Component construction and destruction
639  // ----------------------------------------------------------------------
640 
642  HealthComponentBase(const char* compName) :
643  Fw::QueuedComponentBase(compName)
644  {
645 
646  }
647 
650  {
651 
652  }
653 
654  // ----------------------------------------------------------------------
655  // Getters for numbers of special input ports
656  // ----------------------------------------------------------------------
657 
660  {
661  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_CmdDisp_InputPort));
662  }
663 
664  // ----------------------------------------------------------------------
665  // Getters for numbers of typed input ports
666  // ----------------------------------------------------------------------
667 
670  {
671  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_PingReturn_InputPort));
672  }
673 
676  {
677  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_Run_InputPort));
678  }
679 
680  // ----------------------------------------------------------------------
681  // Getters for numbers of special output ports
682  // ----------------------------------------------------------------------
683 
686  {
687  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_CmdReg_OutputPort));
688  }
689 
692  {
693  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_CmdStatus_OutputPort));
694  }
695 
698  {
699  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_Log_OutputPort));
700  }
701 
702 #if FW_ENABLE_TEXT_LOGGING == 1
703 
704  FwIndexType HealthComponentBase ::
705  getNum_LogText_OutputPorts() const
706  {
707  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_LogText_OutputPort));
708  }
709 
710 #endif
711 
714  {
715  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_Time_OutputPort));
716  }
717 
720  {
721  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_Tlm_OutputPort));
722  }
723 
724  // ----------------------------------------------------------------------
725  // Getters for numbers of typed output ports
726  // ----------------------------------------------------------------------
727 
730  {
731  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_PingSend_OutputPort));
732  }
733 
736  {
737  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_WdogStroke_OutputPort));
738  }
739 
740  // ----------------------------------------------------------------------
741  // Connection status queries for special output ports
742  // ----------------------------------------------------------------------
743 
746  {
747  FW_ASSERT(
748  (0 <= portNum) && (portNum < this->getNum_CmdReg_OutputPorts()),
749  static_cast<FwAssertArgType>(portNum)
750  );
751 
752  return this->m_CmdReg_OutputPort[portNum].isConnected();
753  }
754 
757  {
758  FW_ASSERT(
759  (0 <= portNum) && (portNum < this->getNum_CmdStatus_OutputPorts()),
760  static_cast<FwAssertArgType>(portNum)
761  );
762 
763  return this->m_CmdStatus_OutputPort[portNum].isConnected();
764  }
765 
768  {
769  FW_ASSERT(
770  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
771  static_cast<FwAssertArgType>(portNum)
772  );
773 
774  return this->m_Log_OutputPort[portNum].isConnected();
775  }
776 
777 #if FW_ENABLE_TEXT_LOGGING == 1
778 
779  bool HealthComponentBase ::
780  isConnected_LogText_OutputPort(FwIndexType portNum)
781  {
782  FW_ASSERT(
783  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
784  static_cast<FwAssertArgType>(portNum)
785  );
786 
787  return this->m_LogText_OutputPort[portNum].isConnected();
788  }
789 
790 #endif
791 
794  {
795  FW_ASSERT(
796  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
797  static_cast<FwAssertArgType>(portNum)
798  );
799 
800  return this->m_Time_OutputPort[portNum].isConnected();
801  }
802 
805  {
806  FW_ASSERT(
807  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
808  static_cast<FwAssertArgType>(portNum)
809  );
810 
811  return this->m_Tlm_OutputPort[portNum].isConnected();
812  }
813 
814  // ----------------------------------------------------------------------
815  // Connection status queries for typed output ports
816  // ----------------------------------------------------------------------
817 
820  {
821  FW_ASSERT(
822  (0 <= portNum) && (portNum < this->getNum_PingSend_OutputPorts()),
823  static_cast<FwAssertArgType>(portNum)
824  );
825 
826  return this->m_PingSend_OutputPort[portNum].isConnected();
827  }
828 
831  {
832  FW_ASSERT(
833  (0 <= portNum) && (portNum < this->getNum_WdogStroke_OutputPorts()),
834  static_cast<FwAssertArgType>(portNum)
835  );
836 
837  return this->m_WdogStroke_OutputPort[portNum].isConnected();
838  }
839 
840  // ----------------------------------------------------------------------
841  // Port handler base-class functions for typed input ports
842  //
843  // Call these functions directly to bypass the corresponding ports
844  // ----------------------------------------------------------------------
845 
848  FwIndexType portNum,
849  U32 key
850  )
851  {
852  // Make sure port number is valid
853  FW_ASSERT(
854  (0 <= portNum) && (portNum < this->getNum_PingReturn_InputPorts()),
855  static_cast<FwAssertArgType>(portNum)
856  );
857 
858  // Call pre-message hook
860  portNum,
861  key
862  );
863  ComponentIpcSerializableBuffer msg;
865 
866  // Serialize message ID
867  _status = msg.serialize(
868  static_cast<FwEnumStoreType>(PINGRETURN_PING)
869  );
870  FW_ASSERT(
871  _status == Fw::FW_SERIALIZE_OK,
872  static_cast<FwAssertArgType>(_status)
873  );
874 
875  // Serialize port number
876  _status = msg.serialize(portNum);
877  FW_ASSERT(
878  _status == Fw::FW_SERIALIZE_OK,
879  static_cast<FwAssertArgType>(_status)
880  );
881 
882  // Serialize argument key
883  _status = msg.serialize(key);
884  FW_ASSERT(
885  _status == Fw::FW_SERIALIZE_OK,
886  static_cast<FwAssertArgType>(_status)
887  );
888 
889  // Send message
891  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
892 
893  FW_ASSERT(
894  qStatus == Os::Queue::OP_OK,
895  static_cast<FwAssertArgType>(qStatus)
896  );
897  }
898 
901  FwIndexType portNum,
902  U32 context
903  )
904  {
905  // Make sure port number is valid
906  FW_ASSERT(
907  (0 <= portNum) && (portNum < this->getNum_Run_InputPorts()),
908  static_cast<FwAssertArgType>(portNum)
909  );
910 
911  // Call handler function
912  this->Run_handler(
913  portNum,
914  context
915  );
916  }
917 
918  // ----------------------------------------------------------------------
919  // Pre-message hooks for typed async input ports
920  //
921  // Each of these functions is invoked just before processing a message
922  // on the corresponding port. By default, they do nothing. You can
923  // override them to provide specific pre-message behavior.
924  // ----------------------------------------------------------------------
925 
928  FwIndexType portNum,
929  U32 key
930  )
931  {
932  // Default: no-op
933  }
934 
935  // ----------------------------------------------------------------------
936  // Invocation functions for typed output ports
937  // ----------------------------------------------------------------------
938 
941  FwIndexType portNum,
942  U32 key
943  )
944  {
945  FW_ASSERT(
946  (0 <= portNum) && (portNum < this->getNum_PingSend_OutputPorts()),
947  static_cast<FwAssertArgType>(portNum)
948  );
949 
950  FW_ASSERT(
951  this->m_PingSend_OutputPort[portNum].isConnected(),
952  static_cast<FwAssertArgType>(portNum)
953  );
954  this->m_PingSend_OutputPort[portNum].invoke(
955  key
956  );
957  }
958 
961  FwIndexType portNum,
962  U32 code
963  )
964  {
965  FW_ASSERT(
966  (0 <= portNum) && (portNum < this->getNum_WdogStroke_OutputPorts()),
967  static_cast<FwAssertArgType>(portNum)
968  );
969 
970  FW_ASSERT(
971  this->m_WdogStroke_OutputPort[portNum].isConnected(),
972  static_cast<FwAssertArgType>(portNum)
973  );
974  this->m_WdogStroke_OutputPort[portNum].invoke(
975  code
976  );
977  }
978 
979  // ----------------------------------------------------------------------
980  // Command response
981  // ----------------------------------------------------------------------
982 
985  FwOpcodeType opCode,
986  U32 cmdSeq,
987  Fw::CmdResponse response
988  )
989  {
990  FW_ASSERT(this->m_CmdStatus_OutputPort[0].isConnected());
991  this->m_CmdStatus_OutputPort[0].invoke(opCode, cmdSeq, response);
992  }
993 
994  // ----------------------------------------------------------------------
995  // Command handler base-class functions
996  //
997  // Call these functions directly to bypass the command input port
998  // ----------------------------------------------------------------------
999 
1002  FwOpcodeType opCode,
1003  U32 cmdSeq,
1004  Fw::CmdArgBuffer& args
1005  )
1006  {
1007  // Call pre-message hook
1008  this->HLTH_ENABLE_preMsgHook(opCode,cmdSeq);
1009 
1010  // Defer deserializing arguments to the message dispatcher
1011  // to avoid deserializing and reserializing just for IPC
1012  ComponentIpcSerializableBuffer msg;
1014 
1015  // Serialize for IPC
1016  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_HLTH_ENABLE));
1017  FW_ASSERT (
1018  _status == Fw::FW_SERIALIZE_OK,
1019  static_cast<FwAssertArgType>(_status)
1020  );
1021 
1022  // Fake port number to make message dequeue work
1023  FwIndexType port = 0;
1024 
1025  _status = msg.serialize(port);
1026  FW_ASSERT (
1027  _status == Fw::FW_SERIALIZE_OK,
1028  static_cast<FwAssertArgType>(_status)
1029  );
1030 
1031  _status = msg.serialize(opCode);
1032  FW_ASSERT (
1033  _status == Fw::FW_SERIALIZE_OK,
1034  static_cast<FwAssertArgType>(_status)
1035  );
1036 
1037  _status = msg.serialize(cmdSeq);
1038  FW_ASSERT (
1039  _status == Fw::FW_SERIALIZE_OK,
1040  static_cast<FwAssertArgType>(_status)
1041  );
1042 
1043  _status = msg.serialize(args);
1044  FW_ASSERT (
1045  _status == Fw::FW_SERIALIZE_OK,
1046  static_cast<FwAssertArgType>(_status)
1047  );
1048 
1049  // Send message
1051  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1052 
1053  FW_ASSERT(
1054  qStatus == Os::Queue::OP_OK,
1055  static_cast<FwAssertArgType>(qStatus)
1056  );
1057  }
1058 
1061  FwOpcodeType opCode,
1062  U32 cmdSeq,
1063  Fw::CmdArgBuffer& args
1064  )
1065  {
1066  // Call pre-message hook
1067  this->HLTH_PING_ENABLE_preMsgHook(opCode,cmdSeq);
1068 
1069  // Defer deserializing arguments to the message dispatcher
1070  // to avoid deserializing and reserializing just for IPC
1071  ComponentIpcSerializableBuffer msg;
1073 
1074  // Serialize for IPC
1075  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_HLTH_PING_ENABLE));
1076  FW_ASSERT (
1077  _status == Fw::FW_SERIALIZE_OK,
1078  static_cast<FwAssertArgType>(_status)
1079  );
1080 
1081  // Fake port number to make message dequeue work
1082  FwIndexType port = 0;
1083 
1084  _status = msg.serialize(port);
1085  FW_ASSERT (
1086  _status == Fw::FW_SERIALIZE_OK,
1087  static_cast<FwAssertArgType>(_status)
1088  );
1089 
1090  _status = msg.serialize(opCode);
1091  FW_ASSERT (
1092  _status == Fw::FW_SERIALIZE_OK,
1093  static_cast<FwAssertArgType>(_status)
1094  );
1095 
1096  _status = msg.serialize(cmdSeq);
1097  FW_ASSERT (
1098  _status == Fw::FW_SERIALIZE_OK,
1099  static_cast<FwAssertArgType>(_status)
1100  );
1101 
1102  _status = msg.serialize(args);
1103  FW_ASSERT (
1104  _status == Fw::FW_SERIALIZE_OK,
1105  static_cast<FwAssertArgType>(_status)
1106  );
1107 
1108  // Send message
1110  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1111 
1112  FW_ASSERT(
1113  qStatus == Os::Queue::OP_OK,
1114  static_cast<FwAssertArgType>(qStatus)
1115  );
1116  }
1117 
1120  FwOpcodeType opCode,
1121  U32 cmdSeq,
1122  Fw::CmdArgBuffer& args
1123  )
1124  {
1125  // Call pre-message hook
1126  this->HLTH_CHNG_PING_preMsgHook(opCode,cmdSeq);
1127 
1128  // Defer deserializing arguments to the message dispatcher
1129  // to avoid deserializing and reserializing just for IPC
1130  ComponentIpcSerializableBuffer msg;
1132 
1133  // Serialize for IPC
1134  _status = msg.serialize(static_cast<FwEnumStoreType>(CMD_HLTH_CHNG_PING));
1135  FW_ASSERT (
1136  _status == Fw::FW_SERIALIZE_OK,
1137  static_cast<FwAssertArgType>(_status)
1138  );
1139 
1140  // Fake port number to make message dequeue work
1141  FwIndexType port = 0;
1142 
1143  _status = msg.serialize(port);
1144  FW_ASSERT (
1145  _status == Fw::FW_SERIALIZE_OK,
1146  static_cast<FwAssertArgType>(_status)
1147  );
1148 
1149  _status = msg.serialize(opCode);
1150  FW_ASSERT (
1151  _status == Fw::FW_SERIALIZE_OK,
1152  static_cast<FwAssertArgType>(_status)
1153  );
1154 
1155  _status = msg.serialize(cmdSeq);
1156  FW_ASSERT (
1157  _status == Fw::FW_SERIALIZE_OK,
1158  static_cast<FwAssertArgType>(_status)
1159  );
1160 
1161  _status = msg.serialize(args);
1162  FW_ASSERT (
1163  _status == Fw::FW_SERIALIZE_OK,
1164  static_cast<FwAssertArgType>(_status)
1165  );
1166 
1167  // Send message
1169  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1170 
1171  FW_ASSERT(
1172  qStatus == Os::Queue::OP_OK,
1173  static_cast<FwAssertArgType>(qStatus)
1174  );
1175  }
1176 
1177  // ----------------------------------------------------------------------
1178  // Pre-message hooks for async commands
1179  //
1180  // Each of these functions is invoked just before processing the
1181  // corresponding command. By default they do nothing. You can
1182  // override them to provide specific pre-command behavior.
1183  // ----------------------------------------------------------------------
1184 
1187  FwOpcodeType opCode,
1188  U32 cmdSeq
1189  )
1190  {
1191  // Defaults to no-op; can be overridden
1192  (void) opCode;
1193  (void) cmdSeq;
1194  }
1195 
1198  FwOpcodeType opCode,
1199  U32 cmdSeq
1200  )
1201  {
1202  // Defaults to no-op; can be overridden
1203  (void) opCode;
1204  (void) cmdSeq;
1205  }
1206 
1209  FwOpcodeType opCode,
1210  U32 cmdSeq
1211  )
1212  {
1213  // Defaults to no-op; can be overridden
1214  (void) opCode;
1215  (void) cmdSeq;
1216  }
1217 
1218  // ----------------------------------------------------------------------
1219  // Event logging functions
1220  // ----------------------------------------------------------------------
1221 
1224  {
1225  // Get the time
1226  Fw::Time _logTime;
1227  if (this->m_Time_OutputPort[0].isConnected()) {
1228  this->m_Time_OutputPort[0].invoke(_logTime);
1229  }
1230 
1231  FwEventIdType _id = static_cast<FwEventIdType>(0);
1232 
1233  _id = this->getIdBase() + EVENTID_HLTH_PING_WARN;
1234 
1235  // Emit the event on the log port
1236  if (this->m_Log_OutputPort[0].isConnected()) {
1237  Fw::LogBuffer _logBuff;
1239 
1240 #if FW_AMPCS_COMPATIBLE
1241  // Serialize the number of arguments
1242  _status = _logBuff.serialize(static_cast<U8>(1));
1243  FW_ASSERT(
1244  _status == Fw::FW_SERIALIZE_OK,
1245  static_cast<FwAssertArgType>(_status)
1246  );
1247 #endif
1248 
1249  _status = entry.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1250  FW_ASSERT(
1251  _status == Fw::FW_SERIALIZE_OK,
1252  static_cast<FwAssertArgType>(_status)
1253  );
1254 
1255  this->m_Log_OutputPort[0].invoke(
1256  _id,
1257  _logTime,
1259  _logBuff
1260  );
1261  }
1262 
1263  // Emit the event on the text log port
1264 #if FW_ENABLE_TEXT_LOGGING
1265  if (this->m_LogText_OutputPort[0].isConnected()) {
1266 #if FW_OBJECT_NAMES == 1
1267  const char* _formatString =
1268  "(%s) %s: Ping entry %s late warning";
1269 #else
1270  const char* _formatString =
1271  "%s: Ping entry %s late warning";
1272 #endif
1273 
1274  Fw::TextLogString _logString;
1275  _logString.format(
1276  _formatString,
1277 #if FW_OBJECT_NAMES == 1
1278  this->m_objName.toChar(),
1279 #endif
1280  "HLTH_PING_WARN ",
1281  entry.toChar()
1282  );
1283 
1284  this->m_LogText_OutputPort[0].invoke(
1285  _id,
1286  _logTime,
1288  _logString
1289  );
1290  }
1291 #endif
1292  }
1293 
1296  {
1297  // Get the time
1298  Fw::Time _logTime;
1299  if (this->m_Time_OutputPort[0].isConnected()) {
1300  this->m_Time_OutputPort[0].invoke(_logTime);
1301  }
1302 
1303  FwEventIdType _id = static_cast<FwEventIdType>(0);
1304 
1305  _id = this->getIdBase() + EVENTID_HLTH_PING_LATE;
1306 
1307  // Emit the event on the log port
1308  if (this->m_Log_OutputPort[0].isConnected()) {
1309  Fw::LogBuffer _logBuff;
1311 
1312 #if FW_AMPCS_COMPATIBLE
1313  // Serialize the number of arguments
1314  _status = _logBuff.serialize(static_cast<U8>(1 + 1));
1315  FW_ASSERT(
1316  _status == Fw::FW_SERIALIZE_OK,
1317  static_cast<FwAssertArgType>(_status)
1318  );
1319 
1320  // For FATAL, add stack size of 4 and a dummy entry. No support for stacks yet.
1321  _status = _logBuff.serialize(static_cast<U8>(4));
1322  FW_ASSERT(
1323  _status == Fw::FW_SERIALIZE_OK,
1324  static_cast<FwAssertArgType>(_status)
1325  );
1326 
1327  _status = _logBuff.serialize(static_cast<U32>(0));
1328  FW_ASSERT(
1329  _status == Fw::FW_SERIALIZE_OK,
1330  static_cast<FwAssertArgType>(_status)
1331  );
1332 #endif
1333 
1334  _status = entry.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1335  FW_ASSERT(
1336  _status == Fw::FW_SERIALIZE_OK,
1337  static_cast<FwAssertArgType>(_status)
1338  );
1339 
1340  this->m_Log_OutputPort[0].invoke(
1341  _id,
1342  _logTime,
1344  _logBuff
1345  );
1346  }
1347 
1348  // Emit the event on the text log port
1349 #if FW_ENABLE_TEXT_LOGGING
1350  if (this->m_LogText_OutputPort[0].isConnected()) {
1351 #if FW_OBJECT_NAMES == 1
1352  const char* _formatString =
1353  "(%s) %s: Ping entry %s did not respond";
1354 #else
1355  const char* _formatString =
1356  "%s: Ping entry %s did not respond";
1357 #endif
1358 
1359  Fw::TextLogString _logString;
1360  _logString.format(
1361  _formatString,
1362 #if FW_OBJECT_NAMES == 1
1363  this->m_objName.toChar(),
1364 #endif
1365  "HLTH_PING_LATE ",
1366  entry.toChar()
1367  );
1368 
1369  this->m_LogText_OutputPort[0].invoke(
1370  _id,
1371  _logTime,
1373  _logString
1374  );
1375  }
1376 #endif
1377  }
1378 
1381  const Fw::StringBase& entry,
1382  U32 badKey
1383  ) const
1384  {
1385  // Get the time
1386  Fw::Time _logTime;
1387  if (this->m_Time_OutputPort[0].isConnected()) {
1388  this->m_Time_OutputPort[0].invoke(_logTime);
1389  }
1390 
1391  FwEventIdType _id = static_cast<FwEventIdType>(0);
1392 
1393  _id = this->getIdBase() + EVENTID_HLTH_PING_WRONG_KEY;
1394 
1395  // Emit the event on the log port
1396  if (this->m_Log_OutputPort[0].isConnected()) {
1397  Fw::LogBuffer _logBuff;
1399 
1400 #if FW_AMPCS_COMPATIBLE
1401  // Serialize the number of arguments
1402  _status = _logBuff.serialize(static_cast<U8>(2 + 1));
1403  FW_ASSERT(
1404  _status == Fw::FW_SERIALIZE_OK,
1405  static_cast<FwAssertArgType>(_status)
1406  );
1407 
1408  // For FATAL, add stack size of 4 and a dummy entry. No support for stacks yet.
1409  _status = _logBuff.serialize(static_cast<U8>(4));
1410  FW_ASSERT(
1411  _status == Fw::FW_SERIALIZE_OK,
1412  static_cast<FwAssertArgType>(_status)
1413  );
1414 
1415  _status = _logBuff.serialize(static_cast<U32>(0));
1416  FW_ASSERT(
1417  _status == Fw::FW_SERIALIZE_OK,
1418  static_cast<FwAssertArgType>(_status)
1419  );
1420 #endif
1421 
1422  _status = entry.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1423  FW_ASSERT(
1424  _status == Fw::FW_SERIALIZE_OK,
1425  static_cast<FwAssertArgType>(_status)
1426  );
1427 
1428 #if FW_AMPCS_COMPATIBLE
1429  // Serialize the argument size
1430  _status = _logBuff.serialize(
1431  static_cast<U8>(sizeof(U32))
1432  );
1433  FW_ASSERT(
1434  _status == Fw::FW_SERIALIZE_OK,
1435  static_cast<FwAssertArgType>(_status)
1436  );
1437 #endif
1438  _status = _logBuff.serialize(badKey);
1439  FW_ASSERT(
1440  _status == Fw::FW_SERIALIZE_OK,
1441  static_cast<FwAssertArgType>(_status)
1442  );
1443 
1444  this->m_Log_OutputPort[0].invoke(
1445  _id,
1446  _logTime,
1448  _logBuff
1449  );
1450  }
1451 
1452  // Emit the event on the text log port
1453 #if FW_ENABLE_TEXT_LOGGING
1454  if (this->m_LogText_OutputPort[0].isConnected()) {
1455 #if FW_OBJECT_NAMES == 1
1456  const char* _formatString =
1457  "(%s) %s: Ping entry %s responded with wrong key 0x%" PRIx32 "";
1458 #else
1459  const char* _formatString =
1460  "%s: Ping entry %s responded with wrong key 0x%" PRIx32 "";
1461 #endif
1462 
1463  Fw::TextLogString _logString;
1464  _logString.format(
1465  _formatString,
1466 #if FW_OBJECT_NAMES == 1
1467  this->m_objName.toChar(),
1468 #endif
1469  "HLTH_PING_WRONG_KEY ",
1470  entry.toChar(),
1471  badKey
1472  );
1473 
1474  this->m_LogText_OutputPort[0].invoke(
1475  _id,
1476  _logTime,
1478  _logString
1479  );
1480  }
1481 #endif
1482  }
1483 
1486  {
1487  // Get the time
1488  Fw::Time _logTime;
1489  if (this->m_Time_OutputPort[0].isConnected()) {
1490  this->m_Time_OutputPort[0].invoke(_logTime);
1491  }
1492 
1493  FwEventIdType _id = static_cast<FwEventIdType>(0);
1494 
1495  _id = this->getIdBase() + EVENTID_HLTH_CHECK_ENABLE;
1496 
1497  // Emit the event on the log port
1498  if (this->m_Log_OutputPort[0].isConnected()) {
1499  Fw::LogBuffer _logBuff;
1501 
1502 #if FW_AMPCS_COMPATIBLE
1503  // Serialize the number of arguments
1504  _status = _logBuff.serialize(static_cast<U8>(1));
1505  FW_ASSERT(
1506  _status == Fw::FW_SERIALIZE_OK,
1507  static_cast<FwAssertArgType>(_status)
1508  );
1509 #endif
1510 
1511 #if FW_AMPCS_COMPATIBLE
1512  // Serialize the argument size
1513  _status = _logBuff.serialize(
1514  static_cast<U8>(Fw::Enabled::SERIALIZED_SIZE)
1515  );
1516  FW_ASSERT(
1517  _status == Fw::FW_SERIALIZE_OK,
1518  static_cast<FwAssertArgType>(_status)
1519  );
1520 #endif
1521  _status = _logBuff.serialize(enabled);
1522  FW_ASSERT(
1523  _status == Fw::FW_SERIALIZE_OK,
1524  static_cast<FwAssertArgType>(_status)
1525  );
1526 
1527  this->m_Log_OutputPort[0].invoke(
1528  _id,
1529  _logTime,
1531  _logBuff
1532  );
1533  }
1534 
1535  // Emit the event on the text log port
1536 #if FW_ENABLE_TEXT_LOGGING
1537  if (this->m_LogText_OutputPort[0].isConnected()) {
1538 #if FW_OBJECT_NAMES == 1
1539  const char* _formatString =
1540  "(%s) %s: Health checking set to %s";
1541 #else
1542  const char* _formatString =
1543  "%s: Health checking set to %s";
1544 #endif
1545 
1546  Fw::String enabledStr;
1547  enabled.toString(enabledStr);
1548 
1549  Fw::TextLogString _logString;
1550  _logString.format(
1551  _formatString,
1552 #if FW_OBJECT_NAMES == 1
1553  this->m_objName.toChar(),
1554 #endif
1555  "HLTH_CHECK_ENABLE ",
1556  enabledStr.toChar()
1557  );
1558 
1559  this->m_LogText_OutputPort[0].invoke(
1560  _id,
1561  _logTime,
1563  _logString
1564  );
1565  }
1566 #endif
1567  }
1568 
1571  Fw::Enabled enabled,
1572  const Fw::StringBase& entry
1573  ) const
1574  {
1575  // Get the time
1576  Fw::Time _logTime;
1577  if (this->m_Time_OutputPort[0].isConnected()) {
1578  this->m_Time_OutputPort[0].invoke(_logTime);
1579  }
1580 
1581  FwEventIdType _id = static_cast<FwEventIdType>(0);
1582 
1583  _id = this->getIdBase() + EVENTID_HLTH_CHECK_PING;
1584 
1585  // Emit the event on the log port
1586  if (this->m_Log_OutputPort[0].isConnected()) {
1587  Fw::LogBuffer _logBuff;
1589 
1590 #if FW_AMPCS_COMPATIBLE
1591  // Serialize the number of arguments
1592  _status = _logBuff.serialize(static_cast<U8>(2));
1593  FW_ASSERT(
1594  _status == Fw::FW_SERIALIZE_OK,
1595  static_cast<FwAssertArgType>(_status)
1596  );
1597 #endif
1598 
1599 #if FW_AMPCS_COMPATIBLE
1600  // Serialize the argument size
1601  _status = _logBuff.serialize(
1602  static_cast<U8>(Fw::Enabled::SERIALIZED_SIZE)
1603  );
1604  FW_ASSERT(
1605  _status == Fw::FW_SERIALIZE_OK,
1606  static_cast<FwAssertArgType>(_status)
1607  );
1608 #endif
1609  _status = _logBuff.serialize(enabled);
1610  FW_ASSERT(
1611  _status == Fw::FW_SERIALIZE_OK,
1612  static_cast<FwAssertArgType>(_status)
1613  );
1614 
1615  _status = entry.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1616  FW_ASSERT(
1617  _status == Fw::FW_SERIALIZE_OK,
1618  static_cast<FwAssertArgType>(_status)
1619  );
1620 
1621  this->m_Log_OutputPort[0].invoke(
1622  _id,
1623  _logTime,
1625  _logBuff
1626  );
1627  }
1628 
1629  // Emit the event on the text log port
1630 #if FW_ENABLE_TEXT_LOGGING
1631  if (this->m_LogText_OutputPort[0].isConnected()) {
1632 #if FW_OBJECT_NAMES == 1
1633  const char* _formatString =
1634  "(%s) %s: Health checking set to %s for %s";
1635 #else
1636  const char* _formatString =
1637  "%s: Health checking set to %s for %s";
1638 #endif
1639 
1640  Fw::String enabledStr;
1641  enabled.toString(enabledStr);
1642 
1643  Fw::TextLogString _logString;
1644  _logString.format(
1645  _formatString,
1646 #if FW_OBJECT_NAMES == 1
1647  this->m_objName.toChar(),
1648 #endif
1649  "HLTH_CHECK_PING ",
1650  enabledStr.toChar(),
1651  entry.toChar()
1652  );
1653 
1654  this->m_LogText_OutputPort[0].invoke(
1655  _id,
1656  _logTime,
1658  _logString
1659  );
1660  }
1661 #endif
1662  }
1663 
1666  {
1667  // Get the time
1668  Fw::Time _logTime;
1669  if (this->m_Time_OutputPort[0].isConnected()) {
1670  this->m_Time_OutputPort[0].invoke(_logTime);
1671  }
1672 
1673  FwEventIdType _id = static_cast<FwEventIdType>(0);
1674 
1676 
1677  // Emit the event on the log port
1678  if (this->m_Log_OutputPort[0].isConnected()) {
1679  Fw::LogBuffer _logBuff;
1681 
1682 #if FW_AMPCS_COMPATIBLE
1683  // Serialize the number of arguments
1684  _status = _logBuff.serialize(static_cast<U8>(1));
1685  FW_ASSERT(
1686  _status == Fw::FW_SERIALIZE_OK,
1687  static_cast<FwAssertArgType>(_status)
1688  );
1689 #endif
1690 
1691  _status = entry.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1692  FW_ASSERT(
1693  _status == Fw::FW_SERIALIZE_OK,
1694  static_cast<FwAssertArgType>(_status)
1695  );
1696 
1697  this->m_Log_OutputPort[0].invoke(
1698  _id,
1699  _logTime,
1701  _logBuff
1702  );
1703  }
1704 
1705  // Emit the event on the text log port
1706 #if FW_ENABLE_TEXT_LOGGING
1707  if (this->m_LogText_OutputPort[0].isConnected()) {
1708 #if FW_OBJECT_NAMES == 1
1709  const char* _formatString =
1710  "(%s) %s: Couldn't find entry %s";
1711 #else
1712  const char* _formatString =
1713  "%s: Couldn't find entry %s";
1714 #endif
1715 
1716  Fw::TextLogString _logString;
1717  _logString.format(
1718  _formatString,
1719 #if FW_OBJECT_NAMES == 1
1720  this->m_objName.toChar(),
1721 #endif
1722  "HLTH_CHECK_LOOKUP_ERROR ",
1723  entry.toChar()
1724  );
1725 
1726  this->m_LogText_OutputPort[0].invoke(
1727  _id,
1728  _logTime,
1730  _logString
1731  );
1732  }
1733 #endif
1734  }
1735 
1738  const Fw::StringBase& entry,
1739  U32 warn,
1740  U32 fatal
1741  ) const
1742  {
1743  // Get the time
1744  Fw::Time _logTime;
1745  if (this->m_Time_OutputPort[0].isConnected()) {
1746  this->m_Time_OutputPort[0].invoke(_logTime);
1747  }
1748 
1749  FwEventIdType _id = static_cast<FwEventIdType>(0);
1750 
1751  _id = this->getIdBase() + EVENTID_HLTH_PING_UPDATED;
1752 
1753  // Emit the event on the log port
1754  if (this->m_Log_OutputPort[0].isConnected()) {
1755  Fw::LogBuffer _logBuff;
1757 
1758 #if FW_AMPCS_COMPATIBLE
1759  // Serialize the number of arguments
1760  _status = _logBuff.serialize(static_cast<U8>(3));
1761  FW_ASSERT(
1762  _status == Fw::FW_SERIALIZE_OK,
1763  static_cast<FwAssertArgType>(_status)
1764  );
1765 #endif
1766 
1767  _status = entry.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1768  FW_ASSERT(
1769  _status == Fw::FW_SERIALIZE_OK,
1770  static_cast<FwAssertArgType>(_status)
1771  );
1772 
1773 #if FW_AMPCS_COMPATIBLE
1774  // Serialize the argument size
1775  _status = _logBuff.serialize(
1776  static_cast<U8>(sizeof(U32))
1777  );
1778  FW_ASSERT(
1779  _status == Fw::FW_SERIALIZE_OK,
1780  static_cast<FwAssertArgType>(_status)
1781  );
1782 #endif
1783  _status = _logBuff.serialize(warn);
1784  FW_ASSERT(
1785  _status == Fw::FW_SERIALIZE_OK,
1786  static_cast<FwAssertArgType>(_status)
1787  );
1788 
1789 #if FW_AMPCS_COMPATIBLE
1790  // Serialize the argument size
1791  _status = _logBuff.serialize(
1792  static_cast<U8>(sizeof(U32))
1793  );
1794  FW_ASSERT(
1795  _status == Fw::FW_SERIALIZE_OK,
1796  static_cast<FwAssertArgType>(_status)
1797  );
1798 #endif
1799  _status = _logBuff.serialize(fatal);
1800  FW_ASSERT(
1801  _status == Fw::FW_SERIALIZE_OK,
1802  static_cast<FwAssertArgType>(_status)
1803  );
1804 
1805  this->m_Log_OutputPort[0].invoke(
1806  _id,
1807  _logTime,
1809  _logBuff
1810  );
1811  }
1812 
1813  // Emit the event on the text log port
1814 #if FW_ENABLE_TEXT_LOGGING
1815  if (this->m_LogText_OutputPort[0].isConnected()) {
1816 #if FW_OBJECT_NAMES == 1
1817  const char* _formatString =
1818  "(%s) %s: Health ping for %s changed to WARN %" PRIu32 " FATAL %" PRIu32 "";
1819 #else
1820  const char* _formatString =
1821  "%s: Health ping for %s changed to WARN %" PRIu32 " FATAL %" PRIu32 "";
1822 #endif
1823 
1824  Fw::TextLogString _logString;
1825  _logString.format(
1826  _formatString,
1827 #if FW_OBJECT_NAMES == 1
1828  this->m_objName.toChar(),
1829 #endif
1830  "HLTH_PING_UPDATED ",
1831  entry.toChar(),
1832  warn,
1833  fatal
1834  );
1835 
1836  this->m_LogText_OutputPort[0].invoke(
1837  _id,
1838  _logTime,
1840  _logString
1841  );
1842  }
1843 #endif
1844  }
1845 
1848  const Fw::StringBase& entry,
1849  U32 warn,
1850  U32 fatal
1851  ) const
1852  {
1853  // Get the time
1854  Fw::Time _logTime;
1855  if (this->m_Time_OutputPort[0].isConnected()) {
1856  this->m_Time_OutputPort[0].invoke(_logTime);
1857  }
1858 
1859  FwEventIdType _id = static_cast<FwEventIdType>(0);
1860 
1862 
1863  // Emit the event on the log port
1864  if (this->m_Log_OutputPort[0].isConnected()) {
1865  Fw::LogBuffer _logBuff;
1867 
1868 #if FW_AMPCS_COMPATIBLE
1869  // Serialize the number of arguments
1870  _status = _logBuff.serialize(static_cast<U8>(3));
1871  FW_ASSERT(
1872  _status == Fw::FW_SERIALIZE_OK,
1873  static_cast<FwAssertArgType>(_status)
1874  );
1875 #endif
1876 
1877  _status = entry.serialize(_logBuff, FW_MIN(FW_LOG_STRING_MAX_SIZE, 40));
1878  FW_ASSERT(
1879  _status == Fw::FW_SERIALIZE_OK,
1880  static_cast<FwAssertArgType>(_status)
1881  );
1882 
1883 #if FW_AMPCS_COMPATIBLE
1884  // Serialize the argument size
1885  _status = _logBuff.serialize(
1886  static_cast<U8>(sizeof(U32))
1887  );
1888  FW_ASSERT(
1889  _status == Fw::FW_SERIALIZE_OK,
1890  static_cast<FwAssertArgType>(_status)
1891  );
1892 #endif
1893  _status = _logBuff.serialize(warn);
1894  FW_ASSERT(
1895  _status == Fw::FW_SERIALIZE_OK,
1896  static_cast<FwAssertArgType>(_status)
1897  );
1898 
1899 #if FW_AMPCS_COMPATIBLE
1900  // Serialize the argument size
1901  _status = _logBuff.serialize(
1902  static_cast<U8>(sizeof(U32))
1903  );
1904  FW_ASSERT(
1905  _status == Fw::FW_SERIALIZE_OK,
1906  static_cast<FwAssertArgType>(_status)
1907  );
1908 #endif
1909  _status = _logBuff.serialize(fatal);
1910  FW_ASSERT(
1911  _status == Fw::FW_SERIALIZE_OK,
1912  static_cast<FwAssertArgType>(_status)
1913  );
1914 
1915  this->m_Log_OutputPort[0].invoke(
1916  _id,
1917  _logTime,
1919  _logBuff
1920  );
1921  }
1922 
1923  // Emit the event on the text log port
1924 #if FW_ENABLE_TEXT_LOGGING
1925  if (this->m_LogText_OutputPort[0].isConnected()) {
1926 #if FW_OBJECT_NAMES == 1
1927  const char* _formatString =
1928  "(%s) %s: Health ping for %s invalid values: WARN %" PRIu32 " FATAL %" PRIu32 "";
1929 #else
1930  const char* _formatString =
1931  "%s: Health ping for %s invalid values: WARN %" PRIu32 " FATAL %" PRIu32 "";
1932 #endif
1933 
1934  Fw::TextLogString _logString;
1935  _logString.format(
1936  _formatString,
1937 #if FW_OBJECT_NAMES == 1
1938  this->m_objName.toChar(),
1939 #endif
1940  "HLTH_PING_INVALID_VALUES ",
1941  entry.toChar(),
1942  warn,
1943  fatal
1944  );
1945 
1946  this->m_LogText_OutputPort[0].invoke(
1947  _id,
1948  _logTime,
1950  _logString
1951  );
1952  }
1953 #endif
1954  }
1955 
1956  // ----------------------------------------------------------------------
1957  // Telemetry write functions
1958  // ----------------------------------------------------------------------
1959 
1962  U32 arg,
1963  Fw::Time _tlmTime
1964  ) const
1965  {
1966  if (this->m_Tlm_OutputPort[0].isConnected()) {
1967  if (
1968  this->m_Time_OutputPort[0].isConnected() &&
1969  (_tlmTime == Fw::ZERO_TIME)
1970  ) {
1971  this->m_Time_OutputPort[0].invoke(_tlmTime);
1972  }
1973 
1974  Fw::TlmBuffer _tlmBuff;
1975  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1976  FW_ASSERT(
1977  _stat == Fw::FW_SERIALIZE_OK,
1978  static_cast<FwAssertArgType>(_stat)
1979  );
1980 
1981  FwChanIdType _id;
1982 
1983  _id = this->getIdBase() + CHANNELID_PINGLATEWARNINGS;
1984 
1985  this->m_Tlm_OutputPort[0].invoke(
1986  _id,
1987  _tlmTime,
1988  _tlmBuff
1989  );
1990  }
1991  }
1992 
1993  // ----------------------------------------------------------------------
1994  // Time
1995  // ----------------------------------------------------------------------
1996 
1998  getTime() const
1999  {
2000  if (this->m_Time_OutputPort[0].isConnected()) {
2001  Fw::Time _time;
2002  this->m_Time_OutputPort[0].invoke(_time);
2003  return _time;
2004  }
2005  else {
2006  return Fw::Time(TB_NONE, 0, 0);
2007  }
2008  }
2009 
2010  // ----------------------------------------------------------------------
2011  // Message dispatch functions
2012  // ----------------------------------------------------------------------
2013 
2016  {
2017  ComponentIpcSerializableBuffer _msg;
2018  FwQueuePriorityType _priority = 0;
2019 
2020  Os::Queue::Status _msgStatus = this->m_queue.receive(
2021  _msg,
2023  _priority
2024  );
2025  if (Os::Queue::Status::EMPTY == _msgStatus) {
2027  }
2028  else {
2029  FW_ASSERT(
2030  _msgStatus == Os::Queue::OP_OK,
2031  static_cast<FwAssertArgType>(_msgStatus)
2032  );
2033  }
2034 
2035  // Reset to beginning of buffer
2036  _msg.resetDeser();
2037 
2038  FwEnumStoreType _desMsg = 0;
2039  Fw::SerializeStatus _deserStatus = _msg.deserialize(_desMsg);
2040  FW_ASSERT(
2041  _deserStatus == Fw::FW_SERIALIZE_OK,
2042  static_cast<FwAssertArgType>(_deserStatus)
2043  );
2044 
2045  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
2046 
2047  if (_msgType == HEALTH_COMPONENT_EXIT) {
2048  return MSG_DISPATCH_EXIT;
2049  }
2050 
2051  FwIndexType portNum = 0;
2052  _deserStatus = _msg.deserialize(portNum);
2053  FW_ASSERT(
2054  _deserStatus == Fw::FW_SERIALIZE_OK,
2055  static_cast<FwAssertArgType>(_deserStatus)
2056  );
2057 
2058  switch (_msgType) {
2059  // Handle async input port PingReturn
2060  case PINGRETURN_PING: {
2061  // Deserialize argument key
2062  U32 key;
2063  _deserStatus = _msg.deserialize(key);
2064  FW_ASSERT(
2065  _deserStatus == Fw::FW_SERIALIZE_OK,
2066  static_cast<FwAssertArgType>(_deserStatus)
2067  );
2068  // Call handler function
2069  this->PingReturn_handler(
2070  portNum,
2071  key
2072  );
2073 
2074  break;
2075  }
2076 
2077  // Handle command HLTH_ENABLE
2078  case CMD_HLTH_ENABLE: {
2079  // Deserialize opcode
2080  FwOpcodeType _opCode = 0;
2081  _deserStatus = _msg.deserialize(_opCode);
2082  FW_ASSERT (
2083  _deserStatus == Fw::FW_SERIALIZE_OK,
2084  static_cast<FwAssertArgType>(_deserStatus)
2085  );
2086 
2087  // Deserialize command sequence
2088  U32 _cmdSeq = 0;
2089  _deserStatus = _msg.deserialize(_cmdSeq);
2090  FW_ASSERT (
2091  _deserStatus == Fw::FW_SERIALIZE_OK,
2092  static_cast<FwAssertArgType>(_deserStatus)
2093  );
2094 
2095  // Deserialize command argument buffer
2096  Fw::CmdArgBuffer args;
2097  _deserStatus = _msg.deserialize(args);
2098  FW_ASSERT (
2099  _deserStatus == Fw::FW_SERIALIZE_OK,
2100  static_cast<FwAssertArgType>(_deserStatus)
2101  );
2102 
2103  // Reset buffer
2104  args.resetDeser();
2105 
2106  // Deserialize argument enable
2107  Fw::Enabled enable;
2108  _deserStatus = args.deserialize(enable);
2109  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2110  if (this->m_CmdStatus_OutputPort[0].isConnected()) {
2111  this->cmdResponse_out(
2112  _opCode,
2113  _cmdSeq,
2115  );
2116  }
2117  // Don't crash the task if bad arguments were passed from the ground
2118  break;
2119  }
2120 
2121  // Make sure there was no data left over.
2122  // That means the argument buffer size was incorrect.
2123 #if FW_CMD_CHECK_RESIDUAL
2124  if (args.getBuffLeft() != 0) {
2125  if (this->m_CmdStatus_OutputPort[0].isConnected()) {
2126  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2127  }
2128  // Don't crash the task if bad arguments were passed from the ground
2129  break;
2130  }
2131 #endif
2132 
2133  // Call handler function
2134  this->HLTH_ENABLE_cmdHandler(
2135  _opCode, _cmdSeq,
2136  enable
2137  );
2138 
2139  break;
2140  }
2141 
2142  // Handle command HLTH_PING_ENABLE
2143  case CMD_HLTH_PING_ENABLE: {
2144  // Deserialize opcode
2145  FwOpcodeType _opCode = 0;
2146  _deserStatus = _msg.deserialize(_opCode);
2147  FW_ASSERT (
2148  _deserStatus == Fw::FW_SERIALIZE_OK,
2149  static_cast<FwAssertArgType>(_deserStatus)
2150  );
2151 
2152  // Deserialize command sequence
2153  U32 _cmdSeq = 0;
2154  _deserStatus = _msg.deserialize(_cmdSeq);
2155  FW_ASSERT (
2156  _deserStatus == Fw::FW_SERIALIZE_OK,
2157  static_cast<FwAssertArgType>(_deserStatus)
2158  );
2159 
2160  // Deserialize command argument buffer
2161  Fw::CmdArgBuffer args;
2162  _deserStatus = _msg.deserialize(args);
2163  FW_ASSERT (
2164  _deserStatus == Fw::FW_SERIALIZE_OK,
2165  static_cast<FwAssertArgType>(_deserStatus)
2166  );
2167 
2168  // Reset buffer
2169  args.resetDeser();
2170 
2171  // Deserialize argument entry
2172  Fw::CmdStringArg entry;
2173  _deserStatus = args.deserialize(entry);
2174  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2175  if (this->m_CmdStatus_OutputPort[0].isConnected()) {
2176  this->cmdResponse_out(
2177  _opCode,
2178  _cmdSeq,
2180  );
2181  }
2182  // Don't crash the task if bad arguments were passed from the ground
2183  break;
2184  }
2185 
2186  // Deserialize argument enable
2187  Fw::Enabled enable;
2188  _deserStatus = args.deserialize(enable);
2189  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2190  if (this->m_CmdStatus_OutputPort[0].isConnected()) {
2191  this->cmdResponse_out(
2192  _opCode,
2193  _cmdSeq,
2195  );
2196  }
2197  // Don't crash the task if bad arguments were passed from the ground
2198  break;
2199  }
2200 
2201  // Make sure there was no data left over.
2202  // That means the argument buffer size was incorrect.
2203 #if FW_CMD_CHECK_RESIDUAL
2204  if (args.getBuffLeft() != 0) {
2205  if (this->m_CmdStatus_OutputPort[0].isConnected()) {
2206  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2207  }
2208  // Don't crash the task if bad arguments were passed from the ground
2209  break;
2210  }
2211 #endif
2212 
2213  // Call handler function
2215  _opCode, _cmdSeq,
2216  entry,
2217  enable
2218  );
2219 
2220  break;
2221  }
2222 
2223  // Handle command HLTH_CHNG_PING
2224  case CMD_HLTH_CHNG_PING: {
2225  // Deserialize opcode
2226  FwOpcodeType _opCode = 0;
2227  _deserStatus = _msg.deserialize(_opCode);
2228  FW_ASSERT (
2229  _deserStatus == Fw::FW_SERIALIZE_OK,
2230  static_cast<FwAssertArgType>(_deserStatus)
2231  );
2232 
2233  // Deserialize command sequence
2234  U32 _cmdSeq = 0;
2235  _deserStatus = _msg.deserialize(_cmdSeq);
2236  FW_ASSERT (
2237  _deserStatus == Fw::FW_SERIALIZE_OK,
2238  static_cast<FwAssertArgType>(_deserStatus)
2239  );
2240 
2241  // Deserialize command argument buffer
2242  Fw::CmdArgBuffer args;
2243  _deserStatus = _msg.deserialize(args);
2244  FW_ASSERT (
2245  _deserStatus == Fw::FW_SERIALIZE_OK,
2246  static_cast<FwAssertArgType>(_deserStatus)
2247  );
2248 
2249  // Reset buffer
2250  args.resetDeser();
2251 
2252  // Deserialize argument entry
2253  Fw::CmdStringArg entry;
2254  _deserStatus = args.deserialize(entry);
2255  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2256  if (this->m_CmdStatus_OutputPort[0].isConnected()) {
2257  this->cmdResponse_out(
2258  _opCode,
2259  _cmdSeq,
2261  );
2262  }
2263  // Don't crash the task if bad arguments were passed from the ground
2264  break;
2265  }
2266 
2267  // Deserialize argument warningValue
2268  U32 warningValue;
2269  _deserStatus = args.deserialize(warningValue);
2270  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2271  if (this->m_CmdStatus_OutputPort[0].isConnected()) {
2272  this->cmdResponse_out(
2273  _opCode,
2274  _cmdSeq,
2276  );
2277  }
2278  // Don't crash the task if bad arguments were passed from the ground
2279  break;
2280  }
2281 
2282  // Deserialize argument fatalValue
2283  U32 fatalValue;
2284  _deserStatus = args.deserialize(fatalValue);
2285  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2286  if (this->m_CmdStatus_OutputPort[0].isConnected()) {
2287  this->cmdResponse_out(
2288  _opCode,
2289  _cmdSeq,
2291  );
2292  }
2293  // Don't crash the task if bad arguments were passed from the ground
2294  break;
2295  }
2296 
2297  // Make sure there was no data left over.
2298  // That means the argument buffer size was incorrect.
2299 #if FW_CMD_CHECK_RESIDUAL
2300  if (args.getBuffLeft() != 0) {
2301  if (this->m_CmdStatus_OutputPort[0].isConnected()) {
2302  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2303  }
2304  // Don't crash the task if bad arguments were passed from the ground
2305  break;
2306  }
2307 #endif
2308 
2309  // Call handler function
2311  _opCode, _cmdSeq,
2312  entry,
2313  warningValue,
2314  fatalValue
2315  );
2316 
2317  break;
2318  }
2319 
2320  default:
2321  return MSG_DISPATCH_ERROR;
2322  }
2323 
2324  return MSG_DISPATCH_OK;
2325  }
2326 
2327  // ----------------------------------------------------------------------
2328  // Helper functions for dispatching current messages
2329  // ----------------------------------------------------------------------
2330 
2333  {
2334  // Dispatch all current messages unless ERROR or EXIT occur
2335  const FwSizeType currentMessageCount = this->m_queue.getMessagesAvailable();
2336  MsgDispatchStatus messageStatus = MsgDispatchStatus::MSG_DISPATCH_EMPTY;
2337  for (FwSizeType i = 0; i < currentMessageCount; i++) {
2338  messageStatus = this->doDispatch();
2339  if (messageStatus != QueuedComponentBase::MSG_DISPATCH_OK) {
2340  break;
2341  }
2342  }
2343  return messageStatus;
2344  }
2345 
2346  // ----------------------------------------------------------------------
2347  // Calls for messages received on special input ports
2348  // ----------------------------------------------------------------------
2349 
2350  void HealthComponentBase ::
2351  m_p_CmdDisp_in(
2352  Fw::PassiveComponentBase* callComp,
2353  FwIndexType portNum,
2354  FwOpcodeType opCode,
2355  U32 cmdSeq,
2356  Fw::CmdArgBuffer& args
2357  )
2358  {
2359  FW_ASSERT(callComp);
2360  HealthComponentBase* compPtr = static_cast<HealthComponentBase*>(callComp);
2361 
2362  const U32 idBase = callComp->getIdBase();
2363  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
2364 
2365  // Select base class function based on opcode
2366  switch (opCode - idBase) {
2367  case OPCODE_HLTH_ENABLE: {
2368  compPtr->HLTH_ENABLE_cmdHandlerBase(
2369  opCode,
2370  cmdSeq,
2371  args
2372  );
2373  break;
2374  }
2375 
2376  case OPCODE_HLTH_PING_ENABLE: {
2378  opCode,
2379  cmdSeq,
2380  args
2381  );
2382  break;
2383  }
2384 
2385  case OPCODE_HLTH_CHNG_PING: {
2387  opCode,
2388  cmdSeq,
2389  args
2390  );
2391  break;
2392  }
2393  }
2394  }
2395 
2396  // ----------------------------------------------------------------------
2397  // Calls for messages received on typed input ports
2398  // ----------------------------------------------------------------------
2399 
2400  void HealthComponentBase ::
2401  m_p_PingReturn_in(
2402  Fw::PassiveComponentBase* callComp,
2403  FwIndexType portNum,
2404  U32 key
2405  )
2406  {
2407  FW_ASSERT(callComp);
2408  HealthComponentBase* compPtr = static_cast<HealthComponentBase*>(callComp);
2409  compPtr->PingReturn_handlerBase(
2410  portNum,
2411  key
2412  );
2413  }
2414 
2415  void HealthComponentBase ::
2416  m_p_Run_in(
2417  Fw::PassiveComponentBase* callComp,
2418  FwIndexType portNum,
2419  U32 context
2420  )
2421  {
2422  FW_ASSERT(callComp);
2423  HealthComponentBase* compPtr = static_cast<HealthComponentBase*>(callComp);
2424  compPtr->Run_handlerBase(
2425  portNum,
2426  context
2427  );
2428  }
2429 
2430 }
Serialization/Deserialization operation was successful.
The size of the serial representations of the port arguments.
Definition: CmdPortAc.hpp:38
virtual void HLTH_CHNG_PING_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &entry, U32 warningValue, U32 fatalValue)=0
void regCommands()
Register commands with the Command Dispatcher.
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:134
Auto-generated base for Health component.
Definition: Time.hpp:9
virtual void Run_handler(FwIndexType portNum, U32 context)=0
Handler for input port Run.
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
virtual ~HealthComponentBase()
Destroy HealthComponentBase object.
Report a particular entry on or off.
Operation succeeded.
Definition: Os.hpp:26
void tlmWrite_PingLateWarnings(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
void log_FATAL_HLTH_PING_WRONG_KEY(const Fw::StringBase &entry, U32 badKey) const
PlatformSizeType FwSizeType
void set_CmdStatus_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to CmdStatus[portNum].
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
Definition: Queue.cpp:59
I32 FwEnumStoreType
Status
status returned from the queue send function
Definition: Queue.hpp:30
virtual MsgDispatchStatus doDispatch()
Called in the message loop to dispatch a message from the queue.
#define FW_LOG_STRING_MAX_SIZE
Max size of log string parameter type.
Definition: FpConfig.h:219
FwIndexType getNum_PingSend_OutputPorts() const
FwIndexType getNum_Time_OutputPorts() const
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
void init()
Initialization function.
Definition: SchedPortAc.cpp:56
const char * toChar() const
Definition: String.hpp:50
virtual void PingReturn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port PingReturn.
void init()
Initialization function.
Definition: CmdPortAc.cpp:56
void log_WARNING_LO_HLTH_CHECK_LOOKUP_ERROR(const Fw::StringBase &entry) const
U32 FwChanIdType
The type of a telemetry channel identifier.
void log_WARNING_HI_HLTH_PING_INVALID_VALUES(const Fw::StringBase &entry, U32 warn, U32 fatal) const
void invoke(U32 key) const
Invoke a port interface.
Definition: PingPortAc.cpp:147
bool isConnected_Log_OutputPort(FwIndexType portNum)
const Time ZERO_TIME
Definition: Time.cpp:5
bool isConnected_CmdReg_OutputPort(FwIndexType portNum)
void init()
Initialization function.
Definition: TlmPortAc.cpp:144
Enum representing a command response.
bool isConnected_CmdStatus_OutputPort(FwIndexType portNum)
void addCallPort(InputWatchDogPort *callPort)
Register an input port.
void set_WdogStroke_OutputPort(FwIndexType portNum, Svc::InputWatchDogPort *port)
Connect port to WdogStroke[portNum].
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
A command to enable or disable health checks.
virtual void HLTH_ENABLE_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command HLTH_ENABLE.
Os::Queue m_queue
queue object for active component
void set_CmdReg_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to CmdReg[portNum].
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:150
void init()
Object initializer.
Definition: ObjBase.cpp:26
U32 FwEventIdType
The type of an event identifier.
SerializeStatus
forward declaration for string
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: CmdPortAc.cpp:62
FwIndexType getNum_Log_OutputPorts() const
FwIndexType getNum_WdogStroke_OutputPorts() const
Svc::InputPingPort * get_PingReturn_InputPort(FwIndexType portNum)
void invoke(FwOpcodeType opCode) const
Invoke a port interface.
void PingReturn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port PingReturn.
U32 FwOpcodeType
The type of a command opcode.
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:53
Serializable::SizeType getBuffLeft() const
returns how much deserialization buffer is left
void init()
Initialization function.
Definition: TimePortAc.cpp:128
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
#define FW_MIN(a, b)
MIN macro.
Definition: BasicTypes.h:95
Warn that a ping target is longer than the warning value.
A less serious but recoverable event.
Declare FATAL since task is no longer responding.
void init()
Initialization function.
Definition: PingPortAc.cpp:128
FwIndexType getNum_CmdReg_OutputPorts() const
FwIndexType getNum_PingReturn_InputPorts() const
FwIndexType getNum_CmdStatus_OutputPorts() const
void invoke(Fw::Time &time) const
Invoke a port interface.
Definition: TimePortAc.cpp:147
void log_ACTIVITY_HI_HLTH_CHECK_PING(Fw::Enabled enabled, const Fw::StringBase &entry) const
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
const char * toChar() const
Definition: ObjectName.hpp:50
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke a port interface.
FwSizeType SizeType
void addCallPort(InputPingPort *callPort)
Register an input port.
Definition: PingPortAc.cpp:134
bool isConnected_Time_OutputPort(FwIndexType portNum)
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
Definition: Queue.cpp:42
void WdogStroke_out(FwIndexType portNum, U32 code)
Invoke output port WdogStroke.
void HLTH_PING_ENABLE_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void resetDeser()
reset deserialization to beginning
FwIndexType getNum_Run_InputPorts() const
message to exit active component task
A serious but recoverable event.
The size of the serial representations of the port arguments.
Definition: PingPortAc.hpp:36
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port interface.
Definition: TlmPortAc.cpp:163
bool isConnected() const
Definition: PortBase.cpp:42
virtual void HLTH_ENABLE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, Fw::Enabled enable)=0
void set_PingSend_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to PingSend[portNum].
#define PRI_FwIndexType
Enabled and disabled states.
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:55
void init()
Initialization function.
Definition: LogPortAc.cpp:151
bool isConnected_WdogStroke_OutputPort(FwIndexType portNum)
void setPortNum(FwIndexType portNum)
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:56
BlockingType
message type
Definition: Queue.hpp:46
FwSizeType getMessagesAvailable() const override
get number of messages available
Definition: Queue.cpp:77
bool isConnected_PingSend_OutputPort(FwIndexType portNum)
Command failed to deserialize.
void log_FATAL_HLTH_PING_LATE(const Fw::StringBase &entry) const
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
Important informational events.
The size of the serial representation.
Fw::InputCmdPort * get_CmdDisp_InputPort(FwIndexType portNum)
bool isConnected_Tlm_OutputPort(FwIndexType portNum)
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: SchedPortAc.cpp:62
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port interface.
Definition: LogPortAc.cpp:170
HealthComponentBase(const char *compName="")
Construct HealthComponentBase object.
void invoke(U32 code) const
Invoke a port interface.
virtual void HLTH_PING_ENABLE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &entry, Fw::Enabled enable)=0
virtual void HLTH_CHNG_PING_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command HLTH_CHNG_PING.
A message was sent requesting an exit of the loop.
No time base has been established.
Definition: FpConfig.h:30
void init()
Initialization function.
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
PlatformIndexType FwIndexType
virtual void PingReturn_handler(FwIndexType portNum, U32 key)=0
Handler for input port PingReturn.
A fatal non-recoverable event.
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition: BasicTypes.h:93
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:157
Declare FATAL since task is no longer responding.
void set_Tlm_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to Tlm[portNum].
void init()
Initialization function.
void init()
Initialization function.
Definition: PingPortAc.cpp:56
RateGroupDivider component implementation.
message sent/received okay
Definition: Queue.hpp:31
U8 BYTE
byte type
Definition: BasicTypes.h:59
virtual SerializeStatus serialize(SerializeBufferBase &buffer) const
serialization function
Definition: StringBase.cpp:142
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: PingPortAc.cpp:62
Message will return with status when space is unavailable.
Definition: Queue.hpp:48
FwIndexType getNum_Tlm_OutputPorts() const
Svc::InputSchedPort * get_Run_InputPort(FwIndexType portNum)
void set_Log_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
void init()
Initialization function.
MsgDispatchStatus dispatchCurrentMessages()
Dispatch all current messages unless ERROR or EXIT occurs.
void log_ACTIVITY_HI_HLTH_CHECK_ENABLE(Fw::Enabled enabled) const
FwIndexType getNum_CmdDisp_InputPorts() const
void HLTH_CHNG_PING_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
#define FW_ASSERT(...)
Definition: Assert.hpp:14
void log_WARNING_HI_HLTH_PING_WARN(const Fw::StringBase &entry) const
void HLTH_ENABLE_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
virtual const CHAR * toChar() const =0
virtual void HLTH_PING_ENABLE_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command HLTH_PING_ENABLE.
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
void Run_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port Run.
void PingSend_out(FwIndexType portNum, U32 key)
Invoke output port PingSend.
void log_ACTIVITY_HI_HLTH_PING_UPDATED(const Fw::StringBase &entry, U32 warn, U32 fatal) const