F´ Flight Software - C/C++ Documentation
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 
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 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_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  // 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  (0 <= portNum) && (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  (0 <= portNum) && (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  (0 <= portNum) && (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.serializeFrom(
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.serializeFrom(portNum);
464  FW_ASSERT(
465  _status == Fw::FW_SERIALIZE_OK,
466  static_cast<FwAssertArgType>(_status)
467  );
468 
469  // Serialize argument context
470  _status = msg.serializeFrom(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  (0 <= portNum) && (portNum < this->getNum_TlmGet_InputPorts()),
497  static_cast<FwAssertArgType>(portNum)
498  );
499 
500  Fw::TlmValid retVal;
501 
502  // Lock guard mutex before calling
503  this->lock();
504 
505  // Call handler function
506  retVal = this->TlmGet_handler(
507  portNum,
508  id,
509  timeTag,
510  val
511  );
512 
513  // Unlock guard mutex
514  this->unLock();
515 
516  return retVal;
517  }
518 
521  FwIndexType portNum,
522  FwChanIdType id,
523  Fw::Time& timeTag,
524  Fw::TlmBuffer& val
525  )
526  {
527  // Make sure port number is valid
528  FW_ASSERT(
529  (0 <= portNum) && (portNum < this->getNum_TlmRecv_InputPorts()),
530  static_cast<FwAssertArgType>(portNum)
531  );
532 
533  // Lock guard mutex before calling
534  this->lock();
535 
536  // Call handler function
537  this->TlmRecv_handler(
538  portNum,
539  id,
540  timeTag,
541  val
542  );
543 
544  // Unlock guard mutex
545  this->unLock();
546  }
547 
550  FwIndexType portNum,
551  U32 key
552  )
553  {
554  // Make sure port number is valid
555  FW_ASSERT(
556  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
557  static_cast<FwAssertArgType>(portNum)
558  );
559 
560  // Call pre-message hook
562  portNum,
563  key
564  );
565  ComponentIpcSerializableBuffer msg;
567 
568  // Serialize message ID
569  _status = msg.serializeFrom(
570  static_cast<FwEnumStoreType>(PINGIN_PING)
571  );
572  FW_ASSERT(
573  _status == Fw::FW_SERIALIZE_OK,
574  static_cast<FwAssertArgType>(_status)
575  );
576 
577  // Serialize port number
578  _status = msg.serializeFrom(portNum);
579  FW_ASSERT(
580  _status == Fw::FW_SERIALIZE_OK,
581  static_cast<FwAssertArgType>(_status)
582  );
583 
584  // Serialize argument key
585  _status = msg.serializeFrom(key);
586  FW_ASSERT(
587  _status == Fw::FW_SERIALIZE_OK,
588  static_cast<FwAssertArgType>(_status)
589  );
590 
591  // Send message
593  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
594 
595  FW_ASSERT(
596  qStatus == Os::Queue::OP_OK,
597  static_cast<FwAssertArgType>(qStatus)
598  );
599  }
600 
601  // ----------------------------------------------------------------------
602  // Pre-message hooks for typed async input ports
603  //
604  // Each of these functions is invoked just before processing a message
605  // on the corresponding port. By default, they do nothing. You can
606  // override them to provide specific pre-message behavior.
607  // ----------------------------------------------------------------------
608 
611  FwIndexType portNum,
612  U32 context
613  )
614  {
615  // Default: no-op
616  }
617 
620  FwIndexType portNum,
621  U32 key
622  )
623  {
624  // Default: no-op
625  }
626 
627  // ----------------------------------------------------------------------
628  // Invocation functions for typed output ports
629  // ----------------------------------------------------------------------
630 
633  FwIndexType portNum,
634  Fw::ComBuffer& data,
635  U32 context
636  )
637  {
638  FW_ASSERT(
639  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
640  static_cast<FwAssertArgType>(portNum)
641  );
642 
643  FW_ASSERT(
644  this->m_PktSend_OutputPort[portNum].isConnected(),
645  static_cast<FwAssertArgType>(portNum)
646  );
647  this->m_PktSend_OutputPort[portNum].invoke(
648  data,
649  context
650  );
651  }
652 
655  FwIndexType portNum,
656  U32 key
657  )
658  {
659  FW_ASSERT(
660  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
661  static_cast<FwAssertArgType>(portNum)
662  );
663 
664  FW_ASSERT(
665  this->m_pingOut_OutputPort[portNum].isConnected(),
666  static_cast<FwAssertArgType>(portNum)
667  );
668  this->m_pingOut_OutputPort[portNum].invoke(
669  key
670  );
671  }
672 
673  // ----------------------------------------------------------------------
674  // Mutex operations for guarded ports
675  //
676  // You can override these operations to provide more sophisticated
677  // synchronization
678  // ----------------------------------------------------------------------
679 
682  {
683  this->m_guardedPortMutex.lock();
684  }
685 
688  {
689  this->m_guardedPortMutex.unLock();
690  }
691 
692  // ----------------------------------------------------------------------
693  // Message dispatch functions
694  // ----------------------------------------------------------------------
695 
696  Fw::QueuedComponentBase::MsgDispatchStatus TlmChanComponentBase ::
697  doDispatch()
698  {
699  ComponentIpcSerializableBuffer _msg;
700  FwQueuePriorityType _priority = 0;
701 
702  Os::Queue::Status _msgStatus = this->m_queue.receive(
703  _msg,
705  _priority
706  );
707  FW_ASSERT(
708  _msgStatus == Os::Queue::OP_OK,
709  static_cast<FwAssertArgType>(_msgStatus)
710  );
711 
712  // Reset to beginning of buffer
713  _msg.resetDeser();
714 
715  FwEnumStoreType _desMsg = 0;
716  Fw::SerializeStatus _deserStatus = _msg.deserializeTo(_desMsg);
717  FW_ASSERT(
718  _deserStatus == Fw::FW_SERIALIZE_OK,
719  static_cast<FwAssertArgType>(_deserStatus)
720  );
721 
722  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
723 
724  if (_msgType == TLMCHAN_COMPONENT_EXIT) {
725  return MSG_DISPATCH_EXIT;
726  }
727 
728  FwIndexType portNum = 0;
729  _deserStatus = _msg.deserializeTo(portNum);
730  FW_ASSERT(
731  _deserStatus == Fw::FW_SERIALIZE_OK,
732  static_cast<FwAssertArgType>(_deserStatus)
733  );
734 
735  switch (_msgType) {
736  // Handle async input port Run
737  case RUN_SCHED: {
738  // Deserialize argument context
739  U32 context;
740  _deserStatus = _msg.deserializeTo(context);
741  FW_ASSERT(
742  _deserStatus == Fw::FW_SERIALIZE_OK,
743  static_cast<FwAssertArgType>(_deserStatus)
744  );
745  // Call handler function
746  this->Run_handler(
747  portNum,
748  context
749  );
750 
751  break;
752  }
753 
754  // Handle async input port pingIn
755  case PINGIN_PING: {
756  // Deserialize argument key
757  U32 key;
758  _deserStatus = _msg.deserializeTo(key);
759  FW_ASSERT(
760  _deserStatus == Fw::FW_SERIALIZE_OK,
761  static_cast<FwAssertArgType>(_deserStatus)
762  );
763  // Call handler function
764  this->pingIn_handler(
765  portNum,
766  key
767  );
768 
769  break;
770  }
771 
772  default:
773  return MSG_DISPATCH_ERROR;
774  }
775 
776  return MSG_DISPATCH_OK;
777  }
778 
779  // ----------------------------------------------------------------------
780  // Calls for messages received on typed input ports
781  // ----------------------------------------------------------------------
782 
783  void TlmChanComponentBase ::
784  m_p_Run_in(
785  Fw::PassiveComponentBase* callComp,
786  FwIndexType portNum,
787  U32 context
788  )
789  {
790  FW_ASSERT(callComp);
791  TlmChanComponentBase* compPtr = static_cast<TlmChanComponentBase*>(callComp);
792  compPtr->Run_handlerBase(
793  portNum,
794  context
795  );
796  }
797 
798  Fw::TlmValid TlmChanComponentBase ::
799  m_p_TlmGet_in(
800  Fw::PassiveComponentBase* callComp,
801  FwIndexType portNum,
802  FwChanIdType id,
803  Fw::Time& timeTag,
804  Fw::TlmBuffer& val
805  )
806  {
807  FW_ASSERT(callComp);
808  TlmChanComponentBase* compPtr = static_cast<TlmChanComponentBase*>(callComp);
809  return compPtr->TlmGet_handlerBase(
810  portNum,
811  id,
812  timeTag,
813  val
814  );
815  }
816 
817  void TlmChanComponentBase ::
818  m_p_TlmRecv_in(
819  Fw::PassiveComponentBase* callComp,
820  FwIndexType portNum,
821  FwChanIdType id,
822  Fw::Time& timeTag,
823  Fw::TlmBuffer& val
824  )
825  {
826  FW_ASSERT(callComp);
827  TlmChanComponentBase* compPtr = static_cast<TlmChanComponentBase*>(callComp);
828  compPtr->TlmRecv_handlerBase(
829  portNum,
830  id,
831  timeTag,
832  val
833  );
834  }
835 
836  void TlmChanComponentBase ::
837  m_p_pingIn_in(
838  Fw::PassiveComponentBase* callComp,
839  FwIndexType portNum,
840  U32 key
841  )
842  {
843  FW_ASSERT(callComp);
844  TlmChanComponentBase* compPtr = static_cast<TlmChanComponentBase*>(callComp);
845  compPtr->pingIn_handlerBase(
846  portNum,
847  key
848  );
849  }
850 
851 }
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:63
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
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.
FwIndexType getNum_TlmRecv_InputPorts() const
FwIndexType getNum_TlmGet_InputPorts() const
void init()
Initialization function.
Definition: TlmPortAc.cpp:56
FwIndexType getNum_Run_InputPorts() const
Os::Queue m_queue
queue object for active component
void init()
Object initializer.
Definition: ObjBase.cpp:24
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: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.
const char * toChar() const
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:46
FwIndexType getNum_pingIn_InputPorts() const
bool isConnected() const
Definition: PortBase.cpp:38
FwIndexType getNum_pingOut_OutputPorts() const
void set_PktSend_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to PktSend[portNum].
#define PRI_FwIndexType
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:55
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
The size of the serial representations of the port arguments.
Definition: PingPortAc.hpp:36
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.
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition: BasicTypes.h:90
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
message to exit active component task
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:48
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.
The size of the serial representations of the port arguments.
Definition: SchedPortAc.hpp:36
void lock()
lock the mutex and assert success
Definition: Mutex.cpp:34