Browse Source

fix detection of 802.11a/b protocols

master
Brad Parker 11 years ago
parent
commit
1fbb285ba7
  1. 5
      iptest/iptest.cpp
  2. 2
      wireless.cpp

5
iptest/iptest.cpp

@ -42,7 +42,7 @@ int main(int argc, char *argv[]) {
//interface.deleteAddress("1.1.1.5/29");
Wireless wi("wlp0s11u1");
Wireless wi("wlp3s0");
QList<BandInfo> bands = wi.bandMap();
@ -81,12 +81,13 @@ int main(int argc, char *argv[]) {
std::cout << "is channel 165 supported? " << (wi.channelSupported(165) ? "yes" : "no") << std::endl;
std::cout << "is frequency 2.437GHz supported? " << (wi.frequencySupported(2437) ? "yes" : "no") << std::endl;
std::cout << "is frequency 5.825GHz supported? " << (wi.frequencySupported(5825) ? "yes" : "no") << std::endl;
std::cout << "all channels:";
}else{
std::cout << "no channels supported" << std::endl;
}
}
std::cout << "all channels:";
foreach(int chan, wi.allChannels()) {
std::cout << " " << chan;
}

2
wireless.cpp

@ -439,7 +439,7 @@ int Wireless::nl80211_freqlist_cb(struct nl_msg *msg, void *arg) {
}
if(!((band.protocols & PROTOCOL_80211_B) == PROTOCOL_80211_B)) {
if(info.chan >= 1) { // first 2.4GHz channel
if(info.chan <= 14) { // last 2.4GHz channel
band.protocols = static_cast<Protocols>(band.protocols | PROTOCOL_80211_B);
band.band = static_cast<Bands>(band.band | BAND_2GHZ);
}

Loading…
Cancel
Save