PicoScenes API Docs
 
Loading...
Searching...
No Matches
QCA9300FrontEnd Class Referenceabstract

Frontend interface for QCA9300 wireless network card. More...

#include <QCA9300FrontEnd.hxx>

Inheritance diagram for QCA9300FrontEnd:
Collaboration diagram for QCA9300FrontEnd:

Public Member Functions

 QCA9300FrontEnd (const std::string &referredInterfaceName)
 Constructor.
 
virtual uint32_t getChansel ()=0
 Get the current channel selection value.
 
virtual uint8_t getBMode ()=0
 Get the current bandwidth mode.
 
virtual uint8_t getTxNess ()=0
 Get the current transmission Ness value.
 
virtual uint32_t getTSF ()=0
 Get the current TSF value.
 
virtual uint32_t getPLLRate ()=0
 Get the current PLL rate.
 
virtual uint16_t getPLLMultiplier ()=0
 Get the current PLL multiplier.
 
virtual uint8_t getPLLRefDiv ()=0
 Get the current PLL reference divider value.
 
virtual uint8_t getPLLClockSelect ()=0
 Get the current PLL clock select value.
 
virtual bool getTxNotSounding ()=0
 Get the current transmission non-sounding state.
 
virtual AtherosCFTuningPolicy getTuningPolicy ()=0
 Get the current carrier frequency tuning policy.
 
virtual void setCarrierFrequency (double freq, enum AtherosCFTuningPolicy policy)=0
 Set carrier frequency and tuning policy.
 
virtual void setChansel (uint32_t chansel)=0
 Set channel selection value.
 
virtual void setBMode (uint8_t bmode)=0
 Set bandwidth mode.
 
virtual void setTuningPolicy (enum AtherosCFTuningPolicy policy)=0
 Set tuning policy.
 
virtual void setTxNess (uint8_t tx_Ness)=0
 Set transmission Ness value.
 
virtual void setPLLValues (uint32_t multipler, uint8_t refDiv, uint8_t clockSelect)=0
 Set PLL values.
 
virtual void setPLLMultiplier (uint32_t multipler)=0
 Set PLL multiplier.
 
virtual void setPLLRefDiv (uint8_t refDiv)=0
 Set PLL reference divider value.
 
virtual void setPLLClockSelect (uint8_t clockSelect)=0
 Set PLL clock select value.
 
virtual void setTxNotSounding (bool not_sounding)=0
 Set transmission non-sounding state.
 
virtual void setRxPA (uint8_t channel, bool manualMode, uint8_t LNA, uint8_t VGA, uint8_t MXR)=0
 Set receive power amplifier parameters.
 
virtual void setRxAGC (bool enabled)=0
 Set receive automatic gain control.
 
virtual uint32_t getRegisterValue (const uint32_t &address, const uint32_t mask=0xffffffff)=0
 Get register value.
 
virtual void setRegisterValue (const uint32_t &address, const uint32_t value, const uint32_t mask)=0
 Set register value.
 
- Public Member Functions inherited from MAC80211CSIExtractableFrontEnd
 MAC80211CSIExtractableFrontEnd (const std::string &referredInterfaceName)
 Constructor for CSI-capable front-end.
 
int startRx () override
 Start the CSI reception service.
 
virtual void setFrameTypeFilter (const std::vector< uint8_t > &frameTypes)
 Set frame type filter for CSI collection.
 
- Public Member Functions inherited from MAC80211InjectionOnlyFrontEnd
int startTx () override
 Start transmission service.
 
int stopTx () override
 Stop transmission service.
 
int startRx () override
 Start reception service.
 
int stopRx () override
 Stop reception service.
 
int transmit (const ModularPicoScenesTxFrame &frame) override
 Transmit a single frame.
 
int transmitFramesInBatch (const std::vector< const ModularPicoScenesTxFrame * > &frames, uint32_t repeat) override
 Transmit multiple frames in batch mode.
 
int transmitFramesInBatch (const std::vector< ModularPicoScenesTxFrame > &frames, uint32_t repeat) override
 Transmit multiple frames in batch mode (vector version)
 
 ~MAC80211InjectionOnlyFrontEnd () override
 Destructor.
 
const std::string & getDevId () const
 Get device interface identifier.
 
const std::string & getMonId () const
 Get monitor interface identifier.
 
uint16_t getPhyIdNumber () const
 Get physical interface number.
 
const std::string & getPhyPath () const
 Get physical interface path.
 
const std::array< uint8_t, 6 > & getMacAddressMon () const
 Get monitor interface MAC address.
 
