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

This class holds the common hardware configuration setters/getters for ALL types of frontend (SDR or NIC). More...

#include <FrontEndConfigurations.hxx>

Inheritance diagram for FrontEndConfigurations:

Public Member Functions

virtual ~FrontEndConfigurations ()=default
 
virtual ExtraInfo buildExtraInfo ()=0
 Build an ExtraInfo object describing the current frontend status.
 
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.
 
virtual std::tuple< double, double, double > getChannelAndBandwidth ()=0
 Get the <contorlfreq-bandwidth-centerfreq> channel parameter.
 
virtual int setChannelAndBandwidth (double control, double bw, double center)=0
 Set the <contorlfreq-bandwidth-centerfreq> channel parameter.
 
virtual int setChannelAndBandwidth (std::optional< double > control, std::optional< double > bw, std::optional< double > center)=0
 Set the <contorlfreq-bandwidth-centerfreq> channel parameter, but with optional.
 
virtual double getCarrierFrequency ()=0
 Get the RF carrier frequency.
 
virtual void setCarrierFrequency (double carrierFrequency)=0
 Get the RF carrier frequency.
 
virtual double getSamplingRate ()=0
 Get the baseband sampling rate.
 
virtual void setSamplingRate (double samplingRate)=0
 set sampling rate (in Hz)
 
virtual double getControlChannelFrequency ()=0
 Get the control channel frequency of <contorlfreq-bandwidth-centerfreq> channel parameter.
 
virtual void setControlChannelFrequency (double controlFrequency)=0
 Get the control channel frequency of <contorlfreq-bandwidth-centerfreq> channel parameter.
 
virtual double getRxChannelBandwidth ()=0
 Get the 802.11 Channel Bandwidth parameter (20e6/40e6/80e6/160e6/320e6) of the Rx path.
 
virtual void setRxChannelBandwidth (double rxcbw)=0
 Set the Rx channel bandwidth parameter of the <contorlfreq-bandwidth-centerfreq> channel parameters.
 
virtual double getTxpower ()=0
 get the transmission power (Tx power)
 
virtual void setTxpower (double txpower)=0
 Set the Tx power (in dB)
 
virtual double getRxGain ()=0
 Get the total Rx gain. However, currently only QCA9300 and SDR frontend support this method.
 
virtual void setRxGain (double rxGain)=0
 Set the total Rx gain. However, currently only QCA9300 and SDR frontend support this method.
 
virtual void setRxGain (double rxGain, uint8_t channel)=0
 Set the Rx gain for the specified channel. However, currently only QCA9300 and SDR frontend support this method.
 
virtual uint8_t getTxChainMask ()=0
 Get the Tx chain mask.
 
virtual void setTxChainMask (uint8_t txChainMask)=0
 Set Tx chain mask. Setting Tx chain mask means to use only the selected Tx chain for signal transmission.
 
virtual uint8_t getRxChainMask ()=0
 Get Rx chain mask.
 
virtual void setRxChainMask (uint8_t rxChainMask)=0
 Set Rx chain mask. Setting Rx chain mask means to use only the selected Rx chains for signal reception.
 
virtual std::vector< size_t > getTxChannels ()=0
 Get the numbers of the active Tx channels, starting from 0.
 
virtual void setTxChannels (const std::vector< size_t > &txChannels)=0
 This methods is fundamentally.
 
void setNumTxChannels (const uint8_t numTxChannels)
 Set the number of Tx channels, the active channels start from 0.
 
virtual std::vector< size_t > getRxChannels ()=0
 Get the number of the active Rx channels, starting from 0.
 
virtual void setRxChannels (const std::vector< size_t > &rxChannels)=0
 Set the number of the active Rx channels, starting 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 uint16_t getChannelFlags ()=0
 Get the old ChannelFlags descriptor.
 
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 ()
 
virtual ModularPicoScenesTxFrame initializeTxFrame ()=0
 

Protected Attributes

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

