Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
renxincheng committed Dec 14, 2021
1 parent d12f4ef commit 93edc22
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion plugin-echoprobe/EchoProbeInitiator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ std::shared_ptr<PicoScenesFrameBuilder> EchoProbeInitiator::buildBasicFrame(uint
fp->setChannelCoding((ChannelCodingEnum) parameters.coding.value_or((uint32_t) ChannelCodingEnum::BCC));
fp->setTxHEExtendedRange(parameters.txHEExtendedRange.value_or(false));
fp->setHEHighDoppler(parameters.heHighDoppler.value_or(false));
fp->setHEMidamblePeriodicity(parameters.heHighDoppler.value_or(10));
fp->setHEMidamblePeriodicity(parameters.heMidamblePeriodicity.value_or(10));
fp->getFrame()->txParameters.idleTime = parameters.ifs.value_or(20e-6);

fp->setDestinationAddress(parameters.inj_target_mac_address->data());
Expand Down
2 changes: 1 addition & 1 deletion plugin-echoprobe/EchoProbeParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class EchoProbeParameters {
std::optional<uint32_t> coding;
std::optional<bool> txHEExtendedRange;
std::optional<bool> heHighDoppler;
std::optional<uint32_t> heMidamblePeriodicity;
std::optional<double> heMidamblePeriodicity;
std::optional<double> ifs;
EchoProbeInjectionContent injectorContent;

Expand Down
12 changes: 4 additions & 8 deletions plugin-echoprobe/EchoProbePlugin.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void EchoProbePlugin::initialization() {
("gi", po::value<uint32_t>(), "Guarding Interval [400, 800, 1600, 3200], 800 as default")
("coding", po::value<std::string>(), "Code scheme [LDPC, BCC], BCC as default")
("extended-range", "Enable 11ax extended range")
("high-doppler", po::value<uint32_t>()->default_value(10), "Enabling 802.11ax High Doppler mode with the Midamble Periodicity of 10 or 20, 10 as default")
("high-doppler", po::value<double>()->implicit_value(10), "Enabling 802.11ax High Doppler mode with the Midamble Periodicity of 10 or 20, 10 as default")
("injector-content", po::value<std::string>(), "Content type for injector mode [full, header, ndp]")
("ifs", po::value<std::string>(), "Inter-Frame Spacing in seconds, 20e-6 as default");

Expand Down Expand Up @@ -249,14 +249,10 @@ void EchoProbePlugin::parseAndExecuteCommands(const std::string &commandString)
}

if (vm.count("high-doppler")) {
auto heMidamblePeriodicity = vm["high-doppler"].as<std::uint32_t>();
auto heMidamblePeriodicity = vm["high-doppler"].as<double>();
if (*parameters.format == PacketFormatEnum::PacketFormat_HESU || *parameters.format == PacketFormatEnum::PacketFormat_HEMU) {
if (heMidamblePeriodicity == 10 || heMidamblePeriodicity == 20) {
parameters.heHighDoppler = true;
parameters.heMidamblePeriodicity = heMidamblePeriodicity;
} else
throw std::invalid_argument(fmt::format("[EchoProbe Plugin]: invalid 802.11 High-Doppler Midamble Periodicity: {}. Only 10 or 20 acceptable. \n", heMidamblePeriodicity));

parameters.heHighDoppler = true;
parameters.heMidamblePeriodicity = heMidamblePeriodicity;
} else {
throw std::invalid_argument(fmt::format("[EchoProbe Plugin]: Only packet format of 11ax supports high doppler."));
}
Expand Down

0 comments on commit 93edc22

Please sign in to comment.