fprime/Svc/FprimeRouter/FprimeRouter.hpp
Thomas Boyer-Chammard c3b2e04880
Use data return pattern on Uplink and standardize port names (#3546)
* First pass at Svc + TcpClient implementation

* Revert FileUplink changes

* Add copy (with allocation/deallocation) to FprimeRouter to simplify buffer management

* Update FprimeRouter UTs

* Update FprimeDeframer UTs

* Update FrameAccumulator UTs

* Update ComStub UTs

* Update missing Drv and UTs

* Update ComInterface to use ComDataWithContext on output

* Update Ref/RPI topology

* Fix spelling

* Fix test typo

* Update Udp component and UTs

* Rename data ports and standardize "Return" naming pattern

* Fix variable name

* Adapt UTs

* Update Communication Adapter Interface docs

* Full SDD updates

* Spelling &  nits and details

* Put formatting back to original

* Update Deframer interface to include bufferReturn

* Address review comments
2025-05-08 10:54:54 -07:00

59 lines
2.3 KiB
C++

// ======================================================================
// \title FprimeRouter.hpp
// \author thomas-bc
// \brief hpp file for FprimeRouter component implementation class
// ======================================================================
#ifndef Svc_FprimeRouter_HPP
#define Svc_FprimeRouter_HPP
#include "Svc/FprimeRouter/FprimeRouterComponentAc.hpp"
namespace Svc {
class FprimeRouter final : public FprimeRouterComponentBase {
public:
// ----------------------------------------------------------------------
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct FprimeRouter object
FprimeRouter(const char* const compName //!< The component name
);
//! Destroy FprimeRouter object
~FprimeRouter();
PRIVATE:
// ----------------------------------------------------------------------
// Handler implementations for user-defined typed input ports
// ----------------------------------------------------------------------
//! Handler implementation for bufferIn
//! Receiving Fw::Buffer from Deframer
void dataIn_handler(FwIndexType portNum, //!< The port number
Fw::Buffer& packetBuffer, //!< The packet buffer
const ComCfg::FrameContext& context //!< The context object
) override;
// ! Handler for input port cmdResponseIn
// ! This is a no-op because FprimeRouter does not need to handle command responses
// ! but the port must be connected
void cmdResponseIn_handler(FwIndexType portNum, //!< The port number
FwOpcodeType opcode, //!< The command opcode
U32 cmdSeq, //!< The command sequence number
const Fw::CmdResponse& response //!< The command response
) override;
//! Handler implementation for fileBufferReturnIn
//!
//! Port for receiving ownership back of buffers sent on fileOut
void fileBufferReturnIn_handler(FwIndexType portNum, //!< The port number
Fw::Buffer& fwBuffer //!< The buffer
) override;
};
} // namespace Svc
#endif