5#ifndef PICOSCENES_PLATFORM_VIRTUALSDRFRONTEND_HXX
6#define PICOSCENES_PLATFORM_VIRTUALSDRFRONTEND_HXX
15 int32_t
transmitSignals(
const std::vector<const void*>& signals, int64_t bufferLength,
double postfixDuration)
override {
30 return std::tuple<double, double, double>();
35 int setChannelAndBandwidth(std::optional<double> control, std::optional<double> bw, std::optional<double> center)
override {
44 void applyPreset(
const std::string& presetName,
bool skipChangeRate)
override {
46 std::string upperPresetName = boost::to_upper_copy(presetName);
50 throw std::invalid_argument(fmt::format(
"Preset '{}' is not supported by the current USRP device type.", presetName));
54 const auto& preset = FrontEndModePreset::getPresetMap().at(upperPresetName);
57 if (preset->txCBW.has_value()) {
63 if (preset->rxCBW.has_value()) {
127 void setRxGain(
const double rxGainV, uint8_t channel)
override {
167 return std::chrono::system_clock::now().time_since_epoch().count();
205 ChannelBandwidthEnum
rxCBW = ChannelBandwidthEnum::CBW_20;
#define LoggingService_Frontend_info_printf(...)
std::string referredInterfaceName
the user specified frontend name
PicoScenesFrameTxParameters userSpecifiedTxParameters
user-specified Tx parameters
const std::string & getReferredInterfaceName() const
Get the user-specified frontend name.
The shared abstract frontend for SDR devices only.
void setRxChannelBandwidthMode(ChannelBandwidthEnum rxCbw) override
Set the CBW value for Wi-Fi baseband decoder, invoked by "--rx-cbw" option.
void setTxResampleRatio(double txResampleRatioV) override
Set Tx signal resample ratio.
double getSamplingRate() override
Get the baseband sampling rate.
void setRxResampleRatio(double rxResampleRatioV) override
Set the Rx signal rasample ratio.
uint8_t getRxChainMask() override
Get Rx chain mask.
uint8_t getTxChainMask() override
Get the Tx chain mask.
void setTxSamplingRate(double txRate) override
uint16_t getChannelFlags() override
Get the old ChannelFlags descriptor.
std::tuple< double, double, double > getChannelAndBandwidth() override
Get the <contorlfreq-bandwidth-centerfreq> channel parameter.
void setRxGain(const double rxGainV) override
Set the total Rx gain. However, currently only QCA9300 and SDR frontend support this method.
static std::shared_ptr< VirtualSDRFrontEnd > getInstance(const std::string &referredInterfaceName)
ChannelBandwidthEnum rxCBW
double getTxpower() override
get the transmission power (Tx power)
void setTimeSource(const std::string &timeSourceV) override
Set the timing source. For USRP, it can be "external", "mimo", "internal".
double getRxSamplingRate() override
bool supportAGC() override
void setFilterBandwidth(const double bw) override
Set the hardware frontend filter bandwidth.
void setMasterClockRate(const double masterClockRateV) override
Set the USRP master clock rate (in Hz)
void setRxAntennas(const std::vector< std::string > &rxAnts) override
Specify antenna for each Rx chain.
void setRxGain(const double rxGainV, uint8_t channel) override
Set the Rx gain for the specified channel. However, currently only QCA9300 and SDR frontend support t...
std::string getClockSource() override
Get the clock source.
void setClockSource(const std::string &clockSourceV) override
Set the clock source. For USRP, it can be "external", "mimo", "internal".
bool isHardwareSupportedPreset(const std::string &presetName) override
Check if a preset configuration is supported by the hardware.
std::optional< double > rxCarrierFrequencyOffset
void setAGC(bool enableAGC) override
void setControlChannelFrequency(const double controlFrequencyV) override
Get the control channel frequency of <contorlfreq-bandwidth-centerfreq> channel parameter.
ExtraInfo buildExtraInfo() override
Build an ExtraInfo object describing the current frontend status.
std::vector< std::string > txAntennas
double getFilterBandwidth() override
get the hardware-frontend filter bandwidth
std::vector< double > getTxCarrierFrequencies() override
void setRxCarrierFrequencies(std::vector< double > carrierFreqsV) override
VirtualSDRFrontEnd(const std::string &referredInterfaceName)
int32_t transmitSignals(const std::vector< const void * > &signals, int64_t bufferLength, double postfixDuration) override
double getTxSamplingRate() override
double getMasterClockRate() override
Get the USRP master clock rate (in Hz)
void setTxCarrierFrequencies(std::vector< double > carrierFreqsV) override
void setTxAntennas(const std::vector< std::string > &txAnts) override
Specify antenna for each Tx chain.
std::vector< double > getRxCarrierFrequencies() override
double getControlChannelFrequency() override
Get the control channel frequency of <contorlfreq-bandwidth-centerfreq> channel parameter.
std::vector< std::string > getTxAntennas() override
std::vector< std::string > getRxAntennas() override
void setTxpower(const double txpowerV) override
Set the Tx power (in dB)
void setRxSamplingRate(double rxRate) override
int setChannelAndBandwidth(double center, double bw, double control) override
Set the <contorlfreq-bandwidth-centerfreq> channel parameter.
double getSDRFrontEndTime() override
Obtain the SDR hardware time.
int setChannelAndBandwidth(std::optional< double > control, std::optional< double > bw, std::optional< double > center) override
Set the <contorlfreq-bandwidth-centerfreq> channel parameter, but with optional.
void applyPreset(const std::string &presetName, bool skipChangeRate) override
Apply a preset configuration to the frontend hardware.
double getRxGain() override
Get the total Rx gain. However, currently only QCA9300 and SDR frontend support this method.
std::vector< std::string > rxAntennas
std::string getTimeSource() override
Get the timing source.
void printStatus() override
Print a status string to command line.