F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
DpCompressProcComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title DpCompressProcComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for DpCompressProc component base class
5 // ======================================================================
6 
7 #include "Fw/Prm/ParamValid.hpp"
8 #include "Fw/Types/Assert.hpp"
10 #if FW_ENABLE_TEXT_LOGGING
11 #include "Fw/Types/String.hpp"
12 #endif
14 
15 namespace Svc {
16 
17  // ----------------------------------------------------------------------
18  // Types for data products
19  // ----------------------------------------------------------------------
20 
23  FwDpIdType id,
24  const Fw::Buffer& buffer,
25  FwDpIdType baseId
26  ) :
27  Fw::DpContainer(id, buffer),
28  m_baseId(baseId)
29  {
30 
31  }
32 
35  Fw::DpContainer(),
36  m_baseId(0)
37  {
38 
39  }
40 
43  const U8* array,
44  FwSizeType size
45  )
46  {
47  FW_ASSERT(array != nullptr);
48  // Compute the size delta
49  const FwSizeType sizeDelta =
50  sizeof(FwDpIdType) +
51  sizeof(FwSizeStoreType) +
52  size * sizeof(U8);
53  // Serialize the elements if they will fit
55  if ((this->m_dataBuffer.getSize() + sizeDelta) <= this->m_dataBuffer.getCapacity()) {
56  const FwDpIdType id = this->m_baseId + RecordId::CompressionRecord;
57  status = this->m_dataBuffer.serializeFrom(id);
58  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
59  status = this->m_dataBuffer.serializeSize(size);
60  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
61  status = this->m_dataBuffer.serializeFrom(array, size, Fw::Serialization::OMIT_LENGTH);
62  FW_ASSERT(status == Fw::FW_SERIALIZE_OK, static_cast<FwAssertArgType>(status));
63  this->m_dataSize += sizeDelta;
64  }
65  else {
67  }
68  return status;
69  }
70 
71  // ----------------------------------------------------------------------
72  // Component initialization
73  // ----------------------------------------------------------------------
74 
77  {
78  // Initialize base class
80 
81 #if !FW_DIRECT_PORT_CALLS
82  // Connect input port cmdIn
83  for (
84  FwIndexType port = 0;
85  port < static_cast<FwIndexType>(this->getNum_cmdIn_InputPorts());
86  port++
87  ) {
88  this->m_cmdIn_InputPort[port].init();
89  this->m_cmdIn_InputPort[port].addCallComp(
90  this,
91  m_p_cmdIn_in
92  );
93  this->m_cmdIn_InputPort[port].setPortNum(port);
94 
95 #if FW_OBJECT_NAMES == 1
96  Fw::ObjectName portName;
97  portName.format(
98  "%s_cmdIn_InputPort[%" PRI_FwIndexType "]",
99  this->m_objName.toChar(),
100  port
101  );
102  this->m_cmdIn_InputPort[port].setObjName(portName.toChar());
103 #endif
104  }
105 #endif
106 
107 #if !FW_DIRECT_PORT_CALLS
108  // Connect input port procRequest
109  for (
110  FwIndexType port = 0;
111  port < static_cast<FwIndexType>(this->getNum_procRequest_InputPorts());
112  port++
113  ) {
114  this->m_procRequest_InputPort[port].init();
115  this->m_procRequest_InputPort[port].addCallComp(
116  this,
117  m_p_procRequest_in
118  );
119  this->m_procRequest_InputPort[port].setPortNum(port);
120 
121 #if FW_OBJECT_NAMES == 1
122  Fw::ObjectName portName;
123  portName.format(
124  "%s_procRequest_InputPort[%" PRI_FwIndexType "]",
125  this->m_objName.toChar(),
126  port
127  );
128  this->m_procRequest_InputPort[port].setObjName(portName.toChar());
129 #endif
130  }
131 #endif
132 
133 #if !FW_DIRECT_PORT_CALLS
134  // Connect output port cmdRegOut
135  for (
136  FwIndexType port = 0;
137  port < static_cast<FwIndexType>(this->getNum_cmdRegOut_OutputPorts());
138  port++
139  ) {
140  this->m_cmdRegOut_OutputPort[port].init();
141 
142 #if FW_OBJECT_NAMES == 1
143  Fw::ObjectName portName;
144  portName.format(
145  "%s_cmdRegOut_OutputPort[%" PRI_FwIndexType "]",
146  this->m_objName.toChar(),
147  port
148  );
149  this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar());
150 #endif
151  }
152 #endif
153 
154 #if !FW_DIRECT_PORT_CALLS
155  // Connect output port cmdResponseOut
156  for (
157  FwIndexType port = 0;
158  port < static_cast<FwIndexType>(this->getNum_cmdResponseOut_OutputPorts());
159  port++
160  ) {
161  this->m_cmdResponseOut_OutputPort[port].init();
162 
163 #if FW_OBJECT_NAMES == 1
164  Fw::ObjectName portName;
165  portName.format(
166  "%s_cmdResponseOut_OutputPort[%" PRI_FwIndexType "]",
167  this->m_objName.toChar(),
168  port
169  );
170  this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar());
171 #endif
172  }
173 #endif
174 
175 #if !FW_DIRECT_PORT_CALLS
176  // Connect output port dpGet
177  for (
178  FwIndexType port = 0;
179  port < static_cast<FwIndexType>(this->getNum_dpGet_OutputPorts());
180  port++
181  ) {
182  this->m_dpGet_OutputPort[port].init();
183 
184 #if FW_OBJECT_NAMES == 1
185  Fw::ObjectName portName;
186  portName.format(
187  "%s_dpGet_OutputPort[%" PRI_FwIndexType "]",
188  this->m_objName.toChar(),
189  port
190  );
191  this->m_dpGet_OutputPort[port].setObjName(portName.toChar());
192 #endif
193  }
194 #endif
195 
196 #if !FW_DIRECT_PORT_CALLS
197  // Connect output port dpSend
198  for (
199  FwIndexType port = 0;
200  port < static_cast<FwIndexType>(this->getNum_dpSend_OutputPorts());
201  port++
202  ) {
203  this->m_dpSend_OutputPort[port].init();
204 
205 #if FW_OBJECT_NAMES == 1
206  Fw::ObjectName portName;
207  portName.format(
208  "%s_dpSend_OutputPort[%" PRI_FwIndexType "]",
209  this->m_objName.toChar(),
210  port
211  );
212  this->m_dpSend_OutputPort[port].setObjName(portName.toChar());
213 #endif
214  }
215 #endif
216 
217 #if !FW_DIRECT_PORT_CALLS
218  // Connect output port logOut
219  for (
220  FwIndexType port = 0;
221  port < static_cast<FwIndexType>(this->getNum_logOut_OutputPorts());
222  port++
223  ) {
224  this->m_logOut_OutputPort[port].init();
225 
226 #if FW_OBJECT_NAMES == 1
227  Fw::ObjectName portName;
228  portName.format(
229  "%s_logOut_OutputPort[%" PRI_FwIndexType "]",
230  this->m_objName.toChar(),
231  port
232  );
233  this->m_logOut_OutputPort[port].setObjName(portName.toChar());
234 #endif
235  }
236 #endif
237 
238 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING
239  // Connect output port logTextOut
240  for (
241  FwIndexType port = 0;
242  port < static_cast<FwIndexType>(this->getNum_logTextOut_OutputPorts());
243  port++
244  ) {
245  this->m_logTextOut_OutputPort[port].init();
246 
247 #if FW_OBJECT_NAMES == 1
248  Fw::ObjectName portName;
249  portName.format(
250  "%s_logTextOut_OutputPort[%" PRI_FwIndexType "]",
251  this->m_objName.toChar(),
252  port
253  );
254  this->m_logTextOut_OutputPort[port].setObjName(portName.toChar());
255 #endif
256  }
257 #endif
258 
259 #if !FW_DIRECT_PORT_CALLS
260  // Connect output port prmGetOut
261  for (
262  FwIndexType port = 0;
263  port < static_cast<FwIndexType>(this->getNum_prmGetOut_OutputPorts());
264  port++
265  ) {
266  this->m_prmGetOut_OutputPort[port].init();
267 
268 #if FW_OBJECT_NAMES == 1
269  Fw::ObjectName portName;
270  portName.format(
271  "%s_prmGetOut_OutputPort[%" PRI_FwIndexType "]",
272  this->m_objName.toChar(),
273  port
274  );
275  this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar());
276 #endif
277  }
278 #endif
279 
280 #if !FW_DIRECT_PORT_CALLS
281  // Connect output port prmSetOut
282  for (
283  FwIndexType port = 0;
284  port < static_cast<FwIndexType>(this->getNum_prmSetOut_OutputPorts());
285  port++
286  ) {
287  this->m_prmSetOut_OutputPort[port].init();
288 
289 #if FW_OBJECT_NAMES == 1
290  Fw::ObjectName portName;
291  portName.format(
292  "%s_prmSetOut_OutputPort[%" PRI_FwIndexType "]",
293  this->m_objName.toChar(),
294  port
295  );
296  this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar());
297 #endif
298  }
299 #endif
300 
301 #if !FW_DIRECT_PORT_CALLS
302  // Connect output port timeCaller
303  for (
304  FwIndexType port = 0;
305  port < static_cast<FwIndexType>(this->getNum_timeCaller_OutputPorts());
306  port++
307  ) {
308  this->m_timeCaller_OutputPort[port].init();
309 
310 #if FW_OBJECT_NAMES == 1
311  Fw::ObjectName portName;
312  portName.format(
313  "%s_timeCaller_OutputPort[%" PRI_FwIndexType "]",
314  this->m_objName.toChar(),
315  port
316  );
317  this->m_timeCaller_OutputPort[port].setObjName(portName.toChar());
318 #endif
319  }
320 #endif
321 
322 #if !FW_DIRECT_PORT_CALLS
323  // Connect output port compressChunk
324  for (
325  FwIndexType port = 0;
326  port < static_cast<FwIndexType>(this->getNum_compressChunk_OutputPorts());
327  port++
328  ) {
329  this->m_compressChunk_OutputPort[port].init();
330 
331 #if FW_OBJECT_NAMES == 1
332  Fw::ObjectName portName;
333  portName.format(
334  "%s_compressChunk_OutputPort[%" PRI_FwIndexType "]",
335  this->m_objName.toChar(),
336  port
337  );
338  this->m_compressChunk_OutputPort[port].setObjName(portName.toChar());
339 #endif
340  }
341 #endif
342  }
343 
344 #if !FW_DIRECT_PORT_CALLS
345 
346  // ----------------------------------------------------------------------
347  // Getters for special input ports
348  // ----------------------------------------------------------------------
349 
352  {
353  FW_ASSERT(
354  (0 <= portNum) && (portNum < this->getNum_cmdIn_InputPorts()),
355  static_cast<FwAssertArgType>(portNum)
356  );
357 
358  return &this->m_cmdIn_InputPort[portNum];
359  }
360 
361 #endif
362 
363 #if !FW_DIRECT_PORT_CALLS
364 
365  // ----------------------------------------------------------------------
366  // Getters for typed input ports
367  // ----------------------------------------------------------------------
368 
371  {
372  FW_ASSERT(
373  (0 <= portNum) && (portNum < this->getNum_procRequest_InputPorts()),
374  static_cast<FwAssertArgType>(portNum)
375  );
376 
377  return &this->m_procRequest_InputPort[portNum];
378  }
379 
380 #endif
381 
382 #if !FW_DIRECT_PORT_CALLS
383 
384  // ----------------------------------------------------------------------
385  // Connect input ports to special output ports
386  // ----------------------------------------------------------------------
387 
390  FwIndexType portNum,
391  Fw::InputCmdRegPort* port
392  )
393  {
394  FW_ASSERT(
395  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
396  static_cast<FwAssertArgType>(portNum)
397  );
398 
399  this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
400  }
401 
404  FwIndexType portNum,
406  )
407  {
408  FW_ASSERT(
409  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
410  static_cast<FwAssertArgType>(portNum)
411  );
412 
413  this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
414  }
415 
418  FwIndexType portNum,
419  Fw::InputDpGetPort* port
420  )
421  {
422  FW_ASSERT(
423  (0 <= portNum) && (portNum < this->getNum_dpGet_OutputPorts()),
424  static_cast<FwAssertArgType>(portNum)
425  );
426 
427  this->m_dpGet_OutputPort[portNum].addCallPort(port);
428  }
429 
432  FwIndexType portNum,
433  Fw::InputDpSendPort* port
434  )
435  {
436  FW_ASSERT(
437  (0 <= portNum) && (portNum < this->getNum_dpSend_OutputPorts()),
438  static_cast<FwAssertArgType>(portNum)
439  );
440 
441  this->m_dpSend_OutputPort[portNum].addCallPort(port);
442  }
443 
446  FwIndexType portNum,
447  Fw::InputLogPort* port
448  )
449  {
450  FW_ASSERT(
451  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
452  static_cast<FwAssertArgType>(portNum)
453  );
454 
455  this->m_logOut_OutputPort[portNum].addCallPort(port);
456  }
457 
458 #if FW_ENABLE_TEXT_LOGGING == 1
459 
460  void DpCompressProcComponentBase ::
461  set_logTextOut_OutputPort(
462  FwIndexType portNum,
464  )
465  {
466  FW_ASSERT(
467  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
468  static_cast<FwAssertArgType>(portNum)
469  );
470 
471  this->m_logTextOut_OutputPort[portNum].addCallPort(port);
472  }
473 
474 #endif
475 
478  FwIndexType portNum,
479  Fw::InputPrmGetPort* port
480  )
481  {
482  FW_ASSERT(
483  (0 <= portNum) && (portNum < this->getNum_prmGetOut_OutputPorts()),
484  static_cast<FwAssertArgType>(portNum)
485  );
486 
487  this->m_prmGetOut_OutputPort[portNum].addCallPort(port);
488  }
489 
492  FwIndexType portNum,
493  Fw::InputPrmSetPort* port
494  )
495  {
496  FW_ASSERT(
497  (0 <= portNum) && (portNum < this->getNum_prmSetOut_OutputPorts()),
498  static_cast<FwAssertArgType>(portNum)
499  );
500 
501  this->m_prmSetOut_OutputPort[portNum].addCallPort(port);
502  }
503 
506  FwIndexType portNum,
507  Fw::InputTimePort* port
508  )
509  {
510  FW_ASSERT(
511  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
512  static_cast<FwAssertArgType>(portNum)
513  );
514 
515  this->m_timeCaller_OutputPort[portNum].addCallPort(port);
516  }
517 
518 #endif
519 
520 #if !FW_DIRECT_PORT_CALLS
521 
522  // ----------------------------------------------------------------------
523  // Connect typed input ports to typed output ports
524  // ----------------------------------------------------------------------
525 
528  FwIndexType portNum,
530  )
531  {
532  FW_ASSERT(
533  (0 <= portNum) && (portNum < this->getNum_compressChunk_OutputPorts()),
534  static_cast<FwAssertArgType>(portNum)
535  );
536 
537  this->m_compressChunk_OutputPort[portNum].addCallPort(port);
538  }
539 
540 #endif
541 
542 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
543 
544  // ----------------------------------------------------------------------
545  // Connect serial input ports to special output ports
546  // ----------------------------------------------------------------------
547 
550  FwIndexType portNum,
551  Fw::InputSerializePort* port
552  )
553  {
554  FW_ASSERT(
555  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
556  static_cast<FwAssertArgType>(portNum)
557  );
558 
559  this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
560  }
561 
564  FwIndexType portNum,
565  Fw::InputSerializePort* port
566  )
567  {
568  FW_ASSERT(
569  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
570  static_cast<FwAssertArgType>(portNum)
571  );
572 
573  this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
574  }
575 
578  FwIndexType portNum,
579  Fw::InputSerializePort* port
580  )
581  {
582  FW_ASSERT(
583  (0 <= portNum) && (portNum < this->getNum_dpSend_OutputPorts()),
584  static_cast<FwAssertArgType>(portNum)
585  );
586 
587  this->m_dpSend_OutputPort[portNum].registerSerialPort(port);
588  }
589 
592  FwIndexType portNum,
593  Fw::InputSerializePort* port
594  )
595  {
596  FW_ASSERT(
597  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
598  static_cast<FwAssertArgType>(portNum)
599  );
600 
601  this->m_logOut_OutputPort[portNum].registerSerialPort(port);
602  }
603 
604 #if FW_ENABLE_TEXT_LOGGING == 1
605 
606  void DpCompressProcComponentBase ::
607  set_logTextOut_OutputPort(
608  FwIndexType portNum,
609  Fw::InputSerializePort* port
610  )
611  {
612  FW_ASSERT(
613  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
614  static_cast<FwAssertArgType>(portNum)
615  );
616 
617  this->m_logTextOut_OutputPort[portNum].registerSerialPort(port);
618  }
619 
620 #endif
621 
624  FwIndexType portNum,
625  Fw::InputSerializePort* port
626  )
627  {
628  FW_ASSERT(
629  (0 <= portNum) && (portNum < this->getNum_prmSetOut_OutputPorts()),
630  static_cast<FwAssertArgType>(portNum)
631  );
632 
633  this->m_prmSetOut_OutputPort[portNum].registerSerialPort(port);
634  }
635 
638  FwIndexType portNum,
639  Fw::InputSerializePort* port
640  )
641  {
642  FW_ASSERT(
643  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
644  static_cast<FwAssertArgType>(portNum)
645  );
646 
647  this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
648  }
649 
650 #endif
651 
652  // ----------------------------------------------------------------------
653  // Command registration
654  // ----------------------------------------------------------------------
655 
658  {
660 
661  this->cmdRegOut_out(
662  0,
664  );
665 
666  this->cmdRegOut_out(
667  0,
669  );
670 
671  this->cmdRegOut_out(
672  0,
673  this->getIdBase() + OPCODE_ENABLE_SET
674  );
675 
676  this->cmdRegOut_out(
677  0,
678  this->getIdBase() + OPCODE_ENABLE_SAVE
679  );
680  }
681 
682  // ----------------------------------------------------------------------
683  // Parameter loading
684  // ----------------------------------------------------------------------
685 
688  {
690  const FwPrmIdType _baseId = static_cast<FwPrmIdType>(this->getIdBase());
692 
693  FwPrmIdType _id{};
694  Fw::ParamBuffer _paramBuffer;
695 
696  _id = _baseId + PARAMID_CHUNK_SIZE;
697 
698  // Get serialized parameter CHUNK_SIZE
699  this->m_param_CHUNK_SIZE_valid = this->prmGetOut_out(
700  0,
701  _id,
702  _paramBuffer
703  );
704 
705  this->m_paramLock.lock();
706 
707  // Deserialize parameter or use default value
708  if (this->m_param_CHUNK_SIZE_valid == Fw::ParamValid::VALID) {
709  _stat = _paramBuffer.deserializeTo(this->m_CHUNK_SIZE);
710  if (_stat != Fw::FW_SERIALIZE_OK) {
711  this->m_param_CHUNK_SIZE_valid = Fw::ParamValid::DEFAULT;
712  }
713  }
714  else {
715  this->m_param_CHUNK_SIZE_valid = Fw::ParamValid::DEFAULT;
716  }
717  if (this->m_param_CHUNK_SIZE_valid == Fw::ParamValid::DEFAULT) {
718  this->m_CHUNK_SIZE = 32768;
719  }
720 
721  this->m_paramLock.unlock();
722  this->parameterLoaded(PARAMID_CHUNK_SIZE, this->m_param_CHUNK_SIZE_valid);
723 
724  _id = _baseId + PARAMID_ENABLE;
725 
726  // Get serialized parameter ENABLE
727  this->m_param_ENABLE_valid = this->prmGetOut_out(
728  0,
729  _id,
730  _paramBuffer
731  );
732 
733  this->m_paramLock.lock();
734 
735  // Deserialize parameter or use default value
736  if (this->m_param_ENABLE_valid == Fw::ParamValid::VALID) {
737  _stat = _paramBuffer.deserializeTo(this->m_ENABLE);
738  if (_stat != Fw::FW_SERIALIZE_OK) {
739  this->m_param_ENABLE_valid = Fw::ParamValid::DEFAULT;
740  }
741  }
742  else {
743  this->m_param_ENABLE_valid = Fw::ParamValid::DEFAULT;
744  }
745  if (this->m_param_ENABLE_valid == Fw::ParamValid::DEFAULT) {
746  this->m_ENABLE = Fw::Enabled::ENABLED;
747  }
748 
749  this->m_paramLock.unlock();
750  this->parameterLoaded(PARAMID_ENABLE, this->m_param_ENABLE_valid);
751 
752  // Call notifier
753  this->parametersLoaded();
754  }
755 
756  // ----------------------------------------------------------------------
757  // Component construction and destruction
758  // ----------------------------------------------------------------------
759 
761  DpCompressProcComponentBase(const char* compName) :
762  Fw::PassiveComponentBase(compName)
763  {
764  this->m_DidNotCompressThrottle = 0;
765  this->m_InvalidHeaderThrottle = 0;
766  this->m_BufferTooSmallForPacketThrottle = 0;
767  this->m_ContainerTooLargeThrottle = 0;
768  }
769 
772  {
773 
774  }
775 
776 #if !FW_DIRECT_PORT_CALLS
777 
778  // ----------------------------------------------------------------------
779  // Connection status queries for special output ports
780  // ----------------------------------------------------------------------
781 
784  {
785  FW_ASSERT(
786  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
787  static_cast<FwAssertArgType>(portNum)
788  );
789 
790  return this->m_cmdRegOut_OutputPort[portNum].isConnected();
791  }
792 
795  {
796  FW_ASSERT(
797  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
798  static_cast<FwAssertArgType>(portNum)
799  );
800 
801  return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
802  }
803 
806  {
807  FW_ASSERT(
808  (0 <= portNum) && (portNum < this->getNum_dpGet_OutputPorts()),
809  static_cast<FwAssertArgType>(portNum)
810  );
811 
812  return this->m_dpGet_OutputPort[portNum].isConnected();
813  }
814 
817  {
818  FW_ASSERT(
819  (0 <= portNum) && (portNum < this->getNum_dpSend_OutputPorts()),
820  static_cast<FwAssertArgType>(portNum)
821  );
822 
823  return this->m_dpSend_OutputPort[portNum].isConnected();
824  }
825 
828  {
829  FW_ASSERT(
830  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
831  static_cast<FwAssertArgType>(portNum)
832  );
833 
834  return this->m_logOut_OutputPort[portNum].isConnected();
835  }
836 
837 #if FW_ENABLE_TEXT_LOGGING == 1
838 
839  bool DpCompressProcComponentBase ::
840  isConnected_logTextOut_OutputPort(FwIndexType portNum) const
841  {
842  FW_ASSERT(
843  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
844  static_cast<FwAssertArgType>(portNum)
845  );
846 
847  return this->m_logTextOut_OutputPort[portNum].isConnected();
848  }
849 
850 #endif
851 
854  {
855  FW_ASSERT(
856  (0 <= portNum) && (portNum < this->getNum_prmGetOut_OutputPorts()),
857  static_cast<FwAssertArgType>(portNum)
858  );
859 
860  return this->m_prmGetOut_OutputPort[portNum].isConnected();
861  }
862 
865  {
866  FW_ASSERT(
867  (0 <= portNum) && (portNum < this->getNum_prmSetOut_OutputPorts()),
868  static_cast<FwAssertArgType>(portNum)
869  );
870 
871  return this->m_prmSetOut_OutputPort[portNum].isConnected();
872  }
873 
876  {
877  FW_ASSERT(
878  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
879  static_cast<FwAssertArgType>(portNum)
880  );
881 
882  return this->m_timeCaller_OutputPort[portNum].isConnected();
883  }
884 
885 #endif
886 
887 #if !FW_DIRECT_PORT_CALLS
888 
889  // ----------------------------------------------------------------------
890  // Connection status queries for typed output ports
891  // ----------------------------------------------------------------------
892 
895  {
896  FW_ASSERT(
897  (0 <= portNum) && (portNum < this->getNum_compressChunk_OutputPorts()),
898  static_cast<FwAssertArgType>(portNum)
899  );
900 
901  return this->m_compressChunk_OutputPort[portNum].isConnected();
902  }
903 
904 #endif
905 
906  // ----------------------------------------------------------------------
907  // Port handler base-class functions for special input ports
908  //
909  // Call these functions directly to bypass the corresponding ports
910  // ----------------------------------------------------------------------
911 
914  FwIndexType portNum,
915  FwOpcodeType opCode,
916  U32 cmdSeq,
917  Fw::CmdArgBuffer& args
918  )
919  {
920 
921  const U32 idBase = this->getIdBase();
922  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
923 
924  // Select base class function based on opcode
925  switch (opCode - idBase) {
926  case OPCODE_CHUNK_SIZE_SET: {
927  Fw::CmdResponse _cstat = this->paramSet_CHUNK_SIZE(args);
928  this->cmdResponse_out(
929  opCode,
930  cmdSeq,
931  _cstat
932  );
933  break;
934  }
935 
936  case OPCODE_CHUNK_SIZE_SAVE: {
937  Fw::CmdResponse _cstat = this->paramSave_CHUNK_SIZE();
938  this->cmdResponse_out(
939  opCode,
940  cmdSeq,
941  _cstat
942  );
943  break;
944  }
945 
946  case OPCODE_ENABLE_SET: {
947  Fw::CmdResponse _cstat = this->paramSet_ENABLE(args);
948  this->cmdResponse_out(
949  opCode,
950  cmdSeq,
951  _cstat
952  );
953  break;
954  }
955 
956  case OPCODE_ENABLE_SAVE: {
957  Fw::CmdResponse _cstat = this->paramSave_ENABLE();
958  this->cmdResponse_out(
959  opCode,
960  cmdSeq,
961  _cstat
962  );
963  break;
964  }
965  default:
966  // Unknown opcode: ignore it
967  break;
968  }
969  }
970 
971  // ----------------------------------------------------------------------
972  // Port handler base-class functions for typed input ports
973  //
974  // Call these functions directly to bypass the corresponding ports
975  // ----------------------------------------------------------------------
976 
979  FwIndexType portNum,
980  Fw::Buffer& fwBuffer
981  )
982  {
983  // Make sure port number is valid
984  FW_ASSERT(
985  (0 <= portNum) && (portNum < this->getNum_procRequest_InputPorts()),
986  static_cast<FwAssertArgType>(portNum)
987  );
988 
989  // Call handler function
990  this->procRequest_handler(
991  portNum,
992  fwBuffer
993  );
994  }
995 
996 #if !FW_DIRECT_PORT_CALLS
997 
998  // ----------------------------------------------------------------------
999  // Invocation functions for typed output ports
1000  // ----------------------------------------------------------------------
1001 
1004  FwIndexType portNum,
1005  Fw::Buffer& buffer,
1006  FwSizeType min_compression,
1007  FwSizeType write_offset
1008  ) const
1009  {
1010  FW_ASSERT(
1011  (0 <= portNum) && (portNum < this->getNum_compressChunk_OutputPorts()),
1012  static_cast<FwAssertArgType>(portNum)
1013  );
1014 
1015  FW_ASSERT(
1016  this->m_compressChunk_OutputPort[portNum].isConnected(),
1017  static_cast<FwAssertArgType>(portNum)
1018  );
1019  return this->m_compressChunk_OutputPort[portNum].invoke(
1020  buffer,
1021  min_compression,
1022  write_offset
1023  );
1024  }
1025 
1026 #endif
1027 
1028  // ----------------------------------------------------------------------
1029  // Command response
1030  // ----------------------------------------------------------------------
1031 
1034  FwOpcodeType opCode,
1035  U32 cmdSeq,
1036  Fw::CmdResponse response
1037  )
1038  {
1040  this->cmdResponseOut_out(0, opCode, cmdSeq, response);
1041  }
1042 
1043  // ----------------------------------------------------------------------
1044  // Event logging functions
1045  // ----------------------------------------------------------------------
1046 
1049  FwDpIdType dp_id,
1050  FwSizeType initial_size,
1051  FwSizeType final_size
1052  ) const
1053  {
1054  // Get the time
1055  Fw::Time _logTime;
1056  if (this->isConnected_timeCaller_OutputPort(0)) {
1057  this->timeCaller_out(0, _logTime);
1058  }
1059 
1060  const FwEventIdType _id = this->getIdBase() + EVENTID_COMPRESSIONCOMPLETE;
1061 
1062  // Emit the event on the log port
1063  if (this->isConnected_logOut_OutputPort(0)) {
1064  Fw::LogBuffer _logBuff;
1066 
1067 #if FW_AMPCS_COMPATIBLE
1068  // Serialize the number of arguments
1069  _status = _logBuff.serializeFrom(static_cast<U8>(3));
1070  FW_ASSERT(
1071  _status == Fw::FW_SERIALIZE_OK,
1072  static_cast<FwAssertArgType>(_status)
1073  );
1074 #endif
1075 
1076 #if FW_AMPCS_COMPATIBLE
1077  // Serialize the argument size
1078  _status = _logBuff.serializeFrom(
1079  static_cast<U8>(sizeof(FwDpIdType))
1080  );
1081  FW_ASSERT(
1082  _status == Fw::FW_SERIALIZE_OK,
1083  static_cast<FwAssertArgType>(_status)
1084  );
1085 #endif
1086  _status = _logBuff.serializeFrom(dp_id);
1087  FW_ASSERT(
1088  _status == Fw::FW_SERIALIZE_OK,
1089  static_cast<FwAssertArgType>(_status)
1090  );
1091 
1092 #if FW_AMPCS_COMPATIBLE
1093  // Serialize the argument size
1094  _status = _logBuff.serializeFrom(
1095  static_cast<U8>(sizeof(FwSizeType))
1096  );
1097  FW_ASSERT(
1098  _status == Fw::FW_SERIALIZE_OK,
1099  static_cast<FwAssertArgType>(_status)
1100  );
1101 #endif
1102  _status = _logBuff.serializeFrom(initial_size);
1103  FW_ASSERT(
1104  _status == Fw::FW_SERIALIZE_OK,
1105  static_cast<FwAssertArgType>(_status)
1106  );
1107 
1108 #if FW_AMPCS_COMPATIBLE
1109  // Serialize the argument size
1110  _status = _logBuff.serializeFrom(
1111  static_cast<U8>(sizeof(FwSizeType))
1112  );
1113  FW_ASSERT(
1114  _status == Fw::FW_SERIALIZE_OK,
1115  static_cast<FwAssertArgType>(_status)
1116  );
1117 #endif
1118  _status = _logBuff.serializeFrom(final_size);
1119  FW_ASSERT(
1120  _status == Fw::FW_SERIALIZE_OK,
1121  static_cast<FwAssertArgType>(_status)
1122  );
1123 
1124  this->logOut_out(
1125  0,
1126  _id,
1127  _logTime,
1129  _logBuff
1130  );
1131  }
1132 
1133  // Emit the event on the text log port
1134 #if FW_ENABLE_TEXT_LOGGING
1135  if (this->isConnected_logTextOut_OutputPort(0)) {
1136 #if FW_OBJECT_NAMES == 1
1137  const char* _formatString =
1138  "(%s) %s: Compressed Data Product %" PRIu32 " from %" PRIu64 " to %" PRIu64 " bytes";
1139 #else
1140  const char* _formatString =
1141  "%s: Compressed Data Product %" PRIu32 " from %" PRIu64 " to %" PRIu64 " bytes";
1142 #endif
1143 
1144  Fw::TextLogString _logString;
1145  (void) _logString.format(
1146  _formatString,
1147 #if FW_OBJECT_NAMES == 1
1148  this->m_objName.toChar(),
1149 #endif
1150  "CompressionComplete ",
1151  dp_id,
1152  initial_size,
1153  final_size
1154  );
1155 
1156  this->logTextOut_out(
1157  0,
1158  _id,
1159  _logTime,
1161  _logString
1162  );
1163  }
1164 #endif
1165  }
1166 
1169  FwDpIdType dp_id,
1170  FwSizeType data_size
1171  )
1172  {
1173  // Check throttle value
1174  if (this->m_DidNotCompressThrottle >= EVENTID_DIDNOTCOMPRESS_THROTTLE) {
1175  return;
1176  }
1177  else {
1178  this->m_DidNotCompressThrottle++;
1179  }
1180 
1181  // Get the time
1182  Fw::Time _logTime;
1183  if (this->isConnected_timeCaller_OutputPort(0)) {
1184  this->timeCaller_out(0, _logTime);
1185  }
1186 
1187  const FwEventIdType _id = this->getIdBase() + EVENTID_DIDNOTCOMPRESS;
1188 
1189  // Emit the event on the log port
1190  if (this->isConnected_logOut_OutputPort(0)) {
1191  Fw::LogBuffer _logBuff;
1193 
1194 #if FW_AMPCS_COMPATIBLE
1195  // Serialize the number of arguments
1196  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1197  FW_ASSERT(
1198  _status == Fw::FW_SERIALIZE_OK,
1199  static_cast<FwAssertArgType>(_status)
1200  );
1201 #endif
1202 
1203 #if FW_AMPCS_COMPATIBLE
1204  // Serialize the argument size
1205  _status = _logBuff.serializeFrom(
1206  static_cast<U8>(sizeof(FwDpIdType))
1207  );
1208  FW_ASSERT(
1209  _status == Fw::FW_SERIALIZE_OK,
1210  static_cast<FwAssertArgType>(_status)
1211  );
1212 #endif
1213  _status = _logBuff.serializeFrom(dp_id);
1214  FW_ASSERT(
1215  _status == Fw::FW_SERIALIZE_OK,
1216  static_cast<FwAssertArgType>(_status)
1217  );
1218 
1219 #if FW_AMPCS_COMPATIBLE
1220  // Serialize the argument size
1221  _status = _logBuff.serializeFrom(
1222  static_cast<U8>(sizeof(FwSizeType))
1223  );
1224  FW_ASSERT(
1225  _status == Fw::FW_SERIALIZE_OK,
1226  static_cast<FwAssertArgType>(_status)
1227  );
1228 #endif
1229  _status = _logBuff.serializeFrom(data_size);
1230  FW_ASSERT(
1231  _status == Fw::FW_SERIALIZE_OK,
1232  static_cast<FwAssertArgType>(_status)
1233  );
1234 
1235  this->logOut_out(
1236  0,
1237  _id,
1238  _logTime,
1240  _logBuff
1241  );
1242  }
1243 
1244  // Emit the event on the text log port
1245 #if FW_ENABLE_TEXT_LOGGING
1246  if (this->isConnected_logTextOut_OutputPort(0)) {
1247 #if FW_OBJECT_NAMES == 1
1248  const char* _formatString =
1249  "(%s) %s: Unable to reduce size of Data Product %" PRIu32 ". Uncompressed size %" PRIu64 "";
1250 #else
1251  const char* _formatString =
1252  "%s: Unable to reduce size of Data Product %" PRIu32 ". Uncompressed size %" PRIu64 "";
1253 #endif
1254 
1255  Fw::TextLogString _logString;
1256  (void) _logString.format(
1257  _formatString,
1258 #if FW_OBJECT_NAMES == 1
1259  this->m_objName.toChar(),
1260 #endif
1261  "DidNotCompress ",
1262  dp_id,
1263  data_size
1264  );
1265 
1266  this->logTextOut_out(
1267  0,
1268  _id,
1269  _logTime,
1271  _logString
1272  );
1273  }
1274 #endif
1275  }
1276 
1279  FwSizeType buffer_size,
1280  U32 error_code
1281  )
1282  {
1283  // Check throttle value
1284  if (this->m_InvalidHeaderThrottle >= EVENTID_INVALIDHEADER_THROTTLE) {
1285  return;
1286  }
1287  else {
1288  this->m_InvalidHeaderThrottle++;
1289  }
1290 
1291  // Get the time
1292  Fw::Time _logTime;
1293  if (this->isConnected_timeCaller_OutputPort(0)) {
1294  this->timeCaller_out(0, _logTime);
1295  }
1296 
1297  const FwEventIdType _id = this->getIdBase() + EVENTID_INVALIDHEADER;
1298 
1299  // Emit the event on the log port
1300  if (this->isConnected_logOut_OutputPort(0)) {
1301  Fw::LogBuffer _logBuff;
1303 
1304 #if FW_AMPCS_COMPATIBLE
1305  // Serialize the number of arguments
1306  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1307  FW_ASSERT(
1308  _status == Fw::FW_SERIALIZE_OK,
1309  static_cast<FwAssertArgType>(_status)
1310  );
1311 #endif
1312 
1313 #if FW_AMPCS_COMPATIBLE
1314  // Serialize the argument size
1315  _status = _logBuff.serializeFrom(
1316  static_cast<U8>(sizeof(FwSizeType))
1317  );
1318  FW_ASSERT(
1319  _status == Fw::FW_SERIALIZE_OK,
1320  static_cast<FwAssertArgType>(_status)
1321  );
1322 #endif
1323  _status = _logBuff.serializeFrom(buffer_size);
1324  FW_ASSERT(
1325  _status == Fw::FW_SERIALIZE_OK,
1326  static_cast<FwAssertArgType>(_status)
1327  );
1328 
1329 #if FW_AMPCS_COMPATIBLE
1330  // Serialize the argument size
1331  _status = _logBuff.serializeFrom(
1332  static_cast<U8>(sizeof(U32))
1333  );
1334  FW_ASSERT(
1335  _status == Fw::FW_SERIALIZE_OK,
1336  static_cast<FwAssertArgType>(_status)
1337  );
1338 #endif
1339  _status = _logBuff.serializeFrom(error_code);
1340  FW_ASSERT(
1341  _status == Fw::FW_SERIALIZE_OK,
1342  static_cast<FwAssertArgType>(_status)
1343  );
1344 
1345  this->logOut_out(
1346  0,
1347  _id,
1348  _logTime,
1350  _logBuff
1351  );
1352  }
1353 
1354  // Emit the event on the text log port
1355 #if FW_ENABLE_TEXT_LOGGING
1356  if (this->isConnected_logTextOut_OutputPort(0)) {
1357 #if FW_OBJECT_NAMES == 1
1358  const char* _formatString =
1359  "(%s) %s: Received buffer of size %" PRIu64 "; deserialization of container header failed with error code %" PRIu32 "";
1360 #else
1361  const char* _formatString =
1362  "%s: Received buffer of size %" PRIu64 "; deserialization of container header failed with error code %" PRIu32 "";
1363 #endif
1364 
1365  Fw::TextLogString _logString;
1366  (void) _logString.format(
1367  _formatString,
1368 #if FW_OBJECT_NAMES == 1
1369  this->m_objName.toChar(),
1370 #endif
1371  "InvalidHeader ",
1372  buffer_size,
1373  error_code
1374  );
1375 
1376  this->logTextOut_out(
1377  0,
1378  _id,
1379  _logTime,
1381  _logString
1382  );
1383  }
1384 #endif
1385  }
1386 
1389  FwSizeType buffer_size,
1390  FwSizeType min_size
1391  )
1392  {
1393  // Check throttle value
1394  if (this->m_BufferTooSmallForPacketThrottle >= EVENTID_BUFFERTOOSMALLFORPACKET_THROTTLE) {
1395  return;
1396  }
1397  else {
1398  this->m_BufferTooSmallForPacketThrottle++;
1399  }
1400 
1401  // Get the time
1402  Fw::Time _logTime;
1403  if (this->isConnected_timeCaller_OutputPort(0)) {
1404  this->timeCaller_out(0, _logTime);
1405  }
1406 
1408 
1409  // Emit the event on the log port
1410  if (this->isConnected_logOut_OutputPort(0)) {
1411  Fw::LogBuffer _logBuff;
1413 
1414 #if FW_AMPCS_COMPATIBLE
1415  // Serialize the number of arguments
1416  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1417  FW_ASSERT(
1418  _status == Fw::FW_SERIALIZE_OK,
1419  static_cast<FwAssertArgType>(_status)
1420  );
1421 #endif
1422 
1423 #if FW_AMPCS_COMPATIBLE
1424  // Serialize the argument size
1425  _status = _logBuff.serializeFrom(
1426  static_cast<U8>(sizeof(FwSizeType))
1427  );
1428  FW_ASSERT(
1429  _status == Fw::FW_SERIALIZE_OK,
1430  static_cast<FwAssertArgType>(_status)
1431  );
1432 #endif
1433  _status = _logBuff.serializeFrom(buffer_size);
1434  FW_ASSERT(
1435  _status == Fw::FW_SERIALIZE_OK,
1436  static_cast<FwAssertArgType>(_status)
1437  );
1438 
1439 #if FW_AMPCS_COMPATIBLE
1440  // Serialize the argument size
1441  _status = _logBuff.serializeFrom(
1442  static_cast<U8>(sizeof(FwSizeType))
1443  );
1444  FW_ASSERT(
1445  _status == Fw::FW_SERIALIZE_OK,
1446  static_cast<FwAssertArgType>(_status)
1447  );
1448 #endif
1449  _status = _logBuff.serializeFrom(min_size);
1450  FW_ASSERT(
1451  _status == Fw::FW_SERIALIZE_OK,
1452  static_cast<FwAssertArgType>(_status)
1453  );
1454 
1455  this->logOut_out(
1456  0,
1457  _id,
1458  _logTime,
1460  _logBuff
1461  );
1462  }
1463 
1464  // Emit the event on the text log port
1465 #if FW_ENABLE_TEXT_LOGGING
1466  if (this->isConnected_logTextOut_OutputPort(0)) {
1467 #if FW_OBJECT_NAMES == 1
1468  const char* _formatString =
1469  "(%s) %s: Received buffer has size %" PRIu64 "; minimum required size is %" PRIu64 "";
1470 #else
1471  const char* _formatString =
1472  "%s: Received buffer has size %" PRIu64 "; minimum required size is %" PRIu64 "";
1473 #endif
1474 
1475  Fw::TextLogString _logString;
1476  (void) _logString.format(
1477  _formatString,
1478 #if FW_OBJECT_NAMES == 1
1479  this->m_objName.toChar(),
1480 #endif
1481  "BufferTooSmallForPacket ",
1482  buffer_size,
1483  min_size
1484  );
1485 
1486  this->logTextOut_out(
1487  0,
1488  _id,
1489  _logTime,
1491  _logString
1492  );
1493  }
1494 #endif
1495  }
1496 
1499  FwDpIdType dp_id,
1500  FwSizeType data_size
1501  )
1502  {
1503  // Check throttle value
1504  if (this->m_ContainerTooLargeThrottle >= EVENTID_CONTAINERTOOLARGE_THROTTLE) {
1505  return;
1506  }
1507  else {
1508  this->m_ContainerTooLargeThrottle++;
1509  }
1510 
1511  // Get the time
1512  Fw::Time _logTime;
1513  if (this->isConnected_timeCaller_OutputPort(0)) {
1514  this->timeCaller_out(0, _logTime);
1515  }
1516 
1517  const FwEventIdType _id = this->getIdBase() + EVENTID_CONTAINERTOOLARGE;
1518 
1519  // Emit the event on the log port
1520  if (this->isConnected_logOut_OutputPort(0)) {
1521  Fw::LogBuffer _logBuff;
1523 
1524 #if FW_AMPCS_COMPATIBLE
1525  // Serialize the number of arguments
1526  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1527  FW_ASSERT(
1528  _status == Fw::FW_SERIALIZE_OK,
1529  static_cast<FwAssertArgType>(_status)
1530  );
1531 #endif
1532 
1533 #if FW_AMPCS_COMPATIBLE
1534  // Serialize the argument size
1535  _status = _logBuff.serializeFrom(
1536  static_cast<U8>(sizeof(FwDpIdType))
1537  );
1538  FW_ASSERT(
1539  _status == Fw::FW_SERIALIZE_OK,
1540  static_cast<FwAssertArgType>(_status)
1541  );
1542 #endif
1543  _status = _logBuff.serializeFrom(dp_id);
1544  FW_ASSERT(
1545  _status == Fw::FW_SERIALIZE_OK,
1546  static_cast<FwAssertArgType>(_status)
1547  );
1548 
1549 #if FW_AMPCS_COMPATIBLE
1550  // Serialize the argument size
1551  _status = _logBuff.serializeFrom(
1552  static_cast<U8>(sizeof(FwSizeType))
1553  );
1554  FW_ASSERT(
1555  _status == Fw::FW_SERIALIZE_OK,
1556  static_cast<FwAssertArgType>(_status)
1557  );
1558 #endif
1559  _status = _logBuff.serializeFrom(data_size);
1560  FW_ASSERT(
1561  _status == Fw::FW_SERIALIZE_OK,
1562  static_cast<FwAssertArgType>(_status)
1563  );
1564 
1565  this->logOut_out(
1566  0,
1567  _id,
1568  _logTime,
1570  _logBuff
1571  );
1572  }
1573 
1574  // Emit the event on the text log port
1575 #if FW_ENABLE_TEXT_LOGGING
1576  if (this->isConnected_logTextOut_OutputPort(0)) {
1577 #if FW_OBJECT_NAMES == 1
1578  const char* _formatString =
1579  "(%s) %s: Data Product %" PRIu32 " has data size %" PRIu64 ", too large for a record size field";
1580 #else
1581  const char* _formatString =
1582  "%s: Data Product %" PRIu32 " has data size %" PRIu64 ", too large for a record size field";
1583 #endif
1584 
1585  Fw::TextLogString _logString;
1586  (void) _logString.format(
1587  _formatString,
1588 #if FW_OBJECT_NAMES == 1
1589  this->m_objName.toChar(),
1590 #endif
1591  "ContainerTooLarge ",
1592  dp_id,
1593  data_size
1594  );
1595 
1596  this->logTextOut_out(
1597  0,
1598  _id,
1599  _logTime,
1601  _logString
1602  );
1603  }
1604 #endif
1605  }
1606 
1607  // ----------------------------------------------------------------------
1608  // Event throttle reset functions
1609  // ----------------------------------------------------------------------
1610 
1613  {
1614  // Reset throttle counter
1615  this->m_DidNotCompressThrottle = 0;
1616  }
1617 
1620  {
1621  // Reset throttle counter
1622  this->m_InvalidHeaderThrottle = 0;
1623  }
1624 
1627  {
1628  // Reset throttle counter
1629  this->m_BufferTooSmallForPacketThrottle = 0;
1630  }
1631 
1634  {
1635  // Reset throttle counter
1636  this->m_ContainerTooLargeThrottle = 0;
1637  }
1638 
1639  // ----------------------------------------------------------------------
1640  // Parameter hook functions
1641  // ----------------------------------------------------------------------
1642 
1645  {
1646  // Do nothing by default
1647  }
1648 
1651  {
1652  // Do nothing by default
1653  }
1654 
1657  FwPrmIdType id,
1658  Fw::ParamValid valid
1659  )
1660  {
1661  if (FW_PARAM_OK(valid)) {
1662  this->parameterUpdated(id);
1663  }
1664  }
1665 
1666  // ----------------------------------------------------------------------
1667  // Parameter get functions
1668  // ----------------------------------------------------------------------
1669 
1672  {
1673  FwSizeStoreType _local{};
1674  this->m_paramLock.lock();
1675  valid = this->m_param_CHUNK_SIZE_valid;
1676  if ((valid == Fw::ParamValid::VALID) || (valid == Fw::ParamValid::DEFAULT)) {
1677  _local = this->m_CHUNK_SIZE;
1678  }
1679  this->m_paramLock.unlock();
1680  return _local;
1681  }
1682 
1685  {
1686  Fw::Enabled _local{};
1687  this->m_paramLock.lock();
1688  valid = this->m_param_ENABLE_valid;
1689  if ((valid == Fw::ParamValid::VALID) || (valid == Fw::ParamValid::DEFAULT)) {
1690  _local = this->m_ENABLE;
1691  }
1692  this->m_paramLock.unlock();
1693  return _local;
1694  }
1695 
1696  // ----------------------------------------------------------------------
1697  // Functions for managing data products
1698  // ----------------------------------------------------------------------
1699 
1702  DpContainer& container,
1703  Fw::Time timeTag
1704  )
1705  {
1706  // Update the time tag
1707  if (timeTag == Fw::ZERO_TIME) {
1708  // Get the time from the time port
1709  timeTag = this->getTime();
1710  }
1711  container.setTimeTag(timeTag);
1712  // Serialize the header into the packet
1713  container.serializeHeader();
1714  // Update the size of the buffer according to the data size
1715  const FwSizeType packetSize = container.getPacketSize();
1716  Fw::Buffer buffer = container.getBuffer();
1717  FW_ASSERT(packetSize <= buffer.getSize(), static_cast<FwAssertArgType>(packetSize),
1718  static_cast<FwAssertArgType>(buffer.getSize()));
1719  buffer.setSize(static_cast<U32>(packetSize));
1720  // Invalidate the buffer in the container, so it can't be reused
1721  container.invalidateBuffer();
1722  // Send the buffer
1723  this->dpSend_out(0, container.getId(), buffer);
1724  }
1725 
1726  // ----------------------------------------------------------------------
1727  // Time
1728  // ----------------------------------------------------------------------
1729 
1731  getTime() const
1732  {
1733  if (this->isConnected_timeCaller_OutputPort(0)) {
1734  Fw::Time _time;
1735  this->timeCaller_out(0, _time);
1736  return _time;
1737  }
1738  else {
1739  return Fw::Time(TimeBase::TB_NONE, 0, 0);
1740  }
1741  }
1742 
1743  // ----------------------------------------------------------------------
1744  // Calls for messages received on special input ports
1745  // ----------------------------------------------------------------------
1746 
1747  void DpCompressProcComponentBase ::
1748  m_p_cmdIn_in(
1749  Fw::PassiveComponentBase* callComp,
1750  FwIndexType portNum,
1751  FwOpcodeType opCode,
1752  U32 cmdSeq,
1753  Fw::CmdArgBuffer& args
1754  )
1755  {
1756  FW_ASSERT(callComp != nullptr);
1757  DpCompressProcComponentBase* compPtr = static_cast<DpCompressProcComponentBase*>(callComp);
1758  compPtr->cmdIn_handlerBase(
1759  portNum,
1760  opCode,
1761  cmdSeq,
1762  args
1763  );
1764  }
1765 
1766  // ----------------------------------------------------------------------
1767  // Calls for messages received on typed input ports
1768  // ----------------------------------------------------------------------
1769 
1770  void DpCompressProcComponentBase ::
1771  m_p_procRequest_in(
1772  Fw::PassiveComponentBase* callComp,
1773  FwIndexType portNum,
1774  Fw::Buffer& fwBuffer
1775  )
1776  {
1777  FW_ASSERT(callComp != nullptr);
1778  DpCompressProcComponentBase* compPtr = static_cast<DpCompressProcComponentBase*>(callComp);
1779  compPtr->procRequest_handlerBase(
1780  portNum,
1781  fwBuffer
1782  );
1783  }
1784 
1785 #if !FW_DIRECT_PORT_CALLS
1786 
1787  // ----------------------------------------------------------------------
1788  // Invocation functions for special output ports
1789  // ----------------------------------------------------------------------
1790 
1791  void DpCompressProcComponentBase ::
1792  cmdRegOut_out(
1793  FwIndexType portNum,
1794  FwOpcodeType opCode
1795  ) const
1796  {
1797  FW_ASSERT(
1798  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
1799  static_cast<FwAssertArgType>(portNum)
1800  );
1801 
1802  FW_ASSERT(
1803  this->m_cmdRegOut_OutputPort[portNum].isConnected(),
1804  static_cast<FwAssertArgType>(portNum)
1805  );
1806  this->m_cmdRegOut_OutputPort[portNum].invoke(
1807  opCode
1808  );
1809  }
1810 
1811  void DpCompressProcComponentBase ::
1812  cmdResponseOut_out(
1813  FwIndexType portNum,
1814  FwOpcodeType opCode,
1815  U32 cmdSeq,
1816  const Fw::CmdResponse& response
1817  ) const
1818  {
1819  FW_ASSERT(
1820  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
1821  static_cast<FwAssertArgType>(portNum)
1822  );
1823 
1824  FW_ASSERT(
1825  this->m_cmdResponseOut_OutputPort[portNum].isConnected(),
1826  static_cast<FwAssertArgType>(portNum)
1827  );
1828  this->m_cmdResponseOut_OutputPort[portNum].invoke(
1829  opCode,
1830  cmdSeq,
1831  response
1832  );
1833  }
1834 
1835  Fw::Success DpCompressProcComponentBase ::
1836  dpGet_out(
1837  FwIndexType portNum,
1838  FwDpIdType id,
1839  FwSizeType dataSize,
1840  Fw::Buffer& buffer
1841  ) const
1842  {
1843  FW_ASSERT(
1844  (0 <= portNum) && (portNum < this->getNum_dpGet_OutputPorts()),
1845  static_cast<FwAssertArgType>(portNum)
1846  );
1847 
1848  FW_ASSERT(
1849  this->m_dpGet_OutputPort[portNum].isConnected(),
1850  static_cast<FwAssertArgType>(portNum)
1851  );
1852  return this->m_dpGet_OutputPort[portNum].invoke(
1853  id,
1854  dataSize,
1855  buffer
1856  );
1857  }
1858 
1859  void DpCompressProcComponentBase ::
1860  dpSend_out(
1861  FwIndexType portNum,
1862  FwDpIdType id,
1863  const Fw::Buffer& buffer
1864  ) const
1865  {
1866  FW_ASSERT(
1867  (0 <= portNum) && (portNum < this->getNum_dpSend_OutputPorts()),
1868  static_cast<FwAssertArgType>(portNum)
1869  );
1870 
1871  FW_ASSERT(
1872  this->m_dpSend_OutputPort[portNum].isConnected(),
1873  static_cast<FwAssertArgType>(portNum)
1874  );
1875  this->m_dpSend_OutputPort[portNum].invoke(
1876  id,
1877  buffer
1878  );
1879  }
1880 
1881  void DpCompressProcComponentBase ::
1882  logOut_out(
1883  FwIndexType portNum,
1884  FwEventIdType id,
1885  Fw::Time& timeTag,
1886  const Fw::LogSeverity& severity,
1887  Fw::LogBuffer& args
1888  ) const
1889  {
1890  FW_ASSERT(
1891  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
1892  static_cast<FwAssertArgType>(portNum)
1893  );
1894 
1895  FW_ASSERT(
1896  this->m_logOut_OutputPort[portNum].isConnected(),
1897  static_cast<FwAssertArgType>(portNum)
1898  );
1899  this->m_logOut_OutputPort[portNum].invoke(
1900  id,
1901  timeTag,
1902  severity,
1903  args
1904  );
1905  }
1906 
1907 #if FW_ENABLE_TEXT_LOGGING
1908 
1909  void DpCompressProcComponentBase ::
1910  logTextOut_out(
1911  FwIndexType portNum,
1912  FwEventIdType id,
1913  Fw::Time& timeTag,
1914  const Fw::LogSeverity& severity,
1915  Fw::TextLogString& text
1916  ) const
1917  {
1918  FW_ASSERT(
1919  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
1920  static_cast<FwAssertArgType>(portNum)
1921  );
1922 
1923  FW_ASSERT(
1924  this->m_logTextOut_OutputPort[portNum].isConnected(),
1925  static_cast<FwAssertArgType>(portNum)
1926  );
1927  this->m_logTextOut_OutputPort[portNum].invoke(
1928  id,
1929  timeTag,
1930  severity,
1931  text
1932  );
1933  }
1934 
1935 #endif
1936 
1937  Fw::ParamValid DpCompressProcComponentBase ::
1938  prmGetOut_out(
1939  FwIndexType portNum,
1940  FwPrmIdType id,
1941  Fw::ParamBuffer& val
1942  ) const
1943  {
1944  FW_ASSERT(
1945  (0 <= portNum) && (portNum < this->getNum_prmGetOut_OutputPorts()),
1946  static_cast<FwAssertArgType>(portNum)
1947  );
1948 
1949  FW_ASSERT(
1950  this->m_prmGetOut_OutputPort[portNum].isConnected(),
1951  static_cast<FwAssertArgType>(portNum)
1952  );
1953  return this->m_prmGetOut_OutputPort[portNum].invoke(
1954  id,
1955  val
1956  );
1957  }
1958 
1959  void DpCompressProcComponentBase ::
1960  prmSetOut_out(
1961  FwIndexType portNum,
1962  FwPrmIdType id,
1963  Fw::ParamBuffer& val
1964  ) const
1965  {
1966  FW_ASSERT(
1967  (0 <= portNum) && (portNum < this->getNum_prmSetOut_OutputPorts()),
1968  static_cast<FwAssertArgType>(portNum)
1969  );
1970 
1971  FW_ASSERT(
1972  this->m_prmSetOut_OutputPort[portNum].isConnected(),
1973  static_cast<FwAssertArgType>(portNum)
1974  );
1975  this->m_prmSetOut_OutputPort[portNum].invoke(
1976  id,
1977  val
1978  );
1979  }
1980 
1981  void DpCompressProcComponentBase ::
1982  timeCaller_out(
1983  FwIndexType portNum,
1984  Fw::Time& time
1985  ) const
1986  {
1987  FW_ASSERT(
1988  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
1989  static_cast<FwAssertArgType>(portNum)
1990  );
1991 
1992  FW_ASSERT(
1993  this->m_timeCaller_OutputPort[portNum].isConnected(),
1994  static_cast<FwAssertArgType>(portNum)
1995  );
1996  this->m_timeCaller_OutputPort[portNum].invoke(
1997  time
1998  );
1999  }
2000 
2001 #endif
2002 
2003  // ----------------------------------------------------------------------
2004  // Parameter set functions
2005  // ----------------------------------------------------------------------
2006 
2007  Fw::CmdResponse DpCompressProcComponentBase ::
2008  paramSet_CHUNK_SIZE(Fw::SerialBufferBase& val)
2009  {
2010  FwSizeStoreType _localVal{};
2011  const Fw::SerializeStatus _stat = val.deserializeTo(_localVal);
2012  if (_stat != Fw::FW_SERIALIZE_OK) {
2014  }
2015 
2016  // Assign value only if successfully deserialized
2017  this->m_paramLock.lock();
2018  this->m_CHUNK_SIZE = _localVal;
2019  this->m_param_CHUNK_SIZE_valid = Fw::ParamValid::VALID;
2020  this->m_paramLock.unlock();
2021 
2022  // Call notifier
2024  return Fw::CmdResponse::OK;
2025  }
2026 
2027  Fw::CmdResponse DpCompressProcComponentBase ::
2028  paramSet_ENABLE(Fw::SerialBufferBase& val)
2029  {
2030  Fw::Enabled _localVal{};
2031  const Fw::SerializeStatus _stat = val.deserializeTo(_localVal);
2032  if (_stat != Fw::FW_SERIALIZE_OK) {
2034  }
2035 
2036  // Assign value only if successfully deserialized
2037  this->m_paramLock.lock();
2038  this->m_ENABLE = _localVal;
2039  this->m_param_ENABLE_valid = Fw::ParamValid::VALID;
2040  this->m_paramLock.unlock();
2041 
2042  // Call notifier
2044  return Fw::CmdResponse::OK;
2045  }
2046 
2047  // ----------------------------------------------------------------------
2048  // Parameter save functions
2049  // ----------------------------------------------------------------------
2050 
2051  Fw::CmdResponse DpCompressProcComponentBase ::
2052  paramSave_CHUNK_SIZE()
2053  {
2054  if (!this->isConnected_prmSetOut_OutputPort(0)) {
2056  }
2057  Fw::ParamBuffer _paramBuffer;
2058  const FwIdType idBase = this->getIdBase();
2060  // Serialize the parameter
2061  this->m_paramLock.lock();
2062  if ((this->m_param_CHUNK_SIZE_valid == Fw::ParamValid::VALID) || (this->m_param_CHUNK_SIZE_valid == Fw::ParamValid::DEFAULT)) {
2063  _stat = _paramBuffer.serializeFrom(m_CHUNK_SIZE);
2064  }
2065  this->m_paramLock.unlock();
2066  if (_stat != Fw::FW_SERIALIZE_OK) {
2068  }
2069  // Save the parameter
2070  this->prmSetOut_out(
2071  0,
2072  static_cast<FwPrmIdType>(idBase + PARAMID_CHUNK_SIZE),
2073  _paramBuffer
2074  );
2075  // Return the command response
2076  return Fw::CmdResponse::OK;
2077  }
2078 
2079  Fw::CmdResponse DpCompressProcComponentBase ::
2080  paramSave_ENABLE()
2081  {
2082  if (!this->isConnected_prmSetOut_OutputPort(0)) {
2084  }
2085  Fw::ParamBuffer _paramBuffer;
2086  const FwIdType idBase = this->getIdBase();
2088  // Serialize the parameter
2089  this->m_paramLock.lock();
2090  if ((this->m_param_ENABLE_valid == Fw::ParamValid::VALID) || (this->m_param_ENABLE_valid == Fw::ParamValid::DEFAULT)) {
2091  _stat = _paramBuffer.serializeFrom(m_ENABLE);
2092  }
2093  this->m_paramLock.unlock();
2094  if (_stat != Fw::FW_SERIALIZE_OK) {
2096  }
2097  // Save the parameter
2098  this->prmSetOut_out(
2099  0,
2100  static_cast<FwPrmIdType>(idBase + PARAMID_ENABLE),
2101  _paramBuffer
2102  );
2103  // Return the command response
2104  return Fw::CmdResponse::OK;
2105  }
2106 
2107  // ----------------------------------------------------------------------
2108  // Private data product handling functions
2109  // ----------------------------------------------------------------------
2110 
2111  Fw::Success::T DpCompressProcComponentBase ::
2112  dpGet(
2113  ContainerId::T containerId,
2114  FwSizeType dataSize,
2115  FwDpPriorityType priority,
2116  DpContainer& container
2117  )
2118  {
2119  const FwDpIdType baseId = this->getIdBase();
2120  const FwDpIdType globalId = baseId + containerId;
2121  const FwSizeType size = DpContainer::getPacketSizeForDataSize(dataSize);
2122  Fw::Buffer buffer;
2123  const Fw::Success::T status = this->dpGet_out(0, globalId, size, buffer);
2124  if (status == Fw::Success::SUCCESS) {
2125  // Assign a fresh DpContainer into container
2126  // This action clears out all the container state
2127  container = DpContainer(globalId, buffer, baseId);
2128  container.setPriority(priority);
2129  }
2130  return status;
2131  }
2132 
2133 }
Serialization/Deserialization operation was successful.
bool isConnected_logOut_OutputPort(FwIndexType portNum) const
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:157
bool isConnected_timeCaller_OutputPort(FwIndexType portNum) const
void log_WARNING_HI_BufferTooSmallForPacket(FwSizeType buffer_size, FwSizeType min_size)
void setTimeTag(Fw::Time timeTag)
Set the time tag.
FwIdType FwOpcodeType
The type of a command opcode.
static constexpr FwIndexType getNum_dpSend_OutputPorts()
virtual void parametersLoaded()
Called whenever parameters are loaded.
static constexpr FwIndexType getNum_compressChunk_OutputPorts()
void set_compressChunk_OutputPort(FwIndexType portNum, Svc::InputCompressChunkPort *port)
Connect port to compressChunk[portNum].
static constexpr FwIndexType getNum_prmGetOut_OutputPorts()
void init()
Initialization function.
#define FW_PARAM_OK(paramValid)
Definition: ParamValid.hpp:22
Representing success.
PlatformSizeType FwSizeType
U32 FwDpPriorityType
The type of a data product priority.
void log_WARNING_HI_InvalidHeader(FwSizeType buffer_size, U32 error_code)
I32 FwEnumStoreType
void addCallPort(InputDpSendPort *callPort)
Register an input port.
void setSize(FwSizeType size)
Definition: Buffer.cpp:131
Enabled state.
bool isConnected_prmGetOut_OutputPort(FwIndexType portNum) const
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
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 addCallPort(InputPrmSetPort *callPort)
Register an input port.
static constexpr FwIndexType getNum_procRequest_InputPorts()
No room left in the buffer to serialize data.
virtual void parameterLoaded(FwPrmIdType id, Fw::ParamValid valid)
Called for each parameter when parameters are loaded.
void dpSend(DpContainer &container, Fw::Time timeTag=Fw::ZERO_TIME)
Send a data product.
bool isConnected_cmdResponseOut_OutputPort(FwIndexType portNum) const
const Time ZERO_TIME
Definition: Time.cpp:5
Number of bytes to use in a compression chunk.
Fw::SerializeStatus serializeRecord_CompressionRecord(const U8 *array, FwSizeType size)
PassiveComponentBase(const char *name)
Named constructor.
bool isConnected_prmSetOut_OutputPort(FwIndexType portNum) const
Error occurred when deserializing the container header.
Fw::InputCmdPort * get_cmdIn_InputPort(FwIndexType portNum)
Enum representing a command response.
void set_prmGetOut_OutputPort(FwIndexType portNum, Fw::InputPrmGetPort *port)
Connect port to prmGetOut[portNum].
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.
bool isConnected_cmdRegOut_OutputPort(FwIndexType portNum) const
bool isConnected_compressChunk_OutputPort(FwIndexType portNum) const
void init()
Initialization function.
Software diagnostic events.
void addCallPort(InputPrmGetPort *callPort)
Register an input port.
void init()
Object initializer.
Definition: ObjBase.cpp:24
void cmdIn_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Handler base-class function for input port cmdIn.
SerializeStatus
forward declaration for string
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: CmdPortAc.cpp:95
virtual SerializeStatus deserializeTo(U8 &val, Endianness mode=Endianness::BIG)=0
Deserialize an 8-bit unsigned integer value.
static constexpr FwIndexType getNum_dpGet_OutputPorts()
void addCallPort(InputCompressChunkPort *callPort)
Register an input port.
void log_ACTIVITY_LO_DidNotCompress(FwDpIdType dp_id, FwSizeType data_size)
Log event DidNotCompress.
FwIdType FwEventIdType
The type of an event identifier.
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
DpCompressProcComponentBase(const char *compName="")
Construct DpCompressProcComponentBase object.
bool isConnected_dpSend_OutputPort(FwIndexType portNum) const
void invoke(FwOpcodeType opCode) const
Invoke a port connection.
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:40
Auto-generated base for DpCompressProc component.
void init()
Initialization function.
Definition: TimePortAc.cpp:151
Data was the wrong format (e.g. wrong packet type)
static constexpr FwIndexType getNum_logOut_OutputPorts()
Less important informational events.
Fw::ParamValid invoke(FwPrmIdType id, Fw::ParamBuffer &val) const
Omit length from serialization.
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
Fw::InputBufferSendPort * get_procRequest_InputPort(FwIndexType portNum)
void init()
Initialization function.
Svc::CompressionAlgorithm compressChunk_out(FwIndexType portNum, Fw::Buffer &buffer, FwSizeType min_compression, FwSizeType write_offset) const
Invoke output port compressChunk.
static constexpr FwIndexType getNum_cmdIn_InputPorts()
void set_dpGet_OutputPort(FwIndexType portNum, Fw::InputDpGetPort *port)
Connect port to dpGet[portNum].
void procRequest_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port procRequest.
void invoke(Fw::Time &time) const
Invoke a port connection.
Definition: TimePortAc.cpp:170
static constexpr FwIndexType getNum_prmSetOut_OutputPorts()
void set_prmSetOut_OutputPort(FwIndexType portNum, Fw::InputPrmSetPort *port)
Connect port to prmSetOut[portNum].
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke a port connection.
void log_WARNING_HI_ContainerTooLarge_ThrottleClear()
Reset throttle value for ContainerTooLarge.
void invalidateBuffer()
Invalidate the packet buffer.
T
The raw enum type.
void log_WARNING_HI_BufferTooSmallForPacket_ThrottleClear()
Reset throttle value for BufferTooSmallForPacket.
void log_DIAGNOSTIC_CompressionComplete(FwDpIdType dp_id, FwSizeType initial_size, FwSizeType final_size) const
Log event CompressionComplete.
A serious but recoverable event.
FwSizeType FwSizeStoreType
static constexpr FwSizeType getPacketSizeForDataSize(FwSizeType dataSize)
Get the packet size for a given data size.
const char * toChar() const
Convert to a C-style char*.
bool isConnected() const
Definition: PortBase.cpp:38
Enum representing event severity.
virtual ~DpCompressProcComponentBase()
Destroy DpCompressProcComponentBase object.
FwSizeType getPacketSize() const
Get the packet size corresponding to the data size.
static constexpr FwIndexType getNum_timeCaller_OutputPorts()
Fw::Buffer getBuffer() const
#define PRI_FwIndexType
Enabled and disabled states.
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:58
void init()
Initialization function.
Definition: LogPortAc.cpp:180
Command successfully executed.
void log_ACTIVITY_LO_DidNotCompress_ThrottleClear()
Reset throttle value for DidNotCompress.
DpContainer()
Constructor with default initialization.
void setPortNum(FwIndexType portNum)
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
static constexpr FwIndexType getNum_cmdResponseOut_OutputPorts()
Received container is too large for its size to be stored in a record size field. ...
void init()
Initialization function.
FwSizeType getSize() const
Definition: Buffer.cpp:90
void lock()
lock the mutex and assert success
Svc::CompressionAlgorithm invoke(Fw::Buffer &buffer, FwSizeType min_compression, FwSizeType write_offset) const
Command had execution error.
FwIdType FwDpIdType
The type of a data product identifier.
virtual void parameterUpdated(FwPrmIdType id)
Called whenever a parameter is updated.
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port connection.
Definition: LogPortAc.cpp:199
Received buffer is too small to hold a data product packet.
FwSizeStoreType paramGet_CHUNK_SIZE(Fw::ParamValid &valid)
Fw::Success invoke(FwDpIdType id, FwSizeType dataSize, Fw::Buffer &buffer) const
PlatformIndexType FwIndexType
void serializeHeader()
Definition: DpContainer.cpp:89
void set_cmdResponseOut_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
void addCallPort(InputDpGetPort *callPort)
Register an input port.
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:186
void init()
Initialization function.
void unlock()
alias for unLock to meet BasicLockable requirements
Command failed validation.
RateGroupDivider component implementation.
bool isConnected_dpGet_OutputPort(FwIndexType portNum) const
Enum representing parameter validity.
void set_dpSend_OutputPort(FwIndexType portNum, Fw::InputDpSendPort *port)
Connect port to dpSend[portNum].
void invoke(FwPrmIdType id, Fw::ParamBuffer &val) const
Invoke a port connection.
Input CompressChunk port.
virtual void procRequest_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port procRequest.
FwDpIdType getId() const
Implementation of malloc based allocator.
void log_WARNING_HI_ContainerTooLarge(FwDpIdType dp_id, FwSizeType data_size)
void loadParameters()
Load the parameters from a parameter source.
void regCommands()
Register commands with the Command Dispatcher.
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
void init()
Initialization function.
void log_WARNING_HI_InvalidHeader_ThrottleClear()
Reset throttle value for InvalidHeader.
Fw::Enabled paramGet_ENABLE(Fw::ParamValid &valid)
void set_cmdRegOut_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to cmdRegOut[portNum].
void init()
Initialization function.
void invoke(FwDpIdType id, const Fw::Buffer &buffer) const
Invoke a port connection.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
static constexpr FwIndexType getNum_cmdRegOut_OutputPorts()
void init()
Initialization function.
Chunk size to use when passing data to the compression backend.
Success/Failure.
PlatformAssertArgType FwAssertArgType
The type of arguments to assert functions.
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
U32 FwIdType
The id type.