37 std::pair<std::string,bool>
40 std::map<std::string,std::vector<Any>> parameters;
42 std::transform(updates.begin(),
44 std::inserter(parameters,parameters.end()),
45 [](
const ConfigurationUpdate::value_type & p)
47 return std::make_pair(p.first,p.second);
50 if(parameters[
"cwmin0"][0] >= parameters[
"cwmax0"][0])
52 return std::make_pair(
"cwmin0 must be less than cwmax0",
false);
55 if(parameters[
"cwmin1"][0] >= parameters[
"cwmax1"][0])
57 return std::make_pair(
"cwmin1 must be less than cwmax1",
false);
60 if(parameters[
"cwmin2"][0] >= parameters[
"cwmax2"][0])
62 return std::make_pair(
"cwmin2 must be less than cwmax2",
false);
65 if(parameters[
"cwmin3"][0] >= parameters[
"cwmax3"][0])
67 return std::make_pair(
"cwmin3 must be less than cwmax3",
false);
71 if(parameters[
"mode"][0].asUINT8() == 1)
74 if(parameters[
"unicastrate"][0].asUINT8() < 5 || parameters[
"unicastrate"][0].asUINT8() > 12)
76 return std::make_pair(
"unicastrate range is [5-12] for mode 80211A",
false);
80 if(parameters[
"multicastrate"][0].asUINT8() < 5 || parameters[
"multicastrate"][0].asUINT8() > 12)
82 return std::make_pair(
"multicastrate range [5-12] for mode 80211A",
false);
87 if(parameters[
"mode"][0].asUINT8() == 2 || parameters[
"mode"][0].asUINT8() == 0)
90 if(parameters[
"unicastrate"][0].asUINT8() < 1 || parameters[
"unicastrate"][0].asUINT8() > 4)
92 return std::make_pair(
"unicastrate range [1-4] for mode 80211B",
false);
96 if(parameters[
"multicastrate"][0].asUINT8() < 1 || parameters[
"multicastrate"][0].asUINT8() > 4)
98 return std::make_pair(
"multicastrate range [1-4] for mode 80211B",
false);
103 if(parameters[
"mode"][0].asUINT8() == 3)
106 if(parameters[
"unicastrate"][0].asUINT8() < 1 || parameters[
"unicastrate"][0].asUINT8() > 12)
108 return std::make_pair(
"unicastrate range [1-12] for mode 80211BG",
false);
112 if(parameters[
"multicastrate"][0].asUINT8() < 1 || parameters[
"multicastrate"][0].asUINT8() > 12)
114 return std::make_pair(
"multicastrate range [1-12] for mode 80211BG",
false);
119 return std::make_pair(
"",
true);
std::pair< std::string, bool > configurationValidator(const ConfigurationUpdate &updates) noexcept
std::vector< ConfigurationNameAnyValues > ConfigurationUpdate