PicoScenes API Docs
 
Loading...
Searching...
No Matches
MAC80211InjectionOnlyFrontEnd.hxx
Go to the documentation of this file.
1//
2// Created by Zhiping Jiang on 12/24/19.
3//
4
5#ifndef PICOSCENES_PLATFORM_MAC80211INJECTIONONLYFRONTEND_HXX
6#define PICOSCENES_PLATFORM_MAC80211INJECTIONONLYFRONTEND_HXX
7
9#include "MAC80211Utils.hxx"
10#include "FrontEndFactory.hxx"
11
13 friend FrontEndFactory;
14public:
15 static bool isMAC80211CompatibleFrontEnd(const std::string &referredInterfaceName);
16
17 int startTx() override;
18
19 int stopTx() override;
20
21 int startRx() override;
22
23 int stopRx() override;
24
25 int transmit(const ModularPicoScenesTxFrame &frame) override;
26
27 int transmitFramesInBatch(const std::vector<const ModularPicoScenesTxFrame *> &frames, uint32_t repeat) override;
28
29 int transmitFramesInBatch(const std::vector<ModularPicoScenesTxFrame> &frames, uint32_t repeat) override;
30
32
33 [[nodiscard]] const std::string &getDevId() const;
34
35 [[nodiscard]] const std::string &getMonId() const;
36
37 [[nodiscard]] uint16_t getPhyIdNumber() const;
38
39 [[nodiscard]] const std::string &getPhyPath() const;
40
41 [[nodiscard]] const std::array<uint8_t, 6> &getMacAddressMon() const;
42
43 [[nodiscard]] const std::array<uint8_t, 6> &getMacAddressDev() const;
44
45 std::tuple<double, double, double> getChannelAndBandwidth() override;
46
47 int setChannelAndBandwidth(double control, double bw, double center) override;
48
49 int setChannelAndBandwidth(std::optional<double> control, std::optional<double> bw, std::optional<double> center) override;
50
51 double getCarrierFrequency() override;
52
53 void setCarrierFrequency(double carrierFrequency) override;
54
55 double getSamplingRate() override;
56
57 void setSamplingRate(double samplingRate) override;
58
59 double getControlChannelFrequency() override;
60
61 void setControlChannelFrequency(double controlFrequency) override;
62
63 double getRxChannelBandwidth() override;
64
65 void setRxChannelBandwidth(double rxcbw) override;
66
67 double getTxpower() override;
68
69 void setTxpower(double txpower) override;
70
71 double getRxGain() override;
72
73 void setRxGain(double rxGain) override;
74
75 void setRxGain(double rxGain, uint8_t channel) override;
76
77 uint8_t getTxChainMask() override;
78
79 void setTxChainMask(uint8_t txChainMask) override;
80
81 uint8_t getRxChainMask() override;
82
83 void setRxChainMask(uint8_t rxChainMask) override;
84
85 std::vector<size_t> getTxChannels() override;
86
87 void setTxChannels(const std::vector<size_t> &txChannels) override;
88
89 std::vector<size_t> getRxChannels() override;
90
91 void setRxChannels(const std::vector<size_t> &rxChannels) override;
92
93 uint16_t getChannelFlags() override;
94
95 ExtraInfo buildExtraInfo() override;
96
97 [[nodiscard]] const std::vector<double> &getSystemSupportedFrequencies() const;
98
99 [[nodiscard]] bool isMAC80211SupportedCarrierFrequency(double frequency) const;
100
101 void printStatus() override;
102
103protected:
104
105 explicit MAC80211InjectionOnlyFrontEnd(const std::string &referredName);
106
107 std::string devId;
108 std::string monId;
109 uint16_t phyIdNumber = 0;
110 std::string phyPath;
111 std::shared_ptr<uint8_t> txContext;
112
113 std::array<uint8_t, 6> macAddress_MON{0, 0, 0, 0, 0, 0};
114 std::array<uint8_t, 6> macAddress_DEV{0, 0, 0, 0, 0, 0};
115
116 std::vector<double> systemSupportedFrequencies;
117};
118
119
120#endif //PICOSCENES_PLATFORM_MAC80211INJECTIONONLYFRONTEND_HXX
The shared abstract frontend interface for both SDR and NIC.
std::string referredInterfaceName
the user specified frontend name
double getRxChannelBandwidth() override
Get the 802.11 Channel Bandwidth parameter (20e6/40e6/80e6/160e6/320e6) of the Rx path.
void setCarrierFrequency(double carrierFrequency) override
Get the RF carrier frequency.
int transmitFramesInBatch(const std::vector< const ModularPicoScenesTxFrame * > &frames, uint32_t repeat) override
Transmit frames in batch with precise inter-frame timing.
double getControlChannelFrequency() override
Get the control channel frequency of <contorlfreq-bandwidth-centerfreq> channel parameter.
const std::vector< double > & getSystemSupportedFrequencies() const
int transmit(const ModularPicoScenesTxFrame &frame) override
std::tuple< double, double, double > getChannelAndBandwidth() override
Get the <contorlfreq-bandwidth-centerfreq> channel parameter.
int startTx() override
Activate internal Tx service loop.
void setRxChannels(const std::vector< size_t > &rxChannels) override
Set the number of the active Rx channels, starting from 0.
void printStatus() override
Print a status string to command line.
~MAC80211InjectionOnlyFrontEnd() override
void setRxGain(double rxGain, uint8_t channel) override
Set the Rx gain for the specified channel. However, currently only QCA9300 and SDR frontend support t...
static bool isMAC80211CompatibleFrontEnd(const std::string &referredInterfaceName)
const std::array< uint8_t, 6 > & getMacAddressDev() const
int stopRx() override
De-activate the Rx service loop, set rxServiceStarted to false.
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.
double getRxGain() override
Get the total Rx gain. However, currently only QCA9300 and SDR frontend support this method.
uint8_t getTxChainMask() override
Get the Tx chain mask.
void setRxChannelBandwidth(double rxcbw) override
Set the Rx channel bandwidth parameter of the <contorlfreq-bandwidth-centerfreq> channel parameters.
std::vector< size_t > getTxChannels() override
Get the numbers of the active Tx channels, starting from 0.
const std::string & getMonId() const
double getTxpower() override
get the transmission power (Tx power)
double getCarrierFrequency() override
Get the RF carrier frequency.
void setSamplingRate(double samplingRate) override
set sampling rate (in Hz)
bool isMAC80211SupportedCarrierFrequency(double frequency) const
int setChannelAndBandwidth(double control, double bw, double center) override
Set the <contorlfreq-bandwidth-centerfreq> channel parameter.
void setTxpower(double txpower) override
Set the Tx power (in dB)
MAC80211InjectionOnlyFrontEnd(const std::string &referredName)
void setRxChainMask(uint8_t rxChainMask) override
Set Rx chain mask. Setting Rx chain mask means to use only the selected Rx chains for signal receptio...
int stopTx() override
De-activate Tx service loop.
std::vector< size_t > getRxChannels() override
Get the number of the active Rx channels, starting from 0.
uint8_t getRxChainMask() override
Get Rx chain mask.
void setControlChannelFrequency(double controlFrequency) override
Get the control channel frequency of <contorlfreq-bandwidth-centerfreq> channel parameter.
uint16_t getChannelFlags() override
Get the old ChannelFlags descriptor.
int startRx() override
Activiate the Rx service loop.
void setRxGain(double rxGain) override
Set the total Rx gain. However, currently only QCA9300 and SDR frontend support this method.
const std::string & getPhyPath() const
int transmitFramesInBatch(const std::vector< ModularPicoScenesTxFrame > &frames, uint32_t repeat) override
void setTxChainMask(uint8_t txChainMask) override
Set Tx chain mask. Setting Tx chain mask means to use only the selected Tx chain for signal transmiss...
const std::array< uint8_t, 6 > & getMacAddressMon() const
const std::string & getDevId() const
uint16_t getPhyIdNumber() const
double getSamplingRate() override
Get the baseband sampling rate.
void setTxChannels(const std::vector< size_t > &txChannels) override
This methods is fundamentally.
ExtraInfo buildExtraInfo() override
Build an ExtraInfo object describing the current frontend status.