satdump/src-core/modules/meteor/simpledeframer.h
2021-05-18 21:40:42 +02:00

29 lines
No EOL
608 B
C++

#pragma once
/*
An arbitrary deframer
*/
#include <vector>
#include <array>
#include <cstdint>
#include "ccsds.h"
template <typename SYNC_T, int SYNC_SIZE, int FRAME_SIZE, SYNC_T ASM_SYNC, int chk_size>
class SimpleDeframer
{
private:
// Main shifter
SYNC_T shifter;
// Small function to push a bit into the frame
void pushBit(uint8_t bit);
// Framing variables
uint8_t byteBuffer;
bool writeFrame;
int wroteBits, outputBits;
std::vector<uint8_t> frameBuffer;
public:
SimpleDeframer();
std::vector<std::vector<uint8_t>> work(std::vector<uint8_t> &data);
};