![]() |
libcyberradio
22.01.24
|
A generic VITA 49-compatible I/Q data source object. More...
#include <VitaIqSource.h>
Public Member Functions | |
| VitaIqSource (const std::string &name="VitaIqSource", int vita_type=0, size_t payload_size=8192, size_t vita_header_size=0, size_t vita_tail_size=0, bool byte_swapped=false, bool iq_swapped=false, const std::string &host="0.0.0.0", unsigned short port=0, bool debug=false) | |
| Creates a VitaIqSource object. More... | |
| virtual | ~VitaIqSource () |
| Destroys a vita_iq_source object. | |
| virtual int | getPackets (int noutput_items, Vita49PacketVector &output_items) |
| Gets VITA 49 or I/Q data packets. More... | |
| virtual int | getPacketSize () const |
| Gets the VITA 49 or I/Q packet size. More... | |
| virtual int | getPacketsPayloadData (int noutput_items, void *buff) |
| Gets VITA 49 or I/Q data packets. More... | |
| bool | isByteSwapped () const |
| Gets the byte-swapping state. More... | |
| bool | isIqSwapped () const |
| Gets the I/Q-swapping state. More... | |
| size_t | getPayloadSize () const |
| Gets the payload size. More... | |
| size_t | getVitaHeaderSize () const |
| Gets the VITA 49 frame header size. More... | |
| size_t | getVitaTailSize () const |
| Gets the VITA 49 frame trailer size. More... | |
| int | getVitaType () const |
| Gets the VITA type. More... | |
| virtual void | setDebugName (const std::string &debug_name) |
| Sets the debug name for this object. More... | |
| virtual void | setDebugFile (FILE *debug_fp) |
| Sets the debug file pointer for this object. More... | |
| virtual void | setDebugTimeFormat (const std::string &debug_timefmt) |
| Sets the debug time format for this object. More... | |
| virtual int | debug (const char *format,...) |
| Outputs debug information. More... | |
| virtual const char * | debugBool (bool x) |
| Gets a debug output string for a Boolean value. More... | |
| virtual bool | isDebug () const |
| Gets whether this object produces debug output. More... | |
| virtual std::string | getDebugName () const |
| Gets the debug name for this object. More... | |
| virtual std::string | rawString (const std::string &data) |
| Gets a "raw" string representation of a given data string. More... | |
A generic VITA 49-compatible I/Q data source object.
The vita_iq_source object provides VITA 49 or raw I/Q data coming from an NDR-class radio via UDP.
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 44 of file VitaIqSource.h.
| VitaIqSource | ( | const std::string & | name = "VitaIqSource", |
| int | vita_type = 0, |
||
| size_t | payload_size = 8192, |
||
| size_t | vita_header_size = 0, |
||
| size_t | vita_tail_size = 0, |
||
| bool | byte_swapped = false, |
||
| bool | iq_swapped = false, |
||
| const std::string & | host = "0.0.0.0", |
||
| unsigned short | port = 0, |
||
| bool | debug = false |
||
| ) |
Creates a VitaIqSource object.
| name | An identifying name for this source object. |
| vita_type | The 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. |
| payload_size | The 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. |
| vita_header_size | The VITA 49 header size for the radio, in bytes. If VITA 49 output is disabled, then this parameter is ignored. |
| vita_tail_size | The VITA 49 tail size for the radio, in bytes. If VITA 49 output is disabled, then this parameter is ignored. |
| byte_swapped | Whether the bytes in the packet are swapped (with respect to the endianness employed by the host operating system). |
| iq_swapped | Whether I and Q data in the payload are swapped. |
| host | The IP address or host name to bind listening UDP ports on. Specify this as "0.0.0.0" to listen on all network interfaces. |
| port | The UDP port number to listen on. |
| debug | Whether the block should produce debug output. Defaults to False. |
Definition at line 21 of file VitaIqSource.cpp.
|
virtualinherited |
Outputs debug information.
This method follows the same semantics as printf(). Output is preceded by a timestamp and the name of the object, if provided.
| format | The printf()-style format string. |
| ... | Comma-separated list of arguments to print. Note that these need to be arguments that can be supported natively through printf(). |
Definition at line 95 of file Debuggable.cpp.
|
virtualinherited |
Gets a debug output string for a Boolean value.
| x | Boolean value |
Definition at line 126 of file Debuggable.cpp.
|
virtualinherited |
Gets the debug name for this object.
Definition at line 138 of file Debuggable.cpp.
|
virtual |
Gets VITA 49 or I/Q data packets.
| noutput_items | Number of packets requested. |
| output_items | Vector of output packets. |
Definition at line 61 of file VitaIqSource.cpp.
|
virtual |
Gets the VITA 49 or I/Q packet size.
Definition at line 154 of file VitaIqSource.cpp.
|
virtual |
Gets VITA 49 or I/Q data packets.
| noutput_items | Number of samples requested. |
| output_items | Vector of output samples of complext data samples. |
Definition at line 115 of file VitaIqSource.cpp.
| size_t getPayloadSize | ( | ) | const |
| size_t getVitaHeaderSize | ( | ) | const |
Gets the VITA 49 frame header size.
Definition at line 174 of file VitaIqSource.cpp.
| size_t getVitaTailSize | ( | ) | const |
Gets the VITA 49 frame trailer size.
Definition at line 179 of file VitaIqSource.cpp.
| int getVitaType | ( | ) | const |
Gets the VITA type.
Supported VITA types vary by radio, but VITA type 0 always represents raw (unframed) I/Q data.
Definition at line 184 of file VitaIqSource.cpp.
| bool isByteSwapped | ( | ) | const |
Gets the byte-swapping state.
Definition at line 159 of file VitaIqSource.cpp.
|
virtualinherited |
Gets whether this object produces debug output.
Definition at line 133 of file Debuggable.cpp.
| bool isIqSwapped | ( | ) | const |
Gets the I/Q-swapping state.
Definition at line 164 of file VitaIqSource.cpp.
|
virtualinherited |
Gets a "raw" string representation of a given data string.
"Raw" string representations mimic Python string representations. Whitespace characters are denoted by backslash representations ("\\r", "\\n", "\\t", "\\v", "\\f"), while other non-printable characters are represented with hex representation ("\\x00", etc.)
| data | Data string |
Definition at line 143 of file Debuggable.cpp.
|
virtualinherited |
Sets the debug file pointer for this object.
| debug_fp | File to send debug output to. |
Definition at line 81 of file Debuggable.cpp.
|
virtualinherited |
Sets the debug name for this object.
Use this method to set unique debug names for objects of the same class for easy differentiation.
| debug_name | Name for identifying this object in debug output. |
Definition at line 74 of file Debuggable.cpp.
|
virtualinherited |
Sets the debug time format for this object.
| debug_timefmt | Format string for displaying timestamp, as compatible with strftime(). If this is an empty string, don't display a timestamp. |
Definition at line 88 of file Debuggable.cpp.