SoDaRadio-12.2.0-cut_dependencies:6c82803
Loading...
Searching...
No Matches
SoDaCLI Namespace Reference

Classes

class  AudioInThread
 Captures microphone audio and sends it to SoDaServer. More...
class  AudioOutThread
 Receives demodulated audio from SoDaServer and plays it. More...
class  AudioToneThread
 Generates a 440 Hz sine wave and plays it through an audio output device. More...

Functions

QAudioDevice findOutputDevice (const std::string &name)
 Find an audio output device by name.
QAudioDevice findInputDevice (const std::string &name)
 Find an audio input device by name.
void listAudioDevices ()
 Print all available audio input and output devices to stdout.
SoDa::CommandPtr parseCommand (const std::string &verb, const std::string &rest)
 Parse an upper-cased verb ("SET","GET","REP") and the rest of the input line into a SoDa::Command.
bool sendCommand (SoDa::UD::ClientSocket *sock, SoDa::CommandPtr cmd, std::ofstream &log)
 Transmit a command via the command socket and log it.
int receiveCommands (SoDa::UD::ClientSocket *sock, std::ofstream &log)
 Drain all pending inbound commands from the server socket, print and log each one.

Function Documentation

◆ findInputDevice()

QAudioDevice SoDaCLI::findInputDevice ( const std::string & name)

Find an audio input device by name.

Same matching rules as findOutputDevice.

Parameters
namePartial or full device description, or "default".
Returns
Matching QAudioDevice.

◆ findOutputDevice()

QAudioDevice SoDaCLI::findOutputDevice ( const std::string & name)

Find an audio output device by name.

Matches case-insensitively against the device description. Returns the system default if name is "default", empty, or not found.

Parameters
namePartial or full device description, or "default".
Returns
Matching QAudioDevice.

◆ listAudioDevices()

void SoDaCLI::listAudioDevices ( )

Print all available audio input and output devices to stdout.

Each device is listed with its direction (IN/OUT) and description. The default device for each direction is marked with an asterisk.

◆ parseCommand()

SoDa::CommandPtr SoDaCLI::parseCommand ( const std::string & verb,
const std::string & rest )

Parse an upper-cased verb ("SET","GET","REP") and the rest of the input line into a SoDa::Command.

Parameter type is auto-detected:

  • Known enum names (USB, TX_ON_1, EXTERNAL, …) → integer
  • Values containing '.', 'e', or 'E' → double
  • Anything parseable as a plain integer → integer
  • Remaining text → string

An explicit single-character type indicator (I / D / S, case-insensitive) may precede the value to force a particular encoding.

Parameters
verbUpper-cased command verb.
restEverything on the line after the verb.
Returns
Shared pointer to the new command, or nullptr on error.

◆ receiveCommands()

int SoDaCLI::receiveCommands ( SoDa::UD::ClientSocket * sock,
std::ofstream & log )

Drain all pending inbound commands from the server socket, print and log each one.

Parameters
sockConnected ClientSocket to SoDaServer.
logOpen log stream.
Returns
number of messages received (≥0), or -1 if the server is gone.

◆ sendCommand()

bool SoDaCLI::sendCommand ( SoDa::UD::ClientSocket * sock,
SoDa::CommandPtr cmd,
std::ofstream & log )

Transmit a command via the command socket and log it.

Parameters
sockConnected ClientSocket to SoDaServer.
cmdCommand to send.
logOpen log stream.
Returns
true on success, false if the socket reported an error.