F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
Svc::FprimeDeframing Class Reference

Implements the F Prime deframing protocol. More...

#include <Svc/FramingProtocol/FprimeProtocol.hpp>

Inheritance diagram for Svc::FprimeDeframing:
Svc::DeframingProtocol

Public Member Functions

 FprimeDeframing ()
 Constructor. More...
 
bool validate (Types::CircularBuffer &buffer, U32 size)
 
DeframingStatus deframe (Types::CircularBuffer &buffer, U32 &needed) override
 
- Public Member Functions inherited from Svc::DeframingProtocol
virtual ~DeframingProtocol ()
 
 DeframingProtocol ()
 
void setup (DeframingProtocolInterface &interface)
 

Additional Inherited Members

- Public Types inherited from Svc::DeframingProtocol
enum  DeframingStatus {
  DEFRAMING_STATUS_SUCCESS , DEFRAMING_INVALID_SIZE , DEFRAMING_INVALID_CHECKSUM , DEFRAMING_MORE_NEEDED ,
  DEFRAMING_INVALID_FORMAT , DEFRAMING_MAX_STATUS
}
 Status of the deframing call. More...
 
- Protected Attributes inherited from Svc::DeframingProtocol
DeframingProtocolInterfacem_interface
 

Detailed Description

Implements the F Prime deframing protocol.

Definition at line 54 of file FprimeProtocol.hpp.

Constructor & Destructor Documentation

◆ FprimeDeframing()

Svc::FprimeDeframing::FprimeDeframing ( )

Constructor.

Definition at line 20 of file FprimeProtocol.cpp.

Member Function Documentation

◆ deframe()

DeframingProtocol::DeframingStatus Svc::FprimeDeframing::deframe ( Types::CircularBuffer buffer,
U32 &  needed 
)
overridevirtual

Implements the deframe method

Returns
Status
Parameters
bufferThe circular buffer
neededThe number of bytes needed, updated by the caller

Implements Svc::DeframingProtocol.

Definition at line 87 of file FprimeProtocol.cpp.

◆ validate()

bool Svc::FprimeDeframing::validate ( Types::CircularBuffer buffer,
U32  size 
)

Validates data against the stored hash value

  1. Computes the hash value V of bytes [0,size-1] in the circular buffer
  2. Compares V against bytes [size, size + HASH_DIGEST_LENGTH - 1] of the circular buffer, which are expected to be the stored hash value.
Parameters
bufferThe circular buffer
sizeThe data size in bytes

Definition at line 62 of file FprimeProtocol.cpp.


The documentation for this class was generated from the following files: