F´ Flight Software - C/C++ Documentation NASA-v1.6.0
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TlmPacketizerComponentAc.hpp
Go to the documentation of this file.
1// ======================================================================
2// \title TlmPacketizerComponentAc.hpp
3// \author Generated by fpp-to-cpp
4// \brief hpp file for TlmPacketizer component base class
5// ======================================================================
6
7#ifndef Svc_TlmPacketizerComponentAc_HPP
8#define Svc_TlmPacketizerComponentAc_HPP
9
10#include "FpConfig.hpp"
11#include "Fw/Cmd/CmdPortAc.hpp"
14#include "Fw/Cmd/CmdString.hpp"
15#include "Fw/Com/ComPortAc.hpp"
17#include "Fw/Log/LogPortAc.hpp"
18#include "Fw/Log/LogString.hpp"
19#if FW_ENABLE_TEXT_LOGGING == 1
21#endif
25#include "Fw/Tlm/TlmPortAc.hpp"
26#include "Fw/Tlm/TlmString.hpp"
29
30namespace Svc {
31
38 {
39
40 // ----------------------------------------------------------------------
41 // Friend classes
42 // ----------------------------------------------------------------------
43
46
47 PROTECTED:
48
49 // ----------------------------------------------------------------------
50 // Constants
51 // ----------------------------------------------------------------------
52
54 enum {
56 };
57
59 enum {
63 };
64
66 enum {
73 };
74
76 enum {
79 };
80
82 enum {
85 };
86
88 enum {
94 };
95
97 enum {
99 };
100
101 public:
102
103 // ----------------------------------------------------------------------
104 // Component initialization
105 // ----------------------------------------------------------------------
106
108 void init(
109 NATIVE_INT_TYPE queueDepth,
110 NATIVE_INT_TYPE instance = 0
111 );
112
113 public:
114
115 // ----------------------------------------------------------------------
116 // Getters for special input ports
117 // ----------------------------------------------------------------------
118
123 NATIVE_INT_TYPE portNum
124 );
125
126 public:
127
128 // ----------------------------------------------------------------------
129 // Getters for typed input ports
130 // ----------------------------------------------------------------------
131
136 NATIVE_INT_TYPE portNum
137 );
138
143 NATIVE_INT_TYPE portNum
144 );
145
150 NATIVE_INT_TYPE portNum
151 );
152
153 public:
154
155 // ----------------------------------------------------------------------
156 // Connect special input ports to special output ports
157 // ----------------------------------------------------------------------
158
161 NATIVE_INT_TYPE portNum,
163 );
164
167 NATIVE_INT_TYPE portNum,
169 );
170
173 NATIVE_INT_TYPE portNum,
174 Fw::InputLogPort* port
175 );
176
177#if FW_ENABLE_TEXT_LOGGING == 1
178
180 void set_textEventOut_OutputPort(
181 NATIVE_INT_TYPE portNum,
183 );
184
185#endif
186
189 NATIVE_INT_TYPE portNum,
190 Fw::InputTimePort* port
191 );
192
195 NATIVE_INT_TYPE portNum,
196 Fw::InputTlmPort* port
197 );
198
199 public:
200
201 // ----------------------------------------------------------------------
202 // Connect typed input ports to typed output ports
203 // ----------------------------------------------------------------------
204
207 NATIVE_INT_TYPE portNum,
208 Fw::InputComPort* port
209 );
210
213 NATIVE_INT_TYPE portNum,
214 Svc::InputPingPort* port
215 );
216
217#if FW_PORT_SERIALIZATION
218
219 public:
220
221 // ----------------------------------------------------------------------
222 // Connect serial input ports to special output ports
223 // ----------------------------------------------------------------------
224
227 NATIVE_INT_TYPE portNum,
228 Fw::InputSerializePort* port
229 );
230
233 NATIVE_INT_TYPE portNum,
234 Fw::InputSerializePort* port
235 );
236
239 NATIVE_INT_TYPE portNum,
240 Fw::InputSerializePort* port
241 );
242
243#if FW_ENABLE_TEXT_LOGGING == 1
244
246 void set_textEventOut_OutputPort(
247 NATIVE_INT_TYPE portNum,
248 Fw::InputSerializePort* port
249 );
250
251#endif
252
255 NATIVE_INT_TYPE portNum,
256 Fw::InputSerializePort* port
257 );
258
261 NATIVE_INT_TYPE portNum,
262 Fw::InputSerializePort* port
263 );
264
265#endif
266
267#if FW_PORT_SERIALIZATION
268
269 public:
270
271 // ----------------------------------------------------------------------
272 // Connect serial input ports to typed output ports
273 // ----------------------------------------------------------------------
274
277 NATIVE_INT_TYPE portNum,
278 Fw::InputSerializePort* port
279 );
280
283 NATIVE_INT_TYPE portNum,
284 Fw::InputSerializePort* port
285 );
286
287#endif
288
289 public:
290
291 // ----------------------------------------------------------------------
292 // Command registration
293 // ----------------------------------------------------------------------
294
298 void regCommands();
299
300 PROTECTED:
301
302 // ----------------------------------------------------------------------
303 // Component construction and destruction
304 // ----------------------------------------------------------------------
305
308 const char* compName = ""
309 );
310
313
314 PROTECTED:
315
316 // ----------------------------------------------------------------------
317 // Getters for numbers of special input ports
318 // ----------------------------------------------------------------------
319
324
325 PROTECTED:
326
327 // ----------------------------------------------------------------------
328 // Getters for numbers of typed input ports
329 // ----------------------------------------------------------------------
330
335
340
345
346 PROTECTED:
347
348 // ----------------------------------------------------------------------
349 // Getters for numbers of special output ports
350 // ----------------------------------------------------------------------
351
356
361
366
367#if FW_ENABLE_TEXT_LOGGING == 1
368
372 NATIVE_INT_TYPE getNum_textEventOut_OutputPorts();
373
374#endif
375
380
385
386 PROTECTED:
387
388 // ----------------------------------------------------------------------
389 // Getters for numbers of typed output ports
390 // ----------------------------------------------------------------------
391
396
401
402 PROTECTED:
403
404 // ----------------------------------------------------------------------
405 // Connection status queries for special output ports
406 // ----------------------------------------------------------------------
407
412 NATIVE_INT_TYPE portNum
413 );
414
419 NATIVE_INT_TYPE portNum
420 );
421
426 NATIVE_INT_TYPE portNum
427 );
428
429#if FW_ENABLE_TEXT_LOGGING == 1
430
434 bool isConnected_textEventOut_OutputPort(
435 NATIVE_INT_TYPE portNum
436 );
437
438#endif
439
444 NATIVE_INT_TYPE portNum
445 );
446
451 NATIVE_INT_TYPE portNum
452 );
453
454 PROTECTED:
455
456 // ----------------------------------------------------------------------
457 // Connection status queries for typed output ports
458 // ----------------------------------------------------------------------
459
464 NATIVE_INT_TYPE portNum
465 );
466
471 NATIVE_INT_TYPE portNum
472 );
473
474 PROTECTED:
475
476 // ----------------------------------------------------------------------
477 // Handlers to implement for typed input ports
478 // ----------------------------------------------------------------------
479
481 virtual void Run_handler(
482 NATIVE_INT_TYPE portNum,
483 NATIVE_UINT_TYPE context
484 ) = 0;
485
487 virtual void TlmRecv_handler(
488 NATIVE_INT_TYPE portNum,
489 FwChanIdType id,
490 Fw::Time& timeTag,
491 Fw::TlmBuffer& val
492 ) = 0;
493
495 virtual void pingIn_handler(
496 NATIVE_INT_TYPE portNum,
497 U32 key
498 ) = 0;
499
500 PROTECTED:
501
502 // ----------------------------------------------------------------------
503 // Port handler base-class functions for typed input ports
504 //
505 // Call these functions directly to bypass the corresponding ports
506 // ----------------------------------------------------------------------
507
509 void Run_handlerBase(
510 NATIVE_INT_TYPE portNum,
511 NATIVE_UINT_TYPE context
512 );
513
516 NATIVE_INT_TYPE portNum,
517 FwChanIdType id,
518 Fw::Time& timeTag,
519 Fw::TlmBuffer& val
520 );
521
524 NATIVE_INT_TYPE portNum,
525 U32 key
526 );
527
528 PROTECTED:
529
530 // ----------------------------------------------------------------------
531 // Pre-message hooks for typed async input ports
532 //
533 // Each of these functions is invoked just before processing a message
534 // on the corresponding port. By default, they do nothing. You can
535 // override them to provide specific pre-message behavior.
536 // ----------------------------------------------------------------------
537
539 virtual void Run_preMsgHook(
540 NATIVE_INT_TYPE portNum,
541 NATIVE_UINT_TYPE context
542 );
543
545 virtual void pingIn_preMsgHook(
546 NATIVE_INT_TYPE portNum,
547 U32 key
548 );
549
550 PROTECTED:
551
552 // ----------------------------------------------------------------------
553 // Invocation functions for typed output ports
554 // ----------------------------------------------------------------------
555
557 void PktSend_out(
558 NATIVE_INT_TYPE portNum,
559 Fw::ComBuffer& data,
560 U32 context
561 );
562
564 void pingOut_out(
565 NATIVE_INT_TYPE portNum,
566 U32 key
567 );
568
569 PROTECTED:
570
571 // ----------------------------------------------------------------------
572 // Command response
573 // ----------------------------------------------------------------------
574
576 void cmdResponse_out(
577 FwOpcodeType opCode,
578 U32 cmdSeq,
579 Fw::CmdResponse response
580 );
581
582 PROTECTED:
583
584 // ----------------------------------------------------------------------
585 // Command handlers to implement
586 // ----------------------------------------------------------------------
587
592 FwOpcodeType opCode,
593 U32 cmdSeq,
594 U32 level
595 ) = 0;
596
601 FwOpcodeType opCode,
602 U32 cmdSeq,
603 U32 id
604 ) = 0;
605
606 PROTECTED:
607
608 // ----------------------------------------------------------------------
609 // Command handler base-class functions
610 //
611 // Call these functions directly to bypass the command input port
612 // ----------------------------------------------------------------------
613
618 FwOpcodeType opCode,
619 U32 cmdSeq,
620 Fw::CmdArgBuffer& args
621 );
622
627 FwOpcodeType opCode,
628 U32 cmdSeq,
629 Fw::CmdArgBuffer& args
630 );
631
632 PROTECTED:
633
634 // ----------------------------------------------------------------------
635 // Pre-message hooks for async commands
636 //
637 // Each of these functions is invoked just before processing the
638 // corresponding command. By default they do nothing. You can
639 // override them to provide specific pre-command behavior.
640 // ----------------------------------------------------------------------
641
643 virtual void SET_LEVEL_preMsgHook(
644 FwOpcodeType opCode,
645 U32 cmdSeq
646 );
647
649 virtual void SEND_PKT_preMsgHook(
650 FwOpcodeType opCode,
651 U32 cmdSeq
652 );
653
654 PROTECTED:
655
656 // ----------------------------------------------------------------------
657 // Event logging functions
658 // ----------------------------------------------------------------------
659
664 U32 Id
665 );
666
671 U32 id
672 );
673
678 U32 level,
679 U32 max
680 );
681
686 U32 id
687 );
688
693 U32 id
694 );
695
696 PROTECTED:
697
698 // ----------------------------------------------------------------------
699 // Telemetry write functions
700 // ----------------------------------------------------------------------
701
706 U32 arg,
707 Fw::Time _tlmTime = Fw::Time()
708 );
709
710 PROTECTED:
711
712 // ----------------------------------------------------------------------
713 // Time
714 // ----------------------------------------------------------------------
715
720
721 PRIVATE:
722
723 // ----------------------------------------------------------------------
724 // Message dispatch functions
725 // ----------------------------------------------------------------------
726
728 virtual MsgDispatchStatus doDispatch();
729
730 PRIVATE:
731
732 // ----------------------------------------------------------------------
733 // Calls for messages received on special input ports
734 // ----------------------------------------------------------------------
735
737 static void m_p_cmdIn_in(
738 Fw::PassiveComponentBase* callComp,
739 NATIVE_INT_TYPE portNum,
740 FwOpcodeType opCode,
741 U32 cmdSeq,
742 Fw::CmdArgBuffer& args
743 );
744
745 PRIVATE:
746
747 // ----------------------------------------------------------------------
748 // Calls for messages received on typed input ports
749 // ----------------------------------------------------------------------
750
752 static void m_p_Run_in(
753 Fw::PassiveComponentBase* callComp,
754 NATIVE_INT_TYPE portNum,
755 NATIVE_UINT_TYPE context
756 );
757
759 static void m_p_TlmRecv_in(
760 Fw::PassiveComponentBase* callComp,
761 NATIVE_INT_TYPE portNum,
762 FwChanIdType id,
763 Fw::Time& timeTag,
764 Fw::TlmBuffer& val
765 );
766
768 static void m_p_pingIn_in(
769 Fw::PassiveComponentBase* callComp,
770 NATIVE_INT_TYPE portNum,
771 U32 key
772 );
773
774 PRIVATE:
775
776 // ----------------------------------------------------------------------
777 // Special input ports
778 // ----------------------------------------------------------------------
779
781 Fw::InputCmdPort m_cmdIn_InputPort[NUM_CMDIN_INPUT_PORTS];
782
783 PRIVATE:
784
785 // ----------------------------------------------------------------------
786 // Typed input ports
787 // ----------------------------------------------------------------------
788
791
793 Fw::InputTlmPort m_TlmRecv_InputPort[NUM_TLMRECV_INPUT_PORTS];
794
796 Svc::InputPingPort m_pingIn_InputPort[NUM_PINGIN_INPUT_PORTS];
797
798 PRIVATE:
799
800 // ----------------------------------------------------------------------
801 // Special output ports
802 // ----------------------------------------------------------------------
803
805 Fw::OutputCmdRegPort m_cmdRegOut_OutputPort[NUM_CMDREGOUT_OUTPUT_PORTS];
806
809
811 Fw::OutputLogPort m_eventOut_OutputPort[NUM_EVENTOUT_OUTPUT_PORTS];
812
813#if FW_ENABLE_TEXT_LOGGING == 1
814
816 Fw::OutputLogTextPort m_textEventOut_OutputPort[NUM_TEXTEVENTOUT_OUTPUT_PORTS];
817
818#endif
819
821 Fw::OutputTimePort m_timeGetOut_OutputPort[NUM_TIMEGETOUT_OUTPUT_PORTS];
822
824 Fw::OutputTlmPort m_tlmOut_OutputPort[NUM_TLMOUT_OUTPUT_PORTS];
825
826 PRIVATE:
827
828 // ----------------------------------------------------------------------
829 // Typed output ports
830 // ----------------------------------------------------------------------
831
833 Fw::OutputComPort m_PktSend_OutputPort[NUM_PKTSEND_OUTPUT_PORTS];
834
836 Svc::OutputPingPort m_pingOut_OutputPort[NUM_PINGOUT_OUTPUT_PORTS];
837
838 };
839
840}
841
842#endif
PlatformIntType NATIVE_INT_TYPE
Definition BasicTypes.h:51
PlatformUIntType NATIVE_UINT_TYPE
Definition BasicTypes.h:52
U32 FwChanIdType
Definition FpConfig.h:59
U32 FwOpcodeType
Definition FpConfig.h:56
C++-compatible configuration header for fprime configuration.
Enum representing a command response.
void init()
Object initializer.
Definition ObjBase.cpp:27
Auto-generated base for TlmPacketizer component.
virtual void pingIn_preMsgHook(NATIVE_INT_TYPE portNum, U32 key)
Pre-message hook for async input port pingIn.
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
virtual void TlmRecv_handler(NATIVE_INT_TYPE portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)=0
Handler for input port TlmRecv.
void set_eventOut_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputLogPort *port)
Connect port to eventOut[portNum].
void pingOut_out(NATIVE_INT_TYPE portNum, U32 key)
Invoke output port pingOut.
void pingIn_handlerBase(NATIVE_INT_TYPE portNum, U32 key)
Handler base-class function for input port pingIn.
@ EVENTID_NOCHAN
Telemetry channel is not part of a telemetry packet.
@ EVENTID_LEVELSET
Telemetry send level set.
@ EVENTID_PACKETNOTFOUND
Couldn't find the packet to send.
@ EVENTID_MAXLEVELEXCEED
Telemetry send level set.
Fw::InputTlmPort * get_TlmRecv_InputPort(NATIVE_INT_TYPE portNum)
void set_timeGetOut_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputTimePort *port)
Connect port to timeGetOut[portNum].
void regCommands()
Register commands with the Command Dispatcher.
void set_PktSend_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputComPort *port)
Connect port to PktSend[portNum].
virtual void SET_LEVEL_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command SET_LEVEL.
void set_cmdRegOut_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputCmdRegPort *port)
Connect port to cmdRegOut[portNum].
void set_tlmOut_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
Svc::InputSchedPort * get_Run_InputPort(NATIVE_INT_TYPE portNum)
void set_pingOut_OutputPort(NATIVE_INT_TYPE portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
void tlmWrite_SendLevel(U32 arg, Fw::Time _tlmTime=Fw::Time())
void PktSend_out(NATIVE_INT_TYPE portNum, Fw::ComBuffer &data, U32 context)
Invoke output port PktSend.
virtual void Run_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context)=0
Handler for input port Run.
bool isConnected_cmdRegOut_OutputPort(NATIVE_INT_TYPE portNum)
virtual void pingIn_handler(NATIVE_INT_TYPE portNum, U32 key)=0
Handler for input port pingIn.
virtual void SEND_PKT_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, U32 id)=0
Svc::InputPingPort * get_pingIn_InputPort(NATIVE_INT_TYPE portNum)
bool isConnected_tlmOut_OutputPort(NATIVE_INT_TYPE portNum)
void SET_LEVEL_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
virtual ~TlmPacketizerComponentBase()
Destroy TlmPacketizerComponentBase object.
bool isConnected_pingOut_OutputPort(NATIVE_INT_TYPE portNum)
friend class TlmPacketizerComponentBaseFriend
Friend class for white-box testing.
bool isConnected_timeGetOut_OutputPort(NATIVE_INT_TYPE portNum)
bool isConnected_PktSend_OutputPort(NATIVE_INT_TYPE portNum)
bool isConnected_cmdResponseOut_OutputPort(NATIVE_INT_TYPE portNum)
void log_WARNING_LO_MaxLevelExceed(U32 level, U32 max)
TlmPacketizerComponentBase(const char *compName="")
Construct TlmPacketizerComponentBase object.
virtual void SEND_PKT_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command SEND_PKT.
@ OPCODE_SEND_PKT
Force a packet to be sent.
@ OPCODE_SET_LEVEL
Set telemetry send level.
void Run_handlerBase(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context)
Handler base-class function for input port Run.
void set_cmdResponseOut_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
bool isConnected_eventOut_OutputPort(NATIVE_INT_TYPE portNum)
void TlmRecv_handlerBase(NATIVE_INT_TYPE portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Handler base-class function for input port TlmRecv.
void SEND_PKT_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Fw::InputCmdPort * get_cmdIn_InputPort(NATIVE_INT_TYPE portNum)
virtual void Run_preMsgHook(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context)
Pre-message hook for async input port Run.
virtual void SET_LEVEL_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, U32 level)=0
@ CHANNELID_SENDLEVEL
Channel ID for SendLevel.