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