This class holds the common hardware configuration setters/getters for ALL types of frontend (SDR or NIC).

Definition at line 15 of file FrontEndConfigurations.hxx.

Constructor & Destructor Documentation

◆ ~FrontEndConfigurations()

virtual FrontEndConfigurations::~FrontEndConfigurations ( )
virtualdefault

Member Function Documentation

◆ applyPreset()

virtual void FrontEndConfigurations::applyPreset ( const std::string &  presetName,
bool  skipChangeRate = false 
)
pure virtual

Apply a preset configuration to the frontend hardware.

Parameters
presetNameThe name of the preset configuration to apply
skipChangeRateWhether to skip changing the sampling rate, default is false

Implemented in VirtualSDRFrontEnd.

◆ buildExtraInfo()

virtual ExtraInfo FrontEndConfigurations::buildExtraInfo ( )
pure virtual

Build an ExtraInfo object describing the current frontend status.

Implemented in AbstractSDRFrontEnd, MAC80211InjectionOnlyFrontEnd, and VirtualSDRFrontEnd.

◆ getAllChannels()

std::vector< size_t > FrontEndConfigurations::getAllChannels ( )
inline

Definition at line 230 of file FrontEndConfigurations.hxx.

References getRxChannels(), and getTxChannels().

◆ getAndIncreasePerFrontEndTxFrameSequenceNumber()

virtual uint16_t FrontEndConfigurations::getAndIncreasePerFrontEndTxFrameSequenceNumber ( )
inlinevirtual

Return the Tx sequence number and increase by 1. The sequence number is used to fill the sequence field of 802.11 MPDU header.

Returns
The Next sequence number

Definition at line 273 of file FrontEndConfigurations.hxx.

References currentTxSequenceNumber.

◆ getCarrierFrequency()

virtual double FrontEndConfigurations::getCarrierFrequency ( )
pure virtual

Get the RF carrier frequency.

Returns
the current RF carrier frequency

Implemented in AbstractSDRFrontEnd, and MAC80211InjectionOnlyFrontEnd.

◆ getChannelAndBandwidth()

virtual std::tuple< double, double, double > FrontEndConfigurations::getChannelAndBandwidth ( )
pure virtual

Get the <contorlfreq-bandwidth-centerfreq> channel parameter.

Note
The format of <contorlfreq-bandwidth-centerfreq> is the same as Linux iw command for 80/160 channel bandwidth case.
Returns
a tuple of three values (in Hz)

Implemented in AbstractSDRFrontEnd, MAC80211InjectionOnlyFrontEnd, and VirtualSDRFrontEnd.

◆ getChannelFlags()

virtual uint16_t FrontEndConfigurations::getChannelFlags ( )
pure virtual

Get the old ChannelFlags descriptor.

Deprecated:
This method is deprecated
Returns
the resulting channel flags

Implemented in AbstractSDRFrontEnd, MAC80211InjectionOnlyFrontEnd, and VirtualSDRFrontEnd.

◆ getControlChannelFrequency()

virtual double FrontEndConfigurations::getControlChannelFrequency ( )
pure virtual

Get the control channel frequency of <contorlfreq-bandwidth-centerfreq> channel parameter.

See also
getChannelAndBandwidth()
Returns

Implemented in AbstractSDRFrontEnd, MAC80211InjectionOnlyFrontEnd, and VirtualSDRFrontEnd.

◆ getRxChainMask()

virtual uint8_t FrontEndConfigurations::getRxChainMask ( )
pure virtual

Get Rx chain mask.

0/1/2/3-bit for the 0/1/2/3-th radio chain. This method should be based on setTxChannels() internally for SDR frontend.

Returns

Implemented in AbstractSDRFrontEnd, and MAC80211InjectionOnlyFrontEnd.

◆ getRxChannelBandwidth()

virtual double FrontEndConfigurations::getRxChannelBandwidth ( )
pure virtual

