libcyberradio  22.01.24
Vita49Packet Class Reference

Decodes a VITA 49 or I/Q data packet. More...

#include <Vita49Packet.h>

Public Member Functions

 Vita49Packet (int vitaType, size_t payloadSize, size_t vitaHeaderSize, size_t vitaTailSize, bool byteSwapped, bool iqSwapped, unsigned char *rawData=NULL, size_t rawDataLen=0)
 Constructs a Vita49Packet object. More...
 
virtual ~Vita49Packet ()
 Destroys a Vita49Packet object.
 
 Vita49Packet (const Vita49Packet &src)
 Copy constructor. More...
 
virtual Vita49Packetoperator= (const Vita49Packet &src)
 Assignment operator. More...
 
bool isVita49 () const
 Indicates whether the packet data is in VITA 49 format. More...
 
int16_t getSampleI (int sample)
 Gets the I component of a given data sample. More...
 
int16_t getSampleQ (int sample)
 Gets the Q component of a given data sample. More...
 
std::string rawDataHex ()
 Gets the raw data in hex-string format. More...
 
std::string dump ()
 Gets a string dump of the contents of the data packet. More...
 

Detailed Description

Decodes a VITA 49 or I/Q data packet.

The Vita49Packet class is used to decode VITA 49 or raw I/Q data coming from an NDR-class radio.

This class is designed to be as flexible as possible in dealing with data streams, since each NDR-class radio varies in how it packages data streams.

Definition at line 37 of file Vita49Packet.h.

Constructor & Destructor Documentation

◆ Vita49Packet() [1/2]

Vita49Packet ( int  vitaType,
size_t  payloadSize,
size_t  vitaHeaderSize,
size_t  vitaTailSize,
bool  byteSwapped,
bool  iqSwapped,
unsigned char *  rawData = NULL,
size_t  rawDataLen = 0 
)

Constructs a Vita49Packet object.

Parameters
vitaTypeThe VITA 49 enable option value. The range of valid values depends on the radio, but 0 always disables VITA 49 formatting. In that case, the data format is raw I/Q.
payloadSizeThe VITA 49 or I/Q payload size for the radio, in bytes. If VITA 49 output is disabled, then this parameter provides the total size of all raw I/Q data transmitted in a single packet.
vitaHeaderSizeThe VITA 49 header size for the radio, in bytes. If VITA 49 output is disabled, then this parameter is ignored.
vitaTailSizeThe VITA 49 tail size for the radio, in bytes. If VITA 49 output is disabled, then this parameter is ignored.
byteSwappedWhether the bytes in the packet are byte-swapped with respect to the endianness employed by the host operating system.
iqSwappedWhether I and Q data in the payload are swapped.
rawDataA pointer to the buffer of raw data received from the radio.
rawDataLenThe length of the raw data buffer.

Definition at line 21 of file Vita49Packet.cpp.

◆ Vita49Packet() [2/2]

Vita49Packet ( const Vita49Packet src)

Copy constructor.

Parameters
srcThe object to copy.

Definition at line 283 of file Vita49Packet.cpp.

Member Function Documentation

◆ dump()

std::string dump ( )

Gets a string dump of the contents of the data packet.

Returns
A string describing the contents of the packet.

Definition at line 417 of file Vita49Packet.cpp.

◆ getSampleI()

int16_t getSampleI ( int  sample)

Gets the I component of a given data sample.

Parameters
sampleThe sample number (0-based).
Returns
The I component of the sample. This method will return 0 if the sample number is out of bounds.

Definition at line 378 of file Vita49Packet.cpp.

◆ getSampleQ()

int16_t getSampleQ ( int  sample)

Gets the Q component of a given data sample.

Parameters
sampleThe sample number (0-based).
Returns
The Q component of the sample. This method will return 0 if the sample number is out of bounds.

Definition at line 386 of file Vita49Packet.cpp.

◆ isVita49()

bool isVita49 ( ) const

Indicates whether the packet data is in VITA 49 format.

Returns
True if the data is VITA 49, False otherwise.

Definition at line 368 of file Vita49Packet.cpp.

◆ operator=()

Vita49Packet & operator= ( const Vita49Packet src)
virtual

Assignment operator.

Parameters
srcThe object to assign properties from.

Definition at line 327 of file Vita49Packet.cpp.

◆ rawDataHex()

std::string rawDataHex ( )
inline

Gets the raw data in hex-string format.

Returns
A hex string representing the raw data.

Definition at line 110 of file Vita49Packet.h.


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