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 {
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  // 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_FwIndexType "]",
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_FwIndexType "]",
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_FwIndexType "]",
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_FwIndexType "]",
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_FwIndexType "]",
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_FwIndexType "]",
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  (0 <= portNum) && (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  (0 <= portNum) && (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  (0 <= portNum) && (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  (0 <= portNum) && (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  (0 <= portNum) && (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  (0 <= portNum) && (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  (0 <= portNum) && (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  (0 <= portNum) && (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  // Connection status queries for typed output ports
359  // ----------------------------------------------------------------------
360 
363  {
364  FW_ASSERT(
365  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
366  static_cast<FwAssertArgType>(portNum)
367  );
368 
369  return this->m_PktSend_OutputPort[portNum].isConnected();
370  }
371 
374  {
375  FW_ASSERT(
376  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
377  static_cast<FwAssertArgType>(portNum)
378  );
379 
380  return this->m_pingOut_OutputPort[portNum].isConnected();
381  }
382 
383  // ----------------------------------------------------------------------
384  // Port handler base-class functions for typed input ports
385  //
386  // Call these functions directly to bypass the corresponding ports
387  // ----------------------------------------------------------------------
388 
391  FwIndexType portNum,
392  U32 context
393  )
394  {
395  // Make sure port number is valid
396  FW_ASSERT(
397  (0 <= portNum) && (portNum < this->getNum_Run_InputPorts()),
398  static_cast<FwAssertArgType>(portNum)
399  );
400 
401  // Call pre-message hook
403  portNum,
404  context
405  );
406  ComponentIpcSerializableBuffer msg;
408 
409  // Serialize message ID
410  _status = msg.serializeFrom(
411  static_cast<FwEnumStoreType>(RUN_SCHED)
412  );
413  FW_ASSERT(
414  _status == Fw::FW_SERIALIZE_OK,
415  static_cast<FwAssertArgType>(_status)
416  );
417 
418  // Serialize port number
419  _status = msg.serializeFrom(portNum);
420  FW_ASSERT(
421  _status == Fw::FW_SERIALIZE_OK,
422  static_cast<FwAssertArgType>(_status)
423  );
424 
425  // Serialize argument context
426  _status = msg.serializeFrom(context);
427  FW_ASSERT(
428  _status == Fw::FW_SERIALIZE_OK,
429  static_cast<FwAssertArgType>(_status)
430  );
431 
432  // Send message
434  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
435 
436  FW_ASSERT(
437  qStatus == Os::Queue::OP_OK,
438  static_cast<FwAssertArgType>(qStatus)
439  );
440  }
441 
444  FwIndexType portNum,
445  FwChanIdType id,
446  Fw::Time& timeTag,
447  Fw::TlmBuffer& val
448  )
449  {
450  // Make sure port number is valid
451  FW_ASSERT(
452  (0 <= portNum) && (portNum < this->getNum_TlmGet_InputPorts()),
453  static_cast<FwAssertArgType>(portNum)
454  );
455 
456  Fw::TlmValid retVal;
457 
458  // Lock guard mutex before calling
459  this->lock();
460 
461  // Call handler function
462  retVal = this->TlmGet_handler(
463  portNum,
464  id,
465  timeTag,
466  val
467  );
468 
469  // Unlock guard mutex
470  this->unLock();
471 
472  return retVal;
473  }
474 
477  FwIndexType portNum,
478  FwChanIdType id,
479  Fw::Time& timeTag,
480  Fw::TlmBuffer& val
481  )
482  {
483  // Make sure port number is valid
484  FW_ASSERT(
485  (0 <= portNum) && (portNum < this->getNum_TlmRecv_InputPorts()),
486  static_cast<FwAssertArgType>(portNum)
487  );
488 
489  // Lock guard mutex before calling
490  this->lock();
491 
492  // Call handler function
493  this->TlmRecv_handler(
494  portNum,
495  id,
496  timeTag,
497  val
498  );
499 
500  // Unlock guard mutex
501  this->unLock();
502  }
503 
506  FwIndexType portNum,
507  U32 key
508  )
509  {
510  // Make sure port number is valid
511  FW_ASSERT(
512  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
513  static_cast<FwAssertArgType>(portNum)
514  );
515 
516  // Call pre-message hook
518  portNum,
519  key
520  );
521  ComponentIpcSerializableBuffer msg;
523 
524  // Serialize message ID
525  _status = msg.serializeFrom(
526  static_cast<FwEnumStoreType>(PINGIN_PING)
527  );
528  FW_ASSERT(
529  _status == Fw::FW_SERIALIZE_OK,
530  static_cast<FwAssertArgType>(_status)
531  );
532 
533  // Serialize port number
534  _status = msg.serializeFrom(portNum);
535  FW_ASSERT(
536  _status == Fw::FW_SERIALIZE_OK,
537  static_cast<FwAssertArgType>(_status)
538  );
539 
540  // Serialize argument key
541  _status = msg.serializeFrom(key);
542  FW_ASSERT(
543  _status == Fw::FW_SERIALIZE_OK,
544  static_cast<FwAssertArgType>(_status)
545  );
546 
547  // Send message
549  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
550 
551  FW_ASSERT(
552  qStatus == Os::Queue::OP_OK,
553  static_cast<FwAssertArgType>(qStatus)
554  );
555  }
556 
557  // ----------------------------------------------------------------------
558  // Pre-message hooks for typed async input ports
559  //
560  // Each of these functions is invoked just before processing a message
561  // on the corresponding port. By default, they do nothing. You can
562  // override them to provide specific pre-message behavior.
563  // ----------------------------------------------------------------------
564 
567  FwIndexType portNum,
568  U32 context
569  )
570  {
571  // Default: no-op
572  }
573 
576  FwIndexType portNum,
577  U32 key
578  )
579  {
580  // Default: no-op
581  }
582 
583  // ----------------------------------------------------------------------
584  // Invocation functions for typed output ports
585  // ----------------------------------------------------------------------
586 
589  FwIndexType portNum,
590  Fw::ComBuffer& data,
591  U32 context
592  )
593  {
594  FW_ASSERT(
595  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
596  static_cast<FwAssertArgType>(portNum)
597  );
598 
599  FW_ASSERT(
600  this->m_PktSend_OutputPort[portNum].isConnected(),
601  static_cast<FwAssertArgType>(portNum)
602  );
603  this->m_PktSend_OutputPort[portNum].invoke(
604  data,
605  context
606  );
607  }
608 
611  FwIndexType portNum,
612  U32 key
613  )
614  {
615  FW_ASSERT(
616  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
617  static_cast<FwAssertArgType>(portNum)
618  );
619 
620  FW_ASSERT(
621  this->m_pingOut_OutputPort[portNum].isConnected(),
622  static_cast<FwAssertArgType>(portNum)
623  );
624  this->m_pingOut_OutputPort[portNum].invoke(
625  key
626  );
627  }
628 
629  // ----------------------------------------------------------------------
630  // Mutex operations for guarded ports
631  //
632  // You can override these operations to provide more sophisticated
633  // synchronization
634  // ----------------------------------------------------------------------
635 
638  {
639  this->m_guardedPortMutex.lock();
640  }
641 
644  {
645  this->m_guardedPortMutex.unLock();
646  }
647 
648  // ----------------------------------------------------------------------
649  // Message dispatch functions
650  // ----------------------------------------------------------------------
651 
652  Fw::QueuedComponentBase::MsgDispatchStatus TlmChanComponentBase ::
653  doDispatch()
654  {
655  ComponentIpcSerializableBuffer _msg;
656  FwQueuePriorityType _priority = 0;
657 
658  Os::Queue::Status _msgStatus = this->m_queue.receive(
659  _msg,
661  _priority
662  );
663  FW_ASSERT(
664  _msgStatus == Os::Queue::OP_OK,
665  static_cast<FwAssertArgType>(_msgStatus)
666  );
667 
668  // Reset to beginning of buffer
669  _msg.resetDeser();
670 
671  FwEnumStoreType _desMsg = 0;
672  Fw::SerializeStatus _deserStatus = _msg.deserializeTo(_desMsg);
673  FW_ASSERT(
674  _deserStatus == Fw::FW_SERIALIZE_OK,
675  static_cast<FwAssertArgType>(_deserStatus)
676  );
677 
678  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
679 
680  if (_msgType == TLMCHAN_COMPONENT_EXIT) {
681  return MSG_DISPATCH_EXIT;
682  }
683 
684  FwIndexType portNum = 0;
685  _deserStatus = _msg.deserializeTo(portNum);
686  FW_ASSERT(
687  _deserStatus == Fw::FW_SERIALIZE_OK,
688  static_cast<FwAssertArgType>(_deserStatus)
689  );
690 
691  switch (_msgType) {
692  // Handle async input port Run
693  case RUN_SCHED: {
694  // Deserialize argument context
695  U32 context;
696  _deserStatus = _msg.deserializeTo(context);
697  FW_ASSERT(
698  _deserStatus == Fw::FW_SERIALIZE_OK,
699  static_cast<FwAssertArgType>(_deserStatus)
700  );
701  // Call handler function
702  this->Run_handler(
703  portNum,
704  context
705  );
706 
707  break;
708  }
709 
710  // Handle async input port pingIn
711  case PINGIN_PING: {
712  // Deserialize argument key
713  U32 key;
714  _deserStatus = _msg.deserializeTo(key);
715  FW_ASSERT(
716  _deserStatus == Fw::FW_SERIALIZE_OK,
717  static_cast<FwAssertArgType>(_deserStatus)
718  );
719  // Call handler function
720  this->pingIn_handler(
721  portNum,
722  key
723  );
724 
725  break;
726  }
727 
728  default:
729  return MSG_DISPATCH_ERROR;
730  }
731 
732  return MSG_DISPATCH_OK;
733  }
734 
735  // ----------------------------------------------------------------------
736  // Calls for messages received on typed input ports
737  // ----------------------------------------------------------------------
738 
739  void TlmChanComponentBase ::
740  m_p_Run_in(
741  Fw::PassiveComponentBase* callComp,
742  FwIndexType portNum,
743  U32 context
744  )
745  {
746  FW_ASSERT(callComp);
747  TlmChanComponentBase* compPtr = static_cast<TlmChanComponentBase*>(callComp);
748  compPtr->Run_handlerBase(
749  portNum,
750  context
751  );
752  }
753 
754  Fw::TlmValid TlmChanComponentBase ::
755  m_p_TlmGet_in(
756  Fw::PassiveComponentBase* callComp,
757  FwIndexType portNum,
758  FwChanIdType id,
759  Fw::Time& timeTag,
760  Fw::TlmBuffer& val
761  )
762  {
763  FW_ASSERT(callComp);
764  TlmChanComponentBase* compPtr = static_cast<TlmChanComponentBase*>(callComp);
765  return compPtr->TlmGet_handlerBase(
766  portNum,
767  id,
768  timeTag,
769  val
770  );
771  }
772 
773  void TlmChanComponentBase ::
774  m_p_TlmRecv_in(
775  Fw::PassiveComponentBase* callComp,
776  FwIndexType portNum,
777  FwChanIdType id,
778  Fw::Time& timeTag,
779  Fw::TlmBuffer& val
780  )
781  {
782  FW_ASSERT(callComp);
783  TlmChanComponentBase* compPtr = static_cast<TlmChanComponentBase*>(callComp);
784  compPtr->TlmRecv_handlerBase(
785  portNum,
786  id,
787  timeTag,
788  val
789  );
790  }
791 
792  void TlmChanComponentBase ::
793  m_p_pingIn_in(
794  Fw::PassiveComponentBase* callComp,
795  FwIndexType portNum,
796  U32 key
797  )
798  {
799  FW_ASSERT(callComp);
800  TlmChanComponentBase* compPtr = static_cast<TlmChanComponentBase*>(callComp);
801  compPtr->pingIn_handlerBase(
802  portNum,
803  key
804  );
805  }
806 
807 }
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
void init()
Initialization function.
Definition: ComPortAc.cpp:137
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
bool isConnected_pingOut_OutputPort(FwIndexType portNum)
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:56
The size of the serial representations of the port arguments.
Definition: PingPortAc.hpp:36
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:41
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.
void init()
Initialization function.
Definition: TlmPortAc.cpp:56
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
virtual void lock()
Lock the guarded mutex.
Svc::InputSchedPort * get_Run_InputPort(FwIndexType 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.
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:134
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:62
static constexpr FwIndexType getNum_pingOut_OutputPorts()
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
A message was sent requesting an exit of the loop.
message to exit active component task
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:56
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:143
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: PingPortAc.cpp:62
static constexpr FwIndexType getNum_TlmGet_InputPorts()
Message will return with status when space is unavailable.
Definition: Queue.hpp:48
Implementation of malloc based allocator.
The size of the serial representations of the port arguments.
Definition: SchedPortAc.hpp:36
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