Get the 802.11 Channel Bandwidth parameter (20e6/40e6/80e6/160e6/320e6) of the Rx path.

Note
This value does NOT necessarily equals to getSamplingRate(), because the latter is the actual working sampling rate.
Returns
For NIC, this value is the channel bandwidth of current Wi-Fi connection or the bandwidth that you specify via array_prepare_for_picoscenes script; for SDR, this value is the CBW20/40/80/160 Rx decoding parameter

Implemented in AbstractSDRFrontEnd, and MAC80211InjectionOnlyFrontEnd.

◆ getRxChannels()

virtual std::vector< size_t > FrontEndConfigurations::getRxChannels ( )
pure virtual

Get the number of the active Rx channels, starting from 0.

Returns
the number array

Implemented in AbstractSDRFrontEnd, and MAC80211InjectionOnlyFrontEnd.

Referenced by getAllChannels().

◆ getRxGain()

virtual double FrontEndConfigurations::getRxGain ( )
pure virtual

Get the total Rx gain. However, currently only QCA9300 and SDR frontend support this method.

Returns
the Rx gain (in dB)

Implemented in AbstractSDRFrontEnd, MAC80211InjectionOnlyFrontEnd, and VirtualSDRFrontEnd.

◆ getSamplingRate()

virtual double FrontEndConfigurations::getSamplingRate ( )
pure virtual

Get the baseband sampling rate.

Returns
the working sampling rate (in Hz)

Implemented in AbstractSDRFrontEnd, and MAC80211InjectionOnlyFrontEnd.

◆ getTxChainMask()

virtual uint8_t FrontEndConfigurations::getTxChainMask ( )
pure virtual

Get the Tx chain mask.

0/1/2/3-bit for the 0/1/2/3-th radio chain; 1 for active and 0 for inactive This method should be based on getTxChannels() internally for SDR frontend.

See also
getRxChainMask()
Returns
current tx chain mask

Implemented in AbstractSDRFrontEnd, and MAC80211InjectionOnlyFrontEnd.

◆ getTxChannels()

virtual std::vector< size_t > FrontEndConfigurations::getTxChannels ( )
pure virtual

Get the numbers of the active Tx channels, starting from 0.

Returns
the number array

Implemented in AbstractSDRFrontEnd, and MAC80211InjectionOnlyFrontEnd.

Referenced by getAllChannels().

◆ getTxpower()

virtual double FrontEndConfigurations::getTxpower ( )
pure virtual

get the transmission power (Tx power)

Returns
the Tx power

Implemented in AbstractSDRFrontEnd, MAC80211InjectionOnlyFrontEnd, and VirtualSDRFrontEnd.

◆ initializeTxFrame()

virtual ModularPicoScenesTxFrame FrontEndConfigurations::initializeTxFrame ( )
pure virtual

Implemented in AbstractFrontEnd.

◆ isHardwareSupportedPreset()

virtual bool FrontEndConfigurations::isHardwareSupportedPreset ( const std::string &  presetName)
pure virtual

Check if a preset configuration is supported by the hardware.

Parameters
presetNameThe name of the preset configuration to check
Returns
true if the preset is supported, false otherwise

Implemented in VirtualSDRFrontEnd.

◆ setCarrierFrequency()

virtual void FrontEndConfigurations::setCarrierFrequency ( double  carrierFrequency)
pure virtual

Get the RF carrier frequency.

Parameters
carrierFrequencythe carrier frequency to be set

Implemented in AbstractSDRFrontEnd, and MAC80211InjectionOnlyFrontEnd.

◆ setChannelAndBandwidth() [1/2]

virtual int FrontEndConfigurations::setChannelAndBandwidth ( double  control,
double  bw,
double  center 
)
pure virtual

Set the <contorlfreq-bandwidth-centerfreq> channel parameter.

See also
getChannelAndBandwidth()
Parameters
controlthe control channel frequency (in Hz or MHz)
bwthe bandwidth (in Hz or MHz)
centerthe actual center frequency (in Hz or MHz)
Returns
0 for OK 1 for Error

