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