PicoScenes API Docs
 
Loading...
Searching...
No Matches
SDRFrontEndConfigurations.hxx
Go to the documentation of this file.
1//
2// Created by Zhiping Jiang on 5/2/21.
3//
4
5#ifndef PICOSCENES_PLATFORM_SDRFRONTENDCONFIGURATIONS_HXX
6#define PICOSCENES_PLATFORM_SDRFRONTENDCONFIGURATIONS_HXX
7
9
16enum class SDRFrontEndTransferType : uint8_t {
17 CS8 = 8,
18 CS16 = 16,
19};
20
28 bool valid{false};
29 bool error{false};
30 double txTime{0.0};
31 double scheduledTime{0.0};
32 double systemDelay{0.0};
33 int eventCode{0};
34 int numACKs{0};
36 size_t actualTxLength{0};
38 PicoScenesDeviceType deviceType{PicoScenesDeviceType::Unknown};
39 PicoScenesDeviceSubtype subType{PicoScenesDeviceSubtype::Unknown};
40};
41
49 bool valid{false};
50 bool error{false};
51 bool hasTime{false};
52 double rxStartTime{0.0};
53 int errorCode{0};
54 int64_t numReceived{0};
56 PicoScenesDeviceType deviceType{PicoScenesDeviceType::Unknown};
57 PicoScenesDeviceSubtype subType{PicoScenesDeviceSubtype::Unknown};
58};
59
61 std::vector<size_t> rx_channel;
63 int rx_cbw{20};
65 int mt{1};
66 double cfo{0},sfo{0};
67};
77public:
79
89 virtual double getRxSensitivity() = 0;
90
96 virtual void setRxSensitivity(double rxSensitivity) = 0;
97
103 virtual bool isRxResampleBypassFIR() = 0;
104
110 virtual void setRxResampleBypassFIR(bool bypass) = 0;
111
117 virtual bool isTxSplitHighLow() = 0;
118
124 virtual void setTxSplitHighLow(bool split) = 0;
125
131 virtual bool isRxMergeHighLow() = 0;
132
138 virtual void setRxMergeHighLow(bool merge) = 0;
139
147 virtual std::optional<double> getCarrierFrequencyOffset4TxEncoding() = 0;
148
154 virtual void setCarrierFrequencyOffset4TxEncoding(double carrierFrequencyOffset) = 0;
155
163 virtual std::optional<double> getSamplingFrequencyOffset4TxEncoding() = 0;
164
170 virtual void setSamplingFrequencyOffset4TxEncoding(double samplingFrequencyOffset) = 0;
171
179 virtual std::optional<double> getCarrierFrequencyOffset4RxDecoding() = 0;
180
186 virtual void setCarrierFrequencyOffset4RxDecoding(double carrierFrequencyOffset) = 0;
187
195 virtual std::optional<double> getSamplingFrequencyOffset4RxDecoding() = 0;
196
202 virtual void setSamplingFrequencyOffset4RxDecoding(double samplingFrequencyOffset) = 0;
203
209 virtual double getTxResampleRatio() = 0;
210
218 virtual void setTxResampleRatio(double txResampleRatio) = 0;
219
225 virtual double getRxResampleRatio() = 0;
226
235 virtual void setRxResampleRatio(double rxResampleRatio) = 0;
236
242 virtual double getSDRFrontEndTime() = 0;
243
249 virtual ChannelBandwidthEnum getRxChannelBandwidthMode() = 0;
250
256 virtual void setRxChannelBandwidthMode(ChannelBandwidthEnum rxCbw) = 0;
257
264 virtual void setTxIQMismatch(double iq_ratio_db, double iq_crosstalk_degree) = 0;
265
272 virtual void setRxIQMismatch(double iq_ratio_db, double iq_crosstalk_degree) = 0;
273
279 virtual double getTxIqRatioDB() = 0;
280
286 virtual double getTxIqCrossTalkDegree() = 0;
287
293 virtual double getRxIqRatioDB() = 0;
294
300 virtual double getRxIqCrossTalkDegree() = 0;
301
307 virtual bool isFullDuplexEnabled() = 0;
308
317 virtual void setFullDuplex(bool enableFullduplex) = 0;
318
324 virtual double getRxOfdmSymbolOffset() = 0;
325
331 virtual void setRxOfdmSymbolOffset(double rxOfdmSymbolOffset) = 0;
332
338 virtual double getNumSamplesSavedBeforeStart() = 0;
339
345 virtual void getNumSamplesSavedBeforeStart(double numSamplesSavedBeforeStart) = 0;
346
352 [[nodiscard]] virtual bool isReturnBasebandSignals() const = 0;
353
359 [[nodiscard]] virtual bool useConventionalPacketDetector() const = 0;
360};
361
370public:
374 virtual void initializeSDR() = 0;
375
381 [[nodiscard]] virtual const std::vector<size_t>& userSpecifiedTxChannels() const = 0;
382
388 [[nodiscard]] virtual const std::vector<size_t>& userSpecifiedRxChannels() const = 0;
389
395 virtual void setTxCarrierFrequencies(std::vector<double> carrierFreqs) = 0;
396
402 virtual void setRxCarrierFrequencies(std::vector<double> carrierFreqs) = 0;
403
409 virtual std::vector<double> getTxCarrierFrequencies() = 0;
410
416 virtual std::vector<double> getRxCarrierFrequencies() = 0;
417
423 virtual void setTxSamplingRate(double txRate) = 0;
424
430 virtual void setRxSamplingRate(double rxRate) = 0;
431
437 virtual double getTxSamplingRate() = 0;
438
444 virtual double getRxSamplingRate() = 0;
445
451 virtual bool supportAGC() = 0;
452
458 virtual void setAGC(bool enableAGC) = 0;
459
465 virtual std::string getTxAntenna() = 0;
466
472 virtual std::string getRxAntenna() = 0;
473
479 virtual void setTxAntenna(const std::string& txAnt) = 0;
480
486 virtual void setRxAntenna(const std::string& rxAnt) = 0;
487
493 virtual std::vector<std::string> getTxAntennas() = 0;
494
500 virtual std::vector<std::string> getRxAntennas() = 0;
501
507 virtual void setTxAntennas(const std::vector<std::string>& txAnts) = 0;
508
514 virtual void setRxAntennas(const std::vector<std::string>& rxAnts) = 0;
515
521 virtual double getFilterBandwidth() = 0;
522
528 virtual void setFilterBandwidth(double bw) = 0;
529
535 virtual std::string getClockSource() = 0;
536
542 virtual void setClockSource(const std::string& clockSource) = 0;
543
549 virtual void setClockSources(const std::vector<std::string>& clockSources) = 0;
550
556 virtual std::vector<std::string> getClockSources() = 0;
557
563 virtual std::string getTimeSource() = 0;
564
570 virtual void setTimeSource(const std::string& timeSource) = 0;
571
577 virtual void setTimeSources(const std::vector<std::string>& timeSources) = 0;
578
584 virtual std::vector<std::string> getTimeSources() = 0;
585
591 virtual double getMasterClockRate() = 0;
592
598 virtual void setMasterClockRate(double masterClockRate) = 0;
599
605 [[nodiscard]] virtual SDRFrontEndTransferType getTransferType() const = 0;
606
612 virtual void setTransferType(SDRFrontEndTransferType transferType) = 0;
613
619 virtual void setNumThreads4RxDecoding(uint8_t numThreads) = 0;
620
626 [[nodiscard]] virtual double getRxBufferDuration() const = 0;
627
633 virtual void skipMPDUDecoding4HESUHighDopplerFrame(bool skipDataDecoding) = 0;
634
635 virtual void setRxPipelineChannels(std::vector<std::vector<size_t>> PipelineChannels) = 0;
636
637 virtual std::vector<std::vector<size_t>> getRxPipelineChannels() = 0;
638
639 virtual void setPinelineConfig(std::vector<PipelineConfig> cfgs) = 0;
640
641 virtual std::vector<PipelineConfig> getPinelineConfig() = 0;
642};
643
644#endif //PICOSCENES_PLATFORM_SDRFRONTENDCONFIGURATIONS_HXX
SDRFrontEndTransferType
Enumeration for SDR frontend data transfer type.
Interface class for SDR frontend baseband configurations.
virtual double getTxResampleRatio()=0
Get the Tx resampling ratio.
virtual bool useConventionalPacketDetector() const =0
Check if conventional packet detector should be used.
virtual void setCarrierFrequencyOffset4RxDecoding(double carrierFrequencyOffset)=0
Set the carrier frequency offset for Rx decoding.
virtual bool isRxResampleBypassFIR()=0
Check if FIR filter is bypassed in Rx resampling.
virtual double getRxIqCrossTalkDegree()=0
Get the I/Q crosstalk angle for Rx.
virtual void setCarrierFrequencyOffset4TxEncoding(double carrierFrequencyOffset)=0
Set the carrier frequency offset for Tx encoding.
virtual std::optional< double > getCarrierFrequencyOffset4RxDecoding()=0
Get the carrier frequency offset for Rx decoding.
virtual double getTxIqRatioDB()=0
Get the I/Q ratio for Tx in dB.
virtual double getRxSensitivity()=0
Get the receiver sensitivity.
virtual double getRxOfdmSymbolOffset()=0
Get the Rx OFDM symbol offset.
virtual void setRxMergeHighLow(bool merge)=0
Set whether to merge high/low for Rx.
virtual void setRxSensitivity(double rxSensitivity)=0
Set the receiver sensitivity.
virtual double getSDRFrontEndTime()=0
Get the current SDR hardware time.
virtual bool isRxMergeHighLow()=0
Check if high/low merge is enabled for Rx.
virtual void setRxResampleRatio(double rxResampleRatio)=0
Set the Rx resampling ratio.
virtual double getRxResampleRatio()=0
Get the Rx resampling ratio.
virtual bool isTxSplitHighLow()=0
Check if high/low split is enabled for Tx.
virtual void setSamplingFrequencyOffset4RxDecoding(double samplingFrequencyOffset)=0
Set the sampling frequency offset for Rx decoding.
virtual void setRxOfdmSymbolOffset(double rxOfdmSymbolOffset)=0
Set the Rx OFDM symbol offset.
virtual double getTxIqCrossTalkDegree()=0
Get the I/Q crosstalk angle for Tx.
virtual void setRxChannelBandwidthMode(ChannelBandwidthEnum rxCbw)=0
Set the channel bandwidth mode for Rx.
virtual std::optional< double > getSamplingFrequencyOffset4TxEncoding()=0
Get the sampling frequency offset for Tx encoding.
virtual double getNumSamplesSavedBeforeStart()=0
Get the number of samples saved before start.
virtual void setFullDuplex(bool enableFullduplex)=0
Set full duplex mode.
virtual std::optional< double > getCarrierFrequencyOffset4TxEncoding()=0
Get the carrier frequency offset for Tx encoding.
virtual void setTxIQMismatch(double iq_ratio_db, double iq_crosstalk_degree)=0
Set I/Q mismatch parameters for Tx.
virtual void setRxIQMismatch(double iq_ratio_db, double iq_crosstalk_degree)=0
Set I/Q mismatch parameters for Rx.
virtual void setTxSplitHighLow(bool split)=0
Set whether to split high/low for Tx.
virtual void setTxResampleRatio(double txResampleRatio)=0
Set the Tx resampling ratio.
virtual ChannelBandwidthEnum getRxChannelBandwidthMode()=0
Get the current channel bandwidth mode for Rx.
virtual double getRxIqRatioDB()=0
Get the I/Q ratio for Rx in dB.
virtual bool isFullDuplexEnabled()=0
Check if full duplex mode is enabled.
virtual bool isReturnBasebandSignals() const =0
Check if baseband signals should be returned.
virtual void setRxResampleBypassFIR(bool bypass)=0
Set whether to bypass FIR filter in Rx resampling.
virtual void setSamplingFrequencyOffset4TxEncoding(double samplingFrequencyOffset)=0
Set the sampling frequency offset for Tx encoding.
virtual void getNumSamplesSavedBeforeStart(double numSamplesSavedBeforeStart)=0
Set the number of samples saved before start.
virtual ~SDRFrontEndBasebandConfigurations()=default
virtual std::optional< double > getSamplingFrequencyOffset4RxDecoding()=0
Get the sampling frequency offset for Rx decoding.
Configuration class for SDR frontend hardware settings.
virtual void setMasterClockRate(double masterClockRate)=0
Set the master clock rate.
virtual void skipMPDUDecoding4HESUHighDopplerFrame(bool skipDataDecoding)=0
Set whether to skip MPDU decoding for HE-SU high Doppler frames.
virtual void setTxAntennas(const std::vector< std::string > &txAnts)=0
Set antennas for all Tx chains.
virtual SDRFrontEndTransferType getTransferType() const =0
Get the current transfer type.
virtual const std::vector< size_t > & userSpecifiedRxChannels() const =0
Get the list of user-specified Rx channels.
virtual void setAGC(bool enableAGC)=0
Enable or disable AGC.
virtual void setRxSamplingRate(double rxRate)=0
Set the Rx sampling rate.
virtual void setRxAntenna(const std::string &rxAnt)=0
Set the Rx antenna.
virtual void setTxSamplingRate(double txRate)=0
Set the Tx sampling rate.
virtual double getTxSamplingRate()=0
Get the current Tx sampling rate.
virtual std::vector< std::string > getClockSources()=0
Get list of current clock sources.
virtual void setRxCarrierFrequencies(std::vector< double > carrierFreqs)=0
Set carrier frequencies for Rx channels.
virtual double getFilterBandwidth()=0
Get the current filter bandwidth.
virtual void setClockSources(const std::vector< std::string > &clockSources)=0
Set clock sources for multiple motherboards.
virtual void setTimeSource(const std::string &timeSource)=0
Set the time source.
virtual std::string getTimeSource()=0
Get the current time source.
virtual double getMasterClockRate()=0
Get the master clock rate.
virtual const std::vector< size_t > & userSpecifiedTxChannels() const =0
Get the list of user-specified Tx channels.
virtual double getRxBufferDuration() const =0
Get the Rx buffer duration.
virtual void setNumThreads4RxDecoding(uint8_t numThreads)=0
Set the number of threads for Rx decoding.
virtual bool supportAGC()=0
Check if AGC is supported.
virtual std::string getClockSource()=0
Get the current clock source.
virtual void setTransferType(SDRFrontEndTransferType transferType)=0
Set the transfer type.
virtual std::vector< std::string > getRxAntennas()=0
Get list of available Rx antennas.
virtual void setTimeSources(const std::vector< std::string > &timeSources)=0
Set time sources for multiple motherboards.
virtual void setTxAntenna(const std::string &txAnt)=0
Set the Tx antenna.
virtual void setTxCarrierFrequencies(std::vector< double > carrierFreqs)=0
Set carrier frequencies for Tx channels.
virtual std::vector< double > getTxCarrierFrequencies()=0
Get carrier frequencies for Tx channels.
virtual std::vector< double > getRxCarrierFrequencies()=0
Get carrier frequencies for Rx channels.
virtual std::vector< PipelineConfig > getPinelineConfig()=0
virtual void setClockSource(const std::string &clockSource)=0
Set the clock source.
virtual void setPinelineConfig(std::vector< PipelineConfig > cfgs)=0
virtual void setRxAntennas(const std::vector< std::string > &rxAnts)=0
Set antennas for all Rx chains.
virtual std::vector< std::string > getTxAntennas()=0
Get list of available Tx antennas.
virtual std::vector< std::string > getTimeSources()=0
Get list of current time sources.
virtual std::string getRxAntenna()=0
Get the current Rx antenna.
virtual std::string getTxAntenna()=0
Get the current Tx antenna.
virtual void initializeSDR()=0
Initialize the SDR hardware.
virtual void setRxPipelineChannels(std::vector< std::vector< size_t > > PipelineChannels)=0
virtual double getRxSamplingRate()=0
Get the current Rx sampling rate.
virtual void setFilterBandwidth(double bw)=0
Set the filter bandwidth.
virtual std::vector< std::vector< size_t > > getRxPipelineChannels()=0
std::vector< size_t > rx_channel
Structure containing reception status information for SDR frontend.
PicoScenesDeviceSubtype subType
PicoScenesDeviceType deviceType
Structure containing transmission status information for SDR frontend.
PicoScenesDeviceType deviceType
PicoScenesDeviceSubtype subType