F´ Flight Software - C/C++ Documentation  NASA-v1.6.0
A framework for building embedded system applications to NASA flight quality standards.
FprimeProtocol.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FprimeProtocol.hpp
3 // \author mstarch
4 // \brief hpp file for FprimeProtocol class
5 //
6 // \copyright
7 // Copyright 2009-2021, by the California Institute of Technology.
8 // ALL RIGHTS RESERVED. United States Government Sponsorship
9 // acknowledged.
10 //
11 // ======================================================================
12 
13 #ifndef SVC_FPRIME_PROTOCOL_HPP
14 #define SVC_FPRIME_PROTOCOL_HPP
15 
18 
19 namespace Svc {
20 
21  // Definitions for the F Prime frame header
22  namespace FpFrameHeader {
23 
25  typedef U32 TokenType;
26 
27  enum {
29  SIZE = sizeof(TokenType) * 2
30  };
31 
33  const TokenType START_WORD = static_cast<TokenType>(0xdeadbeef);
34 
35  }
36 
39  public:
40 
42  FprimeFraming();
43 
45  void frame(
46  const U8* const data,
47  const U32 size,
48  Fw::ComPacket::ComPacketType packet_type
49  ) override;
50 
51  };
52 
55  public:
56 
59 
64  bool validate(
65  Types::CircularBuffer& buffer,
66  U32 size
67  );
68 
72  Types::CircularBuffer& buffer,
73  U32& needed
74  ) override;
75 
76  };
77 
78 }
79 #endif // SVC_FPRIME_PROTOCOL_HPP
Svc::FpFrameHeader::START_WORD
const TokenType START_WORD
The start word for F Prime framing.
Definition: FprimeProtocol.hpp:33
Svc::FprimeFraming
Implements the F Prime framing protocol.
Definition: FprimeProtocol.hpp:38
Svc::FprimeDeframing::FprimeDeframing
FprimeDeframing()
Constructor.
Definition: FprimeProtocol.cpp:22
U8
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.hpp:73
DeframingProtocol.hpp
Svc::FpFrameHeader::SIZE
@ SIZE
Header size for F Prime frame header.
Definition: FprimeProtocol.hpp:29
Svc::FprimeDeframing::deframe
DeframingStatus deframe(Types::CircularBuffer &buffer, U32 &needed) override
Definition: FprimeProtocol.cpp:84
Svc::FpFrameHeader::TokenType
U32 TokenType
Token type for F Prime frame header.
Definition: FprimeProtocol.hpp:25
Svc::DeframingProtocol::DeframingStatus
DeframingStatus
Status of the deframing call.
Definition: DeframingProtocol.hpp:39
Svc::FprimeFraming::FprimeFraming
FprimeFraming()
Constructor.
Definition: FprimeProtocol.cpp:20
Svc::FramingProtocol
abstract class representing a framing protocol
Definition: FramingProtocol.hpp:31
Svc
Definition: ActiveRateGroupCfg.hpp:18
Svc::DeframingProtocol
Abstract base class representing a deframing protocol.
Definition: DeframingProtocol.hpp:33
Fw::ComPacket::ComPacketType
ComPacketType
Definition: ComPacket.hpp:21
Svc::FprimeDeframing::validate
bool validate(Types::CircularBuffer &buffer, U32 size)
Definition: FprimeProtocol.cpp:61
Types::CircularBuffer
Definition: CircularBuffer.hpp:28
FramingProtocol.hpp
Svc::FprimeDeframing
Implements the F Prime deframing protocol.
Definition: FprimeProtocol.hpp:54
Svc::FprimeFraming::frame
void frame(const U8 *const data, const U32 size, Fw::ComPacket::ComPacketType packet_type) override
Implements the frame method.
Definition: FprimeProtocol.cpp:24