const std::array< uint8_t, 6 > & getMacAddressDev () const
 Get device interface MAC address.
 
std::tuple< double, double, double > getChannelAndBandwidth () override
 Get current channel and bandwidth configuration.
 
int setChannelAndBandwidth (double control, double bw, double center) override
 Set channel and bandwidth configuration.
 
int setChannelAndBandwidth (std::optional< double > control, std::optional< double > bw, std::optional< double > center) override
 Set channel and bandwidth with optional parameters.
 
double getCarrierFrequency () override
 Get carrier frequency.
 
void setCarrierFrequency (double carrierFrequency) override
 Set carrier frequency.
 
double getSamplingRate () override
 Get sampling rate.
 
void setSamplingRate (double samplingRate) override
 Set sampling rate.
 
double getControlChannelFrequency () override
 Get control channel frequency.
 
void setControlChannelFrequency (double controlFrequency) override
 Set control channel frequency.
 
double getRxChannelBandwidth () override
 Get receive channel bandwidth.
 
void setRxChannelBandwidth (double rxcbw) override
 Set receive channel bandwidth.
 
double getTxpower () override
 Get transmit power.
 
void setTxpower (double txpower) override
 Set transmit power.
 
double getRxGain () override
 Get receive gain.
 
void setRxGain (double rxGain) override
 Set receive gain.
 
void setRxGain (double rxGain, uint8_t channel) override
 Set receive gain for specific channel.
 
uint8_t getTxChainMask () override
 Get transmit chain mask.
 
void setTxChainMask (uint8_t txChainMask) override
 Set transmit chain mask.
 
uint8_t getRxChainMask () override
 Get receive chain mask.
 
void setRxChainMask (uint8_t rxChainMask) override
 Set receive chain mask.
 
std::vector< size_t > getTxChannels () override
 Get active transmit channels.
 
void setTxChannels (const std::vector< size_t > &txChannels) override
 Set active transmit channels.
 
std::vector< size_t > getRxChannels () override
 Get active receive channels.
 
void setRxChannels (const std::vector< size_t > &rxChannels) override
 Set active receive channels.
 
uint16_t getChannelFlags () override
 Get channel flags.
 
ExtraInfo buildExtraInfo () override
 Build extra information about the frontend.
 
const std::vector< double > & getSystemSupportedFrequencies () const
 Get system supported frequencies.
 
bool isMAC80211SupportedCarrierFrequency (double frequency) const
 Check if frequency is supported by MAC80211.
 
void printStatus () override
 Print current frontend status.
 
- Public Member Functions inherited from AbstractFrontEnd
 AbstractFrontEnd (const std::string &referredInterfaceName)
 Create AbstractFrontEnd object according to the user-specified frontend name referredInterfaceName.
 
virtual bool isTxServiceStarted () const
 Returns whether Tx service is started.
 
virtual int pauseTx ()
 Pause Tx service loop.
 
virtual int resumeTx ()
 Resume Tx service loop.
 
template<int repeat = 1, typename ... Frames, typename = std::enable_if_t<(std::is_same_v<std::remove_cvref_t<Frames>, ModularPicoScenesTxFrame *> &&...) || (std::is_same_v<std::remove_cvref_t<Frames>, ModularPicoScenesTxFrame> &&...) || ((std::is_same_v<std::remove_cvref_t<Frames>, std::shared_ptr<ModularPicoScenesTxFrame>> || std::is_same_v<std::remove_cvref_t<Frames>, std::unique_ptr<ModularPicoScenesTxFrame>>) &&...)>>
int transmitFramesInBatch (Frames &&... frames)
 
virtual int pauseRx ()
 Pause the Rx service loop, set rxPaused to true.
 
virtual int resumeRx ()
 Resuase the paused Rx service loop, set rxPaused to false.
 
void registerRxHandle (const std::function< void(const ModularPicoScenesRxFrame &)> &rxHandle)
 Register a handler for the received ModularPicoScenesRxFrame frames.
 
const std::string & getReferredInterfaceName () const
 Get the user-specified frontend name.
 
void setReferredInterfaceName (const std::string &name)
 Set the user-specified frontend name.
 
const std::string & getPhyId () const
 Return the PhyId for NIC frontend. This is a undefined behavior for SDR frontend.
 
PicoScenesDeviceType getFrontEndType () const
 Return the PicoScenesDeviceType of this frontend.
 
PicoScenesDeviceSubtype getFrontEndSubtype () const
 Return the PicoScenesDeviceType subtype of this frontend.
 
