mirror of
https://github.com/nasa/fprime.git
synced 2025-12-13 03:01:27 -06:00
* Revise include guards * Revise FramingProtocol include guards * Changes to FPrimeProtocol code after review * Revise comments * Guard against unsigned arithmetic overflow * Revise comment * Revise F Prime protocol * Revise comments * Fix spelling * Revise comments in FramingProtocol * Remove commented-out code in tests * Revise Framing Protocol Add Svc namespace Co-authored-by: Robert L. Bocchino Jr <bocchino@jpl.nasas.gov>
45 lines
1.4 KiB
C++
45 lines
1.4 KiB
C++
// ======================================================================
|
|
// \title FramingProtocolInterface.hpp
|
|
// \author mstarch
|
|
// \brief hpp file for framing protocol interface
|
|
//
|
|
// \copyright
|
|
// Copyright 2009-2022, by the California Institute of Technology.
|
|
// ALL RIGHTS RESERVED. United States Government Sponsorship
|
|
// acknowledged.
|
|
//
|
|
// ======================================================================
|
|
|
|
#ifndef SVC_FRAMING_PROTOCOL_INTERFACE_HPP
|
|
#define SVC_FRAMING_PROTOCOL_INTERFACE_HPP
|
|
|
|
#include <Fw/Buffer/Buffer.hpp>
|
|
#include <Fw/Time/Time.hpp>
|
|
|
|
namespace Svc {
|
|
|
|
/**
|
|
* \brief interface supplied to the framing protocol
|
|
*
|
|
* In order to supply necessary fprime actions to framing implementations this allows the framing
|
|
* implementation to call the functions to delegate the actions. Typically the FramerComponentImpl
|
|
* is the concrete implementor of this interface.
|
|
*/
|
|
class FramingProtocolInterface {
|
|
public:
|
|
virtual ~FramingProtocolInterface(){};
|
|
//! \brief allocation callback to allocate memory when framing
|
|
//! \param size: size of the allocation request
|
|
//! \return buffer wrapping allocated memory
|
|
virtual Fw::Buffer allocate(const U32 size) = 0;
|
|
|
|
//! \brief send framed data out of the framer
|
|
//! \param outgoing: framed data wrapped in an Fw::Buffer
|
|
virtual void send(Fw::Buffer& outgoing) = 0;
|
|
|
|
};
|
|
|
|
}
|
|
#endif // SVC_FRAMING_PROTOCOL_INTERFACE_HPP
|
|
|