Implemented in VirtualSDRFrontEnd, AbstractSDRFrontEnd, and MAC80211InjectionOnlyFrontEnd.

◆ setChannelAndBandwidth() [2/2]

virtual int FrontEndConfigurations::setChannelAndBandwidth ( std::optional< double >  control,
std::optional< double >  bw,
std::optional< double >  center 
)
pure virtual

Set the <contorlfreq-bandwidth-centerfreq> channel parameter, but with optional.

Note
This method will first find the optimal <contorlfreq-bandwidth-centerfreq> channel parameter, then invoke setChannelAndBandwidth(double control, double bw, double center) internally
Parameters
controlthe control channel frequency
bwthe bandwidth
centerthe actual center frequency
Returns
0 for OK 1 for Error

Implemented in AbstractSDRFrontEnd, MAC80211InjectionOnlyFrontEnd, and VirtualSDRFrontEnd.

◆ setControlChannelFrequency()

virtual void FrontEndConfigurations::setControlChannelFrequency ( double  controlFrequency)
pure virtual

Get the control channel frequency of <contorlfreq-bandwidth-centerfreq> channel parameter.

Note
This method will first find the optimal <contorlfreq-bandwidth-centerfreq> channel parameter, then invoke setChannelAndBandwidth(double control, double bw, double center) internally
Parameters
controlFrequency

Implemented in VirtualSDRFrontEnd, AbstractSDRFrontEnd, and MAC80211InjectionOnlyFrontEnd.

◆ setDestinationMACAddressFilter()

virtual void FrontEndConfigurations::setDestinationMACAddressFilter ( const std::vector< std::array< uint8_t, 6 > > &  addresses)
inlinevirtual

Set the DESTINATION addresses that will be blocked by the frontend.

Parameters
addressesan address vector holding all DESTINATION addresses to be blocked

Definition at line 262 of file FrontEndConfigurations.hxx.

References destinationAddressFilterList.

◆ setNumRxChannels()

void FrontEndConfigurations::setNumRxChannels ( const uint8_t  numRxChannels)
inline

Set the number of Rx channels, the active channels start from 0.

Parameters
numRxChannels

Definition at line 222 of file FrontEndConfigurations.hxx.

References setRxChannels().

◆ setNumTxChannels()

void FrontEndConfigurations::setNumTxChannels ( const uint8_t  numTxChannels)
inline

Set the number of Tx channels, the active channels start from 0.

Parameters
numTxChannels

Definition at line 198 of file FrontEndConfigurations.hxx.

References setTxChannels().

◆ setRxChainMask()

virtual void FrontEndConfigurations::setRxChainMask ( uint8_t  rxChainMask)
pure virtual

Set Rx chain mask. Setting Rx chain mask means to use only the selected Rx chains for signal reception.

0/1/2/3-bit for the 0/1/2/3-th radio chain. This method should be based on setRxChannels() internally for SDR frontend.

Returns

Implemented in AbstractSDRFrontEnd, and MAC80211InjectionOnlyFrontEnd.

◆ setRxChannelBandwidth()

virtual void FrontEndConfigurations::setRxChannelBandwidth ( double  rxcbw)
pure virtual

Set the Rx channel bandwidth parameter of the <contorlfreq-bandwidth-centerfreq> channel parameters.

Note
This method will first find the optimal <contorlfreq-bandwidth-centerfreq> channel parameter, then invoke setChannelAndBandwidth(double control, double bw, double center) internally
Parameters
rxcbw

Implemented in AbstractSDRFrontEnd, and MAC80211InjectionOnlyFrontEnd.

◆ setRxChannels()

virtual void FrontEndConfigurations::setRxChannels ( const std::vector< size_t > &  rxChannels)
pure virtual

Set the number of the active Rx channels, starting from 0.

Returns
the number array

Implemented in MAC80211InjectionOnlyFrontEnd, and AbstractSDRFrontEnd.

