![]() |
F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
|
interface class used to codify what must be supported to allow frame detection More...
#include <Svc/FrameAccumulator/FrameDetector.hpp>
Public Types | |
enum | Status { FRAME_DETECTED, NO_FRAME_DETECTED, MORE_DATA_NEEDED } |
status returned from the detection step More... | |
Public Member Functions | |
virtual | ~FrameDetector ()=default |
virtual destructor More... | |
virtual Status | detect (const Types::CircularBuffer &data, FwSizeType &size_out) const =0 |
detect if a frame is available within the circular buffer More... | |
interface class used to codify what must be supported to allow frame detection
Definition at line 14 of file FrameDetector.hpp.
status returned from the detection step
Definition at line 17 of file FrameDetector.hpp.
|
virtualdefault |
virtual destructor
|
pure virtual |
detect if a frame is available within the circular buffer
Function implemented by sub classes used to determine if a frame is available at the current position of the circular buffer. Implementors should detect if a frame is available, set size_out, and return a status while following these expectations:
MORE_DATA_NEEDED status implies that a frame might be possible but more data is needed before a determination is possible. size_out must be set to the total amount of data needed.
For example, if a frame start word is 4 bytes, and 3 bytes are available in the circular buffer then the return status would be NO_FRAME_DETECTED and size_out must be set to 4 to ensure that at least the start word is available.
data | circular buffer with read-only access |
size_out | set as output to caller indicating size when appropriate |
Implemented in Svc::FrameDetectors::FprimeFrameDetector, and Svc::FrameDetectors::CcsdsTcFrameDetector.