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

Decodes AX25 (PacketRadio) messages from a bit stream. More...

#include <ax25.hh>

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

Public Member Functions

 AX25 ()
 Constructor. More...
 
virtual ~AX25 ()
 Destructor. 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...
 

Static Public Member Functions

static void unpackCall (const uint8_t *buffer, std::string &call, int &ssid, bool &addrExt)
 Unpacks a AX.25 encoded call (address). More...
 

Protected Attributes

uint32_t _bitstream
 The last bits. More...
 
uint32_t _bitbuffer
 A buffer of received bits. More...
 
uint32_t _state
 The current state. More...
 
uint8_t _rxbuffer [512]
 Message buffer. More...
 
uint8_t * _ptr
 Insert-pointer to the buffer. More...
 
Buffer< uint8_t > _buffer
 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...
 

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

Decodes AX25 (PacketRadio) messages from a bit stream.

In conjecture with the (A)FSK demodulator, the AX25 can be used to receive packet radio or APRS messages. AX25 is usually transmitted as FSK in transition mode, means the bits aren't encoded by mark & space tones but rather as a transition from mark to space or in reverse. Hence the FSK node needs to be configured in transition mode.

The node does not process the actual AX.25 packages, it only checks the frame check sequence and forwards the AX.25 datagram to all connected sinks on success. The receiving node is responsible for unpacking and handling the received datagram.

Constructor & Destructor Documentation

AX25::AX25 ( )

Constructor.

AX25::~AX25 ( )
virtual

Destructor.

Member Function Documentation

void AX25::config ( const Config src_cfg)
virtual

Configures the node.

Implements sdr::SinkBase.

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

Processes the bit stream.

Todo:
Double check this!!!

Implements sdr::Sink< uint8_t >.

void AX25::unpackCall ( const uint8_t *  buffer,
std::string &  call,
int &  ssid,
bool &  addrExt 
)
static

Unpacks a AX.25 encoded call (address).

Member Data Documentation

uint32_t sdr::AX25::_bitbuffer
protected

A buffer of received bits.

uint32_t sdr::AX25::_bitstream
protected

The last bits.

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

Output buffer.

uint8_t* sdr::AX25::_ptr
protected

Insert-pointer to the buffer.

uint8_t sdr::AX25::_rxbuffer[512]
protected

Message buffer.

uint32_t sdr::AX25::_state
protected

The current state.


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