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  if (qStatus == Os::Queue::Status::FULL) {
849  this->incNumMsgDropped();
850  return;
851  }
852 
853  FW_ASSERT(
854  qStatus == Os::Queue::OP_OK,
855  static_cast<FwAssertArgType>(qStatus)
856  );
857  }
858 
861  FwIndexType portNum,
862  FwPrmIdType id,
863  Fw::ParamBuffer& val
864  )
865  {
866  // Make sure port number is valid
867  FW_ASSERT(
868  (0 <= portNum) && (portNum < this->getNum_setPrm_InputPorts()),
869  static_cast<FwAssertArgType>(portNum)
870  );
871 
872  // Call pre-message hook
874  portNum,
875  id,
876  val
877  );
878  ComponentIpcSerializableBuffer msg;
880 
881  // Serialize message ID
882  _status = msg.serializeFrom(
883  static_cast<FwEnumStoreType>(SETPRM_PRMSET)
884  );
885  FW_ASSERT(
886  _status == Fw::FW_SERIALIZE_OK,
887  static_cast<FwAssertArgType>(_status)
888  );
889 
890  // Serialize port number
891  _status = msg.serializeFrom(portNum);
892  FW_ASSERT(
893  _status == Fw::FW_SERIALIZE_OK,
894  static_cast<FwAssertArgType>(_status)
895  );
896 
897  // Serialize argument id
898  _status = msg.serializeFrom(id);
899  FW_ASSERT(
900  _status == Fw::FW_SERIALIZE_OK,
901  static_cast<FwAssertArgType>(_status)
902  );
903 
904  // Serialize argument val
905  _status = msg.serializeFrom(val);
906  FW_ASSERT(
907  _status == Fw::FW_SERIALIZE_OK,
908  static_cast<FwAssertArgType>(_status)
909  );
910 
911  // Send message
913  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
914 
915  FW_ASSERT(
916  qStatus == Os::Queue::OP_OK,
917  static_cast<FwAssertArgType>(qStatus)
918  );
919  }
920 
921  // ----------------------------------------------------------------------
922  // Pre-message hooks for typed async input ports
923  //
924  // Each of these functions is invoked just before processing a message
925  // on the corresponding port. By default, they do nothing. You can
926  // override them to provide specific pre-message behavior.
927  // ----------------------------------------------------------------------
928 
931  FwIndexType portNum,
932  U32 key
933  )
934  {
935  // Default: no-op
936  }
937 
940  FwIndexType portNum,
941  FwPrmIdType id,
942  Fw::ParamBuffer& val
943  )
944  {
945  // Default: no-op
946  }
947 
948 #if !FW_DIRECT_PORT_CALLS
949 
950  // ----------------------------------------------------------------------
951  // Invocation functions for typed output ports
952  // ----------------------------------------------------------------------
953 
956  FwIndexType portNum,
957  U32 key
958  ) const
959  {
960  FW_ASSERT(
961  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
962  static_cast<FwAssertArgType>(portNum)
963  );
964 
965  FW_ASSERT(
966  this->m_pingOut_OutputPort[portNum].isConnected(),
967  static_cast<FwAssertArgType>(portNum)
968  );
969  this->m_pingOut_OutputPort[portNum].invoke(
970  key
971  );
972  }
973 
974 #endif
975 
976  // ----------------------------------------------------------------------
977  // Command response
978  // ----------------------------------------------------------------------
979 
982  FwOpcodeType opCode,
983  U32 cmdSeq,
984  Fw::CmdResponse response
985  )
986  {
988  this->CmdStatus_out(0, opCode, cmdSeq, response);
989  }
990 
991  // ----------------------------------------------------------------------
992  // Command handler base-class functions
993  //
994  // Call these functions directly to bypass the command input port
995  // ----------------------------------------------------------------------
996 
999  FwOpcodeType opCode,
1000  U32 cmdSeq,
1001  Fw::CmdArgBuffer& args
1002  )
1003  {
1004  // Call pre-message hook
1005  this->PRM_SAVE_FILE_preMsgHook(opCode,cmdSeq);
1006 
1007  // Defer deserializing arguments to the message dispatcher
1008  // to avoid deserializing and reserializing just for IPC
1009  ComponentIpcSerializableBuffer msg;
1011 
1012  // Serialize for IPC
1013  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_PRM_SAVE_FILE));
1014  FW_ASSERT (
1015  _status == Fw::FW_SERIALIZE_OK,
1016  static_cast<FwAssertArgType>(_status)
1017  );
1018 
1019  // Fake port number to make message dequeue work
1020  FwIndexType port = 0;
1021 
1022  _status = msg.serializeFrom(port);
1023  FW_ASSERT (
1024  _status == Fw::FW_SERIALIZE_OK,
1025  static_cast<FwAssertArgType>(_status)
1026  );
1027 
1028  _status = msg.serializeFrom(opCode);
1029  FW_ASSERT (
1030  _status == Fw::FW_SERIALIZE_OK,
1031  static_cast<FwAssertArgType>(_status)
1032  );
1033 
1034  _status = msg.serializeFrom(cmdSeq);
1035  FW_ASSERT (
1036  _status == Fw::FW_SERIALIZE_OK,
1037  static_cast<FwAssertArgType>(_status)
1038  );
1039 
1040  _status = msg.serializeFrom(args);
1041  FW_ASSERT (
1042  _status == Fw::FW_SERIALIZE_OK,
1043  static_cast<FwAssertArgType>(_status)
1044  );
1045 
1046  // Send message
1048  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1049 
1050  FW_ASSERT(
1051  qStatus == Os::Queue::OP_OK,
1052  static_cast<FwAssertArgType>(qStatus)
1053  );
1054  }
1055 
1058  FwOpcodeType opCode,
1059  U32 cmdSeq,
1060  Fw::CmdArgBuffer& args
1061  )
1062  {
1063  // Call pre-message hook
1064  this->PRM_LOAD_FILE_preMsgHook(opCode,cmdSeq);
1065 
1066  // Defer deserializing arguments to the message dispatcher
1067  // to avoid deserializing and reserializing just for IPC
1068  ComponentIpcSerializableBuffer msg;
1070 
1071  // Serialize for IPC
1072  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_PRM_LOAD_FILE));
1073  FW_ASSERT (
1074  _status == Fw::FW_SERIALIZE_OK,
1075  static_cast<FwAssertArgType>(_status)
1076  );
1077 
1078  // Fake port number to make message dequeue work
1079  FwIndexType port = 0;
1080 
1081  _status = msg.serializeFrom(port);
1082  FW_ASSERT (
1083  _status == Fw::FW_SERIALIZE_OK,
1084  static_cast<FwAssertArgType>(_status)
1085  );
1086 
1087  _status = msg.serializeFrom(opCode);
1088  FW_ASSERT (
1089  _status == Fw::FW_SERIALIZE_OK,
1090  static_cast<FwAssertArgType>(_status)
1091  );
1092 
1093  _status = msg.serializeFrom(cmdSeq);
1094  FW_ASSERT (
1095  _status == Fw::FW_SERIALIZE_OK,
1096  static_cast<FwAssertArgType>(_status)
1097  );
1098 
1099  _status = msg.serializeFrom(args);
1100  FW_ASSERT (
1101  _status == Fw::FW_SERIALIZE_OK,
1102  static_cast<FwAssertArgType>(_status)
1103  );
1104 
1105  // Send message
1107  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1108 
1109  FW_ASSERT(
1110  qStatus == Os::Queue::OP_OK,
1111  static_cast<FwAssertArgType>(qStatus)
1112  );
1113  }
1114 
1117  FwOpcodeType opCode,
1118  U32 cmdSeq,
1119  Fw::CmdArgBuffer& args
1120  )
1121  {
1122  // Call pre-message hook
1123  this->PRM_COMMIT_STAGED_preMsgHook(opCode,cmdSeq);
1124 
1125  // Defer deserializing arguments to the message dispatcher
1126  // to avoid deserializing and reserializing just for IPC
1127  ComponentIpcSerializableBuffer msg;
1129 
1130  // Serialize for IPC
1131  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_PRM_COMMIT_STAGED));
1132  FW_ASSERT (
1133  _status == Fw::FW_SERIALIZE_OK,
1134  static_cast<FwAssertArgType>(_status)
1135  );
1136 
1137  // Fake port number to make message dequeue work
1138  FwIndexType port = 0;
1139 
1140  _status = msg.serializeFrom(port);
1141  FW_ASSERT (
1142  _status == Fw::FW_SERIALIZE_OK,
1143  static_cast<FwAssertArgType>(_status)
1144  );
1145 
1146  _status = msg.serializeFrom(opCode);
1147  FW_ASSERT (
1148  _status == Fw::FW_SERIALIZE_OK,
1149  static_cast<FwAssertArgType>(_status)
1150  );
1151 
1152  _status = msg.serializeFrom(cmdSeq);
1153  FW_ASSERT (
1154  _status == Fw::FW_SERIALIZE_OK,
1155  static_cast<FwAssertArgType>(_status)
1156  );
1157 
1158  _status = msg.serializeFrom(args);
1159  FW_ASSERT (
1160  _status == Fw::FW_SERIALIZE_OK,
1161  static_cast<FwAssertArgType>(_status)
1162  );
1163 
1164  // Send message
1166  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1167 
1168  FW_ASSERT(
1169  qStatus == Os::Queue::OP_OK,
1170  static_cast<FwAssertArgType>(qStatus)
1171  );
1172  }
1173 
1174  // ----------------------------------------------------------------------
1175  // Pre-message hooks for async commands
1176  //
1177  // Each of these functions is invoked just before processing the
1178  // corresponding command. By default they do nothing. You can
1179  // override them to provide specific pre-command behavior.
1180  // ----------------------------------------------------------------------
1181 
1184  FwOpcodeType opCode,
1185  U32 cmdSeq
1186  )
1187  {
1188  // Defaults to no-op; can be overridden
1189  (void) opCode;
1190  (void) cmdSeq;
1191  }
1192 
1195  FwOpcodeType opCode,
1196  U32 cmdSeq
1197  )
1198  {
1199  // Defaults to no-op; can be overridden
1200  (void) opCode;
1201  (void) cmdSeq;
1202  }
1203 
1206  FwOpcodeType opCode,
1207  U32 cmdSeq
1208  )
1209  {
1210  // Defaults to no-op; can be overridden
1211  (void) opCode;
1212  (void) cmdSeq;
1213  }
1214 
1215  // ----------------------------------------------------------------------
1216  // Event logging functions
1217  // ----------------------------------------------------------------------
1218 
1221  {
1222  // Check throttle value
1223  if (this->m_PrmIdNotFoundThrottle >= EVENTID_PRMIDNOTFOUND_THROTTLE) {
1224  return;
1225  }
1226  else {
1227  this->m_PrmIdNotFoundThrottle++;
1228  }
1229 
1230  // Get the time
1231  Fw::Time _logTime;
1232  if (this->isConnected_Time_OutputPort(0)) {
1233  this->Time_out(0, _logTime);
1234  }
1235 
1236  const FwEventIdType _id = this->getIdBase() + EVENTID_PRMIDNOTFOUND;
1237 
1238  // Emit the event on the log port
1239  if (this->isConnected_Log_OutputPort(0)) {
1240  Fw::LogBuffer _logBuff;
1242 
1243 #if FW_AMPCS_COMPATIBLE
1244  // Serialize the number of arguments
1245  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1246  FW_ASSERT(
1247  _status == Fw::FW_SERIALIZE_OK,
1248  static_cast<FwAssertArgType>(_status)
1249  );
1250 #endif
1251 
1252 #if FW_AMPCS_COMPATIBLE
1253  // Serialize the argument size
1254  _status = _logBuff.serializeFrom(
1255  static_cast<U8>(sizeof(FwPrmIdType))
1256  );
1257  FW_ASSERT(
1258  _status == Fw::FW_SERIALIZE_OK,
1259  static_cast<FwAssertArgType>(_status)
1260  );
1261 #endif
1262  _status = _logBuff.serializeFrom(Id);
1263  FW_ASSERT(
1264  _status == Fw::FW_SERIALIZE_OK,
1265  static_cast<FwAssertArgType>(_status)
1266  );
1267 
1268  this->Log_out(
1269  0,
1270  _id,
1271  _logTime,
1273  _logBuff
1274  );
1275  }
1276 
1277  // Emit the event on the text log port
1278 #if FW_ENABLE_TEXT_LOGGING
1279  if (this->isConnected_LogText_OutputPort(0)) {
1280 #if FW_OBJECT_NAMES == 1
1281  const char* _formatString =
1282  "(%s) %s: Parameter ID 0x%" PRIx32 " not found";
1283 #else
1284  const char* _formatString =
1285  "%s: Parameter ID 0x%" PRIx32 " not found";
1286 #endif
1287 
1288  Fw::TextLogString _logString;
1289  (void) _logString.format(
1290  _formatString,
1291 #if FW_OBJECT_NAMES == 1
1292  this->m_objName.toChar(),
1293 #endif
1294  "PrmIdNotFound ",
1295  Id
1296  );
1297 
1298  this->LogText_out(
1299  0,
1300  _id,
1301  _logTime,
1303  _logString
1304  );
1305  }
1306 #endif
1307  }
1308 
1311  {
1312  // Get the time
1313  Fw::Time _logTime;
1314  if (this->isConnected_Time_OutputPort(0)) {
1315  this->Time_out(0, _logTime);
1316  }
1317 
1318  const FwEventIdType _id = this->getIdBase() + EVENTID_PRMIDUPDATED;
1319 
1320  // Emit the event on the log port
1321  if (this->isConnected_Log_OutputPort(0)) {
1322  Fw::LogBuffer _logBuff;
1324 
1325 #if FW_AMPCS_COMPATIBLE
1326  // Serialize the number of arguments
1327  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1328  FW_ASSERT(
1329  _status == Fw::FW_SERIALIZE_OK,
1330  static_cast<FwAssertArgType>(_status)
1331  );
1332 #endif
1333 
1334 #if FW_AMPCS_COMPATIBLE
1335  // Serialize the argument size
1336  _status = _logBuff.serializeFrom(
1337  static_cast<U8>(sizeof(FwPrmIdType))
1338  );
1339  FW_ASSERT(
1340  _status == Fw::FW_SERIALIZE_OK,
1341  static_cast<FwAssertArgType>(_status)
1342  );
1343 #endif
1344  _status = _logBuff.serializeFrom(Id);
1345  FW_ASSERT(
1346  _status == Fw::FW_SERIALIZE_OK,
1347  static_cast<FwAssertArgType>(_status)
1348  );
1349 
1350  this->Log_out(
1351  0,
1352  _id,
1353  _logTime,
1355  _logBuff
1356  );
1357  }
1358 
1359  // Emit the event on the text log port
1360 #if FW_ENABLE_TEXT_LOGGING
1361  if (this->isConnected_LogText_OutputPort(0)) {
1362 #if FW_OBJECT_NAMES == 1
1363  const char* _formatString =
1364  "(%s) %s: Parameter ID 0x%" PRIx32 " updated";
1365 #else
1366  const char* _formatString =
1367  "%s: Parameter ID 0x%" PRIx32 " updated";
1368 #endif
1369 
1370  Fw::TextLogString _logString;
1371  (void) _logString.format(
1372  _formatString,
1373 #if FW_OBJECT_NAMES == 1
1374  this->m_objName.toChar(),
1375 #endif
1376  "PrmIdUpdated ",
1377  Id
1378  );
1379 
1380  this->LogText_out(
1381  0,
1382  _id,
1383  _logTime,
1385  _logString
1386  );
1387  }
1388 #endif
1389  }
1390 
1393  {
1394  // Get the time
1395  Fw::Time _logTime;
1396  if (this->isConnected_Time_OutputPort(0)) {
1397  this->Time_out(0, _logTime);
1398  }
1399 
1400  const FwEventIdType _id = this->getIdBase() + EVENTID_PRMDBFULL;
1401 
1402  // Emit the event on the log port
1403  if (this->isConnected_Log_OutputPort(0)) {
1404  Fw::LogBuffer _logBuff;
1406 
1407 #if FW_AMPCS_COMPATIBLE
1408  // Serialize the number of arguments
1409  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1410  FW_ASSERT(
1411  _status == Fw::FW_SERIALIZE_OK,
1412  static_cast<FwAssertArgType>(_status)
1413  );
1414 #endif
1415 
1416 #if FW_AMPCS_COMPATIBLE
1417  // Serialize the argument size
1418  _status = _logBuff.serializeFrom(
1419  static_cast<U8>(sizeof(FwPrmIdType))
1420  );
1421  FW_ASSERT(
1422  _status == Fw::FW_SERIALIZE_OK,
1423  static_cast<FwAssertArgType>(_status)
1424  );
1425 #endif
1426  _status = _logBuff.serializeFrom(Id);
1427  FW_ASSERT(
1428  _status == Fw::FW_SERIALIZE_OK,
1429  static_cast<FwAssertArgType>(_status)
1430  );
1431 
1432  this->Log_out(
1433  0,
1434  _id,
1435  _logTime,
1437  _logBuff
1438  );
1439  }
1440 
1441  // Emit the event on the text log port
1442 #if FW_ENABLE_TEXT_LOGGING
1443  if (this->isConnected_LogText_OutputPort(0)) {
1444 #if FW_OBJECT_NAMES == 1
1445  const char* _formatString =
1446  "(%s) %s: Parameter DB full when adding ID 0x%" PRIx32 " ";
1447 #else
1448  const char* _formatString =
1449  "%s: Parameter DB full when adding ID 0x%" PRIx32 " ";
1450 #endif
1451 
1452  Fw::TextLogString _logString;
1453  (void) _logString.format(
1454  _formatString,
1455 #if FW_OBJECT_NAMES == 1
1456  this->m_objName.toChar(),
1457 #endif
1458  "PrmDbFull ",
1459  Id
1460  );
1461 
1462  this->LogText_out(
1463  0,
1464  _id,
1465  _logTime,
1467  _logString
1468  );
1469  }
1470 #endif
1471  }
1472 
1475  {
1476  // Get the time
1477  Fw::Time _logTime;
1478  if (this->isConnected_Time_OutputPort(0)) {
1479  this->Time_out(0, _logTime);
1480  }
1481 
1482  const FwEventIdType _id = this->getIdBase() + EVENTID_PRMIDADDED;
1483 
1484  // Emit the event on the log port
1485  if (this->isConnected_Log_OutputPort(0)) {
1486  Fw::LogBuffer _logBuff;
1488 
1489 #if FW_AMPCS_COMPATIBLE
1490  // Serialize the number of arguments
1491  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1492  FW_ASSERT(
1493  _status == Fw::FW_SERIALIZE_OK,
1494  static_cast<FwAssertArgType>(_status)
1495  );
1496 #endif
1497 
1498 #if FW_AMPCS_COMPATIBLE
1499  // Serialize the argument size
1500  _status = _logBuff.serializeFrom(
1501  static_cast<U8>(sizeof(FwPrmIdType))
1502  );
1503  FW_ASSERT(
1504  _status == Fw::FW_SERIALIZE_OK,
1505  static_cast<FwAssertArgType>(_status)
1506  );
1507 #endif
1508  _status = _logBuff.serializeFrom(Id);
1509  FW_ASSERT(
1510  _status == Fw::FW_SERIALIZE_OK,
1511  static_cast<FwAssertArgType>(_status)
1512  );
1513 
1514  this->Log_out(
1515  0,
1516  _id,
1517  _logTime,
1519  _logBuff
1520  );
1521  }
1522 
1523  // Emit the event on the text log port
1524 #if FW_ENABLE_TEXT_LOGGING
1525  if (this->isConnected_LogText_OutputPort(0)) {
1526 #if FW_OBJECT_NAMES == 1
1527  const char* _formatString =
1528  "(%s) %s: Parameter ID 0x%" PRIx32 " added";
1529 #else
1530  const char* _formatString =
1531  "%s: Parameter ID 0x%" PRIx32 " added";
1532 #endif
1533 
1534  Fw::TextLogString _logString;
1535  (void) _logString.format(
1536  _formatString,
1537 #if FW_OBJECT_NAMES == 1
1538  this->m_objName.toChar(),
1539 #endif
1540  "PrmIdAdded ",
1541  Id
1542  );
1543 
1544  this->LogText_out(
1545  0,
1546  _id,
1547  _logTime,
1549  _logString
1550  );
1551  }
1552 #endif
1553  }
1554 
1557  const Svc::PrmDb_PrmWriteError& stage,
1558  I32 record,
1559  I32 error
1560  ) const
1561  {
1562  // Get the time
1563  Fw::Time _logTime;
1564  if (this->isConnected_Time_OutputPort(0)) {
1565  this->Time_out(0, _logTime);
1566  }
1567 
1568  const FwEventIdType _id = this->getIdBase() + EVENTID_PRMFILEWRITEERROR;
1569 
1570  // Emit the event on the log port
1571  if (this->isConnected_Log_OutputPort(0)) {
1572  Fw::LogBuffer _logBuff;
1574 
1575 #if FW_AMPCS_COMPATIBLE
1576  // Serialize the number of arguments
1577  _status = _logBuff.serializeFrom(static_cast<U8>(3));
1578  FW_ASSERT(
1579  _status == Fw::FW_SERIALIZE_OK,
1580  static_cast<FwAssertArgType>(_status)
1581  );
1582 #endif
1583 
1584 #if FW_AMPCS_COMPATIBLE
1585  // Serialize the argument size
1586  _status = _logBuff.serializeFrom(
1588  );
1589  FW_ASSERT(
1590  _status == Fw::FW_SERIALIZE_OK,
1591  static_cast<FwAssertArgType>(_status)
1592  );
1593 #endif
1594  _status = _logBuff.serializeFrom(stage);
1595  FW_ASSERT(
1596  _status == Fw::FW_SERIALIZE_OK,
1597  static_cast<FwAssertArgType>(_status)
1598  );
1599 
1600 #if FW_AMPCS_COMPATIBLE
1601  // Serialize the argument size
1602  _status = _logBuff.serializeFrom(
1603  static_cast<U8>(sizeof(I32))
1604  );
1605  FW_ASSERT(
1606  _status == Fw::FW_SERIALIZE_OK,
1607  static_cast<FwAssertArgType>(_status)
1608  );
1609 #endif
1610  _status = _logBuff.serializeFrom(record);
1611  FW_ASSERT(
1612  _status == Fw::FW_SERIALIZE_OK,
1613  static_cast<FwAssertArgType>(_status)
1614  );
1615 
1616 #if FW_AMPCS_COMPATIBLE
1617  // Serialize the argument size
1618  _status = _logBuff.serializeFrom(
1619  static_cast<U8>(sizeof(I32))
1620  );
1621  FW_ASSERT(
1622  _status == Fw::FW_SERIALIZE_OK,
1623  static_cast<FwAssertArgType>(_status)
1624  );
1625 #endif
1626  _status = _logBuff.serializeFrom(error);
1627  FW_ASSERT(
1628  _status == Fw::FW_SERIALIZE_OK,
1629  static_cast<FwAssertArgType>(_status)
1630  );
1631 
1632  this->Log_out(
1633  0,
1634  _id,
1635  _logTime,
1637  _logBuff
1638  );
1639  }
1640 
1641  // Emit the event on the text log port
1642 #if FW_ENABLE_TEXT_LOGGING
1643  if (this->isConnected_LogText_OutputPort(0)) {
1644 #if FW_OBJECT_NAMES == 1
1645  const char* _formatString =
1646  "(%s) %s: Parameter write failed in stage %s with record %" PRIi32 " and error %" PRIi32 "";
1647 #else
1648  const char* _formatString =
1649  "%s: Parameter write failed in stage %s with record %" PRIi32 " and error %" PRIi32 "";
1650 #endif
1651 
1652  Fw::String stageStr;
1653  stage.toString(stageStr);
1654 
1655  Fw::TextLogString _logString;
1656  (void) _logString.format(
1657  _formatString,
1658 #if FW_OBJECT_NAMES == 1
1659  this->m_objName.toChar(),
1660 #endif
1661  "PrmFileWriteError ",
1662  stageStr.toChar(),
1663  record,
1664  error
1665  );
1666 
1667  this->LogText_out(
1668  0,
1669  _id,
1670  _logTime,
1672  _logString
1673  );
1674  }
1675 #endif
1676  }
1677 
1680  {
1681  // Get the time
1682  Fw::Time _logTime;
1683  if (this->isConnected_Time_OutputPort(0)) {
1684  this->Time_out(0, _logTime);
1685  }
1686 
1687  const FwEventIdType _id = this->getIdBase() + EVENTID_PRMFILESAVECOMPLETE;
1688 
1689  // Emit the event on the log port
1690  if (this->isConnected_Log_OutputPort(0)) {
1691  Fw::LogBuffer _logBuff;
1693 
1694 #if FW_AMPCS_COMPATIBLE
1695  // Serialize the number of arguments
1696  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1697  FW_ASSERT(
1698  _status == Fw::FW_SERIALIZE_OK,
1699  static_cast<FwAssertArgType>(_status)
1700  );
1701 #endif
1702 
1703 #if FW_AMPCS_COMPATIBLE
1704  // Serialize the argument size
1705  _status = _logBuff.serializeFrom(
1706  static_cast<U8>(sizeof(U32))
1707  );
1708  FW_ASSERT(
1709  _status == Fw::FW_SERIALIZE_OK,
1710  static_cast<FwAssertArgType>(_status)
1711  );
1712 #endif
1713  _status = _logBuff.serializeFrom(records);
1714  FW_ASSERT(
1715  _status == Fw::FW_SERIALIZE_OK,
1716  static_cast<FwAssertArgType>(_status)
1717  );
1718 
1719  this->Log_out(
1720  0,
1721  _id,
1722  _logTime,
1724  _logBuff
1725  );
1726  }
1727 
1728  // Emit the event on the text log port
1729 #if FW_ENABLE_TEXT_LOGGING
1730  if (this->isConnected_LogText_OutputPort(0)) {
1731 #if FW_OBJECT_NAMES == 1
1732  const char* _formatString =
1733  "(%s) %s: Parameter file save completed. Wrote %" PRIu32 " records.";
1734 #else
1735  const char* _formatString =
1736  "%s: Parameter file save completed. Wrote %" PRIu32 " records.";
1737 #endif
1738 
1739  Fw::TextLogString _logString;
1740  (void) _logString.format(
1741  _formatString,
1742 #if FW_OBJECT_NAMES == 1
1743  this->m_objName.toChar(),
1744 #endif
1745  "PrmFileSaveComplete ",
1746  records
1747  );
1748 
1749  this->LogText_out(
1750  0,
1751  _id,
1752  _logTime,
1754  _logString
1755  );
1756  }
1757 #endif
1758  }
1759 
1762  const Svc::PrmDb_PrmReadError& stage,
1763  I32 record,
1764  I32 error
1765  ) const
1766  {
1767  // Get the time
1768  Fw::Time _logTime;
1769  if (this->isConnected_Time_OutputPort(0)) {
1770  this->Time_out(0, _logTime);
1771  }
1772 
1773  const FwEventIdType _id = this->getIdBase() + EVENTID_PRMFILEREADERROR;
1774 
1775  // Emit the event on the log port
1776  if (this->isConnected_Log_OutputPort(0)) {
1777  Fw::LogBuffer _logBuff;
1779 
1780 #if FW_AMPCS_COMPATIBLE
1781  // Serialize the number of arguments
1782  _status = _logBuff.serializeFrom(static_cast<U8>(3));
1783  FW_ASSERT(
1784  _status == Fw::FW_SERIALIZE_OK,
1785  static_cast<FwAssertArgType>(_status)
1786  );
1787 #endif
1788 
1789 #if FW_AMPCS_COMPATIBLE
1790  // Serialize the argument size
1791  _status = _logBuff.serializeFrom(
1793  );
1794  FW_ASSERT(
1795  _status == Fw::FW_SERIALIZE_OK,
1796  static_cast<FwAssertArgType>(_status)
1797  );
1798 #endif
1799  _status = _logBuff.serializeFrom(stage);
1800  FW_ASSERT(
1801  _status == Fw::FW_SERIALIZE_OK,
1802  static_cast<FwAssertArgType>(_status)
1803  );
1804 
1805 #if FW_AMPCS_COMPATIBLE
1806  // Serialize the argument size
1807  _status = _logBuff.serializeFrom(
1808  static_cast<U8>(sizeof(I32))
1809  );
1810  FW_ASSERT(
1811  _status == Fw::FW_SERIALIZE_OK,
1812  static_cast<FwAssertArgType>(_status)
1813  );
1814 #endif
1815  _status = _logBuff.serializeFrom(record);
1816  FW_ASSERT(
1817  _status == Fw::FW_SERIALIZE_OK,
1818  static_cast<FwAssertArgType>(_status)
1819  );
1820 
1821 #if FW_AMPCS_COMPATIBLE
1822  // Serialize the argument size
1823  _status = _logBuff.serializeFrom(
1824  static_cast<U8>(sizeof(I32))
1825  );
1826  FW_ASSERT(
1827  _status == Fw::FW_SERIALIZE_OK,
1828  static_cast<FwAssertArgType>(_status)
1829  );
1830 #endif
1831  _status = _logBuff.serializeFrom(error);
1832  FW_ASSERT(
1833  _status == Fw::FW_SERIALIZE_OK,
1834  static_cast<FwAssertArgType>(_status)
1835  );
1836 
1837  this->Log_out(
1838  0,
1839  _id,
1840  _logTime,
1842  _logBuff
1843  );
1844  }
1845 
1846  // Emit the event on the text log port
1847 #if FW_ENABLE_TEXT_LOGGING
1848  if (this->isConnected_LogText_OutputPort(0)) {
1849 #if FW_OBJECT_NAMES == 1
1850  const char* _formatString =
1851  "(%s) %s: Parameter file read failed in stage %s with record %" PRIi32 " and error %" PRIi32 "";
1852 #else
1853  const char* _formatString =
1854  "%s: Parameter file read failed in stage %s with record %" PRIi32 " and error %" PRIi32 "";
1855 #endif
1856 
1857  Fw::String stageStr;
1858  stage.toString(stageStr);
1859 
1860  Fw::TextLogString _logString;
1861  (void) _logString.format(
1862  _formatString,
1863 #if FW_OBJECT_NAMES == 1
1864  this->m_objName.toChar(),
1865 #endif
1866  "PrmFileReadError ",
1867  stageStr.toChar(),
1868  record,
1869  error
1870  );
1871 
1872  this->LogText_out(
1873  0,
1874  _id,
1875  _logTime,
1877  _logString
1878  );
1879  }
1880 #endif
1881  }
1882 
1885  const Fw::StringBase& databaseString,
1886  U32 recordsTotal,
1887  U32 recordsAdded,
1888  U32 recordsUpdated
1889  ) const
1890  {
1891  // Get the time
1892  Fw::Time _logTime;
1893  if (this->isConnected_Time_OutputPort(0)) {
1894  this->Time_out(0, _logTime);
1895  }
1896 
1897  const FwEventIdType _id = this->getIdBase() + EVENTID_PRMFILELOADCOMPLETE;
1898 
1899  // Emit the event on the log port
1900  if (this->isConnected_Log_OutputPort(0)) {
1901  Fw::LogBuffer _logBuff;
1903 
1904 #if FW_AMPCS_COMPATIBLE
1905  // Serialize the number of arguments
1906  _status = _logBuff.serializeFrom(static_cast<U8>(4));
1907  FW_ASSERT(
1908  _status == Fw::FW_SERIALIZE_OK,
1909  static_cast<FwAssertArgType>(_status)
1910  );
1911 #endif
1912 
1913  _status = databaseString.serializeTo(
1914  _logBuff,
1915  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), static_cast<FwSizeType>(FW_FIXED_LENGTH_STRING_SIZE))
1916  );
1917  FW_ASSERT(
1918  _status == Fw::FW_SERIALIZE_OK,
1919  static_cast<FwAssertArgType>(_status)
1920  );
1921 
1922 #if FW_AMPCS_COMPATIBLE
1923  // Serialize the argument size
1924  _status = _logBuff.serializeFrom(
1925  static_cast<U8>(sizeof(U32))
1926  );
1927  FW_ASSERT(
1928  _status == Fw::FW_SERIALIZE_OK,
1929  static_cast<FwAssertArgType>(_status)
1930  );
1931 #endif
1932  _status = _logBuff.serializeFrom(recordsTotal);
1933  FW_ASSERT(
1934  _status == Fw::FW_SERIALIZE_OK,
1935  static_cast<FwAssertArgType>(_status)
1936  );
1937 
1938 #if FW_AMPCS_COMPATIBLE
1939  // Serialize the argument size
1940  _status = _logBuff.serializeFrom(
1941  static_cast<U8>(sizeof(U32))
1942  );
1943  FW_ASSERT(
1944  _status == Fw::FW_SERIALIZE_OK,
1945  static_cast<FwAssertArgType>(_status)
1946  );
1947 #endif
1948  _status = _logBuff.serializeFrom(recordsAdded);
1949  FW_ASSERT(
1950  _status == Fw::FW_SERIALIZE_OK,
1951  static_cast<FwAssertArgType>(_status)
1952  );
1953 
1954 #if FW_AMPCS_COMPATIBLE
1955  // Serialize the argument size
1956  _status = _logBuff.serializeFrom(
1957  static_cast<U8>(sizeof(U32))
1958  );
1959  FW_ASSERT(
1960  _status == Fw::FW_SERIALIZE_OK,
1961  static_cast<FwAssertArgType>(_status)
1962  );
1963 #endif
1964  _status = _logBuff.serializeFrom(recordsUpdated);
1965  FW_ASSERT(
1966  _status == Fw::FW_SERIALIZE_OK,
1967  static_cast<FwAssertArgType>(_status)
1968  );
1969 
1970  this->Log_out(
1971  0,
1972  _id,
1973  _logTime,
1975  _logBuff
1976  );
1977  }
1978 
1979  // Emit the event on the text log port
1980 #if FW_ENABLE_TEXT_LOGGING
1981  if (this->isConnected_LogText_OutputPort(0)) {
1982 #if FW_OBJECT_NAMES == 1
1983  const char* _formatString =
1984  "(%s) %s: Parameter file load completed. Database: %s, Records: %" PRIu32 " (%" PRIu32 " added and %" PRIu32 " updated).";
1985 #else
1986  const char* _formatString =
1987  "%s: Parameter file load completed. Database: %s, Records: %" PRIu32 " (%" PRIu32 " added and %" PRIu32 " updated).";
1988 #endif
1989 
1990  Fw::TextLogString _logString;
1991  (void) _logString.format(
1992  _formatString,
1993 #if FW_OBJECT_NAMES == 1
1994  this->m_objName.toChar(),
1995 #endif
1996  "PrmFileLoadComplete ",
1997  databaseString.toChar(),
1998  recordsTotal,
1999  recordsAdded,
2000  recordsUpdated
2001  );
2002 
2003  this->LogText_out(
2004  0,
2005  _id,
2006  _logTime,
2008  _logString
2009  );
2010  }
2011 #endif
2012  }
2013 
2016  {
2017  // Get the time
2018  Fw::Time _logTime;
2019  if (this->isConnected_Time_OutputPort(0)) {
2020  this->Time_out(0, _logTime);
2021  }
2022 
2023  const FwEventIdType _id = this->getIdBase() + EVENTID_PRMDBCOMMITCOMPLETE;
2024 
2025  // Emit the event on the log port
2026  if (this->isConnected_Log_OutputPort(0)) {
2027  Fw::LogBuffer _logBuff;
2028 
2029 #if FW_AMPCS_COMPATIBLE
2031  // Serialize the number of arguments
2032  _status = _logBuff.serializeFrom(static_cast<U8>(0));
2033  FW_ASSERT(
2034  _status == Fw::FW_SERIALIZE_OK,
2035  static_cast<FwAssertArgType>(_status)
2036  );
2037 #endif
2038 
2039  this->Log_out(
2040  0,
2041  _id,
2042  _logTime,
2044  _logBuff
2045  );
2046  }
2047 
2048  // Emit the event on the text log port
2049 #if FW_ENABLE_TEXT_LOGGING
2050  if (this->isConnected_LogText_OutputPort(0)) {
2051 #if FW_OBJECT_NAMES == 1
2052  const char* _formatString =
2053  "(%s) %s: Parameter DB commit complete, staged updates are now active.";
2054 #else
2055  const char* _formatString =
2056  "%s: Parameter DB commit complete, staged updates are now active.";
2057 #endif
2058 
2059  Fw::TextLogString _logString;
2060  (void) _logString.format(
2061  _formatString,
2062 #if FW_OBJECT_NAMES == 1
2063  this->m_objName.toChar(),
2064 #endif
2065  "PrmDbCommitComplete "
2066  );
2067 
2068  this->LogText_out(
2069  0,
2070  _id,
2071  _logTime,
2073  _logString
2074  );
2075  }
2076 #endif
2077  }
2078 
2081  const Fw::StringBase& databaseStringSrc,
2082  const Fw::StringBase& databaseStringDest
2083  ) const
2084  {
2085  // Get the time
2086  Fw::Time _logTime;
2087  if (this->isConnected_Time_OutputPort(0)) {
2088  this->Time_out(0, _logTime);
2089  }
2090 
2092 
2093  // Emit the event on the log port
2094  if (this->isConnected_Log_OutputPort(0)) {
2095  Fw::LogBuffer _logBuff;
2097 
2098 #if FW_AMPCS_COMPATIBLE
2099  // Serialize the number of arguments
2100  _status = _logBuff.serializeFrom(static_cast<U8>(2));
2101  FW_ASSERT(
2102  _status == Fw::FW_SERIALIZE_OK,
2103  static_cast<FwAssertArgType>(_status)
2104  );
2105 #endif
2106 
2107  _status = databaseStringSrc.serializeTo(
2108  _logBuff,
2109  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), static_cast<FwSizeType>(FW_FIXED_LENGTH_STRING_SIZE))
2110  );
2111  FW_ASSERT(
2112  _status == Fw::FW_SERIALIZE_OK,
2113  static_cast<FwAssertArgType>(_status)
2114  );
2115 
2116  _status = databaseStringDest.serializeTo(
2117  _logBuff,
2118  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), static_cast<FwSizeType>(FW_FIXED_LENGTH_STRING_SIZE))
2119  );
2120  FW_ASSERT(
2121  _status == Fw::FW_SERIALIZE_OK,
2122  static_cast<FwAssertArgType>(_status)
2123  );
2124 
2125  this->Log_out(
2126  0,
2127  _id,
2128  _logTime,
2130  _logBuff
2131  );
2132  }
2133 
2134  // Emit the event on the text log port
2135 #if FW_ENABLE_TEXT_LOGGING
2136  if (this->isConnected_LogText_OutputPort(0)) {
2137 #if FW_OBJECT_NAMES == 1
2138  const char* _formatString =
2139  "(%s) %s: All parameters copied. Source database: %s, Destination database: %s.";
2140 #else
2141  const char* _formatString =
2142  "%s: All parameters copied. Source database: %s, Destination database: %s.";
2143 #endif
2144 
2145  Fw::TextLogString _logString;
2146  (void) _logString.format(
2147  _formatString,
2148 #if FW_OBJECT_NAMES == 1
2149  this->m_objName.toChar(),
2150 #endif
2151  "PrmDbCopyAllComplete ",
2152  databaseStringSrc.toChar(),
2153  databaseStringDest.toChar()
2154  );
2155 
2156  this->LogText_out(
2157  0,
2158  _id,
2159  _logTime,
2161  _logString
2162  );
2163  }
2164 #endif
2165  }
2166 
2169  {
2170  // Get the time
2171  Fw::Time _logTime;
2172  if (this->isConnected_Time_OutputPort(0)) {
2173  this->Time_out(0, _logTime);
2174  }
2175 
2176  const FwEventIdType _id = this->getIdBase() + EVENTID_PRMDBFILELOADFAILED;
2177 
2178  // Emit the event on the log port
2179  if (this->isConnected_Log_OutputPort(0)) {
2180  Fw::LogBuffer _logBuff;
2181 
2182 #if FW_AMPCS_COMPATIBLE
2184  // Serialize the number of arguments
2185  _status = _logBuff.serializeFrom(static_cast<U8>(0));
2186  FW_ASSERT(
2187  _status == Fw::FW_SERIALIZE_OK,
2188  static_cast<FwAssertArgType>(_status)
2189  );
2190 #endif
2191 
2192  this->Log_out(
2193  0,
2194  _id,
2195  _logTime,
2197  _logBuff
2198  );
2199  }
2200 
2201  // Emit the event on the text log port
2202 #if FW_ENABLE_TEXT_LOGGING
2203  if (this->isConnected_LogText_OutputPort(0)) {
2204 #if FW_OBJECT_NAMES == 1
2205  const char* _formatString =
2206  "(%s) %s: Parameter file load failed. Clearing staging database and abandoning parameter file load.";
2207 #else
2208  const char* _formatString =
2209  "%s: Parameter file load failed. Clearing staging database and abandoning parameter file load.";
2210 #endif
2211 
2212  Fw::TextLogString _logString;
2213  (void) _logString.format(
2214  _formatString,
2215 #if FW_OBJECT_NAMES == 1
2216  this->m_objName.toChar(),
2217 #endif
2218  "PrmDbFileLoadFailed "
2219  );
2220 
2221  this->LogText_out(
2222  0,
2223  _id,
2224  _logTime,
2226  _logString
2227  );
2228  }
2229 #endif
2230  }
2231 
2234  const Svc::PrmDb_PrmDbFileLoadState& currentState,
2235  const Svc::PrmDb_PrmLoadAction& attemptedAction
2236  ) const
2237  {
2238  // Get the time
2239  Fw::Time _logTime;
2240  if (this->isConnected_Time_OutputPort(0)) {
2241  this->Time_out(0, _logTime);
2242  }
2243 
2245 
2246  // Emit the event on the log port
2247  if (this->isConnected_Log_OutputPort(0)) {
2248  Fw::LogBuffer _logBuff;
2250 
2251 #if FW_AMPCS_COMPATIBLE
2252  // Serialize the number of arguments
2253  _status = _logBuff.serializeFrom(static_cast<U8>(2));
2254  FW_ASSERT(
2255  _status == Fw::FW_SERIALIZE_OK,
2256  static_cast<FwAssertArgType>(_status)
2257  );
2258 #endif
2259 
2260 #if FW_AMPCS_COMPATIBLE
2261  // Serialize the argument size
2262  _status = _logBuff.serializeFrom(
2264  );
2265  FW_ASSERT(
2266  _status == Fw::FW_SERIALIZE_OK,
2267  static_cast<FwAssertArgType>(_status)
2268  );
2269 #endif
2270  _status = _logBuff.serializeFrom(currentState);
2271  FW_ASSERT(
2272  _status == Fw::FW_SERIALIZE_OK,
2273  static_cast<FwAssertArgType>(_status)
2274  );
2275 
2276 #if FW_AMPCS_COMPATIBLE
2277  // Serialize the argument size
2278  _status = _logBuff.serializeFrom(
2280  );
2281  FW_ASSERT(
2282  _status == Fw::FW_SERIALIZE_OK,
2283  static_cast<FwAssertArgType>(_status)
2284  );
2285 #endif
2286  _status = _logBuff.serializeFrom(attemptedAction);
2287  FW_ASSERT(
2288  _status == Fw::FW_SERIALIZE_OK,
2289  static_cast<FwAssertArgType>(_status)
2290  );
2291 
2292  this->Log_out(
2293  0,
2294  _id,
2295  _logTime,
2297  _logBuff
2298  );
2299  }
2300 
2301  // Emit the event on the text log port
2302 #if FW_ENABLE_TEXT_LOGGING
2303  if (this->isConnected_LogText_OutputPort(0)) {
2304 #if FW_OBJECT_NAMES == 1
2305  const char* _formatString =
2306  "(%s) %s: Invalid action during parameter file load. Current state: %s, Action (Invalid for current state): %s.";
2307 #else
2308  const char* _formatString =
2309  "%s: Invalid action during parameter file load. Current state: %s, Action (Invalid for current state): %s.";
2310 #endif
2311 
2312  Fw::String currentStateStr;
2313  currentState.toString(currentStateStr);
2314  Fw::String attemptedActionStr;
2315  attemptedAction.toString(attemptedActionStr);
2316 
2317  Fw::TextLogString _logString;
2318  (void) _logString.format(
2319  _formatString,
2320 #if FW_OBJECT_NAMES == 1
2321  this->m_objName.toChar(),
2322 #endif
2323  "PrmDbFileLoadInvalidAction ",
2324  currentStateStr.toChar(),
2325  attemptedActionStr.toChar()
2326  );
2327 
2328  this->LogText_out(
2329  0,
2330  _id,
2331  _logTime,
2333  _logString
2334  );
2335  }
2336 #endif
2337  }
2338 
2341  U32 readCrc,
2342  U32 compCrc
2343  ) const
2344  {
2345  // Get the time
2346  Fw::Time _logTime;
2347  if (this->isConnected_Time_OutputPort(0)) {
2348  this->Time_out(0, _logTime);
2349  }
2350 
2351  const FwEventIdType _id = this->getIdBase() + EVENTID_PRMFILEBADCRC;
2352 
2353  // Emit the event on the log port
2354  if (this->isConnected_Log_OutputPort(0)) {
2355  Fw::LogBuffer _logBuff;
2357 
2358 #if FW_AMPCS_COMPATIBLE
2359  // Serialize the number of arguments
2360  _status = _logBuff.serializeFrom(static_cast<U8>(2));
2361  FW_ASSERT(
2362  _status == Fw::FW_SERIALIZE_OK,
2363  static_cast<FwAssertArgType>(_status)
2364  );
2365 #endif
2366 
2367 #if FW_AMPCS_COMPATIBLE
2368  // Serialize the argument size
2369  _status = _logBuff.serializeFrom(
2370  static_cast<U8>(sizeof(U32))
2371  );
2372  FW_ASSERT(
2373  _status == Fw::FW_SERIALIZE_OK,
2374  static_cast<FwAssertArgType>(_status)
2375  );
2376 #endif
2377  _status = _logBuff.serializeFrom(readCrc);
2378  FW_ASSERT(
2379  _status == Fw::FW_SERIALIZE_OK,
2380  static_cast<FwAssertArgType>(_status)
2381  );
2382 
2383 #if FW_AMPCS_COMPATIBLE
2384  // Serialize the argument size
2385  _status = _logBuff.serializeFrom(
2386  static_cast<U8>(sizeof(U32))
2387  );
2388  FW_ASSERT(
2389  _status == Fw::FW_SERIALIZE_OK,
2390  static_cast<FwAssertArgType>(_status)
2391  );
2392 #endif
2393  _status = _logBuff.serializeFrom(compCrc);
2394  FW_ASSERT(
2395  _status == Fw::FW_SERIALIZE_OK,
2396  static_cast<FwAssertArgType>(_status)
2397  );
2398 
2399  this->Log_out(
2400  0,
2401  _id,
2402  _logTime,
2404  _logBuff
2405  );
2406  }
2407 
2408  // Emit the event on the text log port
2409 #if FW_ENABLE_TEXT_LOGGING
2410  if (this->isConnected_LogText_OutputPort(0)) {
2411 #if FW_OBJECT_NAMES == 1
2412  const char* _formatString =
2413  "(%s) %s: Parameter file failed CRC. Read: 0x%" PRIx32 " Computed: 0x%" PRIx32 "";
2414 #else
2415  const char* _formatString =
2416  "%s: Parameter file failed CRC. Read: 0x%" PRIx32 " Computed: 0x%" PRIx32 "";
2417 #endif
2418 
2419  Fw::TextLogString _logString;
2420  (void) _logString.format(
2421  _formatString,
2422 #if FW_OBJECT_NAMES == 1
2423  this->m_objName.toChar(),
2424 #endif
2425  "PrmFileBadCrc ",
2426  readCrc,
2427  compCrc
2428  );
2429 
2430  this->LogText_out(
2431  0,
2432  _id,
2433  _logTime,
2435  _logString
2436  );
2437  }
2438 #endif
2439  }
2440 
2441  // ----------------------------------------------------------------------
2442  // Event throttle reset functions
2443  // ----------------------------------------------------------------------
2444 
2447  {
2448  // Reset throttle counter
2449  this->m_PrmIdNotFoundThrottle = 0;
2450  }
2451 
2452  // ----------------------------------------------------------------------
2453  // Time
2454  // ----------------------------------------------------------------------
2455 
2457  getTime() const
2458  {
2459  if (this->isConnected_Time_OutputPort(0)) {
2460  Fw::Time _time;
2461  this->Time_out(0, _time);
2462  return _time;
2463  }
2464  else {
2465  return Fw::Time(TimeBase::TB_NONE, 0, 0);
2466  }
2467  }
2468 
2469  // ----------------------------------------------------------------------
2470  // Mutex operations for guarded ports
2471  //
2472  // You can override these operations to provide more sophisticated
2473  // synchronization
2474  // ----------------------------------------------------------------------
2475 
2478  {
2479  this->m_guardedPortMutex.lock();
2480  }
2481 
2484  {
2485  this->m_guardedPortMutex.unLock();
2486  }
2487 
2488  // ----------------------------------------------------------------------
2489  // Message dispatch functions
2490  // ----------------------------------------------------------------------
2491 
2492  Fw::QueuedComponentBase::MsgDispatchStatus PrmDbComponentBase ::
2493  doDispatch()
2494  {
2495  ComponentIpcSerializableBuffer _msg;
2496  FwQueuePriorityType _priority = 0;
2497 
2498  Os::Queue::Status _msgStatus = this->m_queue.receive(
2499  _msg,
2501  _priority
2502  );
2503  FW_ASSERT(
2504  _msgStatus == Os::Queue::OP_OK,
2505  static_cast<FwAssertArgType>(_msgStatus)
2506  );
2507 
2508  // Reset to beginning of buffer
2509  _msg.resetDeser();
2510 
2511  FwEnumStoreType _desMsg = 0;
2512  Fw::SerializeStatus _deserStatus = _msg.deserializeTo(_desMsg);
2513  FW_ASSERT(
2514  _deserStatus == Fw::FW_SERIALIZE_OK,
2515  static_cast<FwAssertArgType>(_deserStatus)
2516  );
2517 
2518  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
2519 
2520  if (_msgType == PRMDB_COMPONENT_EXIT) {
2521  return MSG_DISPATCH_EXIT;
2522  }
2523 
2524  FwIndexType portNum = 0;
2525  _deserStatus = _msg.deserializeTo(portNum);
2526  FW_ASSERT(
2527  _deserStatus == Fw::FW_SERIALIZE_OK,
2528  static_cast<FwAssertArgType>(_deserStatus)
2529  );
2530 
2531  switch (_msgType) {
2532  // Handle async input port pingIn
2533  case PINGIN_PING: {
2534  // Deserialize argument key
2535  U32 key;
2536  _deserStatus = _msg.deserializeTo(key);
2537  FW_ASSERT(
2538  _deserStatus == Fw::FW_SERIALIZE_OK,
2539  static_cast<FwAssertArgType>(_deserStatus)
2540  );
2541  // Call handler function
2542  this->pingIn_handler(
2543  portNum,
2544  key
2545  );
2546 
2547  break;
2548  }
2549 
2550  // Handle async input port setPrm
2551  case SETPRM_PRMSET: {
2552  // Deserialize argument id
2553  FwPrmIdType id;
2554  _deserStatus = _msg.deserializeTo(id);
2555  FW_ASSERT(
2556  _deserStatus == Fw::FW_SERIALIZE_OK,
2557  static_cast<FwAssertArgType>(_deserStatus)
2558  );
2559 
2560  // Deserialize argument val
2561  Fw::ParamBuffer val;
2562  _deserStatus = _msg.deserializeTo(val);
2563  FW_ASSERT(
2564  _deserStatus == Fw::FW_SERIALIZE_OK,
2565  static_cast<FwAssertArgType>(_deserStatus)
2566  );
2567  // Call handler function
2568  this->setPrm_handler(
2569  portNum,
2570  id,
2571  val
2572  );
2573 
2574  break;
2575  }
2576 
2577  // Handle command PRM_SAVE_FILE
2578  case CMD_PRM_SAVE_FILE: {
2579  // Deserialize opcode
2580  FwOpcodeType _opCode = 0;
2581  _deserStatus = _msg.deserializeTo(_opCode);
2582  FW_ASSERT (
2583  _deserStatus == Fw::FW_SERIALIZE_OK,
2584  static_cast<FwAssertArgType>(_deserStatus)
2585  );
2586 
2587  // Deserialize command sequence
2588  U32 _cmdSeq = 0;
2589  _deserStatus = _msg.deserializeTo(_cmdSeq);
2590  FW_ASSERT (
2591  _deserStatus == Fw::FW_SERIALIZE_OK,
2592  static_cast<FwAssertArgType>(_deserStatus)
2593  );
2594 
2595  // Deserialize command argument buffer
2596  Fw::CmdArgBuffer args;
2597  _deserStatus = _msg.deserializeTo(args);
2598  FW_ASSERT (
2599  _deserStatus == Fw::FW_SERIALIZE_OK,
2600  static_cast<FwAssertArgType>(_deserStatus)
2601  );
2602 
2603  // Reset buffer
2604  args.resetDeser();
2605 
2606  // Make sure there was no data left over.
2607  // That means the argument buffer size was incorrect.
2608 #if FW_CMD_CHECK_RESIDUAL
2609  if (args.getDeserializeSizeLeft() != 0) {
2610  if (this->isConnected_CmdStatus_OutputPort(0)) {
2611  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2612  }
2613  // Don't crash the task if bad arguments were passed from the ground
2614  break;
2615  }
2616 #endif
2617 
2618  // Call handler function
2619  this->PRM_SAVE_FILE_cmdHandler(_opCode, _cmdSeq);
2620 
2621  break;
2622  }
2623 
2624  // Handle command PRM_LOAD_FILE
2625  case CMD_PRM_LOAD_FILE: {
2626  // Deserialize opcode
2627  FwOpcodeType _opCode = 0;
2628  _deserStatus = _msg.deserializeTo(_opCode);
2629  FW_ASSERT (
2630  _deserStatus == Fw::FW_SERIALIZE_OK,
2631  static_cast<FwAssertArgType>(_deserStatus)
2632  );
2633 
2634  // Deserialize command sequence
2635  U32 _cmdSeq = 0;
2636  _deserStatus = _msg.deserializeTo(_cmdSeq);
2637  FW_ASSERT (
2638  _deserStatus == Fw::FW_SERIALIZE_OK,
2639  static_cast<FwAssertArgType>(_deserStatus)
2640  );
2641 
2642  // Deserialize command argument buffer
2643  Fw::CmdArgBuffer args;
2644  _deserStatus = _msg.deserializeTo(args);
2645  FW_ASSERT (
2646  _deserStatus == Fw::FW_SERIALIZE_OK,
2647  static_cast<FwAssertArgType>(_deserStatus)
2648  );
2649 
2650  // Reset buffer
2651  args.resetDeser();
2652 
2653  // Deserialize argument fileName
2654  Fw::CmdStringArg fileName;
2655  _deserStatus = args.deserializeTo(fileName);
2656  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2657  if (this->isConnected_CmdStatus_OutputPort(0)) {
2658  this->cmdResponse_out(
2659  _opCode,
2660  _cmdSeq,
2662  );
2663  }
2664  // Don't crash the task if bad arguments were passed from the ground
2665  break;
2666  }
2667 
2668  // Deserialize argument merge
2669  Svc::PrmDb_Merge merge;
2670  _deserStatus = args.deserializeTo(merge);
2671  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2672  if (this->isConnected_CmdStatus_OutputPort(0)) {
2673  this->cmdResponse_out(
2674  _opCode,
2675  _cmdSeq,
2677  );
2678  }
2679  // Don't crash the task if bad arguments were passed from the ground
2680  break;
2681  }
2682 
2683  // Make sure there was no data left over.
2684  // That means the argument buffer size was incorrect.
2685 #if FW_CMD_CHECK_RESIDUAL
2686  if (args.getDeserializeSizeLeft() != 0) {
2687  if (this->isConnected_CmdStatus_OutputPort(0)) {
2688  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2689  }
2690  // Don't crash the task if bad arguments were passed from the ground
2691  break;
2692  }
2693 #endif
2694 
2695  // Call handler function
2697  _opCode, _cmdSeq,
2698  fileName,
2699  merge
2700  );
2701 
2702  break;
2703  }
2704 
2705  // Handle command PRM_COMMIT_STAGED
2706  case CMD_PRM_COMMIT_STAGED: {
2707  // Deserialize opcode
2708  FwOpcodeType _opCode = 0;
2709  _deserStatus = _msg.deserializeTo(_opCode);
2710  FW_ASSERT (
2711  _deserStatus == Fw::FW_SERIALIZE_OK,
2712  static_cast<FwAssertArgType>(_deserStatus)
2713  );
2714 
2715  // Deserialize command sequence
2716  U32 _cmdSeq = 0;
2717  _deserStatus = _msg.deserializeTo(_cmdSeq);
2718  FW_ASSERT (
2719  _deserStatus == Fw::FW_SERIALIZE_OK,
2720  static_cast<FwAssertArgType>(_deserStatus)
2721  );
2722 
2723  // Deserialize command argument buffer
2724  Fw::CmdArgBuffer args;
2725  _deserStatus = _msg.deserializeTo(args);
2726  FW_ASSERT (
2727  _deserStatus == Fw::FW_SERIALIZE_OK,
2728  static_cast<FwAssertArgType>(_deserStatus)
2729  );
2730 
2731  // Reset buffer
2732  args.resetDeser();
2733 
2734  // Make sure there was no data left over.
2735  // That means the argument buffer size was incorrect.
2736 #if FW_CMD_CHECK_RESIDUAL
2737  if (args.getDeserializeSizeLeft() != 0) {
2738  if (this->isConnected_CmdStatus_OutputPort(0)) {
2739  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2740  }
2741  // Don't crash the task if bad arguments were passed from the ground
2742  break;
2743  }
2744 #endif
2745 
2746  // Call handler function
2747  this->PRM_COMMIT_STAGED_cmdHandler(_opCode, _cmdSeq);
2748 
2749  break;
2750  }
2751 
2752  default:
2753  return MSG_DISPATCH_ERROR;
2754  }
2755 
2756  return MSG_DISPATCH_OK;
2757  }
2758 
2759  // ----------------------------------------------------------------------
2760  // Calls for messages received on special input ports
2761  // ----------------------------------------------------------------------
2762 
2763  void PrmDbComponentBase ::
2764  m_p_CmdDisp_in(
2765  Fw::PassiveComponentBase* callComp,
2766  FwIndexType portNum,
2767  FwOpcodeType opCode,
2768  U32 cmdSeq,
2769  Fw::CmdArgBuffer& args
2770  )
2771  {
2772  FW_ASSERT(callComp != nullptr);
2773  PrmDbComponentBase* compPtr = static_cast<PrmDbComponentBase*>(callComp);
2774  compPtr->CmdDisp_handlerBase(
2775  portNum,
2776  opCode,
2777  cmdSeq,
2778  args
2779  );
2780  }
2781 
2782  // ----------------------------------------------------------------------
2783  // Calls for messages received on typed input ports
2784  // ----------------------------------------------------------------------
2785 
2786  Fw::ParamValid PrmDbComponentBase ::
2787  m_p_getPrm_in(
2788  Fw::PassiveComponentBase* callComp,
2789  FwIndexType portNum,
2790  FwPrmIdType id,
2791  Fw::ParamBuffer& val
2792  )
2793  {
2794  FW_ASSERT(callComp != nullptr);
2795  PrmDbComponentBase* compPtr = static_cast<PrmDbComponentBase*>(callComp);
2796  return compPtr->getPrm_handlerBase(
2797  portNum,
2798  id,
2799  val
2800  );
2801  }
2802 
2803  void PrmDbComponentBase ::
2804  m_p_pingIn_in(
2805  Fw::PassiveComponentBase* callComp,
2806  FwIndexType portNum,
2807  U32 key
2808  )
2809  {
2810  FW_ASSERT(callComp != nullptr);
2811  PrmDbComponentBase* compPtr = static_cast<PrmDbComponentBase*>(callComp);
2812  compPtr->pingIn_handlerBase(
2813  portNum,
2814  key
2815  );
2816  }
2817 
2818  void PrmDbComponentBase ::
2819  m_p_setPrm_in(
2820  Fw::PassiveComponentBase* callComp,
2821  FwIndexType portNum,
2822  FwPrmIdType id,
2823  Fw::ParamBuffer& val
2824  )
2825  {
2826  FW_ASSERT(callComp != nullptr);
2827  PrmDbComponentBase* compPtr = static_cast<PrmDbComponentBase*>(callComp);
2828  compPtr->setPrm_handlerBase(
2829  portNum,
2830  id,
2831  val
2832  );
2833  }
2834 
2835 #if !FW_DIRECT_PORT_CALLS
2836 
2837  // ----------------------------------------------------------------------
2838  // Invocation functions for special output ports
2839  // ----------------------------------------------------------------------
2840 
2841  void PrmDbComponentBase ::
2842  CmdReg_out(
2843  FwIndexType portNum,
2844  FwOpcodeType opCode
2845  ) const
2846  {
2847  FW_ASSERT(
2848  (0 <= portNum) && (portNum < this->getNum_CmdReg_OutputPorts()),
2849  static_cast<FwAssertArgType>(portNum)
2850  );
2851 
2852  FW_ASSERT(
2853  this->m_CmdReg_OutputPort[portNum].isConnected(),
2854  static_cast<FwAssertArgType>(portNum)
2855  );
2856  this->m_CmdReg_OutputPort[portNum].invoke(
2857  opCode
2858  );
2859  }
2860 
2861  void PrmDbComponentBase ::
2862  CmdStatus_out(
2863  FwIndexType portNum,
2864  FwOpcodeType opCode,
2865  U32 cmdSeq,
2866  const Fw::CmdResponse& response
2867  ) const
2868  {
2869  FW_ASSERT(
2870  (0 <= portNum) && (portNum < this->getNum_CmdStatus_OutputPorts()),
2871  static_cast<FwAssertArgType>(portNum)
2872  );
2873 
2874  FW_ASSERT(
2875  this->m_CmdStatus_OutputPort[portNum].isConnected(),
2876  static_cast<FwAssertArgType>(portNum)
2877  );
2878  this->m_CmdStatus_OutputPort[portNum].invoke(
2879  opCode,
2880  cmdSeq,
2881  response
2882  );
2883  }
2884 
2885  void PrmDbComponentBase ::
2886  Log_out(
2887  FwIndexType portNum,
2888  FwEventIdType id,
2889  Fw::Time& timeTag,
2890  const Fw::LogSeverity& severity,
2891  Fw::LogBuffer& args
2892  ) const
2893  {
2894  FW_ASSERT(
2895  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
2896  static_cast<FwAssertArgType>(portNum)
2897  );
2898 
2899  FW_ASSERT(
2900  this->m_Log_OutputPort[portNum].isConnected(),
2901  static_cast<FwAssertArgType>(portNum)
2902  );
2903  this->m_Log_OutputPort[portNum].invoke(
2904  id,
2905  timeTag,
2906  severity,
2907  args
2908  );
2909  }
2910 
2911 #if FW_ENABLE_TEXT_LOGGING
2912 
2913  void PrmDbComponentBase ::
2914  LogText_out(
2915  FwIndexType portNum,
2916  FwEventIdType id,
2917  Fw::Time& timeTag,
2918  const Fw::LogSeverity& severity,
2919  Fw::TextLogString& text
2920  ) const
2921  {
2922  FW_ASSERT(
2923  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
2924  static_cast<FwAssertArgType>(portNum)
2925  );
2926 
2927  FW_ASSERT(
2928  this->m_LogText_OutputPort[portNum].isConnected(),
2929  static_cast<FwAssertArgType>(portNum)
2930  );
2931  this->m_LogText_OutputPort[portNum].invoke(
2932  id,
2933  timeTag,
2934  severity,
2935  text
2936  );
2937  }
2938 
2939 #endif
2940 
2941  void PrmDbComponentBase ::
2942  Time_out(
2943  FwIndexType portNum,
2944  Fw::Time& time
2945  ) const
2946  {
2947  FW_ASSERT(
2948  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
2949  static_cast<FwAssertArgType>(portNum)
2950  );
2951 
2952  FW_ASSERT(
2953  this->m_Time_OutputPort[portNum].isConnected(),
2954  static_cast<FwAssertArgType>(portNum)
2955  );
2956  this->m_Time_OutputPort[portNum].invoke(
2957  time
2958  );
2959  }
2960 
2961 #endif
2962 
2963 }
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
Loads a file from storage into the staging database. The file could have selective IDs and not the wh...
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
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
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 log_WARNING_HI_PrmFileReadError(const Svc::PrmDb_PrmReadError &stage, I32 record, I32 error) const
void log_ACTIVITY_HI_PrmFileSaveComplete(U32 records) const
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()
Parameter file load failed, not staging any update.
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.
The size of the serial representation.
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.
The size of the serial representation.
Parameter ID updated in database.
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
void unLock()
unlock the mutex and assert success
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)
Commits the backup database to become the prime (active) database.
A serious but recoverable event.
The size of the serial representation.
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.
#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
void setPortNum(FwIndexType portNum)
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)
void lock()
lock the mutex and assert success
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)
message to exit active component task
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
All parameters Copied from one DB to another.
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.
Command to save parameter image to file. Uses file name passed to constructor.
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 incNumMsgDropped()
increment the number of messages dropped
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
void init()
Initialization function.
Definition: PingPortAc.cpp:73
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.
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 ID not found in database.
#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.
SerializeStatus serializeTo(SerialBufferBase &buffer, Endianness mode=Endianness::BIG) const override
Serialize the contents of this object to a buffer.
BYTE cmdPortSize[Fw::CmdPortBuffer::CAPACITY]