F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
PingReceiverComponentImpl.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title PingReceiverImpl.cpp
3 // \author tim
4 // \brief cpp file for PingReceiver component implementation class
5 //
6 // \copyright
7 // Copyright 2009-2015, by the California Institute of Technology.
8 // ALL RIGHTS RESERVED. United States Government Sponsorship
9 // acknowledged.
10 //
11 // ======================================================================
12 
13 #include <Fw/FPrimeBasicTypes.hpp>
15 
16 namespace Ref {
17 
18 // ----------------------------------------------------------------------
19 // Construction, initialization, and destruction
20 // ----------------------------------------------------------------------
21 
23  : PingReceiverComponentBase(compName), m_inhibitPings(false), m_pingsRecvd(0) {}
24 
26 
27 // ----------------------------------------------------------------------
28 // Handler implementations for user-defined typed input ports
29 // ----------------------------------------------------------------------
30 
31 void PingReceiverComponentImpl ::PingIn_handler(const FwIndexType portNum, U32 key) {
32  // this->log_DIAGNOSTIC_PR_PingReceived(key);
33  this->tlmWrite_PR_NumPings(this->m_pingsRecvd++);
34  if (not this->m_inhibitPings) {
35  PingOut_out(0, key);
36  }
37 }
38 
39 void PingReceiverComponentImpl::PR_StopPings_cmdHandler(FwOpcodeType opCode,
40  U32 cmdSeq
41 ) {
42  this->m_inhibitPings = true;
43  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
44 }
45 
46 } // end namespace Ref
FwIdType FwOpcodeType
The type of a command opcode.
Command successfully executed.
PlatformIndexType FwIndexType
PingReceiverComponentImpl(const char *const compName)