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 
7 #include "Fw/Types/Assert.hpp"
9 #if FW_ENABLE_TEXT_LOGGING
10 #include "Fw/Types/String.hpp"
11 #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 {
27  BYTE pingInPortSize[Svc::PingPortBuffer::CAPACITY];
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 getCapacity() 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 #if !FW_DIRECT_PORT_CALLS
80  // Connect input port Run
81  for (
82  FwIndexType port = 0;
83  port < static_cast<FwIndexType>(this->getNum_Run_InputPorts());
84  port++
85  ) {
86  this->m_Run_InputPort[port].init();
87  this->m_Run_InputPort[port].addCallComp(
88  this,
89  m_p_Run_in
90  );
91  this->m_Run_InputPort[port].setPortNum(port);
92 
93 #if FW_OBJECT_NAMES == 1
94  Fw::ObjectName portName;
95  portName.format(
96  "%s_Run_InputPort[%" PRI_FwIndexType "]",
97  this->m_objName.toChar(),
98  port
99  );
100  this->m_Run_InputPort[port].setObjName(portName.toChar());
101 #endif
102  }
103 #endif
104 
105 #if !FW_DIRECT_PORT_CALLS
106  // Connect input port TlmGet
107  for (
108  FwIndexType port = 0;
109  port < static_cast<FwIndexType>(this->getNum_TlmGet_InputPorts());
110  port++
111  ) {
112  this->m_TlmGet_InputPort[port].init();
113  this->m_TlmGet_InputPort[port].addCallComp(
114  this,
115  m_p_TlmGet_in
116  );
117  this->m_TlmGet_InputPort[port].setPortNum(port);
118 
119 #if FW_OBJECT_NAMES == 1
120  Fw::ObjectName portName;
121  portName.format(
122  "%s_TlmGet_InputPort[%" PRI_FwIndexType "]",
123  this->m_objName.toChar(),
124  port
125  );
126  this->m_TlmGet_InputPort[port].setObjName(portName.toChar());
127 #endif
128  }
129 #endif
130 
131 #if !FW_DIRECT_PORT_CALLS
132  // Connect input port TlmRecv
133  for (
134  FwIndexType port = 0;
135  port < static_cast<FwIndexType>(this->getNum_TlmRecv_InputPorts());
136  port++
137  ) {
138  this->m_TlmRecv_InputPort[port].init();
139  this->m_TlmRecv_InputPort[port].addCallComp(
140  this,
141  m_p_TlmRecv_in
142  );
143  this->m_TlmRecv_InputPort[port].setPortNum(port);
144 
145 #if FW_OBJECT_NAMES == 1
146  Fw::ObjectName portName;
147  portName.format(
148  "%s_TlmRecv_InputPort[%" PRI_FwIndexType "]",
149  this->m_objName.toChar(),
150  port
151  );
152  this->m_TlmRecv_InputPort[port].setObjName(portName.toChar());
153 #endif
154  }
155 #endif
156 
157 #if !FW_DIRECT_PORT_CALLS
158  // Connect input port pingIn
159  for (
160  FwIndexType port = 0;
161  port < static_cast<FwIndexType>(this->getNum_pingIn_InputPorts());
162  port++
163  ) {
164  this->m_pingIn_InputPort[port].init();
165  this->m_pingIn_InputPort[port].addCallComp(
166  this,
167  m_p_pingIn_in
168  );
169  this->m_pingIn_InputPort[port].setPortNum(port);
170 
171 #if FW_OBJECT_NAMES == 1
172  Fw::ObjectName portName;
173  portName.format(
174  "%s_pingIn_InputPort[%" PRI_FwIndexType "]",
175  this->m_objName.toChar(),
176  port
177  );
178  this->m_pingIn_InputPort[port].setObjName(portName.toChar());
179 #endif
180  }
181 #endif
182 
183 #if !FW_DIRECT_PORT_CALLS
184  // Connect output port PktSend
185  for (
186  FwIndexType port = 0;
187  port < static_cast<FwIndexType>(this->getNum_PktSend_OutputPorts());
188  port++
189  ) {
190  this->m_PktSend_OutputPort[port].init();
191 
192 #if FW_OBJECT_NAMES == 1
193  Fw::ObjectName portName;
194  portName.format(
195  "%s_PktSend_OutputPort[%" PRI_FwIndexType "]",
196  this->m_objName.toChar(),
197  port
198  );
199  this->m_PktSend_OutputPort[port].setObjName(portName.toChar());
200 #endif
201  }
202 #endif
203 
204 #if !FW_DIRECT_PORT_CALLS
205  // Connect output port pingOut
206  for (
207  FwIndexType port = 0;
208  port < static_cast<FwIndexType>(this->getNum_pingOut_OutputPorts());
209  port++
210  ) {
211  this->m_pingOut_OutputPort[port].init();
212 
213 #if FW_OBJECT_NAMES == 1
214  Fw::ObjectName portName;
215  portName.format(
216  "%s_pingOut_OutputPort[%" PRI_FwIndexType "]",
217  this->m_objName.toChar(),
218  port
219  );
220  this->m_pingOut_OutputPort[port].setObjName(portName.toChar());
221 #endif
222  }
223 #endif
224 
225  // Create the queue
226  Os::Queue::Status qStat = this->createQueue(
227  queueDepth,
228  static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
229  );
230  FW_ASSERT(
231  Os::Queue::Status::OP_OK == qStat,
232  static_cast<FwAssertArgType>(qStat)
233  );
234  }
235 
236 #if !FW_DIRECT_PORT_CALLS
237 
238  // ----------------------------------------------------------------------
239  // Getters for typed input ports
240  // ----------------------------------------------------------------------
241 
244  {
245  FW_ASSERT(
246  (0 <= portNum) && (portNum < this->getNum_Run_InputPorts()),
247  static_cast<FwAssertArgType>(portNum)
248  );
249 
250  return &this->m_Run_InputPort[portNum];
251  }
252 
255  {
256  FW_ASSERT(
257  (0 <= portNum) && (portNum < this->getNum_TlmGet_InputPorts()),
258  static_cast<FwAssertArgType>(portNum)
259  );
260 
261  return &this->m_TlmGet_InputPort[portNum];
262  }
263 
266  {
267  FW_ASSERT(
268  (0 <= portNum) && (portNum < this->getNum_TlmRecv_InputPorts()),
269  static_cast<FwAssertArgType>(portNum)
270  );
271 
272  return &this->m_TlmRecv_InputPort[portNum];
273  }
274 
277  {
278  FW_ASSERT(
279  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
280  static_cast<FwAssertArgType>(portNum)
281  );
282 
283  return &this->m_pingIn_InputPort[portNum];
284  }
285 
286 #endif
287 
288 #if !FW_DIRECT_PORT_CALLS
289 
290  // ----------------------------------------------------------------------
291  // Connect typed input ports to typed output ports
292  // ----------------------------------------------------------------------
293 
296  FwIndexType portNum,
297  Fw::InputComPort* port
298  )
299  {
300  FW_ASSERT(
301  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
302  static_cast<FwAssertArgType>(portNum)
303  );
304 
305  this->m_PktSend_OutputPort[portNum].addCallPort(port);
306  }
307 
310  FwIndexType portNum,
311  Svc::InputPingPort* port
312  )
313  {
314  FW_ASSERT(
315  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
316  static_cast<FwAssertArgType>(portNum)
317  );
318 
319  this->m_pingOut_OutputPort[portNum].addCallPort(port);
320  }
321 
322 #endif
323 
324 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
325 
326  // ----------------------------------------------------------------------
327  // Connect serial input ports to typed output ports
328  // ----------------------------------------------------------------------
329 
332  FwIndexType portNum,
333  Fw::InputSerializePort* port
334  )
335  {
336  FW_ASSERT(
337  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
338  static_cast<FwAssertArgType>(portNum)
339  );
340 
341  this->m_PktSend_OutputPort[portNum].registerSerialPort(port);
342  }
343 
346  FwIndexType portNum,
347  Fw::InputSerializePort* port
348  )
349  {
350  FW_ASSERT(
351  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
352  static_cast<FwAssertArgType>(portNum)
353  );
354 
355  this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
356  }
357 
358 #endif
359 
360  // ----------------------------------------------------------------------
361  // Component construction and destruction
362  // ----------------------------------------------------------------------
363 
365  TlmChanComponentBase(const char* compName) :
366  Fw::ActiveComponentBase(compName)
367  {
368 
369  }
370 
373  {
374 
375  }
376 
377 #if !FW_DIRECT_PORT_CALLS
378 
379  // ----------------------------------------------------------------------
380  // Connection status queries for typed output ports
381  // ----------------------------------------------------------------------
382 
385  {
386  FW_ASSERT(
387  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
388  static_cast<FwAssertArgType>(portNum)
389  );
390 
391  return this->m_PktSend_OutputPort[portNum].isConnected();
392  }
393 
396  {
397  FW_ASSERT(
398  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
399  static_cast<FwAssertArgType>(portNum)
400  );
401 
402  return this->m_pingOut_OutputPort[portNum].isConnected();
403  }
404 
405 #endif
406 
407  // ----------------------------------------------------------------------
408  // Port handler base-class functions for typed input ports
409  //
410  // Call these functions directly to bypass the corresponding ports
411  // ----------------------------------------------------------------------
412 
415  FwIndexType portNum,
416  U32 context
417  )
418  {
419  // Make sure port number is valid
420  FW_ASSERT(
421  (0 <= portNum) && (portNum < this->getNum_Run_InputPorts()),
422  static_cast<FwAssertArgType>(portNum)
423  );
424 
425  // Call pre-message hook
427  portNum,
428  context
429  );
430  ComponentIpcSerializableBuffer msg;
432 
433  // Serialize message ID
434  _status = msg.serializeFrom(
435  static_cast<FwEnumStoreType>(RUN_SCHED)
436  );
437  FW_ASSERT(
438  _status == Fw::FW_SERIALIZE_OK,
439  static_cast<FwAssertArgType>(_status)
440  );
441 
442  // Serialize port number
443  _status = msg.serializeFrom(portNum);
444  FW_ASSERT(
445  _status == Fw::FW_SERIALIZE_OK,
446  static_cast<FwAssertArgType>(_status)
447  );
448 
449  // Serialize argument context
450  _status = msg.serializeFrom(context);
451  FW_ASSERT(
452  _status == Fw::FW_SERIALIZE_OK,
453  static_cast<FwAssertArgType>(_status)
454  );
455 
456  // Send message
458  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
459 
460  FW_ASSERT(
461  qStatus == Os::Queue::OP_OK,
462  static_cast<FwAssertArgType>(qStatus)
463  );
464  }
465 
468  FwIndexType portNum,
469  FwChanIdType id,
470  Fw::Time& timeTag,
471  Fw::TlmBuffer& val
472  )
473  {
474  // Make sure port number is valid
475  FW_ASSERT(
476  (0 <= portNum) && (portNum < this->getNum_TlmGet_InputPorts()),
477  static_cast<FwAssertArgType>(portNum)
478  );
479 
480  Fw::TlmValid retVal;
481 
482  // Lock guard mutex before calling
483  this->lock();
484 
485  // Call handler function
486  retVal = this->TlmGet_handler(
487  portNum,
488  id,
489  timeTag,
490  val
491  );
492 
493  // Unlock guard mutex
494  this->unLock();
495 
496  return retVal;
497  }
498 
501  FwIndexType portNum,
502  FwChanIdType id,
503  Fw::Time& timeTag,
504  Fw::TlmBuffer& val
505  )
506  {
507  // Make sure port number is valid
508  FW_ASSERT(
509  (0 <= portNum) && (portNum < this->getNum_TlmRecv_InputPorts()),
510  static_cast<FwAssertArgType>(portNum)
511  );
512 
513  // Lock guard mutex before calling
514  this->lock();
515 
516  // Call handler function
517  this->TlmRecv_handler(
518  portNum,
519  id,
520  timeTag,
521  val
522  );
523 
524  // Unlock guard mutex
525  this->unLock();
526  }
527 
530  FwIndexType portNum,
531  U32 key
532  )
533  {
534  // Make sure port number is valid
535  FW_ASSERT(
536  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
537  static_cast<FwAssertArgType>(portNum)
538  );
539 
540  // Call pre-message hook
542  portNum,
543  key
544  );
545  ComponentIpcSerializableBuffer msg;
547 
548  // Serialize message ID
549  _status = msg.serializeFrom(
550  static_cast<FwEnumStoreType>(PINGIN_PING)
551  );
552  FW_ASSERT(
553  _status == Fw::FW_SERIALIZE_OK,
554  static_cast<FwAssertArgType>(_status)
555  );
556 
557  // Serialize port number
558  _status = msg.serializeFrom(portNum);
559  FW_ASSERT(
560  _status == Fw::FW_SERIALIZE_OK,
561  static_cast<FwAssertArgType>(_status)
562  );
563 
564  // Serialize argument key
565  _status = msg.serializeFrom(key);
566  FW_ASSERT(
567  _status == Fw::FW_SERIALIZE_OK,
568  static_cast<FwAssertArgType>(_status)
569  );
570 
571  // Send message
573  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
574 
575  FW_ASSERT(
576  qStatus == Os::Queue::OP_OK,
577  static_cast<FwAssertArgType>(qStatus)
578  );
579  }
580 
581  // ----------------------------------------------------------------------
582  // Pre-message hooks for typed async input ports
583  //
584  // Each of these functions is invoked just before processing a message
585  // on the corresponding port. By default, they do nothing. You can
586  // override them to provide specific pre-message behavior.
587  // ----------------------------------------------------------------------
588 
591  FwIndexType portNum,
592  U32 context
593  )
594  {
595  // Default: no-op
596  }
597 
600  FwIndexType portNum,
601  U32 key
602  )
603  {
604  // Default: no-op
605  }
606 
607 #if !FW_DIRECT_PORT_CALLS
608 
609  // ----------------------------------------------------------------------
610  // Invocation functions for typed output ports
611  // ----------------------------------------------------------------------
612 
615  FwIndexType portNum,
616  Fw::ComBuffer& data,
617  U32 context
618  ) const
619  {
620  FW_ASSERT(
621  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
622  static_cast<FwAssertArgType>(portNum)
623  );
624 
625  FW_ASSERT(
626  this->m_PktSend_OutputPort[portNum].isConnected(),
627  static_cast<FwAssertArgType>(portNum)
628  );
629  this->m_PktSend_OutputPort[portNum].invoke(
630  data,
631  context
632  );
633  }
634 
637  FwIndexType portNum,
638  U32 key
639  ) const
640  {
641  FW_ASSERT(
642  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
643  static_cast<FwAssertArgType>(portNum)
644  );
645 
646  FW_ASSERT(
647  this->m_pingOut_OutputPort[portNum].isConnected(),
648  static_cast<FwAssertArgType>(portNum)
649  );
650  this->m_pingOut_OutputPort[portNum].invoke(
651  key
652  );
653  }
654 
655 #endif
656 
657  // ----------------------------------------------------------------------
658  // Mutex operations for guarded ports
659  //
660  // You can override these operations to provide more sophisticated
661  // synchronization
662  // ----------------------------------------------------------------------
663 
666  {
667  this->m_guardedPortMutex.lock();
668  }
669 
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.deserializeTo(_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.deserializeTo(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.deserializeTo(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.deserializeTo(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  Fw::TlmValid 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  return 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 }
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 connection.
Definition: ComPortAc.cpp:181
void init()
Initialization function.
Definition: ComPortAc.cpp:162
Operation succeeded.
Definition: Os.hpp:26
virtual Fw::TlmValid TlmGet_handler(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)=0
Handler for input port TlmGet.
PlatformSizeType FwSizeType
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
Fw::InputTlmPort * get_TlmRecv_InputPort(FwIndexType portNum)
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
Definition: Queue.cpp:71
I32 FwEnumStoreType
void init()
Initialization function.
Status
status returned from the queue send function
Definition: Queue.hpp:30
Fw::TlmValid TlmGet_handlerBase(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Handler base-class function for input port TlmGet.
void init()
Initialization function.
Definition: SchedPortAc.cpp:73
bool isConnected_pingOut_OutputPort(FwIndexType portNum) const
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: TlmPortAc.cpp:95
void unLock()
unlock the mutex and assert success
Definition: Mutex.cpp:41
bool isConnected_PktSend_OutputPort(FwIndexType portNum) const
void invoke(U32 key) const
Invoke a port connection.
Definition: PingPortAc.cpp:170
virtual ~TlmChanComponentBase()
Destroy TlmChanComponentBase object.
void init()
Initialization function.
Definition: TlmPortAc.cpp:89
static constexpr FwIndexType getNum_Run_InputPorts()
Os::Queue m_queue
queue object for active component
void init()
Object initializer.
Definition: ObjBase.cpp:24
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:47
void PktSend_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context) const
Invoke output port PktSend.
static constexpr FwSizeType CAPACITY
Definition: PingPortAc.hpp:34
virtual void lock()
Lock the guarded mutex.
Svc::InputSchedPort * get_Run_InputPort(FwIndexType portNum)
void pingOut_out(FwIndexType portNum, U32 key) const
Invoke output port pingOut.
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
void init()
Initialization function.
Definition: PingPortAc.cpp:151
static constexpr FwIndexType getNum_pingIn_InputPorts()
const char * toChar() const
Convert to a C-style char*.
Definition: ObjectName.hpp:50
FwIdType FwChanIdType
The type of a telemetry channel identifier.
FwSizeType SizeType
void addCallPort(InputPingPort *callPort)
Register an input port.
Definition: PingPortAc.cpp:157
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
Definition: Queue.cpp:54
static constexpr FwIndexType getNum_TlmRecv_InputPorts()
bool isConnected() const
Definition: PortBase.cpp:38
void set_PktSend_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to PktSend[portNum].
#define PRI_FwIndexType
static constexpr FwIndexType getNum_PktSend_OutputPorts()
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:39
void setPortNum(FwIndexType portNum)
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:53
BlockingType
message type
Definition: Queue.hpp:46
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.
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: SchedPortAc.cpp:79
static constexpr FwIndexType getNum_pingOut_OutputPorts()
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
A message was sent requesting an exit of the loop.
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.
PlatformIndexType FwIndexType
virtual void unLock()
Unlock the guarded mutex.
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:73
RateGroupDivider component implementation.
message sent/received okay
Definition: Queue.hpp:31
U8 BYTE
byte type
Definition: BasicTypes.h:56
Fw::InputTlmGetPort * get_TlmGet_InputPort(FwIndexType portNum)
void addCallPort(InputComPort *callPort)
Register an input port.
Definition: ComPortAc.cpp:168
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: PingPortAc.cpp:79
static constexpr FwIndexType getNum_TlmGet_InputPorts()
Message will return with status when space is unavailable.
Definition: Queue.hpp:48
Implementation of malloc based allocator.
TlmChanComponentBase(const char *compName="")
Construct TlmChanComponentBase object.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
static constexpr FwSizeType CAPACITY
Definition: SchedPortAc.hpp:34
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
message to exit active component task