180 std::istringstream iss(str);
182 std::string cmd_str, targ_str, typ_str, val_s;
189 cmd_str =
""; targ_str =
"";
190 iss >> cmd_str >> targ_str;
192 if(cmd_str ==
"SET") {
195 std::cerr <<
"Command target was [" << targ_str <<
"] can't parse that." << std::endl;
200 switch (typ_str[0]) {
203 return new Command(ct, targ, val_i);
207 return new Command(ct, targ, val_d);
211 return new Command(ct, targ, val_s);
214 std::cerr <<
"Can't parse dtype string [" << typ_str <<
"]" << std::endl;
218 else if(cmd_str ==
"GET") {
220 else if(cmd_str ==
"REP") {
223 std::cerr <<
"Can't parse [" << str <<
"] first token was [" << cmd_str <<
"]" << std::endl;
236 std::ostringstream oss;
238 case SET: oss <<
"SET ";
240 case GET: oss <<
"GET ";
242 case REP: oss <<
"REP ";
252 oss <<
" [?" <<
target <<
"?] ";
259 oss <<
" I " <<
iparms[0];
262 oss <<
" D " <<
dparms[0];
265 oss <<
" S \"" <<
sparm <<
"\"";
tweak the waterfall display parameters like resolution bandwidth
On receipt of a TVRT_LO_DISABLE command, turn the LO output on TX2 off.
Not many choices for TX ant, just TX.
Enable the TX audio bandpass filter (limit to 2.5 kHz) for SSB/AM/FM.
low spectrum frequency range
turn transmitter on and off.
Sample rate for RX is typically 600 KHz or better to allow a reasonable span for the waterfall and pe...
Command()
Constructor – create an empty command.
Sample rate for TX needs to be fast enough for reasonable FM We set it to 625000 just because there d...
Set the TX final amplifier.
Set the RX front end attenuator/amp.
Set the modulation mode for the receive chain.
This is an LO check command - use it for finding the actual microwave LO frequency.
int iparms[4]
integer parameters
Report min max TX Gain setting (dparm[0,1] = min, max)
Set the RX front end (1st LO, the 2nd IF LO), and the 3rd LO in a more-or-less optimal way to positio...
Set the modulation mode for the transmit chain.
Report the motherboard name (the model name of the USRP)
all spec info in one call, cf, span, and buflen
CmdType
Commands are of the form, SET, GET, or REPort some parameter.
CmdTarget target
the thing we're touching
TX Carrier Control – send a dead carrier.
Report a string/name pair for modulation mode.
indicate to GUI that we've sent all the initial configuration information
Report min max RX Gain setting (dparm[0,1] = min, max)
static int command_sequence_number
sequential ID applied to each command
Flush outstanding CW text strings from pending buffer.
On receipt of a STOP command, all threads should exit their run loop.
static std::map< CmdTarget, std::string > target_map_v2s
mapping for toString
This is a list of all the commands that can "do something" to one or more components in the SoDa radi...
how many FFT samples contribute to a spectrum report
Same effect as TX_TUNE_FREQ.
char sparm[64]
a buffer holding the string
the center frequency (command from GUI)
The STATUS_MESSAGE carries a payload of up to 64 characters.
Set the RX front end 1st LO and the 2nd IF LO.
Report TX antenna choice (asciiz string, uint tag)
char parm_type
is this a double, int, string?
TX CW text control – a buffer of up to 8 characters.
RX ant choices are TX/RX, and RX2.
CmdTarget
Each command has a "target" state that it is meant to modify, query, or report.
static bool table_needs_init
if true, we need to call initTables()
CmdType cmd
the command type (SET, GET, REP)
double dparms[4]
double float parameters
static std::map< std::string, CmdTarget > target_map_s2v
mapping for parseCommandString
how many FFT samples between spectrum reports
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.
send character count from start-of-time each time we send a character.
Tune the 3rd LO, if the current FE frequency is such that the desired frequency is between RX_FE_FREQ...
Set speed of CW generator.
Report the SDR (SoDa server program) version info.
tweak the AF chain – filter settings
Tune the 3rd LO (in SoDa::USRPRX).
Set the TX front end (1st LO, the 2nd IF LO), and the 3rd LO in a more-or-less optimal way to positio...
static Command * parseCommandString(std::string str)
convert a string to a command
RX audio gain for sidetone (CW) monitor.
number of samples in the buffer.
Report a string/name pair for AF filter bandwidth.
Report RX antenna choice (asciiz string, uint tag)
high spectrum frequency range
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.
static void initTables()
setup maps to support parseCommandString and toString
On receipt of a TVRT_LO_CONFIG command , set the TX2 channel frequency to dparam[0] and the TX2 outpu...
Same effect as TX_TUNE_FREQ.
std::string toString() const
return a string that displays the command
this is a GET/REP command – BaseBandRX takes FFT centered around 0 and reports largest peak within 5...
Select the transmit chain audio input (for SSB, AM, and FM)