libsdr  0.1.0
A simple SDR library
Public Types | Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
sdr::Baudot Class Reference

Implements a Baudot decoder. More...

#include <baudot.hh>

Inheritance diagram for sdr::Baudot:
sdr::Sink< uint8_t > sdr::Source sdr::SinkBase

Public Types

enum  Mode { LETTERS, FIGURES }
 Specifies the current code-tables. More...
 
enum  StopBits { STOP1, STOP15, STOP2 }
 Specifies the number of stop bits. More...
 

Public Member Functions

 Baudot (StopBits stopBits=STOP15)
 Constructor. More...
 
virtual void config (const Config &src_cfg)
 Configures the node. More...
 
virtual void process (const Buffer< uint8_t > &buffer, bool allow_overwrite)
 Processes the bit-stream. More...
 
- Public Member Functions inherited from sdr::Sink< uint8_t >
 Sink ()
 Constructor. More...
 
virtual ~Sink ()
 Drestructor. More...
 
virtual void handleBuffer (const RawBuffer &buffer, bool allow_overwrite)
 Re-implemented from SinkBase. More...
 
- Public Member Functions inherited from sdr::SinkBase
 SinkBase ()
 Constructor. More...
 
virtual ~SinkBase ()
 Destructor. More...
 
- Public Member Functions inherited from sdr::Source
 Source ()
 Constructor. More...
 
virtual ~Source ()
 Destructor. More...
 
virtual void send (const RawBuffer &buffer, bool allow_overwrite=false)
 Sends the given buffer to all connected sinks. More...
 
void connect (SinkBase *sink, bool direct=false)
 Connect this source to a sink. More...
 
void disconnect (SinkBase *sink)
 Disconnect a sink again. More...
 
virtual void setConfig (const Config &config)
 Stores the configuration and propergates it if the configuration has been changed. More...
 
virtual double sampleRate () const
 Returns the configured sample rate or 0 otherwise. More...
 
virtual Config::Type type () const
 Returns the configured source type or Config::Type_UNDEFINED otherwise. More...
 
template<class T >
void addEOS (T *instance, void(T::*function)())
 Adds a callback to the end-of-stream signal of the source. More...
 

Protected Attributes

uint16_t _bitstream
 The last bits received. More...
 
size_t _bitcount
 The number of bits received. More...
 
Mode _mode
 The currently selected table. More...
 
size_t _bitsPerSymbol
 Specifies the number of half bits per symbol. More...
 
uint16_t _pattern
 Specifies the frame pattern. More...
 
uint16_t _mask
 Specifies the frame mask. More...
 
uint16_t _stopHBits
 Number of half bits forming the stop bit. More...
 
Buffer< uint8_t > _buffer
 The output buffer. More...
 
- Protected Attributes inherited from sdr::Source
Config _config
 Holds the source configuration, this can be updated by calling setConfig. More...
 
std::map< SinkBase *, bool > _sinks
 The connected sinks. More...
 
std::list< DelegateInterface * > _eos
 The connected EOS singal handlers. More...
 

Static Protected Attributes

static char _letter [32]
 Code table for letters. More...
 
static char _figure [32]
 Code table for symbols or figure (i.e. More...
 

Additional Inherited Members

- Protected Member Functions inherited from sdr::Source
void signalEOS ()
 Signals the EOS. More...
 
void propagateConfig (const Config &config)
 Propagates the given configuration to all connected sinks. More...
 

Detailed Description

Implements a Baudot decoder.

Inconjecture with the (A)FSK demodulator, it enables the reception of radio teletype (RTTY) messages.

Please note that a baudot encoded char is usually transmitted in a frame with one start bit and 1, 1.5 or 2 stop bits. Hence this node expects to receive two bits for one decoded bit in order to detect the 1.5 stop bits reliably.

I.e. to receive a 45.45 baud RTTY signal, the (A)FSK demodulator need to be configured for 90.90 baud (= 2*45.45 baud).

Constructor & Destructor Documentation

Baudot::Baudot ( StopBits  stopBits = STOP15)

Constructor.

Member Function Documentation

void Baudot::config ( const Config src_cfg)
virtual

Configures the node.

Implements sdr::SinkBase.

void Baudot::process ( const Buffer< uint8_t > &  buffer,
bool  allow_overwrite 
)
virtual

Processes the bit-stream.

Implements sdr::Sink< uint8_t >.

Member Data Documentation

size_t sdr::Baudot::_bitcount
protected

The number of bits received.

size_t sdr::Baudot::_bitsPerSymbol
protected

Specifies the number of half bits per symbol.

uint16_t sdr::Baudot::_bitstream
protected

The last bits received.

Buffer<uint8_t> sdr::Baudot::_buffer
protected

The output buffer.

char Baudot::_figure
staticprotected
Initial value:
= { 0, '3','\n', '-', ' ','\a', '8', '7','\n', '?', '4','\'', ',', '!',
':', '(', '5', '"', ')', '2', '#', '6', '0', '1', '9', '?', '&', 0,
'.', '/', ';', 0}

Code table for symbols or figure (i.e.

numbers).

char Baudot::_letter
staticprotected
Initial value:
= { 0, 'E','\n', 'A', ' ', 'S', 'I', 'U','\n', 'D', 'R', 'J', 'N', 'F',
'C', 'K', 'T', 'Z', 'L', 'W', 'H', 'Y', 'P', 'Q', 'O', 'B', 'G', 0,
'M', 'X', 'V', 0}

Code table for letters.

uint16_t sdr::Baudot::_mask
protected

Specifies the frame mask.

Mode sdr::Baudot::_mode
protected

The currently selected table.

uint16_t sdr::Baudot::_pattern
protected

Specifies the frame pattern.

uint16_t sdr::Baudot::_stopHBits
protected

Number of half bits forming the stop bit.


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