F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
PrmDbComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title PrmDbComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for PrmDb 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 {
19  PINGIN_PING,
20  SETPRM_PRMSET,
21  CMD_PRM_SAVE_FILE,
22  CMD_PRM_LOAD_FILE,
23  CMD_PRM_COMMIT_STAGED,
24  };
25 
26  // Get the max size by constructing a union of the async input, command, and
27  // internal port serialization sizes
28  union BuffUnion {
30  BYTE setPrmPortSize[Fw::PrmSetPortBuffer::CAPACITY];
32  };
33 
34  // Define a message buffer class large enough to handle all the
35  // asynchronous inputs to the component
36  class ComponentIpcSerializableBuffer :
38  {
39 
40  public:
41 
42  enum {
43  // Offset into data in buffer: Size of message ID and port number
44  DATA_OFFSET = sizeof(FwEnumStoreType) + sizeof(FwIndexType),
45  // Max data size
46  MAX_DATA_SIZE = sizeof(BuffUnion),
47  // Max message size: Size of message id + size of port + max data size
48  SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
49  };
50 
51  ComponentIpcSerializableBuffer() : Fw::LinearBufferBase(m_buff, sizeof(m_buff)) {
52 
53  }
54 
55  private:
56  // Should be the max of all the input ports serialized sizes...
57  U8 m_buff[SERIALIZATION_SIZE];
58 
59  };
60  }
61 
62  // ----------------------------------------------------------------------
63  // Component initialization
64  // ----------------------------------------------------------------------
65 
68  FwSizeType queueDepth,
69  FwEnumStoreType instance
70  )
71  {
72  // Initialize base class
74 
75 #if !FW_DIRECT_PORT_CALLS
76  // Connect input port CmdDisp
77  for (
78  FwIndexType port = 0;
79  port < static_cast<FwIndexType>(this->getNum_CmdDisp_InputPorts());
80  port++
81  ) {
82  this->m_CmdDisp_InputPort[port].init();
83  this->m_CmdDisp_InputPort[port].addCallComp(
84  this,
85  m_p_CmdDisp_in
86  );
87  this->m_CmdDisp_InputPort[port].setPortNum(port);
88 
89 #if FW_OBJECT_NAMES == 1
90  Fw::ObjectName portName;
91  portName.format(
92  "%s_CmdDisp_InputPort[%" PRI_FwIndexType "]",
93  this->m_objName.toChar(),
94  port
95  );
96  this->m_CmdDisp_InputPort[port].setObjName(portName.toChar());
97 #endif
98  }
99 #endif
100 
101 #if !FW_DIRECT_PORT_CALLS
102  // Connect input port getPrm
103  for (
104  FwIndexType port = 0;
105  port < static_cast<FwIndexType>(this->getNum_getPrm_InputPorts());
106  port++
107  ) {
108  this->m_getPrm_InputPort[port].init();
109  this->m_getPrm_InputPort[port].addCallComp(
110  this,
111  m_p_getPrm_in
112  );
113  this->m_getPrm_InputPort[port].setPortNum(port);
114 
115 #if FW_OBJECT_NAMES == 1
116  Fw::ObjectName portName;
117  portName.format(
118  "%s_getPrm_InputPort[%" PRI_FwIndexType "]",
119  this->m_objName.toChar(),
120  port
121  );
122  this->m_getPrm_InputPort[port].setObjName(portName.toChar());
123 #endif
124  }
125 #endif
126 
127 #if !FW_DIRECT_PORT_CALLS
128  // Connect input port pingIn
129  for (
130  FwIndexType port = 0;
131  port < static_cast<FwIndexType>(this->getNum_pingIn_InputPorts());
132  port++
133  ) {
134  this->m_pingIn_InputPort[port].init();
135  this->m_pingIn_InputPort[port].addCallComp(
136  this,
137  m_p_pingIn_in
138  );
139  this->m_pingIn_InputPort[port].setPortNum(port);
140 
141 #if FW_OBJECT_NAMES == 1
142  Fw::ObjectName portName;
143  portName.format(
144  "%s_pingIn_InputPort[%" PRI_FwIndexType "]",
145  this->m_objName.toChar(),
146  port
147  );
148  this->m_pingIn_InputPort[port].setObjName(portName.toChar());
149 #endif
150  }
151 #endif
152 
153 #if !FW_DIRECT_PORT_CALLS
154  // Connect input port setPrm
155  for (
156  FwIndexType port = 0;
157  port < static_cast<FwIndexType>(this->getNum_setPrm_InputPorts());
158  port++
159  ) {
160  this->m_setPrm_InputPort[port].init();
161  this->m_setPrm_InputPort[port].addCallComp(
162  this,
163  m_p_setPrm_in
164  );
165  this->m_setPrm_InputPort[port].setPortNum(port);
166 
167 #if FW_OBJECT_NAMES == 1
168  Fw::ObjectName portName;
169  portName.format(
170  "%s_setPrm_InputPort[%" PRI_FwIndexType "]",
171  this->m_objName.toChar(),
172  port
173  );
174  this->m_setPrm_InputPort[port].setObjName(portName.toChar());
175 #endif
176  }
177 #endif
178 
179 #if !FW_DIRECT_PORT_CALLS
180  // Connect output port CmdReg
181  for (
182  FwIndexType port = 0;
183  port < static_cast<FwIndexType>(this->getNum_CmdReg_OutputPorts());
184  port++
185  ) {
186  this->m_CmdReg_OutputPort[port].init();
187 
188 #if FW_OBJECT_NAMES == 1
189  Fw::ObjectName portName;
190  portName.format(
191  "%s_CmdReg_OutputPort[%" PRI_FwIndexType "]",
192  this->m_objName.toChar(),
193  port
194  );
195  this->m_CmdReg_OutputPort[port].setObjName(portName.toChar());
196 #endif
197  }
198 #endif
199 
200 #if !FW_DIRECT_PORT_CALLS
201  // Connect output port CmdStatus
202  for (
203  FwIndexType port = 0;
204  port < static_cast<FwIndexType>(this->getNum_CmdStatus_OutputPorts());
205  port++
206  ) {
207  this->m_CmdStatus_OutputPort[port].init();
208 
209 #if FW_OBJECT_NAMES == 1
210  Fw::ObjectName portName;
211  portName.format(
212  "%s_CmdStatus_OutputPort[%" PRI_FwIndexType "]",
213  this->m_objName.toChar(),
214  port
215  );
216  this->m_CmdStatus_OutputPort[port].setObjName(portName.toChar());
217 #endif
218  }
219 #endif
220 
221 #if !FW_DIRECT_PORT_CALLS
222  // Connect output port Log
223  for (
224  FwIndexType port = 0;
225  port < static_cast<FwIndexType>(this->getNum_Log_OutputPorts());
226  port++
227  ) {
228  this->m_Log_OutputPort[port].init();
229 
230 #if FW_OBJECT_NAMES == 1
231  Fw::ObjectName portName;
232  portName.format(
233  "%s_Log_OutputPort[%" PRI_FwIndexType "]",
234  this->m_objName.toChar(),
235  port
236  );
237  this->m_Log_OutputPort[port].setObjName(portName.toChar());
238 #endif
239  }
240 #endif
241 
242 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING
243  // Connect output port LogText
244  for (
245  FwIndexType port = 0;
246  port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
247  port++
248  ) {
249  this->m_LogText_OutputPort[port].init();
250 
251 #if FW_OBJECT_NAMES == 1
252  Fw::ObjectName portName;
253  portName.format(
254  "%s_LogText_OutputPort[%" PRI_FwIndexType "]",
255  this->m_objName.toChar(),
256  port
257  );
258  this->m_LogText_OutputPort[port].setObjName(portName.toChar());
259 #endif
260  }
261 #endif
262 
263 #if !FW_DIRECT_PORT_CALLS
264  // Connect output port Time
265  for (
266  FwIndexType port = 0;
267  port < static_cast<FwIndexType>(this->getNum_Time_OutputPorts());
268  port++
269  ) {
270  this->m_Time_OutputPort[port].init();
271 
272 #if FW_OBJECT_NAMES == 1
273  Fw::ObjectName portName;
274  portName.format(
275  "%s_Time_OutputPort[%" PRI_FwIndexType "]",
276  this->m_objName.toChar(),
277  port
278  );
279  this->m_Time_OutputPort[port].setObjName(portName.toChar());
280 #endif
281  }
282 #endif
283 
284 #if !FW_DIRECT_PORT_CALLS
285  // Connect output port pingOut
286  for (
287  FwIndexType port = 0;
288  port < static_cast<FwIndexType>(this->getNum_pingOut_OutputPorts());
289  port++
290  ) {
291  this->m_pingOut_OutputPort[port].init();
292 
293 #if FW_OBJECT_NAMES == 1
294  Fw::ObjectName portName;
295  portName.format(
296  "%s_pingOut_OutputPort[%" PRI_FwIndexType "]",
297  this->m_objName.toChar(),
298  port
299  );
300  this->m_pingOut_OutputPort[port].setObjName(portName.toChar());
301 #endif
302  }
303 #endif
304 
305  // Create the queue
306  Os::Queue::Status qStat = this->createQueue(
307  queueDepth,
308  static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
309  );
310  FW_ASSERT(
311  Os::Queue::Status::OP_OK == qStat,
312  static_cast<FwAssertArgType>(qStat)
313  );
314  }
315 
316 #if !FW_DIRECT_PORT_CALLS
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 #endif
334 
335 #if !FW_DIRECT_PORT_CALLS
336 
337  // ----------------------------------------------------------------------
338  // Getters for typed input ports
339  // ----------------------------------------------------------------------
340 
343  {
344  FW_ASSERT(
345  (0 <= portNum) && (portNum < this->getNum_getPrm_InputPorts()),
346  static_cast<FwAssertArgType>(portNum)
347  );
348 
349  return &this->m_getPrm_InputPort[portNum];
350  }
351 
354  {
355  FW_ASSERT(
356  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
357  static_cast<FwAssertArgType>(portNum)
358  );
359 
360  return &this->m_pingIn_InputPort[portNum];
361  }
362 
365  {
366  FW_ASSERT(
367  (0 <= portNum) && (portNum < this->getNum_setPrm_InputPorts()),
368  static_cast<FwAssertArgType>(portNum)
369  );
370 
371  return &this->m_setPrm_InputPort[portNum];
372  }
373 
374 #endif
375 
376 #if !FW_DIRECT_PORT_CALLS
377 
378  // ----------------------------------------------------------------------
379  // Connect input ports to special output ports
380  // ----------------------------------------------------------------------
381 
384  FwIndexType portNum,
385  Fw::InputCmdRegPort* port
386  )
387  {
388  FW_ASSERT(
389  (0 <= portNum) && (portNum < this->getNum_CmdReg_OutputPorts()),
390  static_cast<FwAssertArgType>(portNum)
391  );
392 
393  this->m_CmdReg_OutputPort[portNum].addCallPort(port);
394  }
395 
398  FwIndexType portNum,
400  )
401  {
402  FW_ASSERT(
403  (0 <= portNum) && (portNum < this->getNum_CmdStatus_OutputPorts()),
404  static_cast<FwAssertArgType>(portNum)
405  );
406 
407  this->m_CmdStatus_OutputPort[portNum].addCallPort(port);
408  }
409 
412  FwIndexType portNum,
413  Fw::InputLogPort* port
414  )
415  {
416  FW_ASSERT(
417  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
418  static_cast<FwAssertArgType>(portNum)
419  );
420 
421  this->m_Log_OutputPort[portNum].addCallPort(port);
422  }
423 
424 #if FW_ENABLE_TEXT_LOGGING == 1
425 
426  void PrmDbComponentBase ::
427  set_LogText_OutputPort(
428  FwIndexType portNum,
430  )
431  {
432  FW_ASSERT(
433  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
434  static_cast<FwAssertArgType>(portNum)
435  );
436 
437  this->m_LogText_OutputPort[portNum].addCallPort(port);
438  }
439 
440 #endif
441 
444  FwIndexType portNum,
445  Fw::InputTimePort* port
446  )
447  {
448  FW_ASSERT(
449  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
450  static_cast<FwAssertArgType>(portNum)
451  );
452 
453  this->m_Time_OutputPort[portNum].addCallPort(port);
454  }
455 
456 #endif
457 
458 #if !FW_DIRECT_PORT_CALLS
459 
460  // ----------------------------------------------------------------------
461  // Connect typed input ports to typed output ports
462  // ----------------------------------------------------------------------
463 
466  FwIndexType portNum,
467  Svc::InputPingPort* port
468  )
469  {
470  FW_ASSERT(
471  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
472  static_cast<FwAssertArgType>(portNum)
473  );
474 
475  this->m_pingOut_OutputPort[portNum].addCallPort(port);
476  }
477 
478 #endif
479 
480 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
481 
482  // ----------------------------------------------------------------------
483  // Connect serial input ports to special output ports
484  // ----------------------------------------------------------------------
485 
488  FwIndexType portNum,
489  Fw::InputSerializePort* port
490  )
491  {
492  FW_ASSERT(
493  (0 <= portNum) && (portNum < this->getNum_CmdReg_OutputPorts()),
494  static_cast<FwAssertArgType>(portNum)
495  );
496 
497  this->m_CmdReg_OutputPort[portNum].registerSerialPort(port);
498  }
499 
502  FwIndexType portNum,
503  Fw::InputSerializePort* port
504  )
505  {
506  FW_ASSERT(
507  (0 <= portNum) && (portNum < this->getNum_CmdStatus_OutputPorts()),
508  static_cast<FwAssertArgType>(portNum)
509  );
510 
511  this->m_CmdStatus_OutputPort[portNum].registerSerialPort(port);
512  }
513 
516  FwIndexType portNum,
517  Fw::InputSerializePort* port
518  )
519  {
520  FW_ASSERT(
521  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
522  static_cast<FwAssertArgType>(portNum)
523  );
524 
525  this->m_Log_OutputPort[portNum].registerSerialPort(port);
526  }
527 
528 #if FW_ENABLE_TEXT_LOGGING == 1
529 
530  void PrmDbComponentBase ::
531  set_LogText_OutputPort(
532  FwIndexType portNum,
533  Fw::InputSerializePort* port
534  )
535  {
536  FW_ASSERT(
537  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
538  static_cast<FwAssertArgType>(portNum)
539  );
540 
541  this->m_LogText_OutputPort[portNum].registerSerialPort(port);
542  }
543 
544 #endif
545 
548  FwIndexType portNum,
549  Fw::InputSerializePort* port
550  )
551  {
552  FW_ASSERT(
553  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
554  static_cast<FwAssertArgType>(portNum)
555  );
556 
557  this->m_Time_OutputPort[portNum].registerSerialPort(port);
558  }
559 
560 #endif
561 
562 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
563 
564  // ----------------------------------------------------------------------
565  // Connect serial input ports to typed output ports
566  // ----------------------------------------------------------------------
567 
570  FwIndexType portNum,
571  Fw::InputSerializePort* port
572  )
573  {
574  FW_ASSERT(
575  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
576  static_cast<FwAssertArgType>(portNum)
577  );
578 
579  this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
580  }
581 
582 #endif
583 
584  // ----------------------------------------------------------------------
585  // Command registration
586  // ----------------------------------------------------------------------
587 
590  {
592 
593  this->CmdReg_out(
594  0,
596  );
597 
598  this->CmdReg_out(
599  0,
601  );
602 
603  this->CmdReg_out(
604  0,
606  );
607  }
608 
609  // ----------------------------------------------------------------------
610  // Component construction and destruction
611  // ----------------------------------------------------------------------
612 
614  PrmDbComponentBase(const char* compName) :
615  Fw::ActiveComponentBase(compName)
616  {
617  this->m_PrmIdNotFoundThrottle = 0;
618  }
619 
622  {
623 
624  }
625 
626 #if !FW_DIRECT_PORT_CALLS
627 
628  // ----------------------------------------------------------------------
629  // Connection status queries for special output ports
630  // ----------------------------------------------------------------------
631 
634  {
635  FW_ASSERT(
636  (0 <= portNum) && (portNum < this->getNum_CmdReg_OutputPorts()),
637  static_cast<FwAssertArgType>(portNum)
638  );
639 
640  return this->m_CmdReg_OutputPort[portNum].isConnected();
641  }
642 
645  {
646  FW_ASSERT(
647  (0 <= portNum) && (portNum < this->getNum_CmdStatus_OutputPorts()),
648  static_cast<FwAssertArgType>(portNum)
649  );
650 
651  return this->m_CmdStatus_OutputPort[portNum].isConnected();
652  }
653 
656  {
657  FW_ASSERT(
658  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
659  static_cast<FwAssertArgType>(portNum)
660  );
661 
662  return this->m_Log_OutputPort[portNum].isConnected();
663  }
664 
665 #if FW_ENABLE_TEXT_LOGGING == 1
666 
667  bool PrmDbComponentBase ::
668  isConnected_LogText_OutputPort(FwIndexType portNum) const
669  {
670  FW_ASSERT(
671  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
672  static_cast<FwAssertArgType>(portNum)
673  );
674 
675  return this->m_LogText_OutputPort[portNum].isConnected();
676  }
677 
678 #endif
679 
682  {
683  FW_ASSERT(
684  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
685  static_cast<FwAssertArgType>(portNum)
686  );
687 
688  return this->m_Time_OutputPort[portNum].isConnected();
689  }
690 
691 #endif
692 
693 #if !FW_DIRECT_PORT_CALLS
694 
695  // ----------------------------------------------------------------------
696  // Connection status queries for typed output ports
697  // ----------------------------------------------------------------------
698 
701  {
702  FW_ASSERT(
703  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
704  static_cast<FwAssertArgType>(portNum)
705  );
706 
707  return this->m_pingOut_OutputPort[portNum].isConnected();
708  }
709 
710 #endif
711 
712  // ----------------------------------------------------------------------
713  // Port handler base-class functions for special input ports
714  //
715  // Call these functions directly to bypass the corresponding ports
716  // ----------------------------------------------------------------------
717 
720  FwIndexType portNum,
721  FwOpcodeType opCode,
722  U32 cmdSeq,
723  Fw::CmdArgBuffer& args
724  )
725  {
726 
727  const U32 idBase = this->getIdBase();
728  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
729 
730  // Select base class function based on opcode
731  switch (opCode - idBase) {
732  case OPCODE_PRM_SAVE_FILE: {
734  opCode,
735  cmdSeq,
736  args
737  );
738  break;
739  }
740 
741  case OPCODE_PRM_LOAD_FILE: {
743  opCode,
744  cmdSeq,
745  args
746  );
747  break;
748  }
749 
752  opCode,
753  cmdSeq,
754  args
755  );
756  break;
757  }
758  default:
759  // Unknown opcode: ignore it
760  break;
761  }
762  }
763 
764  // ----------------------------------------------------------------------
765  // Port handler base-class functions for typed input ports
766  //
767  // Call these functions directly to bypass the corresponding ports
768  // ----------------------------------------------------------------------
769 
772  FwIndexType portNum,
773  FwPrmIdType id,
774  Fw::ParamBuffer& val
775  )
776  {
777  // Make sure port number is valid
778  FW_ASSERT(
779  (0 <= portNum) && (portNum < this->getNum_getPrm_InputPorts()),
780  static_cast<FwAssertArgType>(portNum)
781  );
782 
783  Fw::ParamValid retVal;
784 
785  // Lock guard mutex before calling
786  this->lock();
787 
788  // Call handler function
789  retVal = this->getPrm_handler(
790  portNum,
791  id,
792  val
793  );
794 
795  // Unlock guard mutex
796  this->unLock();
797 
798  return retVal;
799  }
800 
803  FwIndexType portNum,
804  U32 key
805  )
806  {
807  // Make sure port number is valid
808  FW_ASSERT(
809  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
810  static_cast<FwAssertArgType>(portNum)
811  );
812 
813  // Call pre-message hook
815  portNum,
816  key
817  );
818  ComponentIpcSerializableBuffer msg;
820 
821  // Serialize message ID
822  _status = msg.serializeFrom(
823  static_cast<FwEnumStoreType>(PINGIN_PING)
824  );
825  FW_ASSERT(
826  _status == Fw::FW_SERIALIZE_OK,
827  static_cast<FwAssertArgType>(_status)
828  );
829 
830  // Serialize port number
831  _status = msg.serializeFrom(portNum);
832  FW_ASSERT(
833  _status == Fw::FW_SERIALIZE_OK,
834  static_cast<FwAssertArgType>(_status)
835  );
836 
837  // Serialize argument key
838  _status = msg.serializeFrom(key);
839  FW_ASSERT(
840  _status == Fw::FW_SERIALIZE_OK,
841  static_cast<FwAssertArgType>(_status)
842  );
843 
844  // Send message
846  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
847 
848  FW_ASSERT(
849  qStatus == Os::Queue::OP_OK,
850  static_cast<FwAssertArgType>(qStatus)
851  );
852  }
853 
856  FwIndexType portNum,
857  FwPrmIdType id,
858  Fw::ParamBuffer& val
859  )
860  {
861  // Make sure port number is valid
862  FW_ASSERT(
863  (0 <= portNum) && (portNum < this->getNum_setPrm_InputPorts()),
864  static_cast<FwAssertArgType>(portNum)
865  );
866 
867  // Call pre-message hook
869  portNum,
870  id,
871  val
872  );
873  ComponentIpcSerializableBuffer msg;
875 
876  // Serialize message ID
877  _status = msg.serializeFrom(
878  static_cast<FwEnumStoreType>(SETPRM_PRMSET)
879  );
880  FW_ASSERT(
881  _status == Fw::FW_SERIALIZE_OK,
882  static_cast<FwAssertArgType>(_status)
883  );
884 
885  // Serialize port number
886  _status = msg.serializeFrom(portNum);
887  FW_ASSERT(
888  _status == Fw::FW_SERIALIZE_OK,
889  static_cast<FwAssertArgType>(_status)
890  );
891 
892  // Serialize argument id
893  _status = msg.serializeFrom(id);
894  FW_ASSERT(
895  _status == Fw::FW_SERIALIZE_OK,
896  static_cast<FwAssertArgType>(_status)
897  );
898 
899  // Serialize argument val
900  _status = msg.serializeFrom(val);
901  FW_ASSERT(
902  _status == Fw::FW_SERIALIZE_OK,
903  static_cast<FwAssertArgType>(_status)
904  );
905 
906  // Send message
908  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
909 
910  FW_ASSERT(
911  qStatus == Os::Queue::OP_OK,
912  static_cast<FwAssertArgType>(qStatus)
913  );
914  }
915 
916  // ----------------------------------------------------------------------
917  // Pre-message hooks for typed async input ports
918  //
919  // Each of these functions is invoked just before processing a message
920  // on the corresponding port. By default, they do nothing. You can
921  // override them to provide specific pre-message behavior.
922  // ----------------------------------------------------------------------
923 
926  FwIndexType portNum,
927  U32 key
928  )
929  {
930  // Default: no-op
931  }
932 
935  FwIndexType portNum,
936  FwPrmIdType id,
937  Fw::ParamBuffer& val
938  )
939  {
940  // Default: no-op
941  }
942 
943 #if !FW_DIRECT_PORT_CALLS
944 
945  // ----------------------------------------------------------------------
946  // Invocation functions for typed output ports
947  // ----------------------------------------------------------------------
948 
951  FwIndexType portNum,
952  U32 key
953  ) const
954  {
955  FW_ASSERT(
956  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
957  static_cast<FwAssertArgType>(portNum)
958  );
959 
960  FW_ASSERT(
961  this->m_pingOut_OutputPort[portNum].isConnected(),
962  static_cast<FwAssertArgType>(portNum)
963  );
964  this->m_pingOut_OutputPort[portNum].invoke(
965  key
966  );
967  }
968 
969 #endif
970 
971  // ----------------------------------------------------------------------
972  // Command response
973  // ----------------------------------------------------------------------
974 
977  FwOpcodeType opCode,
978  U32 cmdSeq,
979  Fw::CmdResponse response
980  )
981  {
983  this->CmdStatus_out(0, opCode, cmdSeq, response);
984  }
985 
986  // ----------------------------------------------------------------------
987  // Command handler base-class functions
988  //
989  // Call these functions directly to bypass the command input port
990  // ----------------------------------------------------------------------
991 
994  FwOpcodeType opCode,
995  U32 cmdSeq,
996  Fw::CmdArgBuffer& args
997  )
998  {
999  // Call pre-message hook
1000  this->PRM_SAVE_FILE_preMsgHook(opCode,cmdSeq);
1001 
1002  // Defer deserializing arguments to the message dispatcher
1003  // to avoid deserializing and reserializing just for IPC
1004  ComponentIpcSerializableBuffer msg;
1006 
1007  // Serialize for IPC
1008  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_PRM_SAVE_FILE));
1009  FW_ASSERT (
1010  _status == Fw::FW_SERIALIZE_OK,
1011  static_cast<FwAssertArgType>(_status)
1012  );
1013 
1014  // Fake port number to make message dequeue work
1015  FwIndexType port = 0;
1016 
1017  _status = msg.serializeFrom(port);
1018  FW_ASSERT (
1019  _status == Fw::FW_SERIALIZE_OK,
1020  static_cast<FwAssertArgType>(_status)
1021  );
1022 
1023  _status = msg.serializeFrom(opCode);
1024  FW_ASSERT (
1025  _status == Fw::FW_SERIALIZE_OK,
1026  static_cast<FwAssertArgType>(_status)
1027  );
1028 
1029  _status = msg.serializeFrom(cmdSeq);
1030  FW_ASSERT (
1031  _status == Fw::FW_SERIALIZE_OK,
1032  static_cast<FwAssertArgType>(_status)
1033  );
1034 
1035  _status = msg.serializeFrom(args);
1036  FW_ASSERT (
1037  _status == Fw::FW_SERIALIZE_OK,
1038  static_cast<FwAssertArgType>(_status)
1039  );
1040 
1041  // Send message
1043  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1044 
1045  FW_ASSERT(
1046  qStatus == Os::Queue::OP_OK,
1047  static_cast<FwAssertArgType>(qStatus)
1048  );
1049  }
1050 
1053  FwOpcodeType opCode,
1054  U32 cmdSeq,
1055  Fw::CmdArgBuffer& args
1056  )
1057  {
1058  // Call pre-message hook
1059  this->PRM_LOAD_FILE_preMsgHook(opCode,cmdSeq);
1060 
1061  // Defer deserializing arguments to the message dispatcher
1062  // to avoid deserializing and reserializing just for IPC
1063  ComponentIpcSerializableBuffer msg;
1065 
1066  // Serialize for IPC
1067  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_PRM_LOAD_FILE));
1068  FW_ASSERT (
1069  _status == Fw::FW_SERIALIZE_OK,
1070  static_cast<FwAssertArgType>(_status)
1071  );
1072 
1073  // Fake port number to make message dequeue work
1074  FwIndexType port = 0;
1075 
1076  _status = msg.serializeFrom(port);
1077  FW_ASSERT (
1078  _status == Fw::FW_SERIALIZE_OK,
1079  static_cast<FwAssertArgType>(_status)
1080  );
1081 
1082  _status = msg.serializeFrom(opCode);
1083  FW_ASSERT (
1084  _status == Fw::FW_SERIALIZE_OK,
1085  static_cast<FwAssertArgType>(_status)
1086  );
1087 
1088  _status = msg.serializeFrom(cmdSeq);
1089  FW_ASSERT (
1090  _status == Fw::FW_SERIALIZE_OK,
1091  static_cast<FwAssertArgType>(_status)
1092  );
1093 
1094  _status = msg.serializeFrom(args);
1095  FW_ASSERT (
1096  _status == Fw::FW_SERIALIZE_OK,
1097  static_cast<FwAssertArgType>(_status)
1098  );
1099 
1100  // Send message
1102  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1103 
1104  FW_ASSERT(
1105  qStatus == Os::Queue::OP_OK,
1106  static_cast<FwAssertArgType>(qStatus)
1107  );
1108  }
1109 
1112  FwOpcodeType opCode,
1113  U32 cmdSeq,
1114  Fw::CmdArgBuffer& args
1115  )
1116  {
1117  // Call pre-message hook
1118  this->PRM_COMMIT_STAGED_preMsgHook(opCode,cmdSeq);
1119 
1120  // Defer deserializing arguments to the message dispatcher
1121  // to avoid deserializing and reserializing just for IPC
1122  ComponentIpcSerializableBuffer msg;
1124 
1125  // Serialize for IPC
1126  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_PRM_COMMIT_STAGED));
1127  FW_ASSERT (
1128  _status == Fw::FW_SERIALIZE_OK,
1129  static_cast<FwAssertArgType>(_status)
1130  );
1131 
1132  // Fake port number to make message dequeue work
1133  FwIndexType port = 0;
1134 
1135  _status = msg.serializeFrom(port);
1136  FW_ASSERT (
1137  _status == Fw::FW_SERIALIZE_OK,
1138  static_cast<FwAssertArgType>(_status)
1139  );
1140 
1141  _status = msg.serializeFrom(opCode);
1142  FW_ASSERT (
1143  _status == Fw::FW_SERIALIZE_OK,
1144  static_cast<FwAssertArgType>(_status)
1145  );
1146 
1147  _status = msg.serializeFrom(cmdSeq);
1148  FW_ASSERT (
1149  _status == Fw::FW_SERIALIZE_OK,
1150  static_cast<FwAssertArgType>(_status)
1151  );
1152 
1153  _status = msg.serializeFrom(args);
1154  FW_ASSERT (
1155  _status == Fw::FW_SERIALIZE_OK,
1156  static_cast<FwAssertArgType>(_status)
1157  );
1158 
1159  // Send message
1161  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1162 
1163  FW_ASSERT(
1164  qStatus == Os::Queue::OP_OK,
1165  static_cast<FwAssertArgType>(qStatus)
1166  );
1167  }
1168 
1169  // ----------------------------------------------------------------------
1170  // Pre-message hooks for async commands
1171  //
1172  // Each of these functions is invoked just before processing the
1173  // corresponding command. By default they do nothing. You can
1174  // override them to provide specific pre-command behavior.
1175  // ----------------------------------------------------------------------
1176 
1179  FwOpcodeType opCode,
1180  U32 cmdSeq
1181  )
1182  {
1183  // Defaults to no-op; can be overridden
1184  (void) opCode;
1185  (void) cmdSeq;
1186  }
1187 
1190  FwOpcodeType opCode,
1191  U32 cmdSeq
1192  )
1193  {
1194  // Defaults to no-op; can be overridden
1195  (void) opCode;
1196  (void) cmdSeq;
1197  }
1198 
1201  FwOpcodeType opCode,
1202  U32 cmdSeq
1203  )
1204  {
1205  // Defaults to no-op; can be overridden
1206  (void) opCode;
1207  (void) cmdSeq;
1208  }
1209 
1210  // ----------------------------------------------------------------------
1211  // Event logging functions
1212  // ----------------------------------------------------------------------
1213 
1216  {
1217  // Check throttle value
1218  if (this->m_PrmIdNotFoundThrottle >= EVENTID_PRMIDNOTFOUND_THROTTLE) {
1219  return;
1220  }
1221  else {
1222  this->m_PrmIdNotFoundThrottle++;
1223  }
1224 
1225  // Get the time
1226  Fw::Time _logTime;
1227  if (this->isConnected_Time_OutputPort(0)) {
1228  this->Time_out(0, _logTime);
1229  }
1230 
1231  const FwEventIdType _id = this->getIdBase() + EVENTID_PRMIDNOTFOUND;
1232 
1233  // Emit the event on the log port
1234  if (this->isConnected_Log_OutputPort(0)) {
1235  Fw::LogBuffer _logBuff;
1237 
1238 #if FW_AMPCS_COMPATIBLE
1239  // Serialize the number of arguments
1240  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1241  FW_ASSERT(
1242  _status == Fw::FW_SERIALIZE_OK,
1243  static_cast<FwAssertArgType>(_status)
1244  );
1245 #endif
1246 
1247 #if FW_AMPCS_COMPATIBLE
1248  // Serialize the argument size
1249  _status = _logBuff.serializeFrom(
1250  static_cast<U8>(sizeof(FwPrmIdType))
1251  );
1252  FW_ASSERT(
1253  _status == Fw::FW_SERIALIZE_OK,
1254  static_cast<FwAssertArgType>(_status)
1255  );
1256 #endif
1257  _status = _logBuff.serializeFrom(Id);
1258  FW_ASSERT(
1259  _status == Fw::FW_SERIALIZE_OK,
1260  static_cast<FwAssertArgType>(_status)
1261  );
1262 
1263  this->Log_out(
1264  0,
1265  _id,
1266  _logTime,
1268  _logBuff
1269  );
1270  }
1271 
1272  // Emit the event on the text log port
1273 #if FW_ENABLE_TEXT_LOGGING
1274  if (this->isConnected_LogText_OutputPort(0)) {
1275 #if FW_OBJECT_NAMES == 1
1276  const char* _formatString =
1277  "(%s) %s: Parameter ID 0x%" PRIx32 " not found";
1278 #else
1279  const char* _formatString =
1280  "%s: Parameter ID 0x%" PRIx32 " not found";
1281 #endif
1282 
1283  Fw::TextLogString _logString;
1284  (void) _logString.format(
1285  _formatString,
1286 #if FW_OBJECT_NAMES == 1
1287  this->m_objName.toChar(),
1288 #endif
1289  "PrmIdNotFound ",
1290  Id
1291  );
1292 
1293  this->LogText_out(
1294  0,
1295  _id,
1296  _logTime,
1298  _logString
1299  );
1300  }
1301 #endif
1302  }
1303 
1306  {
1307  // Get the time
1308  Fw::Time _logTime;
1309  if (this->isConnected_Time_OutputPort(0)) {
1310  this->Time_out(0, _logTime);
1311  }
1312 
1313  const FwEventIdType _id = this->getIdBase() + EVENTID_PRMIDUPDATED;
1314 
1315  // Emit the event on the log port
1316  if (this->isConnected_Log_OutputPort(0)) {
1317  Fw::LogBuffer _logBuff;
1319 
1320 #if FW_AMPCS_COMPATIBLE
1321  // Serialize the number of arguments
1322  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1323  FW_ASSERT(
1324  _status == Fw::FW_SERIALIZE_OK,
1325  static_cast<FwAssertArgType>(_status)
1326  );
1327 #endif
1328 
1329 #if FW_AMPCS_COMPATIBLE
1330  // Serialize the argument size
1331  _status = _logBuff.serializeFrom(
1332  static_cast<U8>(sizeof(FwPrmIdType))
1333  );
1334  FW_ASSERT(
1335  _status == Fw::FW_SERIALIZE_OK,
1336  static_cast<FwAssertArgType>(_status)
1337  );
1338 #endif
1339  _status = _logBuff.serializeFrom(Id);
1340  FW_ASSERT(
1341  _status == Fw::FW_SERIALIZE_OK,
1342  static_cast<FwAssertArgType>(_status)
1343  );
1344 
1345  this->Log_out(
1346  0,
1347  _id,
1348  _logTime,
1350  _logBuff
1351  );
1352  }
1353 
1354  // Emit the event on the text log port
1355 #if FW_ENABLE_TEXT_LOGGING
1356  if (this->isConnected_LogText_OutputPort(0)) {
1357 #if FW_OBJECT_NAMES == 1
1358  const char* _formatString =
1359  "(%s) %s: Parameter ID 0x%" PRIx32 " updated";
1360 #else
1361  const char* _formatString =
1362  "%s: Parameter ID 0x%" PRIx32 " updated";
1363 #endif
1364 
1365  Fw::TextLogString _logString;
1366  (void) _logString.format(
1367  _formatString,
1368 #if FW_OBJECT_NAMES == 1
1369  this->m_objName.toChar(),
1370 #endif
1371  "PrmIdUpdated ",
1372  Id
1373  );
1374 
1375  this->LogText_out(
1376  0,
1377  _id,
1378  _logTime,
1380  _logString
1381  );
1382  }
1383 #endif
1384  }
1385 
1388  {
1389  // Get the time
1390  Fw::Time _logTime;
1391  if (this->isConnected_Time_OutputPort(0)) {
1392  this->Time_out(0, _logTime);
1393  }
1394 
1395  const FwEventIdType _id = this->getIdBase() + EVENTID_PRMDBFULL;
1396 
1397  // Emit the event on the log port
1398  if (this->isConnected_Log_OutputPort(0)) {
1399  Fw::LogBuffer _logBuff;
1401 
1402 #if FW_AMPCS_COMPATIBLE
1403  // Serialize the number of arguments
1404  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1405  FW_ASSERT(
1406  _status == Fw::FW_SERIALIZE_OK,
1407  static_cast<FwAssertArgType>(_status)
1408  );
1409 #endif
1410 
1411 #if FW_AMPCS_COMPATIBLE
1412  // Serialize the argument size
1413  _status = _logBuff.serializeFrom(
1414  static_cast<U8>(sizeof(FwPrmIdType))
1415  );
1416  FW_ASSERT(
1417  _status == Fw::FW_SERIALIZE_OK,
1418  static_cast<FwAssertArgType>(_status)
1419  );
1420 #endif
1421  _status = _logBuff.serializeFrom(Id);
1422  FW_ASSERT(
1423  _status == Fw::FW_SERIALIZE_OK,
1424  static_cast<FwAssertArgType>(_status)
1425  );
1426 
1427  this->Log_out(
1428  0,
1429  _id,
1430  _logTime,
1432  _logBuff
1433  );
1434  }
1435 
1436  // Emit the event on the text log port
1437 #if FW_ENABLE_TEXT_LOGGING
1438  if (this->isConnected_LogText_OutputPort(0)) {
1439 #if FW_OBJECT_NAMES == 1
1440  const char* _formatString =
1441  "(%s) %s: Parameter DB full when adding ID 0x%" PRIx32 " ";
1442 #else
1443  const char* _formatString =
1444  "%s: Parameter DB full when adding ID 0x%" PRIx32 " ";
1445 #endif
1446 
1447  Fw::TextLogString _logString;
1448  (void) _logString.format(
1449  _formatString,
1450 #if FW_OBJECT_NAMES == 1
1451  this->m_objName.toChar(),
1452 #endif
1453  "PrmDbFull ",
1454  Id
1455  );
1456 
1457  this->LogText_out(
1458  0,
1459  _id,
1460  _logTime,
1462  _logString
1463  );
1464  }
1465 #endif
1466  }
1467 
1470  {
1471  // Get the time
1472  Fw::Time _logTime;
1473  if (this->isConnected_Time_OutputPort(0)) {
1474  this->Time_out(0, _logTime);
1475  }
1476 
1477  const FwEventIdType _id = this->getIdBase() + EVENTID_PRMIDADDED;
1478 
1479  // Emit the event on the log port
1480  if (this->isConnected_Log_OutputPort(0)) {
1481  Fw::LogBuffer _logBuff;
1483 
1484 #if FW_AMPCS_COMPATIBLE
1485  // Serialize the number of arguments
1486  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1487  FW_ASSERT(
1488  _status == Fw::FW_SERIALIZE_OK,
1489  static_cast<FwAssertArgType>(_status)
1490  );
1491 #endif
1492 
1493 #if FW_AMPCS_COMPATIBLE
1494  // Serialize the argument size
1495  _status = _logBuff.serializeFrom(
1496  static_cast<U8>(sizeof(FwPrmIdType))
1497  );
1498  FW_ASSERT(
1499  _status == Fw::FW_SERIALIZE_OK,
1500  static_cast<FwAssertArgType>(_status)
1501  );
1502 #endif
1503  _status = _logBuff.serializeFrom(Id);
1504  FW_ASSERT(
1505  _status == Fw::FW_SERIALIZE_OK,
1506  static_cast<FwAssertArgType>(_status)
1507  );
1508 
1509  this->Log_out(
1510  0,
1511  _id,
1512  _logTime,
1514  _logBuff
1515  );
1516  }
1517 
1518  // Emit the event on the text log port
1519 #if FW_ENABLE_TEXT_LOGGING
1520  if (this->isConnected_LogText_OutputPort(0)) {
1521 #if FW_OBJECT_NAMES == 1
1522  const char* _formatString =
1523  "(%s) %s: Parameter ID 0x%" PRIx32 " added";
1524 #else
1525  const char* _formatString =
1526  "%s: Parameter ID 0x%" PRIx32 " added";
1527 #endif
1528 
1529  Fw::TextLogString _logString;
1530  (void) _logString.format(
1531  _formatString,
1532 #if FW_OBJECT_NAMES == 1
1533  this->m_objName.toChar(),
1534 #endif
1535  "PrmIdAdded ",
1536  Id
1537  );
1538 
1539  this->LogText_out(
1540  0,
1541  _id,
1542  _logTime,
1544  _logString
1545  );
1546  }
1547 #endif
1548  }
1549 
1552  const Svc::PrmDb_PrmWriteError& stage,
1553  I32 record,
1554  I32 error
1555  ) const
1556  {
1557  // Get the time
1558  Fw::Time _logTime;
1559  if (this->isConnected_Time_OutputPort(0)) {
1560  this->Time_out(0, _logTime);
1561  }
1562 
1563  const FwEventIdType _id = this->getIdBase() + EVENTID_PRMFILEWRITEERROR;
1564 
1565  // Emit the event on the log port
1566  if (this->isConnected_Log_OutputPort(0)) {
1567  Fw::LogBuffer _logBuff;
1569 
1570 #if FW_AMPCS_COMPATIBLE
1571  // Serialize the number of arguments
1572  _status = _logBuff.serializeFrom(static_cast<U8>(3));
1573  FW_ASSERT(
1574  _status == Fw::FW_SERIALIZE_OK,
1575  static_cast<FwAssertArgType>(_status)
1576  );
1577 #endif
1578 
1579 #if FW_AMPCS_COMPATIBLE
1580  // Serialize the argument size
1581  _status = _logBuff.serializeFrom(
1583  );
1584  FW_ASSERT(
1585  _status == Fw::FW_SERIALIZE_OK,
1586  static_cast<FwAssertArgType>(_status)
1587  );
1588 #endif
1589  _status = _logBuff.serializeFrom(stage);
1590  FW_ASSERT(
1591  _status == Fw::FW_SERIALIZE_OK,
1592  static_cast<FwAssertArgType>(_status)
1593  );
1594 
1595 #if FW_AMPCS_COMPATIBLE
1596  // Serialize the argument size
1597  _status = _logBuff.serializeFrom(
1598  static_cast<U8>(sizeof(I32))
1599  );
1600  FW_ASSERT(
1601  _status == Fw::FW_SERIALIZE_OK,
1602  static_cast<FwAssertArgType>(_status)
1603  );
1604 #endif
1605  _status = _logBuff.serializeFrom(record);
1606  FW_ASSERT(
1607  _status == Fw::FW_SERIALIZE_OK,
1608  static_cast<FwAssertArgType>(_status)
1609  );
1610 
1611 #if FW_AMPCS_COMPATIBLE
1612  // Serialize the argument size
1613  _status = _logBuff.serializeFrom(
1614  static_cast<U8>(sizeof(I32))
1615  );
1616  FW_ASSERT(
1617  _status == Fw::FW_SERIALIZE_OK,
1618  static_cast<FwAssertArgType>(_status)
1619  );
1620 #endif
1621  _status = _logBuff.serializeFrom(error);
1622  FW_ASSERT(
1623  _status == Fw::FW_SERIALIZE_OK,
1624  static_cast<FwAssertArgType>(_status)
1625  );
1626 
1627  this->Log_out(
1628  0,
1629  _id,
1630  _logTime,
1632  _logBuff
1633  );
1634  }
1635 
1636  // Emit the event on the text log port
1637 #if FW_ENABLE_TEXT_LOGGING
1638  if (this->isConnected_LogText_OutputPort(0)) {
1639 #if FW_OBJECT_NAMES == 1
1640  const char* _formatString =
1641  "(%s) %s: Parameter write failed in stage %s with record %" PRIi32 " and error %" PRIi32 "";
1642 #else
1643  const char* _formatString =
1644  "%s: Parameter write failed in stage %s with record %" PRIi32 " and error %" PRIi32 "";
1645 #endif
1646 
1647  Fw::String stageStr;
1648  stage.toString(stageStr);
1649 
1650  Fw::TextLogString _logString;
1651  (void) _logString.format(
1652  _formatString,
1653 #if FW_OBJECT_NAMES == 1
1654  this->m_objName.toChar(),
1655 #endif
1656  "PrmFileWriteError ",
1657  stageStr.toChar(),
1658  record,
1659  error
1660  );
1661 
1662  this->LogText_out(
1663  0,
1664  _id,
1665  _logTime,
1667  _logString
1668  );
1669  }
1670 #endif
1671  }
1672 
1675  {
1676  // Get the time
1677  Fw::Time _logTime;
1678  if (this->isConnected_Time_OutputPort(0)) {
1679  this->Time_out(0, _logTime);
1680  }
1681 
1682  const FwEventIdType _id = this->getIdBase() + EVENTID_PRMFILESAVECOMPLETE;
1683 
1684  // Emit the event on the log port
1685  if (this->isConnected_Log_OutputPort(0)) {
1686  Fw::LogBuffer _logBuff;
1688 
1689 #if FW_AMPCS_COMPATIBLE
1690  // Serialize the number of arguments
1691  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1692  FW_ASSERT(
1693  _status == Fw::FW_SERIALIZE_OK,
1694  static_cast<FwAssertArgType>(_status)
1695  );
1696 #endif
1697 
1698 #if FW_AMPCS_COMPATIBLE
1699  // Serialize the argument size
1700  _status = _logBuff.serializeFrom(
1701  static_cast<U8>(sizeof(U32))
1702  );
1703  FW_ASSERT(
1704  _status == Fw::FW_SERIALIZE_OK,
1705  static_cast<FwAssertArgType>(_status)
1706  );
1707 #endif
1708  _status = _logBuff.serializeFrom(records);
1709  FW_ASSERT(
1710  _status == Fw::FW_SERIALIZE_OK,
1711  static_cast<FwAssertArgType>(_status)
1712  );
1713 
1714  this->Log_out(
1715  0,
1716  _id,
1717  _logTime,
1719  _logBuff
1720  );
1721  }
1722 
1723  // Emit the event on the text log port
1724 #if FW_ENABLE_TEXT_LOGGING
1725  if (this->isConnected_LogText_OutputPort(0)) {
1726 #if FW_OBJECT_NAMES == 1
1727  const char* _formatString =
1728  "(%s) %s: Parameter file save completed. Wrote %" PRIu32 " records.";
1729 #else
1730  const char* _formatString =
1731  "%s: Parameter file save completed. Wrote %" PRIu32 " records.";
1732 #endif
1733 
1734  Fw::TextLogString _logString;
1735  (void) _logString.format(
1736  _formatString,
1737 #if FW_OBJECT_NAMES == 1
1738  this->m_objName.toChar(),
1739 #endif
1740  "PrmFileSaveComplete ",
1741  records
1742  );
1743 
1744  this->LogText_out(
1745  0,
1746  _id,
1747  _logTime,
1749  _logString
1750  );
1751  }
1752 #endif
1753  }
1754 
1757  const Svc::PrmDb_PrmReadError& stage,
1758  I32 record,
1759  I32 error
1760  ) const
1761  {
1762  // Get the time
1763  Fw::Time _logTime;
1764  if (this->isConnected_Time_OutputPort(0)) {
1765  this->Time_out(0, _logTime);
1766  }
1767 
1768  const FwEventIdType _id = this->getIdBase() + EVENTID_PRMFILEREADERROR;
1769 
1770  // Emit the event on the log port
1771  if (this->isConnected_Log_OutputPort(0)) {
1772  Fw::LogBuffer _logBuff;
1774 
1775 #if FW_AMPCS_COMPATIBLE
1776  // Serialize the number of arguments
1777  _status = _logBuff.serializeFrom(static_cast<U8>(3));
1778  FW_ASSERT(
1779  _status == Fw::FW_SERIALIZE_OK,
1780  static_cast<FwAssertArgType>(_status)
1781  );
1782 #endif
1783 
1784 #if FW_AMPCS_COMPATIBLE
1785  // Serialize the argument size
1786  _status = _logBuff.serializeFrom(
1788  );
1789  FW_ASSERT(
1790  _status == Fw::FW_SERIALIZE_OK,
1791  static_cast<FwAssertArgType>(_status)
1792  );
1793 #endif
1794  _status = _logBuff.serializeFrom(stage);
1795  FW_ASSERT(
1796  _status == Fw::FW_SERIALIZE_OK,
1797  static_cast<FwAssertArgType>(_status)
1798  );
1799 
1800 #if FW_AMPCS_COMPATIBLE
1801  // Serialize the argument size
1802  _status = _logBuff.serializeFrom(
1803  static_cast<U8>(sizeof(I32))
1804  );
1805  FW_ASSERT(
1806  _status == Fw::FW_SERIALIZE_OK,
1807  static_cast<FwAssertArgType>(_status)
1808  );
1809 #endif
1810  _status = _logBuff.serializeFrom(record);
1811  FW_ASSERT(
1812  _status == Fw::FW_SERIALIZE_OK,
1813  static_cast<FwAssertArgType>(_status)
1814  );
1815 
1816 #if FW_AMPCS_COMPATIBLE
1817  // Serialize the argument size
1818  _status = _logBuff.serializeFrom(
1819  static_cast<U8>(sizeof(I32))
1820  );
1821  FW_ASSERT(
1822  _status == Fw::FW_SERIALIZE_OK,
1823  static_cast<FwAssertArgType>(_status)
1824  );
1825 #endif
1826  _status = _logBuff.serializeFrom(error);
1827  FW_ASSERT(
1828  _status == Fw::FW_SERIALIZE_OK,
1829  static_cast<FwAssertArgType>(_status)
1830  );
1831 
1832  this->Log_out(
1833  0,
1834  _id,
1835  _logTime,
1837  _logBuff
1838  );
1839  }
1840 
1841  // Emit the event on the text log port
1842 #if FW_ENABLE_TEXT_LOGGING
1843  if (this->isConnected_LogText_OutputPort(0)) {
1844 #if FW_OBJECT_NAMES == 1
1845  const char* _formatString =
1846  "(%s) %s: Parameter file read failed in stage %s with record %" PRIi32 " and error %" PRIi32 "";
1847 #else
1848  const char* _formatString =
1849  "%s: Parameter file read failed in stage %s with record %" PRIi32 " and error %" PRIi32 "";
1850 #endif
1851 
1852  Fw::String stageStr;
1853  stage.toString(stageStr);
1854 
1855  Fw::TextLogString _logString;
1856  (void) _logString.format(
1857  _formatString,
1858 #if FW_OBJECT_NAMES == 1
1859  this->m_objName.toChar(),
1860 #endif
1861  "PrmFileReadError ",
1862  stageStr.toChar(),
1863  record,
1864  error
1865  );
1866 
1867  this->LogText_out(
1868  0,
1869  _id,
1870  _logTime,
1872  _logString
1873  );
1874  }
1875 #endif
1876  }
1877 
1880  const Fw::StringBase& databaseString,
1881  U32 recordsTotal,
1882  U32 recordsAdded,
1883  U32 recordsUpdated
1884  ) const
1885  {
1886  // Get the time
1887  Fw::Time _logTime;
1888  if (this->isConnected_Time_OutputPort(0)) {
1889  this->Time_out(0, _logTime);
1890  }
1891 
1892  const FwEventIdType _id = this->getIdBase() + EVENTID_PRMFILELOADCOMPLETE;
1893 
1894  // Emit the event on the log port
1895  if (this->isConnected_Log_OutputPort(0)) {
1896  Fw::LogBuffer _logBuff;
1898 
1899 #if FW_AMPCS_COMPATIBLE
1900  // Serialize the number of arguments
1901  _status = _logBuff.serializeFrom(static_cast<U8>(4));
1902  FW_ASSERT(
1903  _status == Fw::FW_SERIALIZE_OK,
1904  static_cast<FwAssertArgType>(_status)
1905  );
1906 #endif
1907 
1908  _status = databaseString.serializeTo(
1909  _logBuff,
1910  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), static_cast<FwSizeType>(FW_FIXED_LENGTH_STRING_SIZE))
1911  );
1912  FW_ASSERT(
1913  _status == Fw::FW_SERIALIZE_OK,
1914  static_cast<FwAssertArgType>(_status)
1915  );
1916 
1917 #if FW_AMPCS_COMPATIBLE
1918  // Serialize the argument size
1919  _status = _logBuff.serializeFrom(
1920  static_cast<U8>(sizeof(U32))
1921  );
1922  FW_ASSERT(
1923  _status == Fw::FW_SERIALIZE_OK,
1924  static_cast<FwAssertArgType>(_status)
1925  );
1926 #endif
1927  _status = _logBuff.serializeFrom(recordsTotal);
1928  FW_ASSERT(
1929  _status == Fw::FW_SERIALIZE_OK,
1930  static_cast<FwAssertArgType>(_status)
1931  );
1932 
1933 #if FW_AMPCS_COMPATIBLE
1934  // Serialize the argument size
1935  _status = _logBuff.serializeFrom(
1936  static_cast<U8>(sizeof(U32))
1937  );
1938  FW_ASSERT(
1939  _status == Fw::FW_SERIALIZE_OK,
1940  static_cast<FwAssertArgType>(_status)
1941  );
1942 #endif
1943  _status = _logBuff.serializeFrom(recordsAdded);
1944  FW_ASSERT(
1945  _status == Fw::FW_SERIALIZE_OK,
1946  static_cast<FwAssertArgType>(_status)
1947  );
1948 
1949 #if FW_AMPCS_COMPATIBLE
1950  // Serialize the argument size
1951  _status = _logBuff.serializeFrom(
1952  static_cast<U8>(sizeof(U32))
1953  );
1954  FW_ASSERT(
1955  _status == Fw::FW_SERIALIZE_OK,
1956  static_cast<FwAssertArgType>(_status)
1957  );
1958 #endif
1959  _status = _logBuff.serializeFrom(recordsUpdated);
1960  FW_ASSERT(
1961  _status == Fw::FW_SERIALIZE_OK,
1962  static_cast<FwAssertArgType>(_status)
1963  );
1964 
1965  this->Log_out(
1966  0,
1967  _id,
1968  _logTime,
1970  _logBuff
1971  );
1972  }
1973 
1974  // Emit the event on the text log port
1975 #if FW_ENABLE_TEXT_LOGGING
1976  if (this->isConnected_LogText_OutputPort(0)) {
1977 #if FW_OBJECT_NAMES == 1
1978  const char* _formatString =
1979  "(%s) %s: Parameter file load completed. Database: %s, Records: %" PRIu32 " (%" PRIu32 " added and %" PRIu32 " updated).";
1980 #else
1981  const char* _formatString =
1982  "%s: Parameter file load completed. Database: %s, Records: %" PRIu32 " (%" PRIu32 " added and %" PRIu32 " updated).";
1983 #endif
1984 
1985  Fw::TextLogString _logString;
1986  (void) _logString.format(
1987  _formatString,
1988 #if FW_OBJECT_NAMES == 1
1989  this->m_objName.toChar(),
1990 #endif
1991  "PrmFileLoadComplete ",
1992  databaseString.toChar(),
1993  recordsTotal,
1994  recordsAdded,
1995  recordsUpdated
1996  );
1997 
1998  this->LogText_out(
1999  0,
2000  _id,
2001  _logTime,
2003  _logString
2004  );
2005  }
2006 #endif
2007  }
2008 
2011  {
2012  // Get the time
2013  Fw::Time _logTime;
2014  if (this->isConnected_Time_OutputPort(0)) {
2015  this->Time_out(0, _logTime);
2016  }
2017 
2018  const FwEventIdType _id = this->getIdBase() + EVENTID_PRMDBCOMMITCOMPLETE;
2019 
2020  // Emit the event on the log port
2021  if (this->isConnected_Log_OutputPort(0)) {
2022  Fw::LogBuffer _logBuff;
2023 
2024 #if FW_AMPCS_COMPATIBLE
2026  // Serialize the number of arguments
2027  _status = _logBuff.serializeFrom(static_cast<U8>(0));
2028  FW_ASSERT(
2029  _status == Fw::FW_SERIALIZE_OK,
2030  static_cast<FwAssertArgType>(_status)
2031  );
2032 #endif
2033 
2034  this->Log_out(
2035  0,
2036  _id,
2037  _logTime,
2039  _logBuff
2040  );
2041  }
2042 
2043  // Emit the event on the text log port
2044 #if FW_ENABLE_TEXT_LOGGING
2045  if (this->isConnected_LogText_OutputPort(0)) {
2046 #if FW_OBJECT_NAMES == 1
2047  const char* _formatString =
2048  "(%s) %s: Parameter DB commit complete, staged updates are now active.";
2049 #else
2050  const char* _formatString =
2051  "%s: Parameter DB commit complete, staged updates are now active.";
2052 #endif
2053 
2054  Fw::TextLogString _logString;
2055  (void) _logString.format(
2056  _formatString,
2057 #if FW_OBJECT_NAMES == 1
2058  this->m_objName.toChar(),
2059 #endif
2060  "PrmDbCommitComplete "
2061  );
2062 
2063  this->LogText_out(
2064  0,
2065  _id,
2066  _logTime,
2068  _logString
2069  );
2070  }
2071 #endif
2072  }
2073 
2076  const Fw::StringBase& databaseStringSrc,
2077  const Fw::StringBase& databaseStringDest
2078  ) const
2079  {
2080  // Get the time
2081  Fw::Time _logTime;
2082  if (this->isConnected_Time_OutputPort(0)) {
2083  this->Time_out(0, _logTime);
2084  }
2085 
2087 
2088  // Emit the event on the log port
2089  if (this->isConnected_Log_OutputPort(0)) {
2090  Fw::LogBuffer _logBuff;
2092 
2093 #if FW_AMPCS_COMPATIBLE
2094  // Serialize the number of arguments
2095  _status = _logBuff.serializeFrom(static_cast<U8>(2));
2096  FW_ASSERT(
2097  _status == Fw::FW_SERIALIZE_OK,
2098  static_cast<FwAssertArgType>(_status)
2099  );
2100 #endif
2101 
2102  _status = databaseStringSrc.serializeTo(
2103  _logBuff,
2104  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), static_cast<FwSizeType>(FW_FIXED_LENGTH_STRING_SIZE))
2105  );
2106  FW_ASSERT(
2107  _status == Fw::FW_SERIALIZE_OK,
2108  static_cast<FwAssertArgType>(_status)
2109  );
2110 
2111  _status = databaseStringDest.serializeTo(
2112  _logBuff,
2113  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), static_cast<FwSizeType>(FW_FIXED_LENGTH_STRING_SIZE))
2114  );
2115  FW_ASSERT(
2116  _status == Fw::FW_SERIALIZE_OK,
2117  static_cast<FwAssertArgType>(_status)
2118  );
2119 
2120  this->Log_out(
2121  0,
2122  _id,
2123  _logTime,
2125  _logBuff
2126  );
2127  }
2128 
2129  // Emit the event on the text log port
2130 #if FW_ENABLE_TEXT_LOGGING
2131  if (this->isConnected_LogText_OutputPort(0)) {
2132 #if FW_OBJECT_NAMES == 1
2133  const char* _formatString =
2134  "(%s) %s: All parameters copied. Source database: %s, Destination database: %s.";
2135 #else
2136  const char* _formatString =
2137  "%s: All parameters copied. Source database: %s, Destination database: %s.";
2138 #endif
2139 
2140  Fw::TextLogString _logString;
2141  (void) _logString.format(
2142  _formatString,
2143 #if FW_OBJECT_NAMES == 1
2144  this->m_objName.toChar(),
2145 #endif
2146  "PrmDbCopyAllComplete ",
2147  databaseStringSrc.toChar(),
2148  databaseStringDest.toChar()
2149  );
2150 
2151  this->LogText_out(
2152  0,
2153  _id,
2154  _logTime,
2156  _logString
2157  );
2158  }
2159 #endif
2160  }
2161 
2164  {
2165  // Get the time
2166  Fw::Time _logTime;
2167  if (this->isConnected_Time_OutputPort(0)) {
2168  this->Time_out(0, _logTime);
2169  }
2170 
2171  const FwEventIdType _id = this->getIdBase() + EVENTID_PRMDBFILELOADFAILED;
2172 
2173  // Emit the event on the log port
2174  if (this->isConnected_Log_OutputPort(0)) {
2175  Fw::LogBuffer _logBuff;
2176 
2177 #if FW_AMPCS_COMPATIBLE
2179  // Serialize the number of arguments
2180  _status = _logBuff.serializeFrom(static_cast<U8>(0));
2181  FW_ASSERT(
2182  _status == Fw::FW_SERIALIZE_OK,
2183  static_cast<FwAssertArgType>(_status)
2184  );
2185 #endif
2186 
2187  this->Log_out(
2188  0,
2189  _id,
2190  _logTime,
2192  _logBuff
2193  );
2194  }
2195 
2196  // Emit the event on the text log port
2197 #if FW_ENABLE_TEXT_LOGGING
2198  if (this->isConnected_LogText_OutputPort(0)) {
2199 #if FW_OBJECT_NAMES == 1
2200  const char* _formatString =
2201  "(%s) %s: Parameter file load failed. Clearing staging database and abandoning parameter file load.";
2202 #else
2203  const char* _formatString =
2204  "%s: Parameter file load failed. Clearing staging database and abandoning parameter file load.";
2205 #endif
2206 
2207  Fw::TextLogString _logString;
2208  (void) _logString.format(
2209  _formatString,
2210 #if FW_OBJECT_NAMES == 1
2211  this->m_objName.toChar(),
2212 #endif
2213  "PrmDbFileLoadFailed "
2214  );
2215 
2216  this->LogText_out(
2217  0,
2218  _id,
2219  _logTime,
2221  _logString
2222  );
2223  }
2224 #endif
2225  }
2226 
2229  const Svc::PrmDb_PrmDbFileLoadState& currentState,
2230  const Svc::PrmDb_PrmLoadAction& attemptedAction
2231  ) const
2232  {
2233  // Get the time
2234  Fw::Time _logTime;
2235  if (this->isConnected_Time_OutputPort(0)) {
2236  this->Time_out(0, _logTime);
2237  }
2238 
2240 
2241  // Emit the event on the log port
2242  if (this->isConnected_Log_OutputPort(0)) {
2243  Fw::LogBuffer _logBuff;
2245 
2246 #if FW_AMPCS_COMPATIBLE
2247  // Serialize the number of arguments
2248  _status = _logBuff.serializeFrom(static_cast<U8>(2));
2249  FW_ASSERT(
2250  _status == Fw::FW_SERIALIZE_OK,
2251  static_cast<FwAssertArgType>(_status)
2252  );
2253 #endif
2254 
2255 #if FW_AMPCS_COMPATIBLE
2256  // Serialize the argument size
2257  _status = _logBuff.serializeFrom(
2259  );
2260  FW_ASSERT(
2261  _status == Fw::FW_SERIALIZE_OK,
2262  static_cast<FwAssertArgType>(_status)
2263  );
2264 #endif
2265  _status = _logBuff.serializeFrom(currentState);
2266  FW_ASSERT(
2267  _status == Fw::FW_SERIALIZE_OK,
2268  static_cast<FwAssertArgType>(_status)
2269  );
2270 
2271 #if FW_AMPCS_COMPATIBLE
2272  // Serialize the argument size
2273  _status = _logBuff.serializeFrom(
2275  );
2276  FW_ASSERT(
2277  _status == Fw::FW_SERIALIZE_OK,
2278  static_cast<FwAssertArgType>(_status)
2279  );
2280 #endif
2281  _status = _logBuff.serializeFrom(attemptedAction);
2282  FW_ASSERT(
2283  _status == Fw::FW_SERIALIZE_OK,
2284  static_cast<FwAssertArgType>(_status)
2285  );
2286 
2287  this->Log_out(
2288  0,
2289  _id,
2290  _logTime,
2292  _logBuff
2293  );
2294  }
2295 
2296  // Emit the event on the text log port
2297 #if FW_ENABLE_TEXT_LOGGING
2298  if (this->isConnected_LogText_OutputPort(0)) {
2299 #if FW_OBJECT_NAMES == 1
2300  const char* _formatString =
2301  "(%s) %s: Invalid action during parameter file load. Current state: %s, Action (Invalid for current state): %s.";
2302 #else
2303  const char* _formatString =
2304  "%s: Invalid action during parameter file load. Current state: %s, Action (Invalid for current state): %s.";
2305 #endif
2306 
2307  Fw::String currentStateStr;
2308  currentState.toString(currentStateStr);
2309  Fw::String attemptedActionStr;
2310  attemptedAction.toString(attemptedActionStr);
2311 
2312  Fw::TextLogString _logString;
2313  (void) _logString.format(
2314  _formatString,
2315 #if FW_OBJECT_NAMES == 1
2316  this->m_objName.toChar(),
2317 #endif
2318  "PrmDbFileLoadInvalidAction ",
2319  currentStateStr.toChar(),
2320  attemptedActionStr.toChar()
2321  );
2322 
2323  this->LogText_out(
2324  0,
2325  _id,
2326  _logTime,
2328  _logString
2329  );
2330  }
2331 #endif
2332  }
2333 
2336  U32 readCrc,
2337  U32 compCrc
2338  ) const
2339  {
2340  // Get the time
2341  Fw::Time _logTime;
2342  if (this->isConnected_Time_OutputPort(0)) {
2343  this->Time_out(0, _logTime);
2344  }
2345 
2346  const FwEventIdType _id = this->getIdBase() + EVENTID_PRMFILEBADCRC;
2347 
2348  // Emit the event on the log port
2349  if (this->isConnected_Log_OutputPort(0)) {
2350  Fw::LogBuffer _logBuff;
2352 
2353 #if FW_AMPCS_COMPATIBLE
2354  // Serialize the number of arguments
2355  _status = _logBuff.serializeFrom(static_cast<U8>(2));
2356  FW_ASSERT(
2357  _status == Fw::FW_SERIALIZE_OK,
2358  static_cast<FwAssertArgType>(_status)
2359  );
2360 #endif
2361 
2362 #if FW_AMPCS_COMPATIBLE
2363  // Serialize the argument size
2364  _status = _logBuff.serializeFrom(
2365  static_cast<U8>(sizeof(U32))
2366  );
2367  FW_ASSERT(
2368  _status == Fw::FW_SERIALIZE_OK,
2369  static_cast<FwAssertArgType>(_status)
2370  );
2371 #endif
2372  _status = _logBuff.serializeFrom(readCrc);
2373  FW_ASSERT(
2374  _status == Fw::FW_SERIALIZE_OK,
2375  static_cast<FwAssertArgType>(_status)
2376  );
2377 
2378 #if FW_AMPCS_COMPATIBLE
2379  // Serialize the argument size
2380  _status = _logBuff.serializeFrom(
2381  static_cast<U8>(sizeof(U32))
2382  );
2383  FW_ASSERT(
2384  _status == Fw::FW_SERIALIZE_OK,
2385  static_cast<FwAssertArgType>(_status)
2386  );
2387 #endif
2388  _status = _logBuff.serializeFrom(compCrc);
2389  FW_ASSERT(
2390  _status == Fw::FW_SERIALIZE_OK,
2391  static_cast<FwAssertArgType>(_status)
2392  );
2393 
2394  this->Log_out(
2395  0,
2396  _id,
2397  _logTime,
2399  _logBuff
2400  );
2401  }
2402 
2403  // Emit the event on the text log port
2404 #if FW_ENABLE_TEXT_LOGGING
2405  if (this->isConnected_LogText_OutputPort(0)) {
2406 #if FW_OBJECT_NAMES == 1
2407  const char* _formatString =
2408  "(%s) %s: Parameter file failed CRC. Read: 0x%" PRIx32 " Computed: 0x%" PRIx32 "";
2409 #else
2410  const char* _formatString =
2411  "%s: Parameter file failed CRC. Read: 0x%" PRIx32 " Computed: 0x%" PRIx32 "";
2412 #endif
2413 
2414  Fw::TextLogString _logString;
2415  (void) _logString.format(
2416  _formatString,
2417 #if FW_OBJECT_NAMES == 1
2418  this->m_objName.toChar(),
2419 #endif
2420  "PrmFileBadCrc ",
2421  readCrc,
2422  compCrc
2423  );
2424 
2425  this->LogText_out(
2426  0,
2427  _id,
2428  _logTime,
2430  _logString
2431  );
2432  }
2433 #endif
2434  }
2435 
2436  // ----------------------------------------------------------------------
2437  // Event throttle reset functions
2438  // ----------------------------------------------------------------------
2439 
2442  {
2443  // Reset throttle counter
2444  this->m_PrmIdNotFoundThrottle = 0;
2445  }
2446 
2447  // ----------------------------------------------------------------------
2448  // Time
2449  // ----------------------------------------------------------------------
2450 
2452  getTime() const
2453  {
2454  if (this->isConnected_Time_OutputPort(0)) {
2455  Fw::Time _time;
2456  this->Time_out(0, _time);
2457  return _time;
2458  }
2459  else {
2460  return Fw::Time(TimeBase::TB_NONE, 0, 0);
2461  }
2462  }
2463 
2464  // ----------------------------------------------------------------------
2465  // Mutex operations for guarded ports
2466  //
2467  // You can override these operations to provide more sophisticated
2468  // synchronization
2469  // ----------------------------------------------------------------------
2470 
2473  {
2474  this->m_guardedPortMutex.lock();
2475  }
2476 
2479  {
2480  this->m_guardedPortMutex.unLock();
2481  }
2482 
2483  // ----------------------------------------------------------------------
2484  // Message dispatch functions
2485  // ----------------------------------------------------------------------
2486 
2487  Fw::QueuedComponentBase::MsgDispatchStatus PrmDbComponentBase ::
2488  doDispatch()
2489  {
2490  ComponentIpcSerializableBuffer _msg;
2491  FwQueuePriorityType _priority = 0;
2492 
2493  Os::Queue::Status _msgStatus = this->m_queue.receive(
2494  _msg,
2496  _priority
2497  );
2498  FW_ASSERT(
2499  _msgStatus == Os::Queue::OP_OK,
2500  static_cast<FwAssertArgType>(_msgStatus)
2501  );
2502 
2503  // Reset to beginning of buffer
2504  _msg.resetDeser();
2505 
2506  FwEnumStoreType _desMsg = 0;
2507  Fw::SerializeStatus _deserStatus = _msg.deserializeTo(_desMsg);
2508  FW_ASSERT(
2509  _deserStatus == Fw::FW_SERIALIZE_OK,
2510  static_cast<FwAssertArgType>(_deserStatus)
2511  );
2512 
2513  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
2514 
2515  if (_msgType == PRMDB_COMPONENT_EXIT) {
2516  return MSG_DISPATCH_EXIT;
2517  }
2518 
2519  FwIndexType portNum = 0;
2520  _deserStatus = _msg.deserializeTo(portNum);
2521  FW_ASSERT(
2522  _deserStatus == Fw::FW_SERIALIZE_OK,
2523  static_cast<FwAssertArgType>(_deserStatus)
2524  );
2525 
2526  switch (_msgType) {
2527  // Handle async input port pingIn
2528  case PINGIN_PING: {
2529  // Deserialize argument key
2530  U32 key;
2531  _deserStatus = _msg.deserializeTo(key);
2532  FW_ASSERT(
2533  _deserStatus == Fw::FW_SERIALIZE_OK,
2534  static_cast<FwAssertArgType>(_deserStatus)
2535  );
2536  // Call handler function
2537  this->pingIn_handler(
2538  portNum,
2539  key
2540  );
2541 
2542  break;
2543  }
2544 
2545  // Handle async input port setPrm
2546  case SETPRM_PRMSET: {
2547  // Deserialize argument id
2548  FwPrmIdType id;
2549  _deserStatus = _msg.deserializeTo(id);
2550  FW_ASSERT(
2551  _deserStatus == Fw::FW_SERIALIZE_OK,
2552  static_cast<FwAssertArgType>(_deserStatus)
2553  );
2554 
2555  // Deserialize argument val
2556  Fw::ParamBuffer val;
2557  _deserStatus = _msg.deserializeTo(val);
2558  FW_ASSERT(
2559  _deserStatus == Fw::FW_SERIALIZE_OK,
2560  static_cast<FwAssertArgType>(_deserStatus)
2561  );
2562  // Call handler function
2563  this->setPrm_handler(
2564  portNum,
2565  id,
2566  val
2567  );
2568 
2569  break;
2570  }
2571 
2572  // Handle command PRM_SAVE_FILE
2573  case CMD_PRM_SAVE_FILE: {
2574  // Deserialize opcode
2575  FwOpcodeType _opCode = 0;
2576  _deserStatus = _msg.deserializeTo(_opCode);
2577  FW_ASSERT (
2578  _deserStatus == Fw::FW_SERIALIZE_OK,
2579  static_cast<FwAssertArgType>(_deserStatus)
2580  );
2581 
2582  // Deserialize command sequence
2583  U32 _cmdSeq = 0;
2584  _deserStatus = _msg.deserializeTo(_cmdSeq);
2585  FW_ASSERT (
2586  _deserStatus == Fw::FW_SERIALIZE_OK,
2587  static_cast<FwAssertArgType>(_deserStatus)
2588  );
2589 
2590  // Deserialize command argument buffer
2591  Fw::CmdArgBuffer args;
2592  _deserStatus = _msg.deserializeTo(args);
2593  FW_ASSERT (
2594  _deserStatus == Fw::FW_SERIALIZE_OK,
2595  static_cast<FwAssertArgType>(_deserStatus)
2596  );
2597 
2598  // Reset buffer
2599  args.resetDeser();
2600 
2601  // Make sure there was no data left over.
2602  // That means the argument buffer size was incorrect.
2603 #if FW_CMD_CHECK_RESIDUAL
2604  if (args.getDeserializeSizeLeft() != 0) {
2605  if (this->isConnected_CmdStatus_OutputPort(0)) {
2606  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2607  }
2608  // Don't crash the task if bad arguments were passed from the ground
2609  break;
2610  }
2611 #endif
2612 
2613  // Call handler function
2614  this->PRM_SAVE_FILE_cmdHandler(_opCode, _cmdSeq);
2615 
2616  break;
2617  }
2618 
2619  // Handle command PRM_LOAD_FILE
2620  case CMD_PRM_LOAD_FILE: {
2621  // Deserialize opcode
2622  FwOpcodeType _opCode = 0;
2623  _deserStatus = _msg.deserializeTo(_opCode);
2624  FW_ASSERT (
2625  _deserStatus == Fw::FW_SERIALIZE_OK,
2626  static_cast<FwAssertArgType>(_deserStatus)
2627  );
2628 
2629  // Deserialize command sequence
2630  U32 _cmdSeq = 0;
2631  _deserStatus = _msg.deserializeTo(_cmdSeq);
2632  FW_ASSERT (
2633  _deserStatus == Fw::FW_SERIALIZE_OK,
2634  static_cast<FwAssertArgType>(_deserStatus)
2635  );
2636 
2637  // Deserialize command argument buffer
2638  Fw::CmdArgBuffer args;
2639  _deserStatus = _msg.deserializeTo(args);
2640  FW_ASSERT (
2641  _deserStatus == Fw::FW_SERIALIZE_OK,
2642  static_cast<FwAssertArgType>(_deserStatus)
2643  );
2644 
2645  // Reset buffer
2646  args.resetDeser();
2647 
2648  // Deserialize argument fileName
2649  Fw::CmdStringArg fileName;
2650  _deserStatus = args.deserializeTo(fileName);
2651  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2652  if (this->isConnected_CmdStatus_OutputPort(0)) {
2653  this->cmdResponse_out(
2654  _opCode,
2655  _cmdSeq,
2657  );
2658  }
2659  // Don't crash the task if bad arguments were passed from the ground
2660  break;
2661  }
2662 
2663  // Deserialize argument merge
2664  Svc::PrmDb_Merge merge;
2665  _deserStatus = args.deserializeTo(merge);
2666  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2667  if (this->isConnected_CmdStatus_OutputPort(0)) {
2668  this->cmdResponse_out(
2669  _opCode,
2670  _cmdSeq,
2672  );
2673  }
2674  // Don't crash the task if bad arguments were passed from the ground
2675  break;
2676  }
2677 
2678  // Make sure there was no data left over.
2679  // That means the argument buffer size was incorrect.
2680 #if FW_CMD_CHECK_RESIDUAL
2681  if (args.getDeserializeSizeLeft() != 0) {
2682  if (this->isConnected_CmdStatus_OutputPort(0)) {
2683  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2684  }
2685  // Don't crash the task if bad arguments were passed from the ground
2686  break;
2687  }
2688 #endif
2689 
2690  // Call handler function
2692  _opCode, _cmdSeq,
2693  fileName,
2694  merge
2695  );
2696 
2697  break;
2698  }
2699 
2700  // Handle command PRM_COMMIT_STAGED
2701  case CMD_PRM_COMMIT_STAGED: {
2702  // Deserialize opcode
2703  FwOpcodeType _opCode = 0;
2704  _deserStatus = _msg.deserializeTo(_opCode);
2705  FW_ASSERT (
2706  _deserStatus == Fw::FW_SERIALIZE_OK,
2707  static_cast<FwAssertArgType>(_deserStatus)
2708  );
2709 
2710  // Deserialize command sequence
2711  U32 _cmdSeq = 0;
2712  _deserStatus = _msg.deserializeTo(_cmdSeq);
2713  FW_ASSERT (
2714  _deserStatus == Fw::FW_SERIALIZE_OK,
2715  static_cast<FwAssertArgType>(_deserStatus)
2716  );
2717 
2718  // Deserialize command argument buffer
2719  Fw::CmdArgBuffer args;
2720  _deserStatus = _msg.deserializeTo(args);
2721  FW_ASSERT (
2722  _deserStatus == Fw::FW_SERIALIZE_OK,
2723  static_cast<FwAssertArgType>(_deserStatus)
2724  );
2725 
2726  // Reset buffer
2727  args.resetDeser();
2728 
2729  // Make sure there was no data left over.
2730  // That means the argument buffer size was incorrect.
2731 #if FW_CMD_CHECK_RESIDUAL
2732  if (args.getDeserializeSizeLeft() != 0) {
2733  if (this->isConnected_CmdStatus_OutputPort(0)) {
2734  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2735  }
2736  // Don't crash the task if bad arguments were passed from the ground
2737  break;
2738  }
2739 #endif
2740 
2741  // Call handler function
2742  this->PRM_COMMIT_STAGED_cmdHandler(_opCode, _cmdSeq);
2743 
2744  break;
2745  }
2746 
2747  default:
2748  return MSG_DISPATCH_ERROR;
2749  }
2750 
2751  return MSG_DISPATCH_OK;
2752  }
2753 
2754  // ----------------------------------------------------------------------
2755  // Calls for messages received on special input ports
2756  // ----------------------------------------------------------------------
2757 
2758  void PrmDbComponentBase ::
2759  m_p_CmdDisp_in(
2760  Fw::PassiveComponentBase* callComp,
2761  FwIndexType portNum,
2762  FwOpcodeType opCode,
2763  U32 cmdSeq,
2764  Fw::CmdArgBuffer& args
2765  )
2766  {
2767  FW_ASSERT(callComp != nullptr);
2768  PrmDbComponentBase* compPtr = static_cast<PrmDbComponentBase*>(callComp);
2769  compPtr->CmdDisp_handlerBase(
2770  portNum,
2771  opCode,
2772  cmdSeq,
2773  args
2774  );
2775  }
2776 
2777  // ----------------------------------------------------------------------
2778  // Calls for messages received on typed input ports
2779  // ----------------------------------------------------------------------
2780 
2781  Fw::ParamValid PrmDbComponentBase ::
2782  m_p_getPrm_in(
2783  Fw::PassiveComponentBase* callComp,
2784  FwIndexType portNum,
2785  FwPrmIdType id,
2786  Fw::ParamBuffer& val
2787  )
2788  {
2789  FW_ASSERT(callComp != nullptr);
2790  PrmDbComponentBase* compPtr = static_cast<PrmDbComponentBase*>(callComp);
2791  return compPtr->getPrm_handlerBase(
2792  portNum,
2793  id,
2794  val
2795  );
2796  }
2797 
2798  void PrmDbComponentBase ::
2799  m_p_pingIn_in(
2800  Fw::PassiveComponentBase* callComp,
2801  FwIndexType portNum,
2802  U32 key
2803  )
2804  {
2805  FW_ASSERT(callComp != nullptr);
2806  PrmDbComponentBase* compPtr = static_cast<PrmDbComponentBase*>(callComp);
2807  compPtr->pingIn_handlerBase(
2808  portNum,
2809  key
2810  );
2811  }
2812 
2813  void PrmDbComponentBase ::
2814  m_p_setPrm_in(
2815  Fw::PassiveComponentBase* callComp,
2816  FwIndexType portNum,
2817  FwPrmIdType id,
2818  Fw::ParamBuffer& val
2819  )
2820  {
2821  FW_ASSERT(callComp != nullptr);
2822  PrmDbComponentBase* compPtr = static_cast<PrmDbComponentBase*>(callComp);
2823  compPtr->setPrm_handlerBase(
2824  portNum,
2825  id,
2826  val
2827  );
2828  }
2829 
2830 #if !FW_DIRECT_PORT_CALLS
2831 
2832  // ----------------------------------------------------------------------
2833  // Invocation functions for special output ports
2834  // ----------------------------------------------------------------------
2835 
2836  void PrmDbComponentBase ::
2837  CmdReg_out(
2838  FwIndexType portNum,
2839  FwOpcodeType opCode
2840  ) const
2841  {
2842  FW_ASSERT(
2843  (0 <= portNum) && (portNum < this->getNum_CmdReg_OutputPorts()),
2844  static_cast<FwAssertArgType>(portNum)
2845  );
2846 
2847  FW_ASSERT(
2848  this->m_CmdReg_OutputPort[portNum].isConnected(),
2849  static_cast<FwAssertArgType>(portNum)
2850  );
2851  this->m_CmdReg_OutputPort[portNum].invoke(
2852  opCode
2853  );
2854  }
2855 
2856  void PrmDbComponentBase ::
2857  CmdStatus_out(
2858  FwIndexType portNum,
2859  FwOpcodeType opCode,
2860  U32 cmdSeq,
2861  const Fw::CmdResponse& response
2862  ) const
2863  {
2864  FW_ASSERT(
2865  (0 <= portNum) && (portNum < this->getNum_CmdStatus_OutputPorts()),
2866  static_cast<FwAssertArgType>(portNum)
2867  );
2868 
2869  FW_ASSERT(
2870  this->m_CmdStatus_OutputPort[portNum].isConnected(),
2871  static_cast<FwAssertArgType>(portNum)
2872  );
2873  this->m_CmdStatus_OutputPort[portNum].invoke(
2874  opCode,
2875  cmdSeq,
2876  response
2877  );
2878  }
2879 
2880  void PrmDbComponentBase ::
2881  Log_out(
2882  FwIndexType portNum,
2883  FwEventIdType id,
2884  Fw::Time& timeTag,
2885  const Fw::LogSeverity& severity,
2886  Fw::LogBuffer& args
2887  ) const
2888  {
2889  FW_ASSERT(
2890  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
2891  static_cast<FwAssertArgType>(portNum)
2892  );
2893 
2894  FW_ASSERT(
2895  this->m_Log_OutputPort[portNum].isConnected(),
2896  static_cast<FwAssertArgType>(portNum)
2897  );
2898  this->m_Log_OutputPort[portNum].invoke(
2899  id,
2900  timeTag,
2901  severity,
2902  args
2903  );
2904  }
2905 
2906 #if FW_ENABLE_TEXT_LOGGING
2907 
2908  void PrmDbComponentBase ::
2909  LogText_out(
2910  FwIndexType portNum,
2911  FwEventIdType id,
2912  Fw::Time& timeTag,
2913  const Fw::LogSeverity& severity,
2914  Fw::TextLogString& text
2915  ) const
2916  {
2917  FW_ASSERT(
2918  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
2919  static_cast<FwAssertArgType>(portNum)
2920  );
2921 
2922  FW_ASSERT(
2923  this->m_LogText_OutputPort[portNum].isConnected(),
2924  static_cast<FwAssertArgType>(portNum)
2925  );
2926  this->m_LogText_OutputPort[portNum].invoke(
2927  id,
2928  timeTag,
2929  severity,
2930  text
2931  );
2932  }
2933 
2934 #endif
2935 
2936  void PrmDbComponentBase ::
2937  Time_out(
2938  FwIndexType portNum,
2939  Fw::Time& time
2940  ) const
2941  {
2942  FW_ASSERT(
2943  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
2944  static_cast<FwAssertArgType>(portNum)
2945  );
2946 
2947  FW_ASSERT(
2948  this->m_Time_OutputPort[portNum].isConnected(),
2949  static_cast<FwAssertArgType>(portNum)
2950  );
2951  this->m_Time_OutputPort[portNum].invoke(
2952  time
2953  );
2954  }
2955 
2956 #endif
2957 
2958 }
void set_CmdReg_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to CmdReg[portNum].
Serialization/Deserialization operation was successful.
void regCommands()
Register commands with the Command Dispatcher.
State of parameter DB file load operations.
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:157
static constexpr FwSizeType CAPACITY
Definition: CmdPortAc.hpp:36
FwIdType FwOpcodeType
The type of a command opcode.
Fw::ParamValid getPrm_handlerBase(FwIndexType portNum, FwPrmIdType id, Fw::ParamBuffer &val)
Handler base-class function for input port getPrm.
Operation succeeded.
Definition: Os.hpp:27
void log_WARNING_LO_PrmIdNotFound_ThrottleClear()
Reset throttle value for PrmIdNotFound.
void pingOut_out(FwIndexType portNum, U32 key) const
Invoke output port pingOut.
PlatformSizeType FwSizeType
All parameters Copied from one DB to another.
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
Definition: Queue.cpp:71
I32 FwEnumStoreType
void log_WARNING_LO_PrmDbFileLoadInvalidAction(const Svc::PrmDb_PrmDbFileLoadState &currentState, const Svc::PrmDb_PrmLoadAction &attemptedAction) const
Status
status returned from the queue send function
Definition: Queue.hpp:30
void log_ACTIVITY_HI_PrmIdUpdated(FwPrmIdType Id) const
message to exit active component task
static constexpr FwIndexType getNum_pingOut_OutputPorts()
BYTE pingInPortSize[Svc::PingPortBuffer::CAPACITY]
PrmDbComponentBase(const char *compName="")
Construct PrmDbComponentBase object.
void init()
Initialization function.
Definition: CmdPortAc.cpp:89
SerializeStatus deserializeTo(U8 &val, Endianness mode=Endianness::BIG) override
Deserialize an 8-bit unsigned integer value.
FwIdType FwPrmIdType
The type of a parameter identifier.
void unLock()
unlock the mutex and assert success
Definition: Mutex.cpp:41
void log_WARNING_HI_PrmFileReadError(const Svc::PrmDb_PrmReadError &stage, I32 record, I32 error) const
void log_ACTIVITY_HI_PrmFileSaveComplete(U32 records) const
Command to save parameter image to file. Uses file name passed to constructor.
void log_WARNING_HI_PrmFileWriteError(const Svc::PrmDb_PrmWriteError &stage, I32 record, I32 error) const
void invoke(U32 key) const
Invoke a port connection.
Definition: PingPortAc.cpp:170
static constexpr FwIndexType getNum_Log_OutputPorts()
virtual const CHAR * toChar() const =0
Convert to a C-style char*.
Fw::InputPrmSetPort * get_setPrm_InputPort(FwIndexType portNum)
static constexpr FwSizeType CAPACITY
virtual void PRM_COMMIT_STAGED_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command PRM_COMMIT_STAGED.
Enum representing a command response.
No time base has been established (Required)
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
virtual void PRM_COMMIT_STAGED_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
static constexpr FwIndexType getNum_Time_OutputPorts()
void init()
Initialization function.
Os::Queue m_queue
queue object for active component
void set_Log_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
virtual void pingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port pingIn.
void log_ACTIVITY_HI_PrmFileLoadComplete(const Fw::StringBase &databaseString, U32 recordsTotal, U32 recordsAdded, U32 recordsUpdated) const
void init()
Object initializer.
Definition: ObjBase.cpp:24
virtual ~PrmDbComponentBase()
Destroy PrmDbComponentBase object.
SerializeStatus
forward declaration for string
bool isConnected_CmdStatus_OutputPort(FwIndexType portNum) const
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: CmdPortAc.cpp:95
virtual void lock()
Lock the guarded mutex.
Message will block until space is available.
Definition: Queue.hpp:47
FwIdType FwEventIdType
The type of an event identifier.
void CmdDisp_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Handler base-class function for input port CmdDisp.
void invoke(FwOpcodeType opCode) const
Invoke a port connection.
bool isConnected_Time_OutputPort(FwIndexType portNum) const
static constexpr FwSizeType CAPACITY
Definition: PingPortAc.hpp:34
static constexpr FwIndexType getNum_getPrm_InputPorts()
bool isConnected_Log_OutputPort(FwIndexType portNum) const
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:40
void init()
Initialization function.
Definition: TimePortAc.cpp:151
void log_ACTIVITY_HI_PrmDbCommitComplete() const
Fw::InputCmdPort * get_CmdDisp_InputPort(FwIndexType portNum)
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
#define FW_MIN(a, b)
MIN macro (deprecated in C++, use std::min)
Definition: BasicTypes.h:99
A less serious but recoverable event.
void init()
Initialization function.
Definition: PingPortAc.cpp:151
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
void invoke(Fw::Time &time) const
Invoke a port connection.
Definition: TimePortAc.cpp:170
void PRM_COMMIT_STAGED_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Serializable::SizeType getDeserializeSizeLeft() const override
Get remaining deserialization buffer size.
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke a port connection.
bool isConnected_pingOut_OutputPort(FwIndexType portNum) const
The size of the serial representation.
void addCallPort(InputPingPort *callPort)
Register an input port.
Definition: PingPortAc.cpp:157
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
Definition: Queue.cpp:54
void setPrm_handlerBase(FwIndexType portNum, FwPrmIdType id, Fw::ParamBuffer &val)
Handler base-class function for input port setPrm.
virtual void unLock()
Unlock the guarded mutex.
void resetDeser() override
Reset deserialization pointer to beginning of buffer.
void log_ACTIVITY_HI_PrmIdAdded(FwPrmIdType Id) const
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
A serious but recoverable event.
bool isConnected_CmdReg_OutputPort(FwIndexType portNum) const
void log_ACTIVITY_HI_PrmDbCopyAllComplete(const Fw::StringBase &databaseStringSrc, const Fw::StringBase &databaseStringDest) const
const char * toChar() const
Convert to a C-style char*.
bool isConnected() const
Definition: PortBase.cpp:38
Enum representing event severity.
Parameter ID not found in database.
#define PRI_FwIndexType
virtual Fw::ParamValid getPrm_handler(FwIndexType portNum, FwPrmIdType id, Fw::ParamBuffer &val)=0
Handler for input port getPrm.
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:58
void init()
Initialization function.
Definition: LogPortAc.cpp:180
Parameter ID updated in database.
void setPortNum(FwIndexType portNum)
Loads a file from storage into the staging database. The file could have selective IDs and not the wh...
void PRM_LOAD_FILE_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
virtual void PRM_SAVE_FILE_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command PRM_SAVE_FILE.
void log_WARNING_HI_PrmDbFull(FwPrmIdType Id) const
BlockingType
message type
Definition: Queue.hpp:46
virtual void PRM_LOAD_FILE_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command PRM_LOAD_FILE.
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
Command failed to deserialize.
void PRM_SAVE_FILE_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
Important informational events.
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port connection.
Definition: LogPortAc.cpp:199
void log_WARNING_LO_PrmIdNotFound(FwPrmIdType Id)
virtual void PRM_LOAD_FILE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &fileName, const Svc::PrmDb_Merge &merge)=0
A message was sent requesting an exit of the loop.
PlatformIndexType FwIndexType
static constexpr FwIndexType getNum_CmdStatus_OutputPorts()
void set_CmdStatus_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to CmdStatus[portNum].
virtual void setPrm_handler(FwIndexType portNum, FwPrmIdType id, Fw::ParamBuffer &val)=0
Handler for input port setPrm.
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:186
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
void init()
Initialization function.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
static constexpr FwIndexType getNum_pingIn_InputPorts()
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
void init()
Initialization function.
Definition: PingPortAc.cpp:73
The size of the serial representation.
RateGroupDivider component implementation.
message sent/received okay
Definition: Queue.hpp:31
Enum representing parameter validity.
U8 BYTE
byte type
Definition: BasicTypes.h:57
static constexpr FwIndexType getNum_CmdDisp_InputPorts()
Fw::InputPrmGetPort * get_getPrm_InputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_CmdReg_OutputPorts()
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
The size of the serial representation.
Commits the backup database to become the prime (active) database.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: PingPortAc.cpp:79
void set_pingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
Message will return with status when space is unavailable.
Definition: Queue.hpp:48
Implementation of malloc based allocator.
void init()
Initialization function.
virtual void PRM_SAVE_FILE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
Parameter file load failed, not staging any update.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
static constexpr FwIndexType getNum_setPrm_InputPorts()
virtual void setPrm_preMsgHook(FwIndexType portNum, FwPrmIdType id, Fw::ParamBuffer &val)
Pre-message hook for async input port setPrm.
void init()
Initialization function.
void log_WARNING_HI_PrmFileBadCrc(U32 readCrc, U32 compCrc) const
void log_WARNING_HI_PrmDbFileLoadFailed() const
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
void lock()
lock the mutex and assert success
Definition: Mutex.cpp:34
SerializeStatus serializeTo(SerialBufferBase &buffer, Endianness mode=Endianness::BIG) const override
Serialize the contents of this object to a buffer.
BYTE cmdPortSize[Fw::CmdPortBuffer::CAPACITY]