30 #include <uhd/utils/safe_main.hpp> 31 #include <uhd/utils/thread_priority.hpp> 32 #include <uhd/usrp/multi_usrp.hpp> 34 #include <sys/types.h> 61 stream_args =
new uhd::stream_args_t(
"fc32",
"sc16");
63 if(0 && (
usrp->get_tx_num_channels() > 1)) {
65 debugMsg(
"This radio is transverter LO capable");
71 debugMsg(
"This radio is NOT transverter LO capable");
106 zero_buf[i] = std::complex<float>(0.0, 0.0);
107 const_buf[i] = std::complex<float>(1.0, 0.0);
115 uhd::set_thread_priority_safe();
121 debugMsg(
"Creating tx streamer.\n");
125 bool exitflag =
false;
128 std::vector<std::complex<float> *> buffers(
LO_capable ? 2 : 1);
131 bool didwork =
false;
150 md.start_of_burst =
false;
168 md.start_of_burst =
false;
191 md.start_of_burst =
false;
214 std::complex<float> c;
216 for(i = 0; i < env_len; i++) {
234 md.start_of_burst =
true;
235 md.end_of_burst =
false;
236 md.has_time_spec =
false;
243 md.end_of_burst =
true;
274 if((cmd->
iparms[0] & 0x2) != 0) {
uhd::stream_args_t * stream_args
On receipt of a TVRT_LO_DISABLE command, turn the LO output on TX2 off.
float * zero_env
envelope for dead silence
void setPhaseIncr(double _pi)
set the phase increment per step for the oscillator (1/freq)
The Thread baseclass for all SoDa thread objects.
void debugMsg(const std::string &msg, unsigned int threshold=1)
turn transmitter on and off.
T * get(unsigned int subscriber_id)
USRPTX(Params *params, uhd::usrp::multi_usrp::sptr _usrp, DatMBox *_tx_stream, DatMBox *_cw_env_stream, CmdMBox *_cmd_stream)
Constructor for RF Transmit/modulator process.
void setCWFreq(bool usb, double freq)
set the CW tone frequency to generate an IQ stream
bool LO_capable
if true, this hardware model supports LO config
bool flush(unsigned int subscriber_id)
flush all items from this mailbox for this subscriber
SoDa::Command::ModulationType tx_modulation
type of transmit modulation (CW_U,CW_L,USB,LSB...)
int iparms[4]
integer parameters
Set the modulation mode for the transmit chain.
Report when CW TX envelope buffer was empty (cmd enables report)
This class handles command line parameters and built-ins.
DatMBox * tx_stream
transmit audio stream
void doCW(std::complex< float > *out, float *envelope, unsigned int env_len)
given a keying envelope, impose it on the CW tone
CmdTarget target
the thing we're touching
bool beacon_mode
if true, we're transmitting a steady carrier
TX Carrier Control – send a dead carrier.
std::complex< float > stepOscCF()
step the oscillator and produce a complex float result
void execGetCommand(Command *cmd)
execute GET commands from the command channel
DatMBox * cw_env_stream
envelope stream from text-to-CW converter (CW unit)
std::complex< float > * zero_buf
zero signal envelope to fill in end of transmit stream
unsigned int tx_buffer_size
size of buffer going to USRP
void execSetCommand(Command *cmd)
handle SET commands from the command channel
unsigned int cw_subs
subscription handle for cw envelope stream (from CW unit)
unsigned int getRFBufferSize() const
On receipt of a STOP command, all threads should exit their run loop.
float * getFloatBuf()
Return a pointer to the storage buffer of floats.
unsigned int tx_subs
subscription handle for transmit audio stream (from BaseBandTX)
std::complex< float > * getComplexBuf()
Return a pointer to the storage buffer of complex floats.
QuadratureOscillator CW_osc
CW tone IQ oscillator.
This is a list of all the commands that can "do something" to one or more components in the SoDa radi...
void transmitSwitch(bool tx_on)
start/stop transmit stream
float * beacon_env
steady constant amplitude envelope
void execRepCommand(Command *cmd)
handle Report commands from the command channel
uhd::usrp::multi_usrp::sptr usrp
the radio.
ModulationType
modulation selector targets take one of these values
std::complex< float > * cw_buf
CW modulated envelope to send to USRP.
void run()
USRPTX run loop: handle commands, and modulate the tx carrier.
unsigned int cmd_subs
subscription handle for command stream
double getTXRate() const
TX rate will always be 625K.
std::complex< float > * const_buf
envelope for dead silence
float cw_env_amplitude
used to set CW output envelope, constant at 0.7
double tx_sample_rate
sample rate for buffer going to USRP (UHD)
unsigned int getComplexLen()
Return the number of complex float values in this buffer.
bool tx_enabled
if true, we're transmitting.
bool LO_configured
if true, the LO has had its gain/freq set.
void getTXStreamer()
setup transmit streamer.
On receipt of a TVRT_LO_ENABLE command dump a perpetual constant IF stream of (1.0, 0.0) into the tx2 channel to get a steady output.
bool waiting_to_run_dry
When set, we should send out a report when we run out of CW buffer.
On receipt of a TVRT_LO_CONFIG command , set the TX2 channel frequency to dparam[0] and the TX2 outpu...
bool LO_enabled
if true, we're in local transverter mode
uhd::tx_metadata_t md
metadata describing USRP transmit buffer
CmdMBox * cmd_stream
command stream
void execCommand(Command *cmd)
Execute (dispatch) a message removed from the command stream to one of the basic Command handler func...
uhd::tx_streamer::sptr tx_bits
USRP (UHD) transmit stream handle.