const std::array< uint8_t, 6 > & getMacAddressPhy () const
 Return the MAC address of this frontend. For SDR frontend, this method should generate a pseudo-MAC address.
 
PicoScenesFrameTxParameters & getUserSpecifiedTxParameters ()
 
ModularPicoScenesTxFrame initializeTxFrame () override
 
virtual ~AbstractFrontEnd ()=default
 
- Public Member Functions inherited from FrontEndConfigurations
virtual ~FrontEndConfigurations ()=default
 
virtual bool isHardwareSupportedPreset (const std::string &presetName)=0
 Check if a preset configuration is supported by the hardware.
 
virtual void applyPreset (const std::string &presetName, bool skipChangeRate=false)=0
 Apply a preset configuration to the frontend hardware.
 
void setNumTxChannels (const uint8_t numTxChannels)
 Set the number of Tx channels, the active channels start from 0.
 
void setNumRxChannels (const uint8_t numRxChannels)
 Set the number of Rx channels, the active channels start from 0.
 
std::vector< size_t > getAllChannels ()
 
virtual void setSourceMACAddressFilter (const std::vector< std::array< uint8_t, 6 > > &addresses)
 Set the SOURCE addresses that will be blocked by the frontend.
 
virtual void setDestinationMACAddressFilter (const std::vector< std::array< uint8_t, 6 > > &addresses)
 Set the DESTINATION addresses that will be blocked by the frontend.
 
virtual uint16_t getAndIncreasePerFrontEndTxFrameSequenceNumber ()
 

Static Public Member Functions

static std::shared_ptr< QCA9300FrontEndgetInstance (const std::string &referredInterfaceName)
 Get an instance of QCA9300FrontEnd.
 
- Static Public Member Functions inherited from MAC80211InjectionOnlyFrontEnd
static bool isMAC80211CompatibleFrontEnd (const std::string &referredInterfaceName)
 Check if a given interface is compatible with MAC80211.
 

Additional Inherited Members

- Protected Member Functions inherited from MAC80211CSIExtractableFrontEnd
virtual void startCSIExtractionAndParsingLoop ()=0
 Start the CSI extraction and parsing loop.
 
- Protected Member Functions inherited from MAC80211InjectionOnlyFrontEnd
 MAC80211InjectionOnlyFrontEnd (const std::string &referredName)
 Protected constructor.
 
- Protected Attributes inherited from MAC80211CSIExtractableFrontEnd
int csiPathPointer {}
 < File descriptor for CSI data port
 
- Protected Attributes inherited from MAC80211InjectionOnlyFrontEnd
std::string devId
 Device interface identifier.
 
std::string monId
 Monitor interface identifier.
 
uint16_t phyIdNumber = 0
 Physical interface number.
 
std::string phyPath
 Path to physical interface.
 
std::shared_ptr< uint8_t > txContext
 Transmission context.
 
std::array< uint8_t, 6 > macAddress_MON {0, 0, 0, 0, 0, 0}
 Monitor interface MAC address.
 
std::array< uint8_t, 6 > macAddress_DEV {0, 0, 0, 0, 0, 0}
 Device interface MAC address.
 
std::vector< double > systemSupportedFrequencies
 List of supported frequencies.
 
- Protected Attributes inherited from AbstractFrontEnd
std::string referredInterfaceName
 the user specified frontend name
 
std::string phyId
 phyId
 
std::array< uint8_t, 6 > macAddress_PHY {0, 0, 0, 0, 0, 0}
 macAddress of the frontend
 
PicoScenesDeviceType frontEndType = PicoScenesDeviceType::Unknown
 frontend type
 
PicoScenesDeviceSubtype frontEndSubtype = PicoScenesDeviceSubtype::Unknown
 frontend subtype
 
bool txServiceStarted = false
 indicate whether Tx service is running
 
PicoScenesFrameTxParameters userSpecifiedTxParameters
 user-specified Tx parameters
 
std::mutex txPauseMutex
 
std::condition_variable txPauseCV
 
bool txPaused = false
 indicate whether Tx serivce is paused
 
std::function< void(const ModularPicoScenesRxFrame &)> rxHandle = nullptr
 The Rx frame handler.
 
bool rxPaused = false
 indicate whether Rx service loop is paused
 
bool rxServiceStarted = false
 indicate whether Rx service loop is running
 
- Protected Attributes inherited from FrontEndConfigurations
std::vector< std::array< uint8_t, 6 > > sourceAddressFilterList
 the source addresses to be filtered
 
std::vector< std::array< uint8_t, 6 > > destinationAddressFilterList
 the destination addressed to be filtered
 
