baudot.hh
#ifndef __SDR_BAUDOT_HH__
#define __SDR_BAUDOT_HH__
#include "node.hh"
#include <map>
namespace sdr {
class Baudot: public Sink<uint8_t>, public Source
{
public:
typedef enum {
LETTERS,
FIGURES
} Mode;
typedef enum {
STOP1,
STOP15,
STOP2
} StopBits;
public:
Baudot(StopBits stopBits = STOP15);
virtual void config(const Config &src_cfg);
virtual void process(const Buffer<uint8_t> &buffer, bool allow_overwrite);
protected:
static char _letter[32];
static char _figure[32];
uint16_t _bitstream;
size_t _bitcount;
Mode _mode;
size_t _bitsPerSymbol;
uint16_t _pattern;
uint16_t _mask;
uint16_t _stopHBits;
Buffer<uint8_t> _buffer;
};
}
#endif // BAUDOT_HH
sdr::Config
A collection of configuration information that is send by a source to all connected sinks to properga...
Definition: node.hh:35
sdr::Baudot::_bitcount
size_t _bitcount
The number of bits received.
Definition: baudot.hh:52
sdr::Baudot::_mask
uint16_t _mask
Specifies the frame mask.
Definition: baudot.hh:62
sdr::Baudot::_figure
static char _figure[32]
Code table for symbols or figure (i.e.
Definition: baudot.hh:48
sdr::Baudot::_pattern
uint16_t _pattern
Specifies the frame pattern.
Definition: baudot.hh:60
sdr::Baudot::_mode
Mode _mode
The currently selected table.
Definition: baudot.hh:55
sdr::Sink
Typed sink.
Definition: node.hh:192
sdr::Baudot::STOP2
2 stop bits.
Definition: baudot.hh:32
sdr
Definition: autocast.hh:8
sdr::Baudot
Implements a Baudot decoder.
Definition: baudot.hh:19
sdr::Baudot::_letter
static char _letter[32]
Code table for letters.
Definition: baudot.hh:46
sdr::Baudot::_bitstream
uint16_t _bitstream
The last bits received.
Definition: baudot.hh:50
sdr::Source
Generic source class.
Definition: node.hh:213
sdr::Baudot::FIGURES
Numbers, symbols etc.
Definition: baudot.hh:25
sdr::Baudot::process
virtual void process(const Buffer< uint8_t > &buffer, bool allow_overwrite)
Processes the bit-stream.
Definition: baudot.cc:86
sdr::Baudot::_stopHBits
uint16_t _stopHBits
Number of half bits forming the stop bit.
Definition: baudot.hh:64
sdr::Baudot::LETTERS
Letters.
Definition: baudot.hh:24
sdr::Baudot::StopBits
StopBits
Specifies the number of stop bits.
Definition: baudot.hh:29
sdr::Baudot::config
virtual void config(const Config &src_cfg)
Configures the node.
Definition: baudot.cc:55
sdr::Baudot::Baudot
Baudot(StopBits stopBits=STOP15)
Constructor.
Definition: baudot.cc:23
sdr::Baudot::_buffer
Buffer< uint8_t > _buffer
The output buffer.
Definition: baudot.hh:67
sdr::Baudot::STOP1
1 stop bit.
Definition: baudot.hh:30
sdr::Baudot::STOP15
1.5 stop bits.
Definition: baudot.hh:31
sdr::Baudot::_bitsPerSymbol
size_t _bitsPerSymbol
Specifies the number of half bits per symbol.
Definition: baudot.hh:58
sdr::Baudot::Mode
Mode
Specifies the current code-tables.
Definition: baudot.hh:23
sdr::Buffer< uint8_t >