SoDaRadio-5.0.3-master:8901fb5
|
This is a list of all the commands that can "do something" to one or more components in the SoDa radio. More...
#include <Command.hxx>
Public Member Functions | |
Command (CmdType _ct, CmdTarget _tgt) | |
Constructor for commands with no parameters. More... | |
Command (CmdType _ct, CmdTarget _tgt, int p0, int p1=0, int p2=0, int p3=0) | |
Constructor for commands with integer parameters. More... | |
Command (CmdType _ct, CmdTarget _tgt, double p0, double p1=0.0, double p2=0.0, double p3=0.0) | |
Constructor for commands with double float parameters. More... | |
Command (CmdType _ct, CmdTarget _tgt, const std::string &_str_arg, unsigned int _tag=0) | |
Constructor for commands with a string parameter. More... | |
Command (CmdType _ct, CmdTarget _tgt, const char *cp, unsigned int _tag=0) | |
Constructor for commands with a string parameter. More... | |
Command (const Command &cc) | |
Copy Constructor. More... | |
Command () | |
Constructor – create an empty command. More... | |
~Command () | |
Destructor. More... | |
std::string | toString () const |
return a string that displays the command More... | |
Public Member Functions inherited from SoDa::MBoxMessage | |
MBoxMessage () | |
void | setReaderCount (unsigned int rc) |
bool | readyToDie () |
bool | decReaderCount () |
bool | free (std::queue< MBoxMessage *> &free_list) |
void | setMBoxTag (void *tag) |
bool | checkMBoxTag (void *tag) |
Static Public Member Functions | |
static Command * | parseCommandString (std::string str) |
convert a string to a command More... | |
static int | getMaxStringLen () |
how long can a string parameter to a command be? More... | |
static void | initTables () |
setup maps to support parseCommandString and toString More... | |
Public Attributes | |
unsigned int | tag |
used to pair an int with a string or other param. More... | |
union { | |
int iparms [4] | |
integer parameters More... | |
double dparms [4] | |
double float parameters More... | |
char sparm [64] | |
a buffer holding the string More... | |
}; | |
CmdType | cmd |
the command type (SET, GET, REP) More... | |
CmdTarget | target |
the thing we're touching More... | |
int | id |
a sequential ID for each command – used in debugging and sequencing More... | |
char | parm_type |
is this a double, int, string? More... | |
Static Public Attributes | |
static int | command_sequence_number = 0 |
sequential ID applied to each command More... | |
static bool | table_needs_init = true |
if true, we need to call initTables() More... | |
static std::map< std::string, CmdTarget > | target_map_s2v |
mapping for parseCommandString More... | |
static std::map< CmdTarget, std::string > | target_map_v2s |
mapping for toString More... | |
This is a list of all the commands that can "do something" to one or more components in the SoDa radio.
The base class defines all the command types in an enum. Each command can take up to 4 double and 4 integer parameters. (This isn't very OO, but the intent is to keep the command packet format simple, stable, and universal.)
Definition at line 47 of file Command.hxx.
these are the possible audio filter bandwidths
Enumerator | |
---|---|
BW_100 | |
BW_500 | |
BW_2000 | |
BW_6000 | |
BW_PASS | |
BW_NULL |
Definition at line 483 of file Command.hxx.
Each command has a "target" state that it is meant to modify, query, or report.
Enumerator | |
---|---|
RX_TUNE_FREQ | Set the RX front end (1st LO, the 2nd IF LO), and the 3rd LO in a more-or-less optimal way to position the requested frequency at least 80 kHz above the target frequency. param is frequency as a double
|
RX_FE_FREQ | Set the RX front end 1st LO and the 2nd IF LO. The 1st LO is an analog synthesizer and the 2nd LO drives the digital down converter in the USRP FPGA. param is frequency as a double
|
RX_RETUNE_FREQ | Tune the 3rd LO, if the current FE frequency is such that the desired frequency is between RX_FE_FREQ + 50KHz and RX_FE_FREQ + 300KHz. Otherwise, promote this to an RX_TUNE_FREQ request. param is frequency as a double |
RX_LO3_FREQ | Tune the 3rd LO (in SoDa::USRPRX). param is frequency as a double |
TX_TUNE_FREQ | Set the TX front end (1st LO, the 2nd IF LO), and the 3rd LO in a more-or-less optimal way to position the requested frequency at least 80 kHz above the target frequency. param is frequency as a double
|
TX_FE_FREQ | Same effect as TX_TUNE_FREQ. param is frequency as a double |
TX_RETUNE_FREQ | Same effect as TX_TUNE_FREQ. param is frequency as a double |
RX_SAMP_RATE | Sample rate for RX is typically 600 KHz or better to allow a reasonable span for the waterfall and periodogram. It also gets us reasonably far away from the high noise region near the oscillators. param is a double |
TX_SAMP_RATE | Sample rate for TX needs to be fast enough for reasonable FM We set it to 625000 just because there doesn't seem to be much utility to go any slower. param is a double |
RX_ANT | RX ant choices are TX/RX, and RX2. param is a string |
TX_ANT | Not many choices for TX ant, just TX. param is a string |
RX_RF_GAIN | Set the RX front end attenuator/amp. gain param is a double 0.0 < gain < 40.0 |
TX_RF_GAIN | Set the TX final amplifier. gain param is a double 0.0 < gain < 100.0 |
RX_AF_GAIN | RX audio gain setting. gain param is a double actual gain factor is 10^(0.1*param - 50) |
RX_AF_SIDETONE_GAIN | RX audio gain for sidetone (CW) monitor. gain param is a double actual gain factor is 10^(0.1*param - 50) |
TX_AF_GAIN | TX mic gain. gain param is a double actual gain factor is 10^(0.1*param - 50) |
TX_STATE | turn transmitter on and off. param is integer 0 disables TX, 3 enables TX |
RX_STATE | Ignored for now. |
TX_BEACON | TX Carrier Control – send a dead carrier. param is integer – nonzero enables beacon mode.
|
TX_CW_TEXT | TX CW text control – a buffer of up to 8 characters. param is a string of 8 chars
|
TX_CW_SPEED | Set speed of CW generator. param is integer in WPM
|
TX_CW_FLUSHTEXT | Flush outstanding CW text strings from pending buffer. REP – iparam[0] is the character count for the last character dropped from the buffer. |
TX_CW_MARKER | Put a marker in the CW text stream, report its "passing". parameter is integer tag that will be reported in a TX_CW_MARKER REP
|
TX_CW_EMPTY | Report when CW TX envelope buffer was empty (cmd enables report) no parameter |
RX_MODE | Set the modulation mode for the receive chain. param integer – (int) conversion of SoDa::Command::ModulationType
|
TX_MODE | Set the modulation mode for the transmit chain. param integer – (int) conversion of SoDa::Command::ModulationType
|
RX_BW | tweak the AF chain – filter settings |
RBW | tweak the waterfall display parameters like resolution bandwidth |
SPEC_CENTER_FREQ | the center frequency (command from GUI) |
SPEC_RANGE_LOW | low spectrum frequency range |
SPEC_RANGE_HI | high spectrum frequency range |
SPEC_STEP | freqency step |
SPEC_BUF_LEN | number of samples in the buffer. |
SPEC_DIMS | all spec info in one call, cf, span, and buflen |
SPEC_AVG_WINDOW | how many FFT samples contribute to a spectrum report |
SPEC_UPDATE_RATE | how many FFT samples between spectrum reports |
CLOCK_SOURCE | The master clock oscillator source Reference oscilator selector set to 1 for external, 0 for internal rep = 1 for internal lock, 0 for unlock 3 for external lock, 2 for external unlocked. |
LO_CHECK | This is an LO check command - use it for finding the actual microwave LO frequency. if the parameter is > 0, set the rx_lo to the dparm arg, and remember that we're in LOcheck mode. |
LO_OFFSET | this is a GET/REP command – BaseBandRX takes FFT centered around 0 and reports largest peak within 50KHz. |
RX_AF_FILTER | Audio Filter. |
RX_AF_FILTER_SHAPE | Audio Filter. |
GPS_LATLON | Report LAT and LON from GPS receiver. params are double Latitude, Longitude forms: REP |
GPS_UTC | Report UTC (time) from GPS receiver. params are int HH, MM, SS forms: REP |
GPS_LOCK | Report when GPS is locked. param is int – 0 for unlocked, 1 for locked forms: REP |
SDR_VERSION | Report the SDR (SoDa server program) version info. string param forms: REP |
DBG_REP | Initiate a debug dump. param (int) ordinal of UnitSelector forms: GET |
HWMB_REP | Report the motherboard name (the model name of the USRP) rep – string param forms: GET, REP |
STOP | On receipt of a STOP command, all threads should exit their run loop. no param forms: SET |
TVRT_LO_ENABLE | 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. Ignore this command unless the radio is a B210. forms: SET |
TVRT_LO_DISABLE | On receipt of a TVRT_LO_DISABLE command, turn the LO output on TX2 off. Ignore this command unless the radio is a B210. no param forms: SET |
TVRT_LO_CONFIG | On receipt of a TVRT_LO_CONFIG command , set the TX2 channel frequency to dparam[0] and the TX2 output gain to dparam[1]. Ignore this command unless the radio is a B210. param (double) output frequency param (double) output gain setting forms: SET, REP |
STATUS_MESSAGE | The STATUS_MESSAGE carries a payload of up to 64 characters. These will be displayed in a log window for the GUI. param char[64] forms: REP |
TX_AUDIO_IN | Select the transmit chain audio input (for SSB, AM, and FM) |
TX_AUDIO_FILT_ENA | Enable the TX audio bandpass filter (limit to 2.5 kHz) for SSB/AM/FM. |
RX_GAIN_RANGE | Report min max RX Gain setting (dparm[0,1] = min, max) |
TX_GAIN_RANGE | Report min max TX Gain setting (dparm[0,1] = min, max) |
RX_ANT_NAME | Report RX antenna choice (asciiz string, uint tag) |
TX_ANT_NAME | Report TX antenna choice (asciiz string, uint tag) |
MOD_SEL_ENTRY | Report a string/name pair for modulation mode. |
AF_FILT_ENTRY | Report a string/name pair for AF filter bandwidth. |
INIT_SETUP_COMPLETE | indicate to GUI that we've sent all the initial configuration information |
CW_CHAR_SENT | send character count from start-of-time each time we send a character. sparm[0] is the sent character, tag is count from start |
NULL_CMD | No comment. |
Definition at line 58 of file Command.hxx.
Commands are of the form, SET, GET, or REPort some parameter.
Enumerator | |
---|---|
SET | |
GET | |
REP | |
NONE |
Definition at line 53 of file Command.hxx.
modulation selector targets take one of these values
Enumerator | |
---|---|
LSB | |
USB | |
CW_U | |
CW_L | |
AM | |
WBFM | |
NBFM |
Definition at line 478 of file Command.hxx.
a selector to identify the Audio TX input (MIC, NOISE...)
Enumerator | |
---|---|
MIC | |
NOISE |
Definition at line 493 of file Command.hxx.
a selector to identify a particular unit for debug reports
Enumerator | |
---|---|
BaseBandRX | |
BaseBandTX | |
RFRX | |
RFTX | |
CWTX | |
CTRL |
Definition at line 488 of file Command.hxx.
Constructor for commands with no parameters.
_ct | the command type (SET, GET, REPort) |
_tgt | the state that we're setting, getting, reporting |
Definition at line 501 of file Command.hxx.
References cmd, command_sequence_number, parm_type, and target.
|
inline |
Constructor for commands with integer parameters.
_ct | the command type (SET, GET, REPort) |
_tgt | the state that we're setting, getting, reporting |
p0 | first integer parameter |
p1 | second integer parameter |
p2 | third integer parameter |
p3 | fourth integer parameter |
Definition at line 519 of file Command.hxx.
References cmd, command_sequence_number, iparms, parm_type, and target.
|
inline |
Constructor for commands with double float parameters.
_ct | the command type (SET, GET, REPort) |
_tgt | the state that we're setting, getting, reporting |
p0 | first double float parameter |
p1 | second double float parameter |
p2 | third double float parameter |
p3 | fourth double float parameter |
Definition at line 545 of file Command.hxx.
References cmd, command_sequence_number, dparms, parm_type, and target.
|
inline |
Constructor for commands with a string parameter.
_ct | the command type (SET, GET, REPort) |
_tgt | the state that we're setting, getting, reporting |
_str_arg | the string we're passing |
_tag | an integer tag to associate with the string. |
Definition at line 569 of file Command.hxx.
References cmd, command_sequence_number, parm_type, sparm, tag, and target.
|
inline |
Constructor for commands with a string parameter.
_ct | the command type (SET, GET, REPort) |
_tgt | the state that we're setting, getting, reporting |
cp | the asciiz string we're passing |
_tag | an integer tag to associate with the string. |
Definition at line 593 of file Command.hxx.
References cmd, command_sequence_number, parm_type, sparm, tag, and target.
|
inline |
Copy Constructor.
cc | the command we're copying |
Definition at line 613 of file Command.hxx.
References cmd, command_sequence_number, dparms, iparms, parm_type, sparm, and target.
|
inline |
Constructor – create an empty command.
Definition at line 632 of file Command.hxx.
References cmd, iparms, NONE, NULL_CMD, parm_type, tag, and target.
Referenced by parseCommandString().
|
inline |
Destructor.
Definition at line 643 of file Command.hxx.
References parseCommandString(), and toString().
|
inlinestatic |
how long can a string parameter to a command be?
Definition at line 664 of file Command.hxx.
Referenced by SoDa::CWTX::enqueueText(), and GUISoDa::Listener::sendCW().
|
static |
setup maps to support parseCommandString and toString
Definition at line 39 of file Command.cxx.
References AF_FILT_ENTRY, CLOCK_SOURCE, CW_CHAR_SENT, DBG_REP, HWMB_REP, INIT_SETUP_COMPLETE, LO_CHECK, LO_OFFSET, MOD_SEL_ENTRY, RBW, RX_AF_FILTER, RX_AF_FILTER_SHAPE, RX_AF_GAIN, RX_AF_SIDETONE_GAIN, RX_ANT, RX_ANT_NAME, RX_BW, RX_FE_FREQ, RX_GAIN_RANGE, RX_LO3_FREQ, RX_MODE, RX_RETUNE_FREQ, RX_RF_GAIN, RX_SAMP_RATE, RX_STATE, RX_TUNE_FREQ, SDR_VERSION, SPEC_AVG_WINDOW, SPEC_BUF_LEN, SPEC_CENTER_FREQ, SPEC_DIMS, SPEC_RANGE_HI, SPEC_RANGE_LOW, SPEC_STEP, SPEC_UPDATE_RATE, STATUS_MESSAGE, STOP, table_needs_init, target_map_s2v, target_map_v2s, TVRT_LO_CONFIG, TVRT_LO_DISABLE, TVRT_LO_ENABLE, TX_AF_GAIN, TX_ANT, TX_ANT_NAME, TX_AUDIO_FILT_ENA, TX_AUDIO_IN, TX_BEACON, TX_CW_FLUSHTEXT, TX_CW_SPEED, TX_CW_TEXT, TX_FE_FREQ, TX_GAIN_RANGE, TX_MODE, TX_RETUNE_FREQ, TX_RF_GAIN, TX_SAMP_RATE, TX_STATE, and TX_TUNE_FREQ.
Referenced by parseCommandString(), and toString().
|
static |
convert a string to a command
str | the string to be parsed |
Definition at line 171 of file Command.cxx.
References Command(), initTables(), SET, table_needs_init, and target_map_s2v.
Referenced by ~Command().
std::string SoDa::Command::toString | ( | ) | const |
return a string that displays the command
Definition at line 230 of file Command.cxx.
References cmd, dparms, GET, initTables(), iparms, parm_type, REP, SET, sparm, table_needs_init, target, and target_map_v2s.
Referenced by SoDa::USRPCtrl::execSetCommand(), SoDa::UI::run(), SoDa::TestServer::run(), and ~Command().
union { ... } |
CmdType SoDa::Command::cmd |
the command type (SET, GET, REP)
Definition at line 672 of file Command.hxx.
Referenced by Command(), SoDa::USRPRX::execCommand(), SoDa::USRPCtrl::execCommand(), SoDa::SoDaThread::execCommand(), SoDa::USRPCtrl::execSetCommand(), GUISoDa::Listener::processCmd(), SoDa::UI::run(), and toString().
|
static |
sequential ID applied to each command
Definition at line 678 of file Command.hxx.
Referenced by Command().
double SoDa::Command::dparms[4] |
double float parameters
Definition at line 669 of file Command.hxx.
Referenced by Command(), SoDa::UI::execRepCommand(), SoDa::USRPRX::execSetCommand(), SoDa::BaseBandTX::execSetCommand(), SoDa::UI::execSetCommand(), SoDa::BaseBandRX::execSetCommand(), SoDa::USRPCtrl::execSetCommand(), GUISoDa::Listener::handleREP(), and toString().
int SoDa::Command::id |
a sequential ID for each command – used in debugging and sequencing
Definition at line 675 of file Command.hxx.
int SoDa::Command::iparms[4] |
integer parameters
Definition at line 668 of file Command.hxx.
Referenced by Command(), SoDa::BaseBandRX::execGetCommand(), SoDa::USRPRX::execSetCommand(), SoDa::CWTX::execSetCommand(), SoDa::BaseBandTX::execSetCommand(), SoDa::UI::execSetCommand(), SoDa::USRPTX::execSetCommand(), SoDa::BaseBandRX::execSetCommand(), SoDa::USRPCtrl::execSetCommand(), GUISoDa::Listener::handleREP(), and toString().
char SoDa::Command::parm_type |
is this a double, int, string?
Definition at line 676 of file Command.hxx.
Referenced by Command(), and toString().
char SoDa::Command::sparm[64] |
a buffer holding the string
Definition at line 670 of file Command.hxx.
Referenced by Command(), SoDa::CWTX::execSetCommand(), SoDa::USRPCtrl::execSetCommand(), GUISoDa::Listener::handleREP(), and toString().
|
static |
if true, we need to call initTables()
Definition at line 680 of file Command.hxx.
Referenced by initTables(), parseCommandString(), and toString().
unsigned int SoDa::Command::tag |
used to pair an int with a string or other param.
Definition at line 666 of file Command.hxx.
Referenced by Command(), and GUISoDa::Listener::handleREP().
CmdTarget SoDa::Command::target |
the thing we're touching
Definition at line 673 of file Command.hxx.
Referenced by Command(), SoDa::CWTX::execGetCommand(), SoDa::USRPTX::execGetCommand(), SoDa::UI::execGetCommand(), SoDa::BaseBandRX::execGetCommand(), SoDa::USRPCtrl::execGetCommand(), SoDa::CWTX::execRepCommand(), SoDa::UI::execRepCommand(), SoDa::USRPTX::execRepCommand(), SoDa::USRPCtrl::execRepCommand(), SoDa::USRPRX::execSetCommand(), SoDa::CWTX::execSetCommand(), SoDa::BaseBandTX::execSetCommand(), SoDa::UI::execSetCommand(), SoDa::USRPTX::execSetCommand(), SoDa::BaseBandRX::execSetCommand(), SoDa::USRPCtrl::execSetCommand(), GUISoDa::Listener::handleGET(), GUISoDa::Listener::handleREP(), GUISoDa::Listener::handleSET(), SoDa::UI::run(), SoDa::GPSmon::run(), SoDa::TestServer::run(), SoDa::CWTX::run(), SoDa::USRPRX::run(), SoDa::USRPTX::run(), SoDa::BaseBandTX::run(), SoDa::USRPCtrl::run(), SoDa::BaseBandRX::run(), and toString().
|
static |
mapping for parseCommandString
Definition at line 681 of file Command.hxx.
Referenced by initTables(), and parseCommandString().
|
static |
mapping for toString
Definition at line 682 of file Command.hxx.
Referenced by initTables(), and toString().