F´ Flight Software - C/C++ Documentation  NASA-v1.5.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
FileUplinkComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FileUplinkComponentAc.hpp
3 // \author Auto-generated
4 // \brief hpp file for FileUplink component base class
5 //
6 // \copyright
7 // Copyright 2009-2015, by the California Institute of Technology.
8 // ALL RIGHTS RESERVED. United States Government Sponsorship
9 // acknowledged.
10 //
11 // ======================================================================
12 
13 #ifndef FILEUPLINK_COMP_HPP_
14 #define FILEUPLINK_COMP_HPP_
15 
16 #include <FpConfig.hpp>
20 #include <Fw/Tlm/TlmString.hpp>
21 #include <Fw/Time/TimePortAc.hpp>
22 #include <Fw/Log/LogString.hpp>
23 #include <Fw/Time/Time.hpp>
24 #include <Fw/Tlm/TlmBuffer.hpp>
25 #include <Fw/Log/LogBuffer.hpp>
26 #include <Fw/Log/TextLogString.hpp>
28 #include <Fw/Time/TimePortAc.hpp>
29 #include <Fw/Tlm/TlmPortAc.hpp>
30 #include <Fw/Log/LogPortAc.hpp>
31 #include <Svc/Ping/PingPortAc.hpp>
32 #if FW_ENABLE_TEXT_LOGGING == 1
33 #include <Fw/Log/LogTextPortAc.hpp>
34 #endif
35 
36 namespace Svc {
37 
43  {
44 
45  // ----------------------------------------------------------------------
46  // Friend classes
47  // ----------------------------------------------------------------------
48 
52 
53  public:
54 
55  // ----------------------------------------------------------------------
56  // Getters for typed input ports
57  // ----------------------------------------------------------------------
58 
65  );
66 
73  );
74 
75  public:
76 
77  // ----------------------------------------------------------------------
78  // Connect typed input ports to typed output ports
79  // ----------------------------------------------------------------------
80 
85  Fw::InputTimePort *port
86  );
87 
93  );
94 
99  Fw::InputTlmPort *port
100  );
101 
106  Fw::InputLogPort *port
107  );
108 
113  Svc::InputPingPort *port
114  );
115 
116 #if FW_ENABLE_TEXT_LOGGING == 1
117  void set_LogText_OutputPort(
121  Fw::InputLogTextPort *port
122  );
123 #endif
124 
125 #if FW_PORT_SERIALIZATION
126 
127  public:
128 
129  // ----------------------------------------------------------------------
130  // Connect serialization input ports to typed output ports
131  // ----------------------------------------------------------------------
132 
137  Fw::InputSerializePort *port
138  );
139 
144  Fw::InputSerializePort *port
145  );
146 
151  Fw::InputSerializePort *port
152  );
153 
158  Fw::InputSerializePort *port
159  );
160 
165  Fw::InputSerializePort *port
166  );
167 
168 #if FW_ENABLE_TEXT_LOGGING == 1
169  void set_LogText_OutputPort(
173  Fw::InputSerializePort *port
174  );
175 #endif
176 
177 #endif
178 
180 
181  // ----------------------------------------------------------------------
182  // Component construction, initialization, and destruction
183  // ----------------------------------------------------------------------
184 
185 #if FW_OBJECT_NAMES == 1
189  const char* compName
190  );
191 #else
195 #endif
196 
199  void init(
200  NATIVE_INT_TYPE queueDepth,
201  NATIVE_INT_TYPE instance = 0
202  );
203 
206  virtual ~FileUplinkComponentBase(void);
207 
209 
210  // ----------------------------------------------------------------------
211  // Handlers to implement for typed input ports
212  // ----------------------------------------------------------------------
213 
215  //
216  virtual void bufferSendIn_handler(
219  ) = 0;
220 
222  //
223  virtual void pingIn_handler(
225  U32 key
226  ) = 0;
227 
229 
230  // ----------------------------------------------------------------------
231  // Port handler base-class functions for typed input ports.
232  // ----------------------------------------------------------------------
233  // Call these functions directly to bypass the corresponding ports.
234  // ----------------------------------------------------------------------
235 
238  void bufferSendIn_handlerBase(
241  );
242 
245  void pingIn_handlerBase(
247  U32 key
248  );
249 
251 
252  // ----------------------------------------------------------------------
253  // Pre-message hooks for typed async input ports.
254  // ----------------------------------------------------------------------
255  // Each of these functions is invoked just before processing a message
256  // on the corresponding port. By default they do nothing. You can
257  // override them to provide specific pre-message behavior.
258  // ----------------------------------------------------------------------
259 
262  virtual void bufferSendIn_preMsgHook(
265  );
266 
269  virtual void pingIn_preMsgHook(
271  U32 key
272  );
273 
275 
276  // ----------------------------------------------------------------------
277  // Invocation functions for typed output ports
278  // ----------------------------------------------------------------------
279 
282  void bufferSendOut_out(
285  );
286 
289  void pingOut_out(
291  U32 key
292  );
293 
295 
296  // ----------------------------------------------------------------------
297  // Getters for numbers of input ports
298  // ----------------------------------------------------------------------
299 
304  NATIVE_INT_TYPE getNum_bufferSendIn_InputPorts(void);
305 
311 
312 
313  // ----------------------------------------------------------------------
314  // Enumerations for number of ports
315  // ----------------------------------------------------------------------
316 
317  enum {
320  };
321 
323 
324  // ----------------------------------------------------------------------
325  // Getters for numbers of output ports
326  // ----------------------------------------------------------------------
327 
332  NATIVE_INT_TYPE getNum_timeCaller_OutputPorts(void);
333 
339 
345 
351 
357 
358 #if FW_ENABLE_TEXT_LOGGING == 1
359  NATIVE_INT_TYPE getNum_LogText_OutputPorts(void);
364 #endif
365 
366 
367  enum {
374  };
375 
377 
378  // ----------------------------------------------------------------------
379  // Connection status queries for output ports
380  // ----------------------------------------------------------------------
381 
386  bool isConnected_timeCaller_OutputPort(
388  );
389 
396  );
397 
404  );
405 
412  );
413 
420  );
421 
422 #if FW_ENABLE_TEXT_LOGGING == 1
423  bool isConnected_LogText_OutputPort(
429  );
430 #endif
431 
433 
434  // ----------------------------------------------------------------------
435  // Event IDs
436  // ----------------------------------------------------------------------
437 
438  enum {
439  EVENTID_FILEUPLINK_BADCHECKSUM = 0, /* During receipt of a file, the computed checksum value did not match the stored value */
440  EVENTID_FILEUPLINK_FILEOPENERROR = 1, /* An error occurred opening a file */
441  EVENTID_FILEUPLINK_FILERECEIVED = 2, /* The File Uplink component successfully received a file */
442  EVENTID_FILEUPLINK_FILEWRITEERROR = 3, /* An error occurred writing to a file */
443  EVENTID_FILEUPLINK_INVALIDRECEIVEMODE = 4, /* The File Uplink component received a packet with a type that was invalid for the current receive mode */
444  EVENTID_FILEUPLINK_PACKETOUTOFBOUNDS = 5, /* During receipt of a file, the File Uplink component encountered a packet with offset and size out of bounds for the current file */
445  EVENTID_FILEUPLINK_PACKETOUTOFORDER = 6, /* The File Uplink component encountered an out-of-order packet during file receipt */
446  EVENTID_FILEUPLINK_UPLINKCANCELED = 7, /* The File Uplink component received a CANCEL packet */
447  };
448 
449  // ----------------------------------------------------------------------
450  // Event Throttle values - sets initial value of countdown variable
451  // ----------------------------------------------------------------------
452 
453  enum {
458  };
459 
461 
462  // ----------------------------------------------------------------------
463  // Event logging functions
464  // ----------------------------------------------------------------------
465 
468  /* During receipt of a file, the computed checksum value did not match the stored value */
469  void log_WARNING_HI_FileUplink_BadChecksum(
470  Fw::LogStringArg& fileName,
471  U32 computed,
472  U32 read
473  );
474 
475 
478  /* An error occurred opening a file */
480  Fw::LogStringArg& fileName
481  );
482 
483 
486  /* The File Uplink component successfully received a file */
488  Fw::LogStringArg& fileName
489  );
490 
491 
494  /* An error occurred writing to a file */
496  Fw::LogStringArg& fileName
497  );
498 
499  // reset throttle value for FileUplink_FileWriteError
501 
504  /* The File Uplink component received a packet with a type that was invalid for the current receive mode */
506  U32 packetType,
507  U32 mode
508  );
509 
510  // reset throttle value for FileUplink_InvalidReceiveMode
512 
515  /* During receipt of a file, the File Uplink component encountered a packet with offset and size out of bounds for the current file */
517  U32 packetIndex,
518  Fw::LogStringArg& fileName
519  );
520 
521  // reset throttle value for FileUplink_PacketOutOfBounds
523 
526  /* The File Uplink component encountered an out-of-order packet during file receipt */
528  U32 packetIndex,
529  U32 lastPacketIndex
530  );
531 
532  // reset throttle value for FileUplink_PacketOutOfOrder
534 
537  /* The File Uplink component received a CANCEL packet */
539  void
540  );
541 
542 
544 
545  // ----------------------------------------------------------------------
546  // Channel IDs
547  // ----------------------------------------------------------------------
548 
549  enum {
550  CHANNELID_FILEUPLINK_FILESRECEIVED = 0,
553  };
554 
556 
557  // ----------------------------------------------------------------------
558  // Telemetry write functions
559  // ----------------------------------------------------------------------
560 
563  /* The total number of complete files received */
564  void tlmWrite_FileUplink_FilesReceived(
565  U32 arg
566  );
567 
570  /* The total number of packets received */
572  U32 arg
573  );
574 
577  /* The total number of warnings issued */
579  U32 arg
580  );
581 
583 
584  // ----------------------------------------------------------------------
585  // Time
586  // ----------------------------------------------------------------------
587 
592  Fw::Time getTime(void);
593 
594 
596 
597  // ----------------------------------------------------------------------
598  // Typed input ports
599  // ----------------------------------------------------------------------
600 
603  Fw::InputBufferSendPort m_bufferSendIn_InputPort[NUM_BUFFERSENDIN_INPUT_PORTS];
604 
608 
610 
611  // ----------------------------------------------------------------------
612  // Typed output ports
613  // ----------------------------------------------------------------------
614 
617  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
618 
622 
626 
630 
634 
635 #if FW_ENABLE_TEXT_LOGGING == 1
636  Fw::OutputLogTextPort m_LogText_OutputPort[NUM_LOGTEXT_OUTPUT_PORTS];
639 #endif
640 
642 
643  // ----------------------------------------------------------------------
644  // Calls for messages received on typed input ports
645  // ----------------------------------------------------------------------
646 
649  static void m_p_bufferSendIn_in(
650  Fw::PassiveComponentBase* callComp,
653  );
654 
657  static void m_p_pingIn_in(
658  Fw::PassiveComponentBase* callComp,
660  U32 key
661  );
662 
664 
665  // ----------------------------------------------------------------------
666  // Message dispatch functions
667  // ----------------------------------------------------------------------
668 
671  virtual MsgDispatchStatus doDispatch(void);
672 
673 
675  // ----------------------------------------------------------------------
676  // Counter values for event throttling
677  // ----------------------------------------------------------------------
678  NATIVE_UINT_TYPE m_FileUplink_FileWriteErrorThrottle;
682 
683  };
684 
685 } // end namespace Svc
686 #endif
Fw::InputTimePort
Definition: TimePortAc.hpp:28
Fw::InputTlmPort
Definition: TlmPortAc.hpp:29
LogBuffer.hpp
PRIVATE
#define PRIVATE
overridable private for unit testing
Definition: BasicTypes.hpp:118
Fw::Time
Definition: Time.hpp:10
TlmPortAc.hpp
Fw::QueuedComponentBase::doDispatch
virtual MsgDispatchStatus doDispatch(void)=0
method to dispatch a single message in the queue.
Fw::OutputTlmPort
Definition: TlmPortAc.hpp:50
Fw::LogStringArg
Definition: LogString.hpp:11
Fw::OutputBufferSendPort
Definition: BufferSendPortAc.hpp:49
TextLogString.hpp
Fw::Buffer
Definition: BufferSerializableAc.hpp:24
InputSerializePort.hpp
Fw::PassiveComponentBase
Definition: PassiveComponentBase.hpp:10
LogString.hpp
Fw::ObjBase::init
void init(void)
Object initializer.
Definition: ObjBase.cpp:26
Fw::OutputLogPort
Definition: LogPortAc.hpp:61
Svc::InputPingPort
Definition: PingPortAc.hpp:27
ActiveComponentBase.hpp
Svc::OutputPingPort
Definition: PingPortAc.hpp:48
TlmString.hpp
TlmBuffer.hpp
Fw::QueuedComponentBase::MsgDispatchStatus
MsgDispatchStatus
Definition: QueuedComponentBase.hpp:25
NATIVE_UINT_TYPE
unsigned int NATIVE_UINT_TYPE
native unsigned integer type declaration
Definition: BasicTypes.hpp:30
PingPortAc.hpp
Fw::InputBufferSendPort
Definition: BufferSendPortAc.hpp:28
Fw::ActiveComponentBase
Definition: ActiveComponentBase.hpp:20
LogTextPortAc.hpp
FpConfig.hpp
ISF configuration file.
Svc
Definition: ActiveLoggerComponentAc.cpp:22
Fw::InputLogPort
Definition: LogPortAc.hpp:40
Fw::OutputTimePort
Definition: TimePortAc.hpp:49
Time.hpp
NATIVE_INT_TYPE
int NATIVE_INT_TYPE
native integer type declaration
Definition: BasicTypes.hpp:29
OutputSerializePort.hpp
BufferSendPortAc.hpp
TimePortAc.hpp
LogPortAc.hpp
Fw::OutputLogTextPort
Definition: LogTextPortAc.hpp:61
Fw::InputLogTextPort
Definition: LogTextPortAc.hpp:40