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
TlmChanComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title TlmChanComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for TlmChan component base class
5 // ======================================================================
6 
8 #include "Fw/Types/Assert.hpp"
10 #if FW_ENABLE_TEXT_LOGGING
11 #include "Fw/Types/String.hpp"
12 #endif
13 
14 namespace Svc {
15 
16  namespace {
17  enum MsgTypeEnum {
18  TLMCHAN_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT,
19  RUN_SCHED,
20  PINGIN_PING,
21  };
22 
23  // Get the max size by constructing a union of the async input, command, and
24  // internal port serialization sizes
25  union BuffUnion {
28  };
29 
30  // Define a message buffer class large enough to handle all the
31  // asynchronous inputs to the component
32  class ComponentIpcSerializableBuffer :
34  {
35 
36  public:
37 
38  enum {
39  // Max. message size = size of data + message id + port
40  SERIALIZATION_SIZE =
41  sizeof(BuffUnion) +
42  sizeof(FwEnumStoreType) +
43  sizeof(FwIndexType)
44  };
45 
46  Fw::Serializable::SizeType getBuffCapacity() const {
47  return sizeof(m_buff);
48  }
49 
50  U8* getBuffAddr() {
51  return m_buff;
52  }
53 
54  const U8* getBuffAddr() const {
55  return m_buff;
56  }
57 
58  private:
59  // Should be the max of all the input ports serialized sizes...
60  U8 m_buff[SERIALIZATION_SIZE];
61 
62  };
63  }
64 
65  // ----------------------------------------------------------------------
66  // Component initialization
67  // ----------------------------------------------------------------------
68 
70  init(
71  FwSizeType queueDepth,
72  FwEnumStoreType instance
73  )
74  {
75  // Initialize base class
77 
78  // Connect input port Run
79  for (
80  FwIndexType port = 0;
81  port < static_cast<FwIndexType>(this->getNum_Run_InputPorts());
82  port++
83  ) {
84  this->m_Run_InputPort[port].init();
85  this->m_Run_InputPort[port].addCallComp(
86  this,
87  m_p_Run_in
88  );
89  this->m_Run_InputPort[port].setPortNum(port);
90 
91 #if FW_OBJECT_NAMES == 1
92  Fw::ObjectName portName;
93  portName.format(
94  "%s_Run_InputPort[%" PRI_PlatformIntType "]",
95  this->m_objName.toChar(),
96  port
97  );
98  this->m_Run_InputPort[port].setObjName(portName.toChar());
99 #endif
100  }
101 
102  // Connect input port TlmGet
103  for (
104  FwIndexType port = 0;
105  port < static_cast<FwIndexType>(this->getNum_TlmGet_InputPorts());
106  port++
107  ) {
108  this->m_TlmGet_InputPort[port].init();
109  this->m_TlmGet_InputPort[port].addCallComp(
110  this,
111  m_p_TlmGet_in
112  );
113  this->m_TlmGet_InputPort[port].setPortNum(port);
114 
115 #if FW_OBJECT_NAMES == 1
116  Fw::ObjectName portName;
117  portName.format(
118  "%s_TlmGet_InputPort[%" PRI_PlatformIntType "]",
119  this->m_objName.toChar(),
120  port
121  );
122  this->m_TlmGet_InputPort[port].setObjName(portName.toChar());
123 #endif
124  }
125 
126  // Connect input port TlmRecv
127  for (
128  FwIndexType port = 0;
129  port < static_cast<FwIndexType>(this->getNum_TlmRecv_InputPorts());
130  port++
131  ) {
132  this->m_TlmRecv_InputPort[port].init();
133  this->m_TlmRecv_InputPort[port].addCallComp(
134  this,
135  m_p_TlmRecv_in
136  );
137  this->m_TlmRecv_InputPort[port].setPortNum(port);
138 
139 #if FW_OBJECT_NAMES == 1
140  Fw::ObjectName portName;
141  portName.format(
142  "%s_TlmRecv_InputPort[%" PRI_PlatformIntType "]",
143  this->m_objName.toChar(),
144  port
145  );
146  this->m_TlmRecv_InputPort[port].setObjName(portName.toChar());
147 #endif
148  }
149 
150  // Connect input port pingIn
151  for (
152  FwIndexType port = 0;
153  port < static_cast<FwIndexType>(this->getNum_pingIn_InputPorts());
154  port++
155  ) {
156  this->m_pingIn_InputPort[port].init();
157  this->m_pingIn_InputPort[port].addCallComp(
158  this,
159  m_p_pingIn_in
160  );
161  this->m_pingIn_InputPort[port].setPortNum(port);
162 
163 #if FW_OBJECT_NAMES == 1
164  Fw::ObjectName portName;
165  portName.format(
166  "%s_pingIn_InputPort[%" PRI_PlatformIntType "]",
167  this->m_objName.toChar(),
168  port
169  );
170  this->m_pingIn_InputPort[port].setObjName(portName.toChar());
171 #endif
172  }
173 
174  // Connect output port PktSend
175  for (
176  FwIndexType port = 0;
177  port < static_cast<FwIndexType>(this->getNum_PktSend_OutputPorts());
178  port++
179  ) {
180  this->m_PktSend_OutputPort[port].init();
181 
182 #if FW_OBJECT_NAMES == 1
183  Fw::ObjectName portName;
184  portName.format(
185  "%s_PktSend_OutputPort[%" PRI_PlatformIntType "]",
186  this->m_objName.toChar(),
187  port
188  );
189  this->m_PktSend_OutputPort[port].setObjName(portName.toChar());
190 #endif
191  }
192 
193  // Connect output port pingOut
194  for (
195  FwIndexType port = 0;
196  port < static_cast<FwIndexType>(this->getNum_pingOut_OutputPorts());
197  port++
198  ) {
199  this->m_pingOut_OutputPort[port].init();
200 
201 #if FW_OBJECT_NAMES == 1
202  Fw::ObjectName portName;
203  portName.format(
204  "%s_pingOut_OutputPort[%" PRI_PlatformIntType "]",
205  this->m_objName.toChar(),
206  port
207  );
208  this->m_pingOut_OutputPort[port].setObjName(portName.toChar());
209 #endif
210  }
211 
212  Os::Queue::Status qStat = this->createQueue(
213  queueDepth,
214  static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
215  );
216  FW_ASSERT(
217  Os::Queue::Status::OP_OK == qStat,
218  static_cast<FwAssertArgType>(qStat)
219  );
220  }
221 
222  // ----------------------------------------------------------------------
223  // Getters for typed input ports
224  // ----------------------------------------------------------------------
225 
228  {
229  FW_ASSERT(
230  portNum < this->getNum_Run_InputPorts(),
231  static_cast<FwAssertArgType>(portNum)
232  );
233 
234  return &this->m_Run_InputPort[portNum];
235  }
236 
239  {
240  FW_ASSERT(
241  portNum < this->getNum_TlmGet_InputPorts(),
242  static_cast<FwAssertArgType>(portNum)
243  );
244 
245  return &this->m_TlmGet_InputPort[portNum];
246  }
247 
250  {
251  FW_ASSERT(
252  portNum < this->getNum_TlmRecv_InputPorts(),
253  static_cast<FwAssertArgType>(portNum)
254  );
255 
256  return &this->m_TlmRecv_InputPort[portNum];
257  }
258 
261  {
262  FW_ASSERT(
263  portNum < this->getNum_pingIn_InputPorts(),
264  static_cast<FwAssertArgType>(portNum)
265  );
266 
267  return &this->m_pingIn_InputPort[portNum];
268  }
269 
270  // ----------------------------------------------------------------------
271  // Connect typed input ports to typed output ports
272  // ----------------------------------------------------------------------
273 
276  FwIndexType portNum,
277  Fw::InputComPort* port
278  )
279  {
280  FW_ASSERT(
281  portNum < this->getNum_PktSend_OutputPorts(),
282  static_cast<FwAssertArgType>(portNum)
283  );
284 
285  this->m_PktSend_OutputPort[portNum].addCallPort(port);
286  }
287 
290  FwIndexType portNum,
291  Svc::InputPingPort* port
292  )
293  {
294  FW_ASSERT(
295  portNum < this->getNum_pingOut_OutputPorts(),
296  static_cast<FwAssertArgType>(portNum)
297  );
298 
299  this->m_pingOut_OutputPort[portNum].addCallPort(port);
300  }
301 
302 #if FW_PORT_SERIALIZATION
303 
304  // ----------------------------------------------------------------------
305  // Connect serial input ports to typed output ports
306  // ----------------------------------------------------------------------
307 
310  FwIndexType portNum,
311  Fw::InputSerializePort* port
312  )
313  {
314  FW_ASSERT(
315  portNum < this->getNum_PktSend_OutputPorts(),
316  static_cast<FwAssertArgType>(portNum)
317  );
318 
319  this->m_PktSend_OutputPort[portNum].registerSerialPort(port);
320  }
321 
324  FwIndexType portNum,
325  Fw::InputSerializePort* port
326  )
327  {
328  FW_ASSERT(
329  portNum < this->getNum_pingOut_OutputPorts(),
330  static_cast<FwAssertArgType>(portNum)
331  );
332 
333  this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
334  }
335 
336 #endif
337 
338  // ----------------------------------------------------------------------
339  // Component construction and destruction
340  // ----------------------------------------------------------------------
341 
343  TlmChanComponentBase(const char* compName) :
344  Fw::ActiveComponentBase(compName)
345  {
346 
347  }
348 
351  {
352 
353  }
354 
355  // ----------------------------------------------------------------------
356  // Getters for numbers of typed input ports
357  // ----------------------------------------------------------------------
358 
361  {
362  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_Run_InputPort));
363  }
364 
367  {
368  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_TlmGet_InputPort));
369  }
370 
373  {
374  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_TlmRecv_InputPort));
375  }
376 
379  {
380  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_pingIn_InputPort));
381  }
382 
383  // ----------------------------------------------------------------------
384  // Getters for numbers of typed output ports
385  // ----------------------------------------------------------------------
386 
389  {
390  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_PktSend_OutputPort));
391  }
392 
395  {
396  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_pingOut_OutputPort));
397  }
398 
399  // ----------------------------------------------------------------------
400  // Connection status queries for typed output ports
401  // ----------------------------------------------------------------------
402 
405  {
406  FW_ASSERT(
407  portNum < this->getNum_PktSend_OutputPorts(),
408  static_cast<FwAssertArgType>(portNum)
409  );
410 
411  return this->m_PktSend_OutputPort[portNum].isConnected();
412  }
413 
416  {
417  FW_ASSERT(
418  portNum < this->getNum_pingOut_OutputPorts(),
419  static_cast<FwAssertArgType>(portNum)
420  );
421 
422  return this->m_pingOut_OutputPort[portNum].isConnected();
423  }
424 
425  // ----------------------------------------------------------------------
426  // Port handler base-class functions for typed input ports
427  //
428  // Call these functions directly to bypass the corresponding ports
429  // ----------------------------------------------------------------------
430 
433  FwIndexType portNum,
434  U32 context
435  )
436  {
437  // Make sure port number is valid
438  FW_ASSERT(
439  portNum < this->getNum_Run_InputPorts(),
440  static_cast<FwAssertArgType>(portNum)
441  );
442 
443  // Call pre-message hook
445  portNum,
446  context
447  );
448  ComponentIpcSerializableBuffer msg;
450 
451  // Serialize message ID
452  _status = msg.serialize(
453  static_cast<FwEnumStoreType>(RUN_SCHED)
454  );
455  FW_ASSERT(
456  _status == Fw::FW_SERIALIZE_OK,
457  static_cast<FwAssertArgType>(_status)
458  );
459 
460  // Serialize port number
461  _status = msg.serialize(portNum);
462  FW_ASSERT(
463  _status == Fw::FW_SERIALIZE_OK,
464  static_cast<FwAssertArgType>(_status)
465  );
466 
467  // Serialize argument context
468  _status = msg.serialize(context);
469  FW_ASSERT(
470  _status == Fw::FW_SERIALIZE_OK,
471  static_cast<FwAssertArgType>(_status)
472  );
473 
474  // Send message
476  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
477 
478  FW_ASSERT(
479  qStatus == Os::Queue::OP_OK,
480  static_cast<FwAssertArgType>(qStatus)
481  );
482  }
483 
486  FwIndexType portNum,
487  FwChanIdType id,
488  Fw::Time& timeTag,
489  Fw::TlmBuffer& val
490  )
491  {
492  // Make sure port number is valid
493  FW_ASSERT(
494  portNum < this->getNum_TlmGet_InputPorts(),
495  static_cast<FwAssertArgType>(portNum)
496  );
497 
498  // Lock guard mutex before calling
499  this->lock();
500 
501  // Call handler function
502  this->TlmGet_handler(
503  portNum,
504  id,
505  timeTag,
506  val
507  );
508 
509  // Unlock guard mutex
510  this->unLock();
511  }
512 
515  FwIndexType portNum,
516  FwChanIdType id,
517  Fw::Time& timeTag,
518  Fw::TlmBuffer& val
519  )
520  {
521  // Make sure port number is valid
522  FW_ASSERT(
523  portNum < this->getNum_TlmRecv_InputPorts(),
524  static_cast<FwAssertArgType>(portNum)
525  );
526 
527  // Lock guard mutex before calling
528  this->lock();
529 
530  // Call handler function
531  this->TlmRecv_handler(
532  portNum,
533  id,
534  timeTag,
535  val
536  );
537 
538  // Unlock guard mutex
539  this->unLock();
540  }
541 
544  FwIndexType portNum,
545  U32 key
546  )
547  {
548  // Make sure port number is valid
549  FW_ASSERT(
550  portNum < this->getNum_pingIn_InputPorts(),
551  static_cast<FwAssertArgType>(portNum)
552  );
553 
554  // Call pre-message hook
556  portNum,
557  key
558  );
559  ComponentIpcSerializableBuffer msg;
561 
562  // Serialize message ID
563  _status = msg.serialize(
564  static_cast<FwEnumStoreType>(PINGIN_PING)
565  );
566  FW_ASSERT(
567  _status == Fw::FW_SERIALIZE_OK,
568  static_cast<FwAssertArgType>(_status)
569  );
570 
571  // Serialize port number
572  _status = msg.serialize(portNum);
573  FW_ASSERT(
574  _status == Fw::FW_SERIALIZE_OK,
575  static_cast<FwAssertArgType>(_status)
576  );
577 
578  // Serialize argument key
579  _status = msg.serialize(key);
580  FW_ASSERT(
581  _status == Fw::FW_SERIALIZE_OK,
582  static_cast<FwAssertArgType>(_status)
583  );
584 
585  // Send message
587  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
588 
589  FW_ASSERT(
590  qStatus == Os::Queue::OP_OK,
591  static_cast<FwAssertArgType>(qStatus)
592  );
593  }
594 
595  // ----------------------------------------------------------------------
596  // Pre-message hooks for typed async input ports
597  //
598  // Each of these functions is invoked just before processing a message
599  // on the corresponding port. By default, they do nothing. You can
600  // override them to provide specific pre-message behavior.
601  // ----------------------------------------------------------------------
602 
605  FwIndexType portNum,
606  U32 context
607  )
608  {
609  // Default: no-op
610  }
611 
614  FwIndexType portNum,
615  U32 key
616  )
617  {
618  // Default: no-op
619  }
620 
621  // ----------------------------------------------------------------------
622  // Invocation functions for typed output ports
623  // ----------------------------------------------------------------------
624 
627  FwIndexType portNum,
628  Fw::ComBuffer& data,
629  U32 context
630  )
631  {
632  FW_ASSERT(
633  portNum < this->getNum_PktSend_OutputPorts(),
634  static_cast<FwAssertArgType>(portNum)
635  );
636  this->m_PktSend_OutputPort[portNum].invoke(
637  data,
638  context
639  );
640  }
641 
644  FwIndexType portNum,
645  U32 key
646  )
647  {
648  FW_ASSERT(
649  portNum < this->getNum_pingOut_OutputPorts(),
650  static_cast<FwAssertArgType>(portNum)
651  );
652  this->m_pingOut_OutputPort[portNum].invoke(
653  key
654  );
655  }
656 
657  // ----------------------------------------------------------------------
658  // Mutex operations for guarded ports
659  //
660  // You can override these operations to provide more sophisticated
661  // synchronization
662  // ----------------------------------------------------------------------
663 
665  lock()
666  {
667  this->m_guardedPortMutex.lock();
668  }
669 
671  unLock()
672  {
673  this->m_guardedPortMutex.unLock();
674  }
675 
676  // ----------------------------------------------------------------------
677  // Message dispatch functions
678  // ----------------------------------------------------------------------
679 
680  Fw::QueuedComponentBase::MsgDispatchStatus TlmChanComponentBase ::
681  doDispatch()
682  {
683  ComponentIpcSerializableBuffer msg;
684  FwQueuePriorityType priority = 0;
685 
686  Os::Queue::Status msgStatus = this->m_queue.receive(
687  msg,
689  priority
690  );
691  FW_ASSERT(
692  msgStatus == Os::Queue::OP_OK,
693  static_cast<FwAssertArgType>(msgStatus)
694  );
695 
696  // Reset to beginning of buffer
697  msg.resetDeser();
698 
699  FwEnumStoreType desMsg = 0;
700  Fw::SerializeStatus deserStatus = msg.deserialize(desMsg);
701  FW_ASSERT(
702  deserStatus == Fw::FW_SERIALIZE_OK,
703  static_cast<FwAssertArgType>(deserStatus)
704  );
705 
706  MsgTypeEnum msgType = static_cast<MsgTypeEnum>(desMsg);
707 
708  if (msgType == TLMCHAN_COMPONENT_EXIT) {
709  return MSG_DISPATCH_EXIT;
710  }
711 
712  FwIndexType portNum = 0;
713  deserStatus = msg.deserialize(portNum);
714  FW_ASSERT(
715  deserStatus == Fw::FW_SERIALIZE_OK,
716  static_cast<FwAssertArgType>(deserStatus)
717  );
718 
719  switch (msgType) {
720  // Handle async input port Run
721  case RUN_SCHED: {
722  // Deserialize argument context
723  U32 context;
724  deserStatus = msg.deserialize(context);
725  FW_ASSERT(
726  deserStatus == Fw::FW_SERIALIZE_OK,
727  static_cast<FwAssertArgType>(deserStatus)
728  );
729  // Call handler function
730  this->Run_handler(
731  portNum,
732  context
733  );
734 
735  break;
736  }
737 
738  // Handle async input port pingIn
739  case PINGIN_PING: {
740  // Deserialize argument key
741  U32 key;
742  deserStatus = msg.deserialize(key);
743  FW_ASSERT(
744  deserStatus == Fw::FW_SERIALIZE_OK,
745  static_cast<FwAssertArgType>(deserStatus)
746  );
747  // Call handler function
748  this->pingIn_handler(
749  portNum,
750  key
751  );
752 
753  break;
754  }
755 
756  default:
757  return MSG_DISPATCH_ERROR;
758  }
759 
760  return MSG_DISPATCH_OK;
761  }
762 
763  // ----------------------------------------------------------------------
764  // Calls for messages received on typed input ports
765  // ----------------------------------------------------------------------
766 
767  void TlmChanComponentBase ::
768  m_p_Run_in(
769  Fw::PassiveComponentBase* callComp,
770  FwIndexType portNum,
771  U32 context
772  )
773  {
774  FW_ASSERT(callComp);
775  TlmChanComponentBase* compPtr = static_cast<TlmChanComponentBase*>(callComp);
776  compPtr->Run_handlerBase(
777  portNum,
778  context
779  );
780  }
781 
782  void TlmChanComponentBase ::
783  m_p_TlmGet_in(
784  Fw::PassiveComponentBase* callComp,
785  FwIndexType portNum,
786  FwChanIdType id,
787  Fw::Time& timeTag,
788  Fw::TlmBuffer& val
789  )
790  {
791  FW_ASSERT(callComp);
792  TlmChanComponentBase* compPtr = static_cast<TlmChanComponentBase*>(callComp);
793  compPtr->TlmGet_handlerBase(
794  portNum,
795  id,
796  timeTag,
797  val
798  );
799  }
800 
801  void TlmChanComponentBase ::
802  m_p_TlmRecv_in(
803  Fw::PassiveComponentBase* callComp,
804  FwIndexType portNum,
805  FwChanIdType id,
806  Fw::Time& timeTag,
807  Fw::TlmBuffer& val
808  )
809  {
810  FW_ASSERT(callComp);
811  TlmChanComponentBase* compPtr = static_cast<TlmChanComponentBase*>(callComp);
812  compPtr->TlmRecv_handlerBase(
813  portNum,
814  id,
815  timeTag,
816  val
817  );
818  }
819 
820  void TlmChanComponentBase ::
821  m_p_pingIn_in(
822  Fw::PassiveComponentBase* callComp,
823  FwIndexType portNum,
824  U32 key
825  )
826  {
827  FW_ASSERT(callComp);
828  TlmChanComponentBase* compPtr = static_cast<TlmChanComponentBase*>(callComp);
829  compPtr->pingIn_handlerBase(
830  portNum,
831  key
832  );
833  }
834 
835 }
#define FW_ASSERT(...)
Definition: Assert.hpp:14
U8 BYTE
byte type
Definition: BasicTypes.h:31
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:30
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition: BasicTypes.h:70
#define PRI_PlatformIntType
I32 FwEnumStoreType
Definition: FpConfig.h:64
PlatformAssertArgType FwAssertArgType
Definition: FpConfig.h:39
U32 FwChanIdType
Definition: FpConfig.h:95
PlatformSizeType FwSizeType
Definition: FpConfig.h:35
PlatformQueuePriorityType FwQueuePriorityType
Definition: FpConfig.h:55
PlatformIndexType FwIndexType
Definition: FpConfig.h:25
@ ACTIVE_COMPONENT_EXIT
message to exit active component task
void setPortNum(NATIVE_INT_TYPE portNum)
void init()
Initialization function.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void init()
Initialization function.
Definition: TlmPortAc.cpp:56
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: TlmPortAc.cpp:62
void init()
Object initializer.
Definition: ObjBase.cpp:27
const char * toChar() const
Definition: ObjectName.hpp:50
void addCallPort(InputComPort *callPort)
Register an input port.
Definition: ComPortAc.cpp:143
void init()
Initialization function.
Definition: ComPortAc.cpp:137
void invoke(Fw::ComBuffer &data, U32 context)
Invoke a port interface.
Definition: ComPortAc.cpp:156
bool isConnected()
Definition: PortBase.cpp:41
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
Os::Queue m_queue
queue object for active component
@ MSG_DISPATCH_OK
Dispatch was normal.
@ MSG_DISPATCH_EXIT
A message was sent requesting an exit of the loop.
@ MSG_DISPATCH_ERROR
Errors dispatching messages.
NATIVE_UINT_TYPE SizeType
void format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:56
Definition: Time.hpp:9
void unLock()
unlock the mutex and assert success
Definition: Mutex.cpp:40
void lock()
lock the mutex and assert success
Definition: Mutex.cpp:34
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
BlockingType
message type
Definition: Queue.hpp:44
@ BLOCKING
Message will block until space is available.
Definition: Queue.hpp:45
@ NONBLOCKING
Message will return with status when space is unavailable.
Definition: Queue.hpp:46
Status
status returned from the queue send function
Definition: Queue.hpp:30
@ OP_OK
message sent/received okay
Definition: Queue.hpp:31
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: PingPortAc.cpp:62
void init()
Initialization function.
Definition: PingPortAc.cpp:56
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
Definition: PingPortAc.hpp:36
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
Definition: SchedPortAc.hpp:36
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: SchedPortAc.cpp:62
void init()
Initialization function.
Definition: SchedPortAc.cpp:56
void invoke(U32 key)
Invoke a port interface.
Definition: PingPortAc.cpp:147
void init()
Initialization function.
Definition: PingPortAc.cpp:128
void addCallPort(InputPingPort *callPort)
Register an input port.
Definition: PingPortAc.cpp:134
FwIndexType getNum_PktSend_OutputPorts() const
virtual void Run_preMsgHook(FwIndexType portNum, U32 context)
Pre-message hook for async input port Run.
FwIndexType getNum_TlmGet_InputPorts() const
void set_pingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
virtual void unLock()
Unlock the guarded mutex.
virtual void Run_handler(FwIndexType portNum, U32 context)=0
Handler for input port Run.
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
virtual ~TlmChanComponentBase()
Destroy TlmChanComponentBase object.
virtual void TlmRecv_handler(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)=0
Handler for input port TlmRecv.
void TlmRecv_handlerBase(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Handler base-class function for input port TlmRecv.
void PktSend_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Invoke output port PktSend.
bool isConnected_PktSend_OutputPort(FwIndexType portNum)
FwIndexType getNum_pingIn_InputPorts() const
virtual void pingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port pingIn.
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
void Run_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port Run.
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
FwIndexType getNum_TlmRecv_InputPorts() const
TlmChanComponentBase(const char *compName="")
Construct TlmChanComponentBase object.
Fw::InputTlmGetPort * get_TlmGet_InputPort(FwIndexType portNum)
virtual void TlmGet_handler(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)=0
Handler for input port TlmGet.
void pingOut_out(FwIndexType portNum, U32 key)
Invoke output port pingOut.
bool isConnected_pingOut_OutputPort(FwIndexType portNum)
Svc::InputSchedPort * get_Run_InputPort(FwIndexType portNum)
FwIndexType getNum_Run_InputPorts() const
Fw::InputTlmPort * get_TlmRecv_InputPort(FwIndexType portNum)
FwIndexType getNum_pingOut_OutputPorts() const
virtual void lock()
Lock the guarded mutex.
void TlmGet_handlerBase(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Handler base-class function for input port TlmGet.
void set_PktSend_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to PktSend[portNum].
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.
@ OP_OK
Operation succeeded.
Definition: Os.hpp:26