The shared abstract frontend interface for both SDR and NIC. More...
#include <AbstractFrontEnd.hxx>
Public Member Functions | |
AbstractFrontEnd (const std::string &referredInterfaceName) | |
Create AbstractFrontEnd object according to the user-specified frontend name referredInterfaceName . | |
virtual int | startTx () |
Activate internal Tx service loop. | |
virtual int | stopTx () |
De-activate Tx service loop. | |
virtual bool | isTxServiceStarted () const |
Returns whether Tx service is started. | |
virtual int | pauseTx () |
Pause Tx service loop. | |
virtual int | resumeTx () |
Resume Tx service loop. | |
virtual int | transmit (const ModularPicoScenesTxFrame &frame)=0 |
virtual int | transmitFramesInBatch (const std::vector< const ModularPicoScenesTxFrame * > &frames, uint32_t repeat)=0 |
Transmit frames in batch with precise inter-frame timing. | |
virtual int | transmitFramesInBatch (const std::vector< ModularPicoScenesTxFrame > &frames, const uint32_t repeat) |
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 | startRx ()=0 |
Activiate the Rx service loop. | |
virtual int | stopRx ()=0 |
De-activate the Rx service loop, set rxServiceStarted to false. | |
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. | |
virtual void | printStatus ()=0 |
Print a status string to command line. | |
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 |
![]() | |
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 () |
Protected Attributes | |
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 | |
![]() | |
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 | |
The shared abstract frontend interface for both SDR and NIC.
Definition at line 19 of file AbstractFrontEnd.hxx.
|
explicit |
Create AbstractFrontEnd object according to the user-specified frontend name referredInterfaceName
.
referredInterfaceName | user supplied frontend name, e.g., phy0 / usrp192.168.10.2 / 3 / hackrf0 / virtualsdr0 |
|
virtualdefault |
PicoScenesDeviceSubtype AbstractFrontEnd::getFrontEndSubtype | ( | ) | const |
Return the PicoScenesDeviceType subtype of this frontend.
Referenced by AbstractSDRFrontEnd::transmit().
PicoScenesDeviceType AbstractFrontEnd::getFrontEndType | ( | ) | const |
Return the PicoScenesDeviceType of this frontend.
Referenced by AbstractSDRFrontEnd::transmitFramesInBatch().
const std::array< uint8_t, 6 > & AbstractFrontEnd::getMacAddressPhy | ( | ) | const |
Return the MAC address of this frontend. For SDR frontend, this method should generate a pseudo-MAC address.
const std::string & AbstractFrontEnd::getPhyId | ( | ) | const |
Return the PhyId for NIC frontend. This is a undefined behavior for SDR frontend.
const std::string & AbstractFrontEnd::getReferredInterfaceName | ( | ) | const |
Get the user-specified frontend name.
Referenced by AbstractSDRFrontEnd::buildExtraInfo(), AbstractSDRFrontEnd::getChannelAndBandwidth(), AbstractSDRFrontEnd::getChannelFlags(), AbstractSDRFrontEnd::getClockSource(), AbstractSDRFrontEnd::getClockSources(), AbstractSDRFrontEnd::getControlChannelFrequency(), AbstractSDRFrontEnd::getFilterBandwidth(), AbstractSDRFrontEnd::getMasterClockRate(), AbstractSDRFrontEnd::getRxAntennas(), AbstractSDRFrontEnd::getRxChannelBandwidth(), AbstractSDRFrontEnd::getRxGain(), AbstractSDRFrontEnd::getSamplingRate(), AbstractSDRFrontEnd::getSDRFrontEndTime(), AbstractSDRFrontEnd::getTimeSource(), AbstractSDRFrontEnd::getTimeSources(), AbstractSDRFrontEnd::getTxAntennas(), AbstractSDRFrontEnd::getTxpower(), AbstractSDRFrontEnd::printStatus(), VirtualSDRFrontEnd::printStatus(), AbstractSDRFrontEnd::setCarrierFrequencyOffset4RxDecoding(), AbstractSDRFrontEnd::setCarrierFrequencyOffset4TxEncoding(), AbstractSDRFrontEnd::setChannelAndBandwidth(), AbstractSDRFrontEnd::setChannelAndBandwidth(), AbstractSDRFrontEnd::setClockSource(), AbstractSDRFrontEnd::setClockSources(), AbstractSDRFrontEnd::setControlChannelFrequency(), AbstractSDRFrontEnd::setFilterBandwidth(), MAC80211CSIExtractableFrontEnd::setFrameTypeFilter(), AbstractSDRFrontEnd::setMasterClockRate(), AbstractSDRFrontEnd::setNumThreads4RxDecoding(), AbstractSDRFrontEnd::setRxAntennas(), AbstractSDRFrontEnd::setRxChannelBandwidth(), AbstractSDRFrontEnd::setRxChannelBandwidthMode(), AbstractSDRFrontEnd::setRxChannels(), AbstractSDRFrontEnd::setRxGain(), AbstractSDRFrontEnd::setRxGain(), AbstractSDRFrontEnd::setRxIQMismatch(), AbstractSDRFrontEnd::setRxOfdmSymbolOffset(), AbstractSDRFrontEnd::setRxResampleBypassFIR(), AbstractSDRFrontEnd::setRxResampleRatio(), AbstractSDRFrontEnd::setRxSensitivity(), AbstractSDRFrontEnd::setSamplingFrequencyOffset4RxDecoding(), AbstractSDRFrontEnd::setSamplingFrequencyOffset4TxEncoding(), AbstractSDRFrontEnd::setTimeSource(), AbstractSDRFrontEnd::setTimeSources(), AbstractSDRFrontEnd::setTxAntennas(), AbstractSDRFrontEnd::setTxChannels(), AbstractSDRFrontEnd::setTxIQMismatch(), AbstractSDRFrontEnd::setTxpower(), AbstractSDRFrontEnd::setTxResampleRatio(), MAC80211CSIExtractableFrontEnd::startRx(), AbstractSDRFrontEnd::transmit(), and AbstractSDRFrontEnd::transmitFramesInBatch().
PicoScenesFrameTxParameters & AbstractFrontEnd::getUserSpecifiedTxParameters | ( | ) |
Return the user specified Tx parameters (mutable)
Referenced by AbstractSDRFrontEnd::getTxIqCrossTalkDegree(), AbstractSDRFrontEnd::getTxIqRatioDB(), AbstractSDRFrontEnd::getTxResampleRatio(), AbstractSDRFrontEnd::isTxSplitHighLow(), AbstractSDRFrontEnd::setTxIQMismatch(), AbstractSDRFrontEnd::setTxResampleRatio(), and AbstractSDRFrontEnd::setTxSplitHighLow().
|
overridevirtual |
Implements FrontEndConfigurations.
|
virtual |
Returns whether Tx service is started.
|
virtual |
Pause the Rx service loop, set rxPaused to true.
|
virtual |
Pause Tx service loop.
|
pure virtual |
Print a status string to command line.
Implemented in AbstractSDRFrontEnd, MAC80211InjectionOnlyFrontEnd, and VirtualSDRFrontEnd.
void AbstractFrontEnd::registerRxHandle | ( | const std::function< void(const ModularPicoScenesRxFrame &)> & | rxHandle | ) |
Register a handler for the received ModularPicoScenesRxFrame frames.
rxHandle |
|
virtual |
Resuase the paused Rx service loop, set rxPaused to false.
|
virtual |
Resume Tx service loop.
void AbstractFrontEnd::setReferredInterfaceName | ( | const std::string & | name | ) |
Set the user-specified frontend name.
name |
|
pure virtual |
Activiate the Rx service loop.
the internal service loop performs four things:
Implemented in MAC80211CSIExtractableFrontEnd, and MAC80211InjectionOnlyFrontEnd.
|
virtual |
Activate internal Tx service loop.
Reimplemented in MAC80211InjectionOnlyFrontEnd.
Referenced by AbstractSDRFrontEnd::transmit(), and AbstractSDRFrontEnd::transmitFramesInBatch().
|
pure virtual |
De-activate the Rx service loop, set rxServiceStarted to false.
Implemented in MAC80211InjectionOnlyFrontEnd.
|
virtual |
De-activate Tx service loop.
Reimplemented in MAC80211InjectionOnlyFrontEnd.
|
pure virtual |
Implemented in AbstractSDRFrontEnd, and MAC80211InjectionOnlyFrontEnd.
|
pure virtual |
Transmit frames in batch with precise inter-frame timing.
Implemented in AbstractSDRFrontEnd, and MAC80211InjectionOnlyFrontEnd.
Referenced by transmitFramesInBatch(), and transmitFramesInBatch().
|
inlinevirtual |
Reimplemented in MAC80211InjectionOnlyFrontEnd.
Definition at line 61 of file AbstractFrontEnd.hxx.
References transmitFramesInBatch().
|
inline |
Definition at line 73 of file AbstractFrontEnd.hxx.
References transmitFramesInBatch().
|
protected |
frontend subtype
Definition at line 189 of file AbstractFrontEnd.hxx.
|
protected |
frontend type
Definition at line 188 of file AbstractFrontEnd.hxx.
|
protected |
macAddress of the frontend
Definition at line 187 of file AbstractFrontEnd.hxx.
|
protected |
phyId
Definition at line 186 of file AbstractFrontEnd.hxx.
|
protected |
the user specified frontend name
Definition at line 185 of file AbstractFrontEnd.hxx.
|
protected |
The Rx frame handler.
Definition at line 197 of file AbstractFrontEnd.hxx.
|
protected |
indicate whether Rx service loop is paused
Definition at line 198 of file AbstractFrontEnd.hxx.
|
protected |
indicate whether Rx service loop is running
Definition at line 199 of file AbstractFrontEnd.hxx.
Referenced by MAC80211CSIExtractableFrontEnd::startRx().
|
protected |
Definition at line 194 of file AbstractFrontEnd.hxx.
|
protected |
indicate whether Tx serivce is paused
Definition at line 195 of file AbstractFrontEnd.hxx.
|
protected |
Definition at line 193 of file AbstractFrontEnd.hxx.
|
protected |
indicate whether Tx service is running
Definition at line 191 of file AbstractFrontEnd.hxx.
Referenced by AbstractSDRFrontEnd::transmit(), and AbstractSDRFrontEnd::transmitFramesInBatch().
|
protected |
user-specified Tx parameters
Definition at line 192 of file AbstractFrontEnd.hxx.
Referenced by VirtualSDRFrontEnd::applyPreset(), AbstractSDRFrontEnd::getCarrierFrequencyOffset4TxEncoding(), AbstractSDRFrontEnd::getSamplingFrequencyOffset4TxEncoding(), AbstractSDRFrontEnd::setCarrierFrequencyOffset4TxEncoding(), and AbstractSDRFrontEnd::setSamplingFrequencyOffset4TxEncoding().