Skip to content

Commit

Permalink
now done yet
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangzp committed Sep 17, 2022
1 parent 473d9bc commit 199f27f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
21 changes: 18 additions & 3 deletions plugin-echoprobe/EchoProbeInitiator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,9 @@ std::vector<double> EchoProbeInitiator::enumerateArbitrarySamplingRates() {
}

std::vector<double> EchoProbeInitiator::enumerateCarrierFrequencies() {
if (false && isIntelMVMTypeNIC(nic->getFrontEnd()->getFrontEndType())) {
return enumerateIntelMVMCarrierFrequencies();
}
return enumerateArbitraryCarrierFrequencies();
}

Expand All @@ -396,15 +399,15 @@ std::vector<double> EchoProbeInitiator::enumerateArbitraryCarrierFrequencies() {

if (cf_end > cf_begin && cf_step < 0)
throw std::invalid_argument("cf_step < 0, however cf_end > cf_begin.\n");
if(cf_step == 160e6) {
if (cf_step == 160e6) {
auto allFrequencies160 = std::set<double>();
auto band160 = MAC80211FrontEndUtils::standardChannelsIn2_4_5_6GHzBandUpTo160MHzBW();
for (auto i = 0; i < band160.size(); i++) {
if (std::get<1>(band160[i]) == 160)
allFrequencies160.insert((double) std::get<2>(band160[i]) * 1000000);
}
for(auto freq : allFrequencies160){
if(freq >= cf_begin && freq <= cf_end )
for (auto freq: allFrequencies160) {
if (freq >= cf_begin && freq <= cf_end)
frequencies.emplace_back(freq);
}
return frequencies;
Expand All @@ -417,6 +420,18 @@ std::vector<double> EchoProbeInitiator::enumerateArbitraryCarrierFrequencies() {
return frequencies;
}

std::vector<double> EchoProbeInitiator::enumerateIntelMVMCarrierFrequencies() {
auto cf_begin = parameters.cf_begin.value_or(nic->getFrontEnd()->getCarrierFrequency());
auto cf_end = parameters.cf_end.value_or(nic->getFrontEnd()->getCarrierFrequency());
auto cf_step = parameters.cf_step.value_or(20e6);
auto cur_cf = cf_begin;

auto frequencies = std::vector<double>{cur_cf};
auto availableChannels = MAC80211FrontEndUtils::standardChannelsIn2_4_5_6GHzBandUpTo160MHzBW();


}

static double closest(std::vector<double> const &vec, double value) {
if (value <= vec[0])
return vec[0];
Expand Down
1 change: 1 addition & 0 deletions plugin-echoprobe/EchoProbeInitiator.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class EchoProbeInitiator {
EchoProbeRequest makeRequestSegment(uint16_t sessionId, std::optional<double> newCF = std::nullopt, std::optional<double> newSF = std::nullopt);


std::vector<double> enumerateIntelMVMCarrierFrequencies();
};

#endif //PICOSCENES_ECHOPROBEINITIATOR_H

0 comments on commit 199f27f

Please sign in to comment.