uint16_t currentTxSequenceNumber {0}
 current Tx sequence number
 

Detailed Description

Frontend interface for QCA9300 wireless network card.

This class provides access to specific features of the QCA9300 wireless card, including channel selection, PLL configuration, transmission parameter settings, etc. It inherits from MAC80211CSIExtractableFrontEnd, supporting CSI extraction functionality.

QCA9300 is a wireless card supporting 802.11n, with configurable PLL, channel selection, and other RF parameters. This class provides a software control interface for these hardware features.

Definition at line 20 of file QCA9300FrontEnd.hxx.

Constructor & Destructor Documentation

◆ QCA9300FrontEnd()

QCA9300FrontEnd::QCA9300FrontEnd ( const std::string &  referredInterfaceName)
explicit

Constructor.

Parameters
referredInterfaceNameName of the network interface

Initializes a QCA9300FrontEnd object. Throws an exception if the specified interface is not a QCA9300 device.

Member Function Documentation

◆ getBMode()

virtual uint8_t QCA9300FrontEnd::getBMode ( )
pure virtual

Get the current bandwidth mode.

Returns
uint8_t Current bandwidth mode

Returns the current bandwidth mode set in QCA9300, used to determine the channel bandwidth.

◆ getChansel()

virtual uint32_t QCA9300FrontEnd::getChansel ( )
pure virtual

Get the current channel selection value.

Returns
uint32_t Current channel selection value

Returns the current channel selection value set in QCA9300, used to determine the operating frequency.

◆ getInstance()

static std::shared_ptr< QCA9300FrontEnd > QCA9300FrontEnd::getInstance ( const std::string &  referredInterfaceName)
static

Get an instance of QCA9300FrontEnd.

Parameters
referredInterfaceNameName of the network interface
Returns
std::shared_ptr<QCA9300FrontEnd> Smart pointer to QCA9300FrontEnd instance

Uses the singleton pattern to get an instance of QCA9300FrontEnd. Returns nullptr if the specified interface is not a QCA9300 device.

◆ getPLLClockSelect()

virtual uint8_t QCA9300FrontEnd::getPLLClockSelect ( )
pure virtual

Get the current PLL clock select value.

Returns
uint8_t Current PLL clock select value

Returns the current PLL clock select value set in QCA9300, used to calculate the PLL rate.

◆ getPLLMultiplier()

virtual uint16_t QCA9300FrontEnd::getPLLMultiplier ( )
pure virtual

Get the current PLL multiplier.

Returns
uint16_t Current PLL multiplier

Returns the current PLL multiplier set in QCA9300, used to calculate the PLL rate.

◆ getPLLRate()

virtual uint32_t QCA9300FrontEnd::getPLLRate ( )
pure virtual

Get the current PLL rate.

Returns
uint32_t Current PLL rate

Returns the current Phase-Locked Loop (PLL) rate set in QCA9300, used to determine the sampling rate.

◆ getPLLRefDiv()

virtual uint8_t QCA9300FrontEnd::getPLLRefDiv ( )
pure virtual

Get the current PLL reference divider value.

Returns
uint8_t Current PLL reference divider value

Returns the current PLL reference divider value set in QCA9300, used to calculate the PLL rate.

◆ getRegisterValue()

virtual uint32_t QCA9300FrontEnd::getRegisterValue ( const uint32_t &  address,
const uint32_t  mask = 0xffffffff 
)
pure virtual

Get register value.

Parameters
addressRegister address
maskMask, defaults to 0xffffffff
Returns
uint32_t Register value

Reads the register value at the specified address in QCA9300, and applies the mask.

◆ getTSF()

virtual uint32_t QCA9300FrontEnd::getTSF ( )
pure virtual

Get the current TSF value.

Returns
uint32_t Current TSF value

Returns the current Time Synchronization Function (TSF) value in QCA9300, used for time synchronization.

◆ getTuningPolicy()

virtual AtherosCFTuningPolicy QCA9300FrontEnd::getTuningPolicy ( )
pure virtual

Get the current carrier frequency tuning policy.

Returns
AtherosCFTuningPolicy Current carrier frequency tuning policy

Returns the current carrier frequency tuning policy used by QCA9300.

◆ getTxNess()

virtual uint8_t QCA9300FrontEnd::getTxNess ( )
pure virtual

Get the current transmission Ness value.

Returns
uint8_t Current transmission Ness value

Returns the current transmission Ness value set in QCA9300, used to control transmission parameters.

◆ getTxNotSounding()

