- refactored Frame to FrameReceiver
git-svn-id: http://moon:8086/svn/software/trunk/libsrc/cpp@1087 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -1,2 +0,0 @@
|
|||||||
// --------------------------------------------------------------
|
|
||||||
#include "Frame.hpp"
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
// --------------------------------------------------------------
|
|
||||||
#ifndef _RADIO_FRAME_HPP_
|
|
||||||
#define _RADIO_FRAME_HPP_
|
|
||||||
|
|
||||||
#include <cstdint>
|
|
||||||
#include <radio/radio_types.h>
|
|
||||||
#include <radio/cpx.h>
|
|
||||||
#include <cpp/radio/processor/src/Block.hpp>
|
|
||||||
|
|
||||||
#include "FrameDefs.hpp"
|
|
||||||
#include "Symbolizer.hpp"
|
|
||||||
#include "Formatter.hpp"
|
|
||||||
#include "DeSymbolizer.hpp"
|
|
||||||
#include "DeFormatter.hpp"
|
|
||||||
|
|
||||||
class FrameReceiver : public Processor::Block
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
FrameReceiver()
|
|
||||||
: Processor::Block(1, 1)
|
|
||||||
, m_desymbolizer()
|
|
||||||
, m_deformatter()
|
|
||||||
, m_framesCount(0)
|
|
||||||
, m_byteCount(0)
|
|
||||||
, m_buf_symbol_in(nullptr)
|
|
||||||
, m_buf_byte_out(nullptr)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
~FrameReceiver()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
frame_statistics_t getStats()
|
|
||||||
{
|
|
||||||
return m_deformatter.getStats();
|
|
||||||
}
|
|
||||||
|
|
||||||
void resetStats()
|
|
||||||
{
|
|
||||||
m_deformatter.resetStats();
|
|
||||||
}
|
|
||||||
|
|
||||||
void setNumBitsPerSymbol(uint32_t nBitsPerSym)
|
|
||||||
{
|
|
||||||
m_desymbolizer.setNumBitsPerSymbol(nBitsPerSym);
|
|
||||||
m_deformatter.resetStats();
|
|
||||||
}
|
|
||||||
|
|
||||||
void prepare()
|
|
||||||
{
|
|
||||||
m_buf_symbol_in = buffer_in<symbol_t>();
|
|
||||||
// m_buf_byte_out = buffer_out<uint8_t>();
|
|
||||||
m_buf_byte_in.resize(m_buf_symbol_in->capacity());
|
|
||||||
|
|
||||||
m_desymbolizer.buffer_in_add(m_buf_symbol_in);
|
|
||||||
m_desymbolizer.buffer_out_add(&m_buf_byte_in);
|
|
||||||
m_desymbolizer.prepare();
|
|
||||||
|
|
||||||
m_deformatter.buffer_in_add(&m_buf_byte_in);
|
|
||||||
m_deformatter.buffer_out_add(m_buf_byte_out);
|
|
||||||
m_deformatter.prepare();
|
|
||||||
}
|
|
||||||
|
|
||||||
void process()
|
|
||||||
{
|
|
||||||
m_desymbolizer.process();
|
|
||||||
m_deformatter.process();
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
DeSymbolizer m_desymbolizer;
|
|
||||||
DeFormatter m_deformatter;
|
|
||||||
uint32_t m_framesCount;
|
|
||||||
uint32_t m_byteCount;
|
|
||||||
Processor::Buffer<symbol_t> *m_buf_symbol_in;
|
|
||||||
Processor::Buffer<uint8_t> *m_buf_byte_out;
|
|
||||||
Processor::Buffer<uint8_t> m_buf_byte_in;
|
|
||||||
};
|
|
||||||
|
|
||||||
// --------------------------------------------------------------
|
|
||||||
#endif // _RADIO_FRAME_HPP_
|
|
||||||
@@ -8,7 +8,6 @@ CXX_SRCS += $(LIBSRC_PATH)/cpp/radio/Symbolizer.cpp
|
|||||||
CXX_SRCS += $(LIBSRC_PATH)/cpp/radio/DeFormatter.cpp
|
CXX_SRCS += $(LIBSRC_PATH)/cpp/radio/DeFormatter.cpp
|
||||||
CXX_SRCS += $(LIBSRC_PATH)/cpp/radio/DeSymbolizer.cpp
|
CXX_SRCS += $(LIBSRC_PATH)/cpp/radio/DeSymbolizer.cpp
|
||||||
CXX_SRCS += $(LIBSRC_PATH)/cpp/radio/Scrambler.cpp
|
CXX_SRCS += $(LIBSRC_PATH)/cpp/radio/Scrambler.cpp
|
||||||
CXX_SRCS += $(LIBSRC_PATH)/cpp/radio/Frame.cpp
|
|
||||||
CXX_SRCS += $(LIBSRC_PATH)/cpp/radio/metrics/Tracker.cpp
|
CXX_SRCS += $(LIBSRC_PATH)/cpp/radio/metrics/Tracker.cpp
|
||||||
CXX_SRCS += $(LIBSRC_PATH)/cpp/radio/interpolation/TimingGenerator.cpp
|
CXX_SRCS += $(LIBSRC_PATH)/cpp/radio/interpolation/TimingGenerator.cpp
|
||||||
CXX_SRCS += $(LIBSRC_PATH)/cpp/radio/interpolation/Farrow.cpp
|
CXX_SRCS += $(LIBSRC_PATH)/cpp/radio/interpolation/Farrow.cpp
|
||||||
|
|||||||
Reference in New Issue
Block a user