Files
fprime/Ref/PingReceiver/PingReceiverComponentImpl.cpp
M Starch a049743e07 Removing component init() functions where unneeded (#2893)
* Removing component init() functions where unneeded

* Removing spurious assert
2024-09-23 18:39:00 -07:00

63 lines
1.8 KiB
C++

// ======================================================================
// \title PingReceiverImpl.cpp
// \author tim
// \brief cpp file for PingReceiver component implementation class
//
// \copyright
// Copyright 2009-2015, by the California Institute of Technology.
// ALL RIGHTS RESERVED. United States Government Sponsorship
// acknowledged.
//
// ======================================================================
#include <Ref/PingReceiver/PingReceiverComponentImpl.hpp>
#include <FpConfig.hpp>
namespace Ref {
// ----------------------------------------------------------------------
// Construction, initialization, and destruction
// ----------------------------------------------------------------------
PingReceiverComponentImpl ::
PingReceiverComponentImpl(
const char *const compName
) : PingReceiverComponentBase(compName), m_inhibitPings(false), m_pingsRecvd(0)
{
}
PingReceiverComponentImpl ::
~PingReceiverComponentImpl()
{
}
// ----------------------------------------------------------------------
// Handler implementations for user-defined typed input ports
// ----------------------------------------------------------------------
void PingReceiverComponentImpl ::
PingIn_handler(
const NATIVE_INT_TYPE portNum,
U32 key
)
{
//this->log_DIAGNOSTIC_PR_PingReceived(key);
this->tlmWrite_PR_NumPings(this->m_pingsRecvd++);
if (not this->m_inhibitPings) {
PingOut_out(0,key);
}
}
void PingReceiverComponentImpl::PR_StopPings_cmdHandler(
FwOpcodeType opCode, /*!< The opcode*/
U32 cmdSeq /*!< The command sequence number*/
) {
this->m_inhibitPings = true;
this->cmdResponse_out(opCode,cmdSeq,Fw::CmdResponse::OK);
}
} // end namespace Ref