Referenced by setNumRxChannels().

◆ setRxGain() [1/2]

virtual void FrontEndConfigurations::setRxGain ( double  rxGain)
pure virtual

Set the total Rx gain. However, currently only QCA9300 and SDR frontend support this method.

This method calls the following method to set same Rx gain for all Rx channels.

Parameters
rxGainthe Rx Gain to be set (in dB)

Implemented in VirtualSDRFrontEnd, AbstractSDRFrontEnd, and MAC80211InjectionOnlyFrontEnd.

◆ setRxGain() [2/2]

virtual void FrontEndConfigurations::setRxGain ( double  rxGain,
uint8_t  channel 
)
pure virtual

Set the Rx gain for the specified channel. However, currently only QCA9300 and SDR frontend support this method.

Parameters
rxGainthe Rx Gain to be set (in dB)
channelthe specified channel (starting from 0)

Implemented in VirtualSDRFrontEnd, AbstractSDRFrontEnd, and MAC80211InjectionOnlyFrontEnd.

◆ setSamplingRate()

virtual void FrontEndConfigurations::setSamplingRate ( double  samplingRate)
pure virtual

set sampling rate (in Hz)

Parameters
samplingRate

Implemented in AbstractSDRFrontEnd, and MAC80211InjectionOnlyFrontEnd.

◆ setSourceMACAddressFilter()

virtual void FrontEndConfigurations::setSourceMACAddressFilter ( const std::vector< std::array< uint8_t, 6 > > &  addresses)
inlinevirtual

Set the SOURCE addresses that will be blocked by the frontend.

Parameters
addressesan address vector holding all SOURCE addresses to be blocked

Definition at line 253 of file FrontEndConfigurations.hxx.

References sourceAddressFilterList.

◆ setTxChainMask()

virtual void FrontEndConfigurations::setTxChainMask ( uint8_t  txChainMask)
pure virtual

Set Tx chain mask. Setting Tx chain mask means to use only the selected Tx chain for signal transmission.

0/1/2/3-bit for the 0/1/2/3-th radio chain. This method should be based on setTxChannels() internally for SDR frontend.

Parameters
txChainMask

Implemented in AbstractSDRFrontEnd, and MAC80211InjectionOnlyFrontEnd.

◆ setTxChannels()

virtual void FrontEndConfigurations::setTxChannels ( const std::vector< size_t > &  txChannels)
pure virtual

This methods is fundamentally.

Parameters
txChannels

Implemented in MAC80211InjectionOnlyFrontEnd, and AbstractSDRFrontEnd.

Referenced by setNumTxChannels().

◆ setTxpower()

virtual void FrontEndConfigurations::setTxpower ( double  txpower)
pure virtual

Set the Tx power (in dB)

Note
When txpower is between [0, 1.0], the actual txpower should be scaled to txpower x MAX_TXPOWER

Implemented in VirtualSDRFrontEnd, AbstractSDRFrontEnd, and MAC80211InjectionOnlyFrontEnd.

Member Data Documentation

◆ currentTxSequenceNumber

uint16_t FrontEndConfigurations::currentTxSequenceNumber {0}
protected

current Tx sequence number

Definition at line 282 of file FrontEndConfigurations.hxx.

Referenced by getAndIncreasePerFrontEndTxFrameSequenceNumber().

◆ destinationAddressFilterList

std::vector<std::array<uint8_t, 6> > FrontEndConfigurations::destinationAddressFilterList
protected

the destination addressed to be filtered

Definition at line 281 of file FrontEndConfigurations.hxx.

Referenced by setDestinationMACAddressFilter().

◆ sourceAddressFilterList

std::vector<std::array<uint8_t, 6> > FrontEndConfigurations::sourceAddressFilterList
protected

the source addresses to be filtered

Definition at line 280 of file FrontEndConfigurations.hxx.

Referenced by setSourceMACAddressFilter().


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