F´ Flight Software - C/C++ Documentation devel
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 <cstdio>
8
10#include "Fw/Types/Assert.hpp"
11#if FW_ENABLE_TEXT_LOGGING
12#include "Fw/Types/String.hpp"
13#endif
14
15namespace Svc {
16
17 namespace {
18 enum MsgTypeEnum {
20 PINGIN_PING,
21 SETPRM_PRMSET,
22 CMD_PRM_SAVE_FILE,
23 };
24
25 // Get the max size by constructing a union of the async input, command, and
26 // internal port serialization sizes
27 union BuffUnion {
31 };
32
33 // Define a message buffer class large enough to handle all the
34 // asynchronous inputs to the component
35 class ComponentIpcSerializableBuffer :
37 {
38
39 public:
40
41 enum {
42 // Max. message size = size of data + message id + port
43 SERIALIZATION_SIZE =
44 sizeof(BuffUnion) +
45 sizeof(NATIVE_INT_TYPE) +
46 sizeof(NATIVE_INT_TYPE)
47 };
48
49 NATIVE_UINT_TYPE getBuffCapacity() const {
50 return sizeof(m_buff);
51 }
52
53 U8* getBuffAddr() {
54 return m_buff;
55 }
56
57 const U8* getBuffAddr() const {
58 return m_buff;
59 }
60
61 private:
62 // Should be the max of all the input ports serialized sizes...
63 U8 m_buff[SERIALIZATION_SIZE];
64
65 };
66 }
67
68 // ----------------------------------------------------------------------
69 // Component initialization
70 // ----------------------------------------------------------------------
71
72 void PrmDbComponentBase ::
73 init(
74 NATIVE_INT_TYPE queueDepth,
75 NATIVE_INT_TYPE instance
76 )
77 {
78 // Initialize base class
80
81 // Connect input port CmdDisp
82 for (
83 PlatformIntType port = 0;
84 port < static_cast<PlatformIntType>(this->getNum_CmdDisp_InputPorts());
85 port++
86 ) {
87 this->m_CmdDisp_InputPort[port].init();
88 this->m_CmdDisp_InputPort[port].addCallComp(
89 this,
90 m_p_CmdDisp_in
91 );
92 this->m_CmdDisp_InputPort[port].setPortNum(port);
93
94#if FW_OBJECT_NAMES == 1
95 // The port name consists of this->m_objName and some extra info.
96 // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
97 // However, the compiler may assume that this->m_objName fills
98 // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
99 // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
100 // bytes to cover the extra info.
101 char portName[2*FW_OBJ_NAME_MAX_SIZE];
102 (void) snprintf(
103 portName,
104 sizeof(portName),
105 "%s_CmdDisp_InputPort[%" PRI_PlatformIntType "]",
106 this->m_objName,
107 port
108 );
109 this->m_CmdDisp_InputPort[port].setObjName(portName);
110#endif
111 }
112
113 // Connect input port getPrm
114 for (
115 PlatformIntType port = 0;
116 port < static_cast<PlatformIntType>(this->getNum_getPrm_InputPorts());
117 port++
118 ) {
119 this->m_getPrm_InputPort[port].init();
120 this->m_getPrm_InputPort[port].addCallComp(
121 this,
122 m_p_getPrm_in
123 );
124 this->m_getPrm_InputPort[port].setPortNum(port);
125
126#if FW_OBJECT_NAMES == 1
127 // The port name consists of this->m_objName and some extra info.
128 // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
129 // However, the compiler may assume that this->m_objName fills
130 // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
131 // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
132 // bytes to cover the extra info.
133 char portName[2*FW_OBJ_NAME_MAX_SIZE];
134 (void) snprintf(
135 portName,
136 sizeof(portName),
137 "%s_getPrm_InputPort[%" PRI_PlatformIntType "]",
138 this->m_objName,
139 port
140 );
141 this->m_getPrm_InputPort[port].setObjName(portName);
142#endif
143 }
144
145 // Connect input port pingIn
146 for (
147 PlatformIntType port = 0;
148 port < static_cast<PlatformIntType>(this->getNum_pingIn_InputPorts());
149 port++
150 ) {
151 this->m_pingIn_InputPort[port].init();
152 this->m_pingIn_InputPort[port].addCallComp(
153 this,
154 m_p_pingIn_in
155 );
156 this->m_pingIn_InputPort[port].setPortNum(port);
157
158#if FW_OBJECT_NAMES == 1
159 // The port name consists of this->m_objName and some extra info.
160 // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
161 // However, the compiler may assume that this->m_objName fills
162 // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
163 // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
164 // bytes to cover the extra info.
165 char portName[2*FW_OBJ_NAME_MAX_SIZE];
166 (void) snprintf(
167 portName,
168 sizeof(portName),
169 "%s_pingIn_InputPort[%" PRI_PlatformIntType "]",
170 this->m_objName,
171 port
172 );
173 this->m_pingIn_InputPort[port].setObjName(portName);
174#endif
175 }
176
177 // Connect input port setPrm
178 for (
179 PlatformIntType port = 0;
180 port < static_cast<PlatformIntType>(this->getNum_setPrm_InputPorts());
181 port++
182 ) {
183 this->m_setPrm_InputPort[port].init();
184 this->m_setPrm_InputPort[port].addCallComp(
185 this,
186 m_p_setPrm_in
187 );
188 this->m_setPrm_InputPort[port].setPortNum(port);
189
190#if FW_OBJECT_NAMES == 1
191 // The port name consists of this->m_objName and some extra info.
192 // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
193 // However, the compiler may assume that this->m_objName fills
194 // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
195 // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
196 // bytes to cover the extra info.
197 char portName[2*FW_OBJ_NAME_MAX_SIZE];
198 (void) snprintf(
199 portName,
200 sizeof(portName),
201 "%s_setPrm_InputPort[%" PRI_PlatformIntType "]",
202 this->m_objName,
203 port
204 );
205 this->m_setPrm_InputPort[port].setObjName(portName);
206#endif
207 }
208
209 // Connect output port CmdReg
210 for (
211 PlatformIntType port = 0;
212 port < static_cast<PlatformIntType>(this->getNum_CmdReg_OutputPorts());
213 port++
214 ) {
215 this->m_CmdReg_OutputPort[port].init();
216
217#if FW_OBJECT_NAMES == 1
218 // The port name consists of this->m_objName and some extra info.
219 // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
220 // However, the compiler may assume that this->m_objName fills
221 // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
222 // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
223 // bytes to cover the extra info.
224 char portName[2*FW_OBJ_NAME_MAX_SIZE];
225 (void) snprintf(
226 portName,
227 sizeof(portName),
228 "%s_CmdReg_OutputPort[%" PRI_PlatformIntType "]",
229 this->m_objName,
230 port
231 );
232 this->m_CmdReg_OutputPort[port].setObjName(portName);
233#endif
234 }
235
236 // Connect output port CmdStatus
237 for (
238 PlatformIntType port = 0;
239 port < static_cast<PlatformIntType>(this->getNum_CmdStatus_OutputPorts());
240 port++
241 ) {
242 this->m_CmdStatus_OutputPort[port].init();
243
244#if FW_OBJECT_NAMES == 1
245 // The port name consists of this->m_objName and some extra info.
246 // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
247 // However, the compiler may assume that this->m_objName fills
248 // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
249 // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
250 // bytes to cover the extra info.
251 char portName[2*FW_OBJ_NAME_MAX_SIZE];
252 (void) snprintf(
253 portName,
254 sizeof(portName),
255 "%s_CmdStatus_OutputPort[%" PRI_PlatformIntType "]",
256 this->m_objName,
257 port
258 );
259 this->m_CmdStatus_OutputPort[port].setObjName(portName);
260#endif
261 }
262
263 // Connect output port Log
264 for (
265 PlatformIntType port = 0;
266 port < static_cast<PlatformIntType>(this->getNum_Log_OutputPorts());
267 port++
268 ) {
269 this->m_Log_OutputPort[port].init();
270
271#if FW_OBJECT_NAMES == 1
272 // The port name consists of this->m_objName and some extra info.
273 // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
274 // However, the compiler may assume that this->m_objName fills
275 // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
276 // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
277 // bytes to cover the extra info.
278 char portName[2*FW_OBJ_NAME_MAX_SIZE];
279 (void) snprintf(
280 portName,
281 sizeof(portName),
282 "%s_Log_OutputPort[%" PRI_PlatformIntType "]",
283 this->m_objName,
284 port
285 );
286 this->m_Log_OutputPort[port].setObjName(portName);
287#endif
288 }
289
290#if FW_ENABLE_TEXT_LOGGING == 1
291 // Connect output port LogText
292 for (
293 PlatformIntType port = 0;
294 port < static_cast<PlatformIntType>(this->getNum_LogText_OutputPorts());
295 port++
296 ) {
297 this->m_LogText_OutputPort[port].init();
298
299#if FW_OBJECT_NAMES == 1
300 // The port name consists of this->m_objName and some extra info.
301 // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
302 // However, the compiler may assume that this->m_objName fills
303 // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
304 // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
305 // bytes to cover the extra info.
306 char portName[2*FW_OBJ_NAME_MAX_SIZE];
307 (void) snprintf(
308 portName,
309 sizeof(portName),
310 "%s_LogText_OutputPort[%" PRI_PlatformIntType "]",
311 this->m_objName,
312 port
313 );
314 this->m_LogText_OutputPort[port].setObjName(portName);
315#endif
316 }
317#endif
318
319 // Connect output port Time
320 for (
321 PlatformIntType port = 0;
322 port < static_cast<PlatformIntType>(this->getNum_Time_OutputPorts());
323 port++
324 ) {
325 this->m_Time_OutputPort[port].init();
326
327#if FW_OBJECT_NAMES == 1
328 // The port name consists of this->m_objName and some extra info.
329 // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
330 // However, the compiler may assume that this->m_objName fills
331 // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
332 // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
333 // bytes to cover the extra info.
334 char portName[2*FW_OBJ_NAME_MAX_SIZE];
335 (void) snprintf(
336 portName,
337 sizeof(portName),
338 "%s_Time_OutputPort[%" PRI_PlatformIntType "]",
339 this->m_objName,
340 port
341 );
342 this->m_Time_OutputPort[port].setObjName(portName);
343#endif
344 }
345
346 // Connect output port pingOut
347 for (
348 PlatformIntType port = 0;
349 port < static_cast<PlatformIntType>(this->getNum_pingOut_OutputPorts());
350 port++
351 ) {
352 this->m_pingOut_OutputPort[port].init();
353
354#if FW_OBJECT_NAMES == 1
355 // The port name consists of this->m_objName and some extra info.
356 // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes.
357 // However, the compiler may assume that this->m_objName fills
358 // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to
359 // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE
360 // bytes to cover the extra info.
361 char portName[2*FW_OBJ_NAME_MAX_SIZE];
362 (void) snprintf(
363 portName,
364 sizeof(portName),
365 "%s_pingOut_OutputPort[%" PRI_PlatformIntType "]",
366 this->m_objName,
367 port
368 );
369 this->m_pingOut_OutputPort[port].setObjName(portName);
370#endif
371 }
372
373 Os::Queue::QueueStatus qStat = this->createQueue(
374 queueDepth,
375 ComponentIpcSerializableBuffer::SERIALIZATION_SIZE
376 );
377 FW_ASSERT(
378 Os::Queue::QUEUE_OK == qStat,
379 static_cast<FwAssertArgType>(qStat)
380 );
381 }
382
383 // ----------------------------------------------------------------------
384 // Getters for special input ports
385 // ----------------------------------------------------------------------
386
387 Fw::InputCmdPort* PrmDbComponentBase ::
388 get_CmdDisp_InputPort(NATIVE_INT_TYPE portNum)
389 {
390 FW_ASSERT(
391 portNum < this->getNum_CmdDisp_InputPorts(),
392 static_cast<FwAssertArgType>(portNum)
393 );
394
395 return &this->m_CmdDisp_InputPort[portNum];
396 }
397
398 // ----------------------------------------------------------------------
399 // Getters for typed input ports
400 // ----------------------------------------------------------------------
401
402 Fw::InputPrmGetPort* PrmDbComponentBase ::
403 get_getPrm_InputPort(NATIVE_INT_TYPE portNum)
404 {
405 FW_ASSERT(
406 portNum < this->getNum_getPrm_InputPorts(),
407 static_cast<FwAssertArgType>(portNum)
408 );
409
410 return &this->m_getPrm_InputPort[portNum];
411 }
412
413 Svc::InputPingPort* PrmDbComponentBase ::
414 get_pingIn_InputPort(NATIVE_INT_TYPE portNum)
415 {
416 FW_ASSERT(
417 portNum < this->getNum_pingIn_InputPorts(),
418 static_cast<FwAssertArgType>(portNum)
419 );
420
421 return &this->m_pingIn_InputPort[portNum];
422 }
423
424 Fw::InputPrmSetPort* PrmDbComponentBase ::
425 get_setPrm_InputPort(NATIVE_INT_TYPE portNum)
426 {
427 FW_ASSERT(
428 portNum < this->getNum_setPrm_InputPorts(),
429 static_cast<FwAssertArgType>(portNum)
430 );
431
432 return &this->m_setPrm_InputPort[portNum];
433 }
434
435 // ----------------------------------------------------------------------
436 // Connect input ports to special output ports
437 // ----------------------------------------------------------------------
438
439 void PrmDbComponentBase ::
440 set_CmdReg_OutputPort(
441 NATIVE_INT_TYPE portNum,
443 )
444 {
445 FW_ASSERT(
446 portNum < this->getNum_CmdReg_OutputPorts(),
447 static_cast<FwAssertArgType>(portNum)
448 );
449
450 this->m_CmdReg_OutputPort[portNum].addCallPort(port);
451 }
452
453 void PrmDbComponentBase ::
454 set_CmdStatus_OutputPort(
455 NATIVE_INT_TYPE portNum,
457 )
458 {
459 FW_ASSERT(
460 portNum < this->getNum_CmdStatus_OutputPorts(),
461 static_cast<FwAssertArgType>(portNum)
462 );
463
464 this->m_CmdStatus_OutputPort[portNum].addCallPort(port);
465 }
466
467 void PrmDbComponentBase ::
468 set_Log_OutputPort(
469 NATIVE_INT_TYPE portNum,
470 Fw::InputLogPort* port
471 )
472 {
473 FW_ASSERT(
474 portNum < this->getNum_Log_OutputPorts(),
475 static_cast<FwAssertArgType>(portNum)
476 );
477
478 this->m_Log_OutputPort[portNum].addCallPort(port);
479 }
480
481#if FW_ENABLE_TEXT_LOGGING == 1
482
483 void PrmDbComponentBase ::
484 set_LogText_OutputPort(
485 NATIVE_INT_TYPE portNum,
487 )
488 {
489 FW_ASSERT(
490 portNum < this->getNum_LogText_OutputPorts(),
491 static_cast<FwAssertArgType>(portNum)
492 );
493
494 this->m_LogText_OutputPort[portNum].addCallPort(port);
495 }
496
497#endif
498
499 void PrmDbComponentBase ::
500 set_Time_OutputPort(
501 NATIVE_INT_TYPE portNum,
503 )
504 {
505 FW_ASSERT(
506 portNum < this->getNum_Time_OutputPorts(),
507 static_cast<FwAssertArgType>(portNum)
508 );
509
510 this->m_Time_OutputPort[portNum].addCallPort(port);
511 }
512
513 // ----------------------------------------------------------------------
514 // Connect typed input ports to typed output ports
515 // ----------------------------------------------------------------------
516
517 void PrmDbComponentBase ::
518 set_pingOut_OutputPort(
519 NATIVE_INT_TYPE portNum,
521 )
522 {
523 FW_ASSERT(
524 portNum < this->getNum_pingOut_OutputPorts(),
525 static_cast<FwAssertArgType>(portNum)
526 );
527
528 this->m_pingOut_OutputPort[portNum].addCallPort(port);
529 }
530
531#if FW_PORT_SERIALIZATION
532
533 // ----------------------------------------------------------------------
534 // Connect serial input ports to special output ports
535 // ----------------------------------------------------------------------
536
537 void PrmDbComponentBase ::
538 set_CmdReg_OutputPort(
539 NATIVE_INT_TYPE portNum,
540 Fw::InputSerializePort* port
541 )
542 {
543 FW_ASSERT(
544 portNum < this->getNum_CmdReg_OutputPorts(),
545 static_cast<FwAssertArgType>(portNum)
546 );
547
548 this->m_CmdReg_OutputPort[portNum].registerSerialPort(port);
549 }
550
551 void PrmDbComponentBase ::
552 set_CmdStatus_OutputPort(
553 NATIVE_INT_TYPE portNum,
554 Fw::InputSerializePort* port
555 )
556 {
557 FW_ASSERT(
558 portNum < this->getNum_CmdStatus_OutputPorts(),
559 static_cast<FwAssertArgType>(portNum)
560 );
561
562 this->m_CmdStatus_OutputPort[portNum].registerSerialPort(port);
563 }
564
565 void PrmDbComponentBase ::
566 set_Log_OutputPort(
567 NATIVE_INT_TYPE portNum,
568 Fw::InputSerializePort* port
569 )
570 {
571 FW_ASSERT(
572 portNum < this->getNum_Log_OutputPorts(),
573 static_cast<FwAssertArgType>(portNum)
574 );
575
576 this->m_Log_OutputPort[portNum].registerSerialPort(port);
577 }
578
579#if FW_ENABLE_TEXT_LOGGING == 1
580
581 void PrmDbComponentBase ::
582 set_LogText_OutputPort(
583 NATIVE_INT_TYPE portNum,
584 Fw::InputSerializePort* port
585 )
586 {
587 FW_ASSERT(
588 portNum < this->getNum_LogText_OutputPorts(),
589 static_cast<FwAssertArgType>(portNum)
590 );
591
592 this->m_LogText_OutputPort[portNum].registerSerialPort(port);
593 }
594
595#endif
596
597 void PrmDbComponentBase ::
598 set_Time_OutputPort(
599 NATIVE_INT_TYPE portNum,
600 Fw::InputSerializePort* port
601 )
602 {
603 FW_ASSERT(
604 portNum < this->getNum_Time_OutputPorts(),
605 static_cast<FwAssertArgType>(portNum)
606 );
607
608 this->m_Time_OutputPort[portNum].registerSerialPort(port);
609 }
610
611#endif
612
613#if FW_PORT_SERIALIZATION
614
615 // ----------------------------------------------------------------------
616 // Connect serial input ports to typed output ports
617 // ----------------------------------------------------------------------
618
619 void PrmDbComponentBase ::
620 set_pingOut_OutputPort(
621 NATIVE_INT_TYPE portNum,
622 Fw::InputSerializePort* port
623 )
624 {
625 FW_ASSERT(
626 portNum < this->getNum_pingOut_OutputPorts(),
627 static_cast<FwAssertArgType>(portNum)
628 );
629
630 this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
631 }
632
633#endif
634
635 // ----------------------------------------------------------------------
636 // Command registration
637 // ----------------------------------------------------------------------
638
639 void PrmDbComponentBase ::
640 regCommands()
641 {
642 FW_ASSERT(this->m_CmdReg_OutputPort[0].isConnected());
643
644 this->m_CmdReg_OutputPort[0].invoke(
645 this->getIdBase() + OPCODE_PRM_SAVE_FILE
646 );
647 }
648
649 // ----------------------------------------------------------------------
650 // Component construction and destruction
651 // ----------------------------------------------------------------------
652
653 PrmDbComponentBase ::
654 PrmDbComponentBase(const char* compName) :
655 Fw::ActiveComponentBase(compName)
656 {
657 this->m_PrmIdNotFoundThrottle = 0;
658 }
659
660 PrmDbComponentBase ::
661 ~PrmDbComponentBase()
662 {
663
664 }
665
666 // ----------------------------------------------------------------------
667 // Getters for numbers of special input ports
668 // ----------------------------------------------------------------------
669
670 NATIVE_INT_TYPE PrmDbComponentBase ::
671 getNum_CmdDisp_InputPorts() const
672 {
673 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_CmdDisp_InputPort));
674 }
675
676 // ----------------------------------------------------------------------
677 // Getters for numbers of typed input ports
678 // ----------------------------------------------------------------------
679
680 NATIVE_INT_TYPE PrmDbComponentBase ::
681 getNum_getPrm_InputPorts() const
682 {
683 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_getPrm_InputPort));
684 }
685
686 NATIVE_INT_TYPE PrmDbComponentBase ::
687 getNum_pingIn_InputPorts() const
688 {
689 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_pingIn_InputPort));
690 }
691
692 NATIVE_INT_TYPE PrmDbComponentBase ::
693 getNum_setPrm_InputPorts() const
694 {
695 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_setPrm_InputPort));
696 }
697
698 // ----------------------------------------------------------------------
699 // Getters for numbers of special output ports
700 // ----------------------------------------------------------------------
701
702 NATIVE_INT_TYPE PrmDbComponentBase ::
703 getNum_CmdReg_OutputPorts() const
704 {
705 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_CmdReg_OutputPort));
706 }
707
708 NATIVE_INT_TYPE PrmDbComponentBase ::
709 getNum_CmdStatus_OutputPorts() const
710 {
711 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_CmdStatus_OutputPort));
712 }
713
714 NATIVE_INT_TYPE PrmDbComponentBase ::
715 getNum_Log_OutputPorts() const
716 {
717 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_Log_OutputPort));
718 }
719
720#if FW_ENABLE_TEXT_LOGGING == 1
721
722 NATIVE_INT_TYPE PrmDbComponentBase ::
723 getNum_LogText_OutputPorts() const
724 {
725 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_LogText_OutputPort));
726 }
727
728#endif
729
730 NATIVE_INT_TYPE PrmDbComponentBase ::
731 getNum_Time_OutputPorts() const
732 {
733 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_Time_OutputPort));
734 }
735
736 // ----------------------------------------------------------------------
737 // Getters for numbers of typed output ports
738 // ----------------------------------------------------------------------
739
740 NATIVE_INT_TYPE PrmDbComponentBase ::
741 getNum_pingOut_OutputPorts() const
742 {
743 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_pingOut_OutputPort));
744 }
745
746 // ----------------------------------------------------------------------
747 // Connection status queries for special output ports
748 // ----------------------------------------------------------------------
749
750 bool PrmDbComponentBase ::
751 isConnected_CmdReg_OutputPort(NATIVE_INT_TYPE portNum)
752 {
753 FW_ASSERT(
754 portNum < this->getNum_CmdReg_OutputPorts(),
755 static_cast<FwAssertArgType>(portNum)
756 );
757
758 return this->m_CmdReg_OutputPort[portNum].isConnected();
759 }
760
761 bool PrmDbComponentBase ::
762 isConnected_CmdStatus_OutputPort(NATIVE_INT_TYPE portNum)
763 {
764 FW_ASSERT(
765 portNum < this->getNum_CmdStatus_OutputPorts(),
766 static_cast<FwAssertArgType>(portNum)
767 );
768
769 return this->m_CmdStatus_OutputPort[portNum].isConnected();
770 }
771
772 bool PrmDbComponentBase ::
773 isConnected_Log_OutputPort(NATIVE_INT_TYPE portNum)
774 {
775 FW_ASSERT(
776 portNum < this->getNum_Log_OutputPorts(),
777 static_cast<FwAssertArgType>(portNum)
778 );
779
780 return this->m_Log_OutputPort[portNum].isConnected();
781 }
782
783#if FW_ENABLE_TEXT_LOGGING == 1
784
785 bool PrmDbComponentBase ::
786 isConnected_LogText_OutputPort(NATIVE_INT_TYPE portNum)
787 {
788 FW_ASSERT(
789 portNum < this->getNum_LogText_OutputPorts(),
790 static_cast<FwAssertArgType>(portNum)
791 );
792
793 return this->m_LogText_OutputPort[portNum].isConnected();
794 }
795
796#endif
797
798 bool PrmDbComponentBase ::
799 isConnected_Time_OutputPort(NATIVE_INT_TYPE portNum)
800 {
801 FW_ASSERT(
802 portNum < this->getNum_Time_OutputPorts(),
803 static_cast<FwAssertArgType>(portNum)
804 );
805
806 return this->m_Time_OutputPort[portNum].isConnected();
807 }
808
809 // ----------------------------------------------------------------------
810 // Connection status queries for typed output ports
811 // ----------------------------------------------------------------------
812
813 bool PrmDbComponentBase ::
814 isConnected_pingOut_OutputPort(NATIVE_INT_TYPE portNum)
815 {
816 FW_ASSERT(
817 portNum < this->getNum_pingOut_OutputPorts(),
818 static_cast<FwAssertArgType>(portNum)
819 );
820
821 return this->m_pingOut_OutputPort[portNum].isConnected();
822 }
823
824 // ----------------------------------------------------------------------
825 // Port handler base-class functions for typed input ports
826 //
827 // Call these functions directly to bypass the corresponding ports
828 // ----------------------------------------------------------------------
829
830 Fw::ParamValid PrmDbComponentBase ::
831 getPrm_handlerBase(
832 NATIVE_INT_TYPE portNum,
833 FwPrmIdType id,
834 Fw::ParamBuffer& val
835 )
836 {
837 // Make sure port number is valid
838 FW_ASSERT(
839 portNum < this->getNum_getPrm_InputPorts(),
840 static_cast<FwAssertArgType>(portNum)
841 );
842
843 Fw::ParamValid retVal;
844
845 // Lock guard mutex before calling
846 this->lock();
847
848 // Call handler function
849 retVal = this->getPrm_handler(
850 portNum,
851 id,
852 val
853 );
854
855 // Unlock guard mutex
856 this->unLock();
857
858 return retVal;
859 }
860
861 void PrmDbComponentBase ::
862 pingIn_handlerBase(
863 NATIVE_INT_TYPE portNum,
864 U32 key
865 )
866 {
867 // Make sure port number is valid
868 FW_ASSERT(
869 portNum < this->getNum_pingIn_InputPorts(),
870 static_cast<FwAssertArgType>(portNum)
871 );
872
873 // Call pre-message hook
874 pingIn_preMsgHook(
875 portNum,
876 key
877 );
878 ComponentIpcSerializableBuffer msg;
880
881 // Serialize message ID
882 _status = msg.serialize(
883 static_cast<NATIVE_INT_TYPE>(PINGIN_PING)
884 );
885 FW_ASSERT(
886 _status == Fw::FW_SERIALIZE_OK,
887 static_cast<FwAssertArgType>(_status)
888 );
889
890 // Serialize port number
891 _status = msg.serialize(portNum);
892 FW_ASSERT(
893 _status == Fw::FW_SERIALIZE_OK,
894 static_cast<FwAssertArgType>(_status)
895 );
896
897 // Serialize argument key
898 _status = msg.serialize(key);
899 FW_ASSERT(
900 _status == Fw::FW_SERIALIZE_OK,
901 static_cast<FwAssertArgType>(_status)
902 );
903
904 // Send message
906 Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
907
908 FW_ASSERT(
909 qStatus == Os::Queue::QUEUE_OK,
910 static_cast<FwAssertArgType>(qStatus)
911 );
912 }
913
914 void PrmDbComponentBase ::
915 setPrm_handlerBase(
916 NATIVE_INT_TYPE portNum,
917 FwPrmIdType id,
918 Fw::ParamBuffer& val
919 )
920 {
921 // Make sure port number is valid
922 FW_ASSERT(
923 portNum < this->getNum_setPrm_InputPorts(),
924 static_cast<FwAssertArgType>(portNum)
925 );
926
927 // Call pre-message hook
928 setPrm_preMsgHook(
929 portNum,
930 id,
931 val
932 );
933 ComponentIpcSerializableBuffer msg;
935
936 // Serialize message ID
937 _status = msg.serialize(
938 static_cast<NATIVE_INT_TYPE>(SETPRM_PRMSET)
939 );
940 FW_ASSERT(
941 _status == Fw::FW_SERIALIZE_OK,
942 static_cast<FwAssertArgType>(_status)
943 );
944
945 // Serialize port number
946 _status = msg.serialize(portNum);
947 FW_ASSERT(
948 _status == Fw::FW_SERIALIZE_OK,
949 static_cast<FwAssertArgType>(_status)
950 );
951
952 // Serialize argument id
953 _status = msg.serialize(id);
954 FW_ASSERT(
955 _status == Fw::FW_SERIALIZE_OK,
956 static_cast<FwAssertArgType>(_status)
957 );
958
959 // Serialize argument val
960 _status = msg.serialize(val);
961 FW_ASSERT(
962 _status == Fw::FW_SERIALIZE_OK,
963 static_cast<FwAssertArgType>(_status)
964 );
965
966 // Send message
968 Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
969
970 FW_ASSERT(
971 qStatus == Os::Queue::QUEUE_OK,
972 static_cast<FwAssertArgType>(qStatus)
973 );
974 }
975
976 // ----------------------------------------------------------------------
977 // Pre-message hooks for typed async input ports
978 //
979 // Each of these functions is invoked just before processing a message
980 // on the corresponding port. By default, they do nothing. You can
981 // override them to provide specific pre-message behavior.
982 // ----------------------------------------------------------------------
983
984 void PrmDbComponentBase ::
985 pingIn_preMsgHook(
986 NATIVE_INT_TYPE portNum,
987 U32 key
988 )
989 {
990 // Default: no-op
991 }
992
993 void PrmDbComponentBase ::
994 setPrm_preMsgHook(
995 NATIVE_INT_TYPE portNum,
996 FwPrmIdType id,
997 Fw::ParamBuffer& val
998 )
999 {
1000 // Default: no-op
1001 }
1002
1003 // ----------------------------------------------------------------------
1004 // Invocation functions for typed output ports
1005 // ----------------------------------------------------------------------
1006
1007 void PrmDbComponentBase ::
1008 pingOut_out(
1009 NATIVE_INT_TYPE portNum,
1010 U32 key
1011 )
1012 {
1013 FW_ASSERT(
1014 portNum < this->getNum_pingOut_OutputPorts(),
1015 static_cast<FwAssertArgType>(portNum)
1016 );
1017 this->m_pingOut_OutputPort[portNum].invoke(
1018 key
1019 );
1020 }
1021
1022 // ----------------------------------------------------------------------
1023 // Command response
1024 // ----------------------------------------------------------------------
1025
1026 void PrmDbComponentBase ::
1027 cmdResponse_out(
1028 FwOpcodeType opCode,
1029 U32 cmdSeq,
1030 Fw::CmdResponse response
1031 )
1032 {
1033 FW_ASSERT(this->m_CmdStatus_OutputPort[0].isConnected());
1034 this->m_CmdStatus_OutputPort[0].invoke(opCode, cmdSeq, response);
1035 }
1036
1037 // ----------------------------------------------------------------------
1038 // Command handler base-class functions
1039 //
1040 // Call these functions directly to bypass the command input port
1041 // ----------------------------------------------------------------------
1042
1043 void PrmDbComponentBase ::
1044 PRM_SAVE_FILE_cmdHandlerBase(
1045 FwOpcodeType opCode,
1046 U32 cmdSeq,
1047 Fw::CmdArgBuffer& args
1048 )
1049 {
1050 // Call pre-message hook
1051 this->PRM_SAVE_FILE_preMsgHook(opCode,cmdSeq);
1052
1053 // Defer deserializing arguments to the message dispatcher
1054 // to avoid deserializing and reserializing just for IPC
1055 ComponentIpcSerializableBuffer msg;
1057
1058 // Serialize for IPC
1059 _status = msg.serialize(static_cast<NATIVE_INT_TYPE>(CMD_PRM_SAVE_FILE));
1060 FW_ASSERT (
1061 _status == Fw::FW_SERIALIZE_OK,
1062 static_cast<FwAssertArgType>(_status)
1063 );
1064
1065 // Fake port number to make message dequeue work
1066 NATIVE_INT_TYPE port = 0;
1067
1068 _status = msg.serialize(port);
1069 FW_ASSERT (
1070 _status == Fw::FW_SERIALIZE_OK,
1071 static_cast<FwAssertArgType>(_status)
1072 );
1073
1074 _status = msg.serialize(opCode);
1075 FW_ASSERT (
1076 _status == Fw::FW_SERIALIZE_OK,
1077 static_cast<FwAssertArgType>(_status)
1078 );
1079
1080 _status = msg.serialize(cmdSeq);
1081 FW_ASSERT (
1082 _status == Fw::FW_SERIALIZE_OK,
1083 static_cast<FwAssertArgType>(_status)
1084 );
1085
1086 _status = msg.serialize(args);
1087 FW_ASSERT (
1088 _status == Fw::FW_SERIALIZE_OK,
1089 static_cast<FwAssertArgType>(_status)
1090 );
1091
1092 // Send message
1094 Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
1095
1096 FW_ASSERT(
1097 qStatus == Os::Queue::QUEUE_OK,
1098 static_cast<FwAssertArgType>(qStatus)
1099 );
1100 }
1101
1102 // ----------------------------------------------------------------------
1103 // Pre-message hooks for async commands
1104 //
1105 // Each of these functions is invoked just before processing the
1106 // corresponding command. By default they do nothing. You can
1107 // override them to provide specific pre-command behavior.
1108 // ----------------------------------------------------------------------
1109
1110 void PrmDbComponentBase ::
1111 PRM_SAVE_FILE_preMsgHook(
1112 FwOpcodeType opCode,
1113 U32 cmdSeq
1114 )
1115 {
1116 // Defaults to no-op; can be overridden
1117 (void) opCode;
1118 (void) cmdSeq;
1119 }
1120
1121 // ----------------------------------------------------------------------
1122 // Event logging functions
1123 // ----------------------------------------------------------------------
1124
1125 void PrmDbComponentBase ::
1126 log_WARNING_LO_PrmIdNotFound(U32 Id)
1127 {
1128 // Check throttle value
1129 if (this->m_PrmIdNotFoundThrottle >= EVENTID_PRMIDNOTFOUND_THROTTLE) {
1130 return;
1131 }
1132 else {
1133 this->m_PrmIdNotFoundThrottle++;
1134 }
1135
1136 // Get the time
1137 Fw::Time _logTime;
1138 if (this->m_Time_OutputPort[0].isConnected()) {
1139 this->m_Time_OutputPort[0].invoke(_logTime);
1140 }
1141
1142 FwEventIdType _id = static_cast<FwEventIdType>(0);
1143
1144 _id = this->getIdBase() + EVENTID_PRMIDNOTFOUND;
1145
1146 // Emit the event on the log port
1147 if (this->m_Log_OutputPort[0].isConnected()) {
1148 Fw::LogBuffer _logBuff;
1150
1151#if FW_AMPCS_COMPATIBLE
1152 // Serialize the number of arguments
1153 _status = _logBuff.serialize(static_cast<U8>(1));
1154 FW_ASSERT(
1155 _status == Fw::FW_SERIALIZE_OK,
1156 static_cast<FwAssertArgType>(_status)
1157 );
1158#endif
1159
1160#if FW_AMPCS_COMPATIBLE
1161 // Serialize the argument size
1162 _status = _logBuff.serialize(
1163 static_cast<U8>(sizeof(U32))
1164 );
1165 FW_ASSERT(
1166 _status == Fw::FW_SERIALIZE_OK,
1167 static_cast<FwAssertArgType>(_status)
1168 );
1169#endif
1170 _status = _logBuff.serialize(Id);
1171 FW_ASSERT(
1172 _status == Fw::FW_SERIALIZE_OK,
1173 static_cast<FwAssertArgType>(_status)
1174 );
1175
1176 this->m_Log_OutputPort[0].invoke(
1177 _id,
1178 _logTime,
1180 _logBuff
1181 );
1182 }
1183
1184 // Emit the event on the text log port
1185#if FW_ENABLE_TEXT_LOGGING
1186 if (this->m_LogText_OutputPort[0].isConnected()) {
1187#if FW_OBJECT_NAMES == 1
1188 const char* _formatString =
1189 "(%s) %s: Parameter ID 0x%" PRIx32 " not found";
1190#else
1191 const char* _formatString =
1192 "%s: Parameter ID 0x%" PRIx32 " not found";
1193#endif
1194
1195 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
1196
1197 (void) snprintf(
1198 _textBuffer,
1200 _formatString,
1201#if FW_OBJECT_NAMES == 1
1202 this->m_objName,
1203#endif
1204 "PrmIdNotFound ",
1205 Id
1206 );
1207
1208 // Null terminate
1209 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
1210 Fw::TextLogString _logString = _textBuffer;
1211 this->m_LogText_OutputPort[0].invoke(
1212 _id,
1213 _logTime,
1215 _logString
1216 );
1217 }
1218#endif
1219 }
1220
1221 void PrmDbComponentBase ::
1222 log_ACTIVITY_HI_PrmIdUpdated(U32 Id)
1223 {
1224 // Get the time
1225 Fw::Time _logTime;
1226 if (this->m_Time_OutputPort[0].isConnected()) {
1227 this->m_Time_OutputPort[0].invoke(_logTime);
1228 }
1229
1230 FwEventIdType _id = static_cast<FwEventIdType>(0);
1231
1232 _id = this->getIdBase() + EVENTID_PRMIDUPDATED;
1233
1234 // Emit the event on the log port
1235 if (this->m_Log_OutputPort[0].isConnected()) {
1236 Fw::LogBuffer _logBuff;
1238
1239#if FW_AMPCS_COMPATIBLE
1240 // Serialize the number of arguments
1241 _status = _logBuff.serialize(static_cast<U8>(1));
1242 FW_ASSERT(
1243 _status == Fw::FW_SERIALIZE_OK,
1244 static_cast<FwAssertArgType>(_status)
1245 );
1246#endif
1247
1248#if FW_AMPCS_COMPATIBLE
1249 // Serialize the argument size
1250 _status = _logBuff.serialize(
1251 static_cast<U8>(sizeof(U32))
1252 );
1253 FW_ASSERT(
1254 _status == Fw::FW_SERIALIZE_OK,
1255 static_cast<FwAssertArgType>(_status)
1256 );
1257#endif
1258 _status = _logBuff.serialize(Id);
1259 FW_ASSERT(
1260 _status == Fw::FW_SERIALIZE_OK,
1261 static_cast<FwAssertArgType>(_status)
1262 );
1263
1264 this->m_Log_OutputPort[0].invoke(
1265 _id,
1266 _logTime,
1268 _logBuff
1269 );
1270 }
1271
1272 // Emit the event on the text log port
1273#if FW_ENABLE_TEXT_LOGGING
1274 if (this->m_LogText_OutputPort[0].isConnected()) {
1275#if FW_OBJECT_NAMES == 1
1276 const char* _formatString =
1277 "(%s) %s: Parameter ID 0x%" PRIx32 " updated";
1278#else
1279 const char* _formatString =
1280 "%s: Parameter ID 0x%" PRIx32 " updated";
1281#endif
1282
1283 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
1284
1285 (void) snprintf(
1286 _textBuffer,
1288 _formatString,
1289#if FW_OBJECT_NAMES == 1
1290 this->m_objName,
1291#endif
1292 "PrmIdUpdated ",
1293 Id
1294 );
1295
1296 // Null terminate
1297 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
1298 Fw::TextLogString _logString = _textBuffer;
1299 this->m_LogText_OutputPort[0].invoke(
1300 _id,
1301 _logTime,
1303 _logString
1304 );
1305 }
1306#endif
1307 }
1308
1309 void PrmDbComponentBase ::
1310 log_FATAL_PrmDbFull(U32 Id)
1311 {
1312 // Get the time
1313 Fw::Time _logTime;
1314 if (this->m_Time_OutputPort[0].isConnected()) {
1315 this->m_Time_OutputPort[0].invoke(_logTime);
1316 }
1317
1318 FwEventIdType _id = static_cast<FwEventIdType>(0);
1319
1320 _id = this->getIdBase() + EVENTID_PRMDBFULL;
1321
1322 // Emit the event on the log port
1323 if (this->m_Log_OutputPort[0].isConnected()) {
1324 Fw::LogBuffer _logBuff;
1326
1327#if FW_AMPCS_COMPATIBLE
1328 // Serialize the number of arguments
1329 _status = _logBuff.serialize(static_cast<U8>(1 + 1));
1330 FW_ASSERT(
1331 _status == Fw::FW_SERIALIZE_OK,
1332 static_cast<FwAssertArgType>(_status)
1333 );
1334
1335 // For FATAL, add stack size of 4 and a dummy entry. No support for stacks yet.
1336 _status = _logBuff.serialize(static_cast<U8>(4));
1337 FW_ASSERT(
1338 _status == Fw::FW_SERIALIZE_OK,
1339 static_cast<FwAssertArgType>(_status)
1340 );
1341
1342 _status = _logBuff.serialize(static_cast<U32>(0));
1343 FW_ASSERT(
1344 _status == Fw::FW_SERIALIZE_OK,
1345 static_cast<FwAssertArgType>(_status)
1346 );
1347#endif
1348
1349#if FW_AMPCS_COMPATIBLE
1350 // Serialize the argument size
1351 _status = _logBuff.serialize(
1352 static_cast<U8>(sizeof(U32))
1353 );
1354 FW_ASSERT(
1355 _status == Fw::FW_SERIALIZE_OK,
1356 static_cast<FwAssertArgType>(_status)
1357 );
1358#endif
1359 _status = _logBuff.serialize(Id);
1360 FW_ASSERT(
1361 _status == Fw::FW_SERIALIZE_OK,
1362 static_cast<FwAssertArgType>(_status)
1363 );
1364
1365 this->m_Log_OutputPort[0].invoke(
1366 _id,
1367 _logTime,
1369 _logBuff
1370 );
1371 }
1372
1373 // Emit the event on the text log port
1374#if FW_ENABLE_TEXT_LOGGING
1375 if (this->m_LogText_OutputPort[0].isConnected()) {
1376#if FW_OBJECT_NAMES == 1
1377 const char* _formatString =
1378 "(%s) %s: Parameter DB full when adding ID 0x%" PRIx32 " ";
1379#else
1380 const char* _formatString =
1381 "%s: Parameter DB full when adding ID 0x%" PRIx32 " ";
1382#endif
1383
1384 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
1385
1386 (void) snprintf(
1387 _textBuffer,
1389 _formatString,
1390#if FW_OBJECT_NAMES == 1
1391 this->m_objName,
1392#endif
1393 "PrmDbFull ",
1394 Id
1395 );
1396
1397 // Null terminate
1398 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
1399 Fw::TextLogString _logString = _textBuffer;
1400 this->m_LogText_OutputPort[0].invoke(
1401 _id,
1402 _logTime,
1404 _logString
1405 );
1406 }
1407#endif
1408 }
1409
1410 void PrmDbComponentBase ::
1411 log_ACTIVITY_HI_PrmIdAdded(U32 Id)
1412 {
1413 // Get the time
1414 Fw::Time _logTime;
1415 if (this->m_Time_OutputPort[0].isConnected()) {
1416 this->m_Time_OutputPort[0].invoke(_logTime);
1417 }
1418
1419 FwEventIdType _id = static_cast<FwEventIdType>(0);
1420
1421 _id = this->getIdBase() + EVENTID_PRMIDADDED;
1422
1423 // Emit the event on the log port
1424 if (this->m_Log_OutputPort[0].isConnected()) {
1425 Fw::LogBuffer _logBuff;
1427
1428#if FW_AMPCS_COMPATIBLE
1429 // Serialize the number of arguments
1430 _status = _logBuff.serialize(static_cast<U8>(1));
1431 FW_ASSERT(
1432 _status == Fw::FW_SERIALIZE_OK,
1433 static_cast<FwAssertArgType>(_status)
1434 );
1435#endif
1436
1437#if FW_AMPCS_COMPATIBLE
1438 // Serialize the argument size
1439 _status = _logBuff.serialize(
1440 static_cast<U8>(sizeof(U32))
1441 );
1442 FW_ASSERT(
1443 _status == Fw::FW_SERIALIZE_OK,
1444 static_cast<FwAssertArgType>(_status)
1445 );
1446#endif
1447 _status = _logBuff.serialize(Id);
1448 FW_ASSERT(
1449 _status == Fw::FW_SERIALIZE_OK,
1450 static_cast<FwAssertArgType>(_status)
1451 );
1452
1453 this->m_Log_OutputPort[0].invoke(
1454 _id,
1455 _logTime,
1457 _logBuff
1458 );
1459 }
1460
1461 // Emit the event on the text log port
1462#if FW_ENABLE_TEXT_LOGGING
1463 if (this->m_LogText_OutputPort[0].isConnected()) {
1464#if FW_OBJECT_NAMES == 1
1465 const char* _formatString =
1466 "(%s) %s: Parameter ID 0x%" PRIx32 " added";
1467#else
1468 const char* _formatString =
1469 "%s: Parameter ID 0x%" PRIx32 " added";
1470#endif
1471
1472 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
1473
1474 (void) snprintf(
1475 _textBuffer,
1477 _formatString,
1478#if FW_OBJECT_NAMES == 1
1479 this->m_objName,
1480#endif
1481 "PrmIdAdded ",
1482 Id
1483 );
1484
1485 // Null terminate
1486 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
1487 Fw::TextLogString _logString = _textBuffer;
1488 this->m_LogText_OutputPort[0].invoke(
1489 _id,
1490 _logTime,
1492 _logString
1493 );
1494 }
1495#endif
1496 }
1497
1498 void PrmDbComponentBase ::
1499 log_WARNING_HI_PrmFileWriteError(
1501 I32 record,
1502 I32 error
1503 )
1504 {
1505 // Get the time
1506 Fw::Time _logTime;
1507 if (this->m_Time_OutputPort[0].isConnected()) {
1508 this->m_Time_OutputPort[0].invoke(_logTime);
1509 }
1510
1511 FwEventIdType _id = static_cast<FwEventIdType>(0);
1512
1513 _id = this->getIdBase() + EVENTID_PRMFILEWRITEERROR;
1514
1515 // Emit the event on the log port
1516 if (this->m_Log_OutputPort[0].isConnected()) {
1517 Fw::LogBuffer _logBuff;
1519
1520#if FW_AMPCS_COMPATIBLE
1521 // Serialize the number of arguments
1522 _status = _logBuff.serialize(static_cast<U8>(3));
1523 FW_ASSERT(
1524 _status == Fw::FW_SERIALIZE_OK,
1525 static_cast<FwAssertArgType>(_status)
1526 );
1527#endif
1528
1529#if FW_AMPCS_COMPATIBLE
1530 // Serialize the argument size
1531 _status = _logBuff.serialize(
1533 );
1534 FW_ASSERT(
1535 _status == Fw::FW_SERIALIZE_OK,
1536 static_cast<FwAssertArgType>(_status)
1537 );
1538#endif
1539 _status = _logBuff.serialize(stage);
1540 FW_ASSERT(
1541 _status == Fw::FW_SERIALIZE_OK,
1542 static_cast<FwAssertArgType>(_status)
1543 );
1544
1545#if FW_AMPCS_COMPATIBLE
1546 // Serialize the argument size
1547 _status = _logBuff.serialize(
1548 static_cast<U8>(sizeof(I32))
1549 );
1550 FW_ASSERT(
1551 _status == Fw::FW_SERIALIZE_OK,
1552 static_cast<FwAssertArgType>(_status)
1553 );
1554#endif
1555 _status = _logBuff.serialize(record);
1556 FW_ASSERT(
1557 _status == Fw::FW_SERIALIZE_OK,
1558 static_cast<FwAssertArgType>(_status)
1559 );
1560
1561#if FW_AMPCS_COMPATIBLE
1562 // Serialize the argument size
1563 _status = _logBuff.serialize(
1564 static_cast<U8>(sizeof(I32))
1565 );
1566 FW_ASSERT(
1567 _status == Fw::FW_SERIALIZE_OK,
1568 static_cast<FwAssertArgType>(_status)
1569 );
1570#endif
1571 _status = _logBuff.serialize(error);
1572 FW_ASSERT(
1573 _status == Fw::FW_SERIALIZE_OK,
1574 static_cast<FwAssertArgType>(_status)
1575 );
1576
1577 this->m_Log_OutputPort[0].invoke(
1578 _id,
1579 _logTime,
1581 _logBuff
1582 );
1583 }
1584
1585 // Emit the event on the text log port
1586#if FW_ENABLE_TEXT_LOGGING
1587 if (this->m_LogText_OutputPort[0].isConnected()) {
1588#if FW_OBJECT_NAMES == 1
1589 const char* _formatString =
1590 "(%s) %s: Parameter write failed in stage %s with record %" PRIi32 " and error %" PRIi32 "";
1591#else
1592 const char* _formatString =
1593 "%s: Parameter write failed in stage %s with record %" PRIi32 " and error %" PRIi32 "";
1594#endif
1595
1596 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
1597
1598 Fw::String stageStr;
1599 stage.toString(stageStr);
1600
1601 (void) snprintf(
1602 _textBuffer,
1604 _formatString,
1605#if FW_OBJECT_NAMES == 1
1606 this->m_objName,
1607#endif
1608 "PrmFileWriteError ",
1609 stageStr.toChar(),
1610 record,
1611 error
1612 );
1613
1614 // Null terminate
1615 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
1616 Fw::TextLogString _logString = _textBuffer;
1617 this->m_LogText_OutputPort[0].invoke(
1618 _id,
1619 _logTime,
1621 _logString
1622 );
1623 }
1624#endif
1625 }
1626
1627 void PrmDbComponentBase ::
1628 log_ACTIVITY_HI_PrmFileSaveComplete(U32 records)
1629 {
1630 // Get the time
1631 Fw::Time _logTime;
1632 if (this->m_Time_OutputPort[0].isConnected()) {
1633 this->m_Time_OutputPort[0].invoke(_logTime);
1634 }
1635
1636 FwEventIdType _id = static_cast<FwEventIdType>(0);
1637
1638 _id = this->getIdBase() + EVENTID_PRMFILESAVECOMPLETE;
1639
1640 // Emit the event on the log port
1641 if (this->m_Log_OutputPort[0].isConnected()) {
1642 Fw::LogBuffer _logBuff;
1644
1645#if FW_AMPCS_COMPATIBLE
1646 // Serialize the number of arguments
1647 _status = _logBuff.serialize(static_cast<U8>(1));
1648 FW_ASSERT(
1649 _status == Fw::FW_SERIALIZE_OK,
1650 static_cast<FwAssertArgType>(_status)
1651 );
1652#endif
1653
1654#if FW_AMPCS_COMPATIBLE
1655 // Serialize the argument size
1656 _status = _logBuff.serialize(
1657 static_cast<U8>(sizeof(U32))
1658 );
1659 FW_ASSERT(
1660 _status == Fw::FW_SERIALIZE_OK,
1661 static_cast<FwAssertArgType>(_status)
1662 );
1663#endif
1664 _status = _logBuff.serialize(records);
1665 FW_ASSERT(
1666 _status == Fw::FW_SERIALIZE_OK,
1667 static_cast<FwAssertArgType>(_status)
1668 );
1669
1670 this->m_Log_OutputPort[0].invoke(
1671 _id,
1672 _logTime,
1674 _logBuff
1675 );
1676 }
1677
1678 // Emit the event on the text log port
1679#if FW_ENABLE_TEXT_LOGGING
1680 if (this->m_LogText_OutputPort[0].isConnected()) {
1681#if FW_OBJECT_NAMES == 1
1682 const char* _formatString =
1683 "(%s) %s: Parameter file save completed. Wrote %" PRIu32 " records.";
1684#else
1685 const char* _formatString =
1686 "%s: Parameter file save completed. Wrote %" PRIu32 " records.";
1687#endif
1688
1689 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
1690
1691 (void) snprintf(
1692 _textBuffer,
1694 _formatString,
1695#if FW_OBJECT_NAMES == 1
1696 this->m_objName,
1697#endif
1698 "PrmFileSaveComplete ",
1699 records
1700 );
1701
1702 // Null terminate
1703 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
1704 Fw::TextLogString _logString = _textBuffer;
1705 this->m_LogText_OutputPort[0].invoke(
1706 _id,
1707 _logTime,
1709 _logString
1710 );
1711 }
1712#endif
1713 }
1714
1715 void PrmDbComponentBase ::
1716 log_WARNING_HI_PrmFileReadError(
1718 I32 record,
1719 I32 error
1720 )
1721 {
1722 // Get the time
1723 Fw::Time _logTime;
1724 if (this->m_Time_OutputPort[0].isConnected()) {
1725 this->m_Time_OutputPort[0].invoke(_logTime);
1726 }
1727
1728 FwEventIdType _id = static_cast<FwEventIdType>(0);
1729
1730 _id = this->getIdBase() + EVENTID_PRMFILEREADERROR;
1731
1732 // Emit the event on the log port
1733 if (this->m_Log_OutputPort[0].isConnected()) {
1734 Fw::LogBuffer _logBuff;
1736
1737#if FW_AMPCS_COMPATIBLE
1738 // Serialize the number of arguments
1739 _status = _logBuff.serialize(static_cast<U8>(3));
1740 FW_ASSERT(
1741 _status == Fw::FW_SERIALIZE_OK,
1742 static_cast<FwAssertArgType>(_status)
1743 );
1744#endif
1745
1746#if FW_AMPCS_COMPATIBLE
1747 // Serialize the argument size
1748 _status = _logBuff.serialize(
1750 );
1751 FW_ASSERT(
1752 _status == Fw::FW_SERIALIZE_OK,
1753 static_cast<FwAssertArgType>(_status)
1754 );
1755#endif
1756 _status = _logBuff.serialize(stage);
1757 FW_ASSERT(
1758 _status == Fw::FW_SERIALIZE_OK,
1759 static_cast<FwAssertArgType>(_status)
1760 );
1761
1762#if FW_AMPCS_COMPATIBLE
1763 // Serialize the argument size
1764 _status = _logBuff.serialize(
1765 static_cast<U8>(sizeof(I32))
1766 );
1767 FW_ASSERT(
1768 _status == Fw::FW_SERIALIZE_OK,
1769 static_cast<FwAssertArgType>(_status)
1770 );
1771#endif
1772 _status = _logBuff.serialize(record);
1773 FW_ASSERT(
1774 _status == Fw::FW_SERIALIZE_OK,
1775 static_cast<FwAssertArgType>(_status)
1776 );
1777
1778#if FW_AMPCS_COMPATIBLE
1779 // Serialize the argument size
1780 _status = _logBuff.serialize(
1781 static_cast<U8>(sizeof(I32))
1782 );
1783 FW_ASSERT(
1784 _status == Fw::FW_SERIALIZE_OK,
1785 static_cast<FwAssertArgType>(_status)
1786 );
1787#endif
1788 _status = _logBuff.serialize(error);
1789 FW_ASSERT(
1790 _status == Fw::FW_SERIALIZE_OK,
1791 static_cast<FwAssertArgType>(_status)
1792 );
1793
1794 this->m_Log_OutputPort[0].invoke(
1795 _id,
1796 _logTime,
1798 _logBuff
1799 );
1800 }
1801
1802 // Emit the event on the text log port
1803#if FW_ENABLE_TEXT_LOGGING
1804 if (this->m_LogText_OutputPort[0].isConnected()) {
1805#if FW_OBJECT_NAMES == 1
1806 const char* _formatString =
1807 "(%s) %s: Parameter file read failed in stage %s with record %" PRIi32 " and error %" PRIi32 "";
1808#else
1809 const char* _formatString =
1810 "%s: Parameter file read failed in stage %s with record %" PRIi32 " and error %" PRIi32 "";
1811#endif
1812
1813 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
1814
1815 Fw::String stageStr;
1816 stage.toString(stageStr);
1817
1818 (void) snprintf(
1819 _textBuffer,
1821 _formatString,
1822#if FW_OBJECT_NAMES == 1
1823 this->m_objName,
1824#endif
1825 "PrmFileReadError ",
1826 stageStr.toChar(),
1827 record,
1828 error
1829 );
1830
1831 // Null terminate
1832 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
1833 Fw::TextLogString _logString = _textBuffer;
1834 this->m_LogText_OutputPort[0].invoke(
1835 _id,
1836 _logTime,
1838 _logString
1839 );
1840 }
1841#endif
1842 }
1843
1844 void PrmDbComponentBase ::
1845 log_ACTIVITY_HI_PrmFileLoadComplete(U32 records)
1846 {
1847 // Get the time
1848 Fw::Time _logTime;
1849 if (this->m_Time_OutputPort[0].isConnected()) {
1850 this->m_Time_OutputPort[0].invoke(_logTime);
1851 }
1852
1853 FwEventIdType _id = static_cast<FwEventIdType>(0);
1854
1855 _id = this->getIdBase() + EVENTID_PRMFILELOADCOMPLETE;
1856
1857 // Emit the event on the log port
1858 if (this->m_Log_OutputPort[0].isConnected()) {
1859 Fw::LogBuffer _logBuff;
1861
1862#if FW_AMPCS_COMPATIBLE
1863 // Serialize the number of arguments
1864 _status = _logBuff.serialize(static_cast<U8>(1));
1865 FW_ASSERT(
1866 _status == Fw::FW_SERIALIZE_OK,
1867 static_cast<FwAssertArgType>(_status)
1868 );
1869#endif
1870
1871#if FW_AMPCS_COMPATIBLE
1872 // Serialize the argument size
1873 _status = _logBuff.serialize(
1874 static_cast<U8>(sizeof(U32))
1875 );
1876 FW_ASSERT(
1877 _status == Fw::FW_SERIALIZE_OK,
1878 static_cast<FwAssertArgType>(_status)
1879 );
1880#endif
1881 _status = _logBuff.serialize(records);
1882 FW_ASSERT(
1883 _status == Fw::FW_SERIALIZE_OK,
1884 static_cast<FwAssertArgType>(_status)
1885 );
1886
1887 this->m_Log_OutputPort[0].invoke(
1888 _id,
1889 _logTime,
1891 _logBuff
1892 );
1893 }
1894
1895 // Emit the event on the text log port
1896#if FW_ENABLE_TEXT_LOGGING
1897 if (this->m_LogText_OutputPort[0].isConnected()) {
1898#if FW_OBJECT_NAMES == 1
1899 const char* _formatString =
1900 "(%s) %s: Parameter file load completed. Read %" PRIu32 " records.";
1901#else
1902 const char* _formatString =
1903 "%s: Parameter file load completed. Read %" PRIu32 " records.";
1904#endif
1905
1906 char _textBuffer[FW_LOG_TEXT_BUFFER_SIZE];
1907
1908 (void) snprintf(
1909 _textBuffer,
1911 _formatString,
1912#if FW_OBJECT_NAMES == 1
1913 this->m_objName,
1914#endif
1915 "PrmFileLoadComplete ",
1916 records
1917 );
1918
1919 // Null terminate
1920 _textBuffer[FW_LOG_TEXT_BUFFER_SIZE-1] = 0;
1921 Fw::TextLogString _logString = _textBuffer;
1922 this->m_LogText_OutputPort[0].invoke(
1923 _id,
1924 _logTime,
1926 _logString
1927 );
1928 }
1929#endif
1930 }
1931
1932 // ----------------------------------------------------------------------
1933 // Event throttle reset functions
1934 // ----------------------------------------------------------------------
1935
1936 void PrmDbComponentBase ::
1937 log_WARNING_LO_PrmIdNotFound_ThrottleClear()
1938 {
1939 // Reset throttle counter
1940 this->m_PrmIdNotFoundThrottle = 0;
1941 }
1942
1943 // ----------------------------------------------------------------------
1944 // Time
1945 // ----------------------------------------------------------------------
1946
1947 Fw::Time PrmDbComponentBase ::
1948 getTime()
1949 {
1950 if (this->m_Time_OutputPort[0].isConnected()) {
1951 Fw::Time _time;
1952 this->m_Time_OutputPort[0].invoke(_time);
1953 return _time;
1954 }
1955 else {
1956 return Fw::Time(TB_NONE, 0, 0);
1957 }
1958 }
1959
1960 // ----------------------------------------------------------------------
1961 // Mutex operations for guarded ports
1962 //
1963 // You can override these operations to provide more sophisticated
1964 // synchronization
1965 // ----------------------------------------------------------------------
1966
1967 void PrmDbComponentBase ::
1968 lock()
1969 {
1970 this->m_guardedPortMutex.lock();
1971 }
1972
1973 void PrmDbComponentBase ::
1974 unLock()
1975 {
1976 this->m_guardedPortMutex.unLock();
1977 }
1978
1979 // ----------------------------------------------------------------------
1980 // Message dispatch functions
1981 // ----------------------------------------------------------------------
1982
1983 Fw::QueuedComponentBase::MsgDispatchStatus PrmDbComponentBase ::
1984 doDispatch()
1985 {
1986 ComponentIpcSerializableBuffer msg;
1987 NATIVE_INT_TYPE priority = 0;
1988
1989 Os::Queue::QueueStatus msgStatus = this->m_queue.receive(
1990 msg,
1991 priority,
1993 );
1994 FW_ASSERT(
1995 msgStatus == Os::Queue::QUEUE_OK,
1996 static_cast<FwAssertArgType>(msgStatus)
1997 );
1998
1999 // Reset to beginning of buffer
2000 msg.resetDeser();
2001
2002 NATIVE_INT_TYPE desMsg = 0;
2003 Fw::SerializeStatus deserStatus = msg.deserialize(desMsg);
2004 FW_ASSERT(
2005 deserStatus == Fw::FW_SERIALIZE_OK,
2006 static_cast<FwAssertArgType>(deserStatus)
2007 );
2008
2009 MsgTypeEnum msgType = static_cast<MsgTypeEnum>(desMsg);
2010
2011 if (msgType == PRMDB_COMPONENT_EXIT) {
2012 return MSG_DISPATCH_EXIT;
2013 }
2014
2015 NATIVE_INT_TYPE portNum = 0;
2016 deserStatus = msg.deserialize(portNum);
2017 FW_ASSERT(
2018 deserStatus == Fw::FW_SERIALIZE_OK,
2019 static_cast<FwAssertArgType>(deserStatus)
2020 );
2021
2022 switch (msgType) {
2023 // Handle async input port pingIn
2024 case PINGIN_PING: {
2025 // Deserialize argument key
2026 U32 key;
2027 deserStatus = msg.deserialize(key);
2028 FW_ASSERT(
2029 deserStatus == Fw::FW_SERIALIZE_OK,
2030 static_cast<FwAssertArgType>(deserStatus)
2031 );
2032 // Call handler function
2033 this->pingIn_handler(
2034 portNum,
2035 key
2036 );
2037
2038 break;
2039 }
2040
2041 // Handle async input port setPrm
2042 case SETPRM_PRMSET: {
2043 // Deserialize argument id
2044 FwPrmIdType id;
2045 deserStatus = msg.deserialize(id);
2046 FW_ASSERT(
2047 deserStatus == Fw::FW_SERIALIZE_OK,
2048 static_cast<FwAssertArgType>(deserStatus)
2049 );
2050
2051 // Deserialize argument val
2052 Fw::ParamBuffer val;
2053 deserStatus = msg.deserialize(val);
2054 FW_ASSERT(
2055 deserStatus == Fw::FW_SERIALIZE_OK,
2056 static_cast<FwAssertArgType>(deserStatus)
2057 );
2058 // Call handler function
2059 this->setPrm_handler(
2060 portNum,
2061 id,
2062 val
2063 );
2064
2065 break;
2066 }
2067
2068 // Handle command PRM_SAVE_FILE
2069 case CMD_PRM_SAVE_FILE: {
2070 // Deserialize opcode
2071 FwOpcodeType opCode = 0;
2072 deserStatus = msg.deserialize(opCode);
2073 FW_ASSERT (
2074 deserStatus == Fw::FW_SERIALIZE_OK,
2075 static_cast<FwAssertArgType>(deserStatus)
2076 );
2077
2078 // Deserialize command sequence
2079 U32 cmdSeq = 0;
2080 deserStatus = msg.deserialize(cmdSeq);
2081 FW_ASSERT (
2082 deserStatus == Fw::FW_SERIALIZE_OK,
2083 static_cast<FwAssertArgType>(deserStatus)
2084 );
2085
2086 // Deserialize command argument buffer
2087 Fw::CmdArgBuffer args;
2088 deserStatus = msg.deserialize(args);
2089 FW_ASSERT (
2090 deserStatus == Fw::FW_SERIALIZE_OK,
2091 static_cast<FwAssertArgType>(deserStatus)
2092 );
2093
2094 // Reset buffer
2095 args.resetDeser();
2096
2097 // Make sure there was no data left over.
2098 // That means the argument buffer size was incorrect.
2099#if FW_CMD_CHECK_RESIDUAL
2100 if (args.getBuffLeft() != 0) {
2101 if (this->m_CmdStatus_OutputPort[0].isConnected()) {
2102 this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2103 }
2104 // Don't crash the task if bad arguments were passed from the ground
2105 break;
2106 }
2107#endif
2108
2109 // Call handler function
2110 this->PRM_SAVE_FILE_cmdHandler(opCode, cmdSeq);
2111
2112 break;
2113 }
2114
2115 default:
2116 return MSG_DISPATCH_ERROR;
2117 }
2118
2119 return MSG_DISPATCH_OK;
2120 }
2121
2122 // ----------------------------------------------------------------------
2123 // Calls for messages received on special input ports
2124 // ----------------------------------------------------------------------
2125
2126 void PrmDbComponentBase ::
2127 m_p_CmdDisp_in(
2128 Fw::PassiveComponentBase* callComp,
2129 NATIVE_INT_TYPE portNum,
2130 FwOpcodeType opCode,
2131 U32 cmdSeq,
2132 Fw::CmdArgBuffer& args
2133 )
2134 {
2135 FW_ASSERT(callComp);
2136 PrmDbComponentBase* compPtr = static_cast<PrmDbComponentBase*>(callComp);
2137
2138 const U32 idBase = callComp->getIdBase();
2139 FW_ASSERT(opCode >= idBase, opCode, idBase);
2140
2141 // Select base class function based on opcode
2142 switch (opCode - idBase) {
2143 case OPCODE_PRM_SAVE_FILE: {
2144 compPtr->PRM_SAVE_FILE_cmdHandlerBase(
2145 opCode,
2146 cmdSeq,
2147 args
2148 );
2149 break;
2150 }
2151 }
2152 }
2153
2154 // ----------------------------------------------------------------------
2155 // Calls for messages received on typed input ports
2156 // ----------------------------------------------------------------------
2157
2158 Fw::ParamValid PrmDbComponentBase ::
2159 m_p_getPrm_in(
2160 Fw::PassiveComponentBase* callComp,
2161 NATIVE_INT_TYPE portNum,
2162 FwPrmIdType id,
2163 Fw::ParamBuffer& val
2164 )
2165 {
2166 FW_ASSERT(callComp);
2167 PrmDbComponentBase* compPtr = static_cast<PrmDbComponentBase*>(callComp);
2168 return compPtr->getPrm_handlerBase(
2169 portNum,
2170 id,
2171 val
2172 );
2173 }
2174
2175 void PrmDbComponentBase ::
2176 m_p_pingIn_in(
2177 Fw::PassiveComponentBase* callComp,
2178 NATIVE_INT_TYPE portNum,
2179 U32 key
2180 )
2181 {
2182 FW_ASSERT(callComp);
2183 PrmDbComponentBase* compPtr = static_cast<PrmDbComponentBase*>(callComp);
2184 compPtr->pingIn_handlerBase(
2185 portNum,
2186 key
2187 );
2188 }
2189
2190 void PrmDbComponentBase ::
2191 m_p_setPrm_in(
2192 Fw::PassiveComponentBase* callComp,
2193 NATIVE_INT_TYPE portNum,
2194 FwPrmIdType id,
2195 Fw::ParamBuffer& val
2196 )
2197 {
2198 FW_ASSERT(callComp);
2199 PrmDbComponentBase* compPtr = static_cast<PrmDbComponentBase*>(callComp);
2200 compPtr->setPrm_handlerBase(
2201 portNum,
2202 id,
2203 val
2204 );
2205 }
2206
2207}
#define FW_ASSERT(...)
Definition Assert.hpp:14
PlatformIntType NATIVE_INT_TYPE
Definition BasicTypes.h:51
U8 BYTE
byte type
Definition BasicTypes.h:27
uint8_t U8
8-bit unsigned integer
Definition BasicTypes.h:26
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition BasicTypes.h:66
PlatformUIntType NATIVE_UINT_TYPE
Definition BasicTypes.h:52
int PlatformIntType
DefaultTypes.hpp provides fallback defaults for the platform types.
#define PRI_PlatformIntType
@ TB_NONE
No time base has been established.
Definition FpConfig.h:39
PlatformAssertArgType FwAssertArgType
Definition FpConfig.h:21
U32 FwEventIdType
Definition FpConfig.h:62
U32 FwOpcodeType
Definition FpConfig.h:56
U32 FwPrmIdType
Definition FpConfig.h:65
#define FW_LOG_TEXT_BUFFER_SIZE
Max size of string for text log message.
Definition FpConfig.h:299
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects)
Definition FpConfig.h:88
@ ACTIVE_COMPONENT_EXIT
message to exit active component task
Enum representing a command response.
@ FORMAT_ERROR
Command failed to deserialize.
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
Definition CmdPortAc.hpp:37
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
@ WARNING_HI
A serious but recoverable event.
@ ACTIVITY_HI
Important informational events.
@ FATAL
A fatal non-recoverable event.
@ WARNING_LO
A less serious but recoverable event.
void init()
Object initializer.
Definition ObjBase.cpp:27
Enum representing parameter validity.
NATIVE_UINT_TYPE getBuffLeft() const
returns how much deserialization buffer is left
void resetDeser()
reset deserialization to beginning
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
const char * toChar() const
gets char buffer
Definition String.cpp:48
@ QUEUE_OK
message sent/received okay
Definition Queue.hpp:28
QueueBlocking
Definition Queue.hpp:40
@ QUEUE_BLOCKING
Queue receive blocks until a message arrives.
Definition Queue.hpp:41
@ QUEUE_NONBLOCKING
Queue receive always returns even if there is no message.
Definition Queue.hpp:42
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
@ SERIALIZED_SIZE
The size of the serial representation.
@ SERIALIZED_SIZE
The size of the serial representation.
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.