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