virtual bool QCA9300FrontEnd::getTxNotSounding ( )
pure virtual

Get the current transmission non-sounding state.

Returns
bool Current transmission non-sounding state

Returns whether QCA9300 is currently set to non-sounding mode.

◆ setBMode()

virtual void QCA9300FrontEnd::setBMode ( uint8_t  bmode)
pure virtual

Set bandwidth mode.

Parameters
bmodeBandwidth mode to set

Sets the bandwidth mode for QCA9300, used to determine the channel bandwidth.

◆ setCarrierFrequency()

virtual void QCA9300FrontEnd::setCarrierFrequency ( double  freq,
enum AtherosCFTuningPolicy  policy 
)
pure virtual

Set carrier frequency and tuning policy.

Parameters
freqCarrier frequency to set (Hz)
policyTuning policy to use

Sets the carrier frequency and tuning policy for QCA9300, used to determine the operating frequency and tuning method.

◆ setChansel()

virtual void QCA9300FrontEnd::setChansel ( uint32_t  chansel)
pure virtual

Set channel selection value.

Parameters
chanselChannel selection value to set

Sets the channel selection value for QCA9300, used to determine the operating frequency.

◆ setPLLClockSelect()

virtual void QCA9300FrontEnd::setPLLClockSelect ( uint8_t  clockSelect)
pure virtual

Set PLL clock select value.

Parameters
clockSelectPLL clock select value to set

Sets the PLL clock select value for QCA9300, used to calculate the PLL rate.

◆ setPLLMultiplier()

virtual void QCA9300FrontEnd::setPLLMultiplier ( uint32_t  multipler)
pure virtual

Set PLL multiplier.

Parameters
multiplerPLL multiplier to set

Sets the PLL multiplier for QCA9300, used to calculate the PLL rate.

◆ setPLLRefDiv()

virtual void QCA9300FrontEnd::setPLLRefDiv ( uint8_t  refDiv)
pure virtual

Set PLL reference divider value.

Parameters
refDivPLL reference divider value to set

Sets the PLL reference divider value for QCA9300, used to calculate the PLL rate.

◆ setPLLValues()

virtual void QCA9300FrontEnd::setPLLValues ( uint32_t  multipler,
uint8_t  refDiv,
uint8_t  clockSelect 
)
pure virtual

Set PLL values.

Parameters
multiplerPLL multiplier to set
refDivPLL reference divider value to set
clockSelectPLL clock select value to set

Sets the PLL multiplier, reference divider value, and clock select value for QCA9300 in one operation, used to configure the PLL.

◆ setRegisterValue()

virtual void QCA9300FrontEnd::setRegisterValue ( const uint32_t &  address,
const uint32_t  value,
const uint32_t  mask 
)
pure virtual

Set register value.

Parameters
addressRegister address
valueValue to set
maskMask

Sets the register value at the specified address in QCA9300, only modifying the bits specified by the mask.

◆ setRxAGC()

virtual void QCA9300FrontEnd::setRxAGC ( bool  enabled)
pure virtual

Set receive automatic gain control.

Parameters
enabledWhether to enable automatic gain control

Sets whether QCA9300 enables receive automatic gain control.

◆ setRxPA()

virtual void QCA9300FrontEnd::setRxPA ( uint8_t  channel,
bool  manualMode,
uint8_t  LNA,
uint8_t  VGA,
uint8_t  MXR 
)
pure virtual

Set receive power amplifier parameters.

Parameters
channelChannel number to set
manualModeWhether to use manual mode
LNALow Noise Amplifier gain value
VGAVariable Gain Amplifier gain value
MXRMixer gain value

Sets the receive power amplifier parameters for QCA9300, used to control receive gain.

◆ setTuningPolicy()

virtual void QCA9300FrontEnd::setTuningPolicy ( enum AtherosCFTuningPolicy  policy)
pure virtual

Set tuning policy.

Parameters
policyTuning policy to set

Sets the carrier frequency tuning policy for QCA9300.

◆ setTxNess()

virtual void QCA9300FrontEnd::setTxNess ( uint8_t  tx_Ness)
pure virtual

Set transmission Ness value.

Parameters
tx_NessTransmission Ness value to set

Sets the transmission Ness value for QCA9300, used to control transmission parameters.

◆ setTxNotSounding()

virtual void QCA9300FrontEnd::setTxNotSounding ( bool  not_sounding)
pure virtual

Set transmission non-sounding state.

Parameters
not_soundingWhether to set to non-sounding mode

Sets whether QCA9300 uses non-sounding mode for transmission.


The documentation for this class was generated from the following file: