Skip to content

Commit

Permalink
Fix bug: Include convert frequency/channel to StubOdinAgent
Browse files Browse the repository at this point in the history
  • Loading branch information
luissequeira committed May 23, 2016
1 parent 849272c commit 9e0357a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -525,19 +525,23 @@ public void sendChannelSwitch(MACAddress clientHwAddr, MACAddress bssid, List<St

public int convertFrequencyToChannel(int freq) {
if (freq >= 2412 && freq <= 2484) {
return (freq - 2412) / 5 + 1;
int chan = (freq - 2412) / 5 + 1;
return chan;
} else if (freq >= 5170 && freq <= 5825) {
return (freq - 5170) / 5 + 34;
int chan = (freq - 5170) / 5 + 34;
return chan;
} else {
return -1;
}
}

public int convertChannelToFrequency(int chan) {
if (chan >= 1 && chan <= 14) {
return 5 * (chan - 1) + 2412;
int freq = 5 * (chan - 1) + 2412;
return freq;
} else if (chan >= 34 && chan <= 165) {
return 5 * (chan - 34) + 5170;
int freq = 5 * (chan - 34) + 5170;
return freq;
} else {
return -1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class StubOdinAgent implements IOdinAgent {
private long lastHeard;
private int channel;
private ConcurrentSkipListSet<OdinClient> clientList = new ConcurrentSkipListSet<OdinClient>();
private int freq;
private int chan;

@Override
public void addClientLvap(OdinClient oc) {
Expand Down Expand Up @@ -109,4 +111,14 @@ public int getChannel() {
public void sendChannelSwitch(MACAddress clientHwAddr, MACAddress bssid, List<String> ssidList, int channel){
// Do nothing.
}

@Override
public int convertFrequencyToChannel(int freq) {
return chan;
}

@Override
public int convertChannelToFrequency(int chan) {
return freq;
}
}
Binary file removed target/floodlight-test.jar
Binary file not shown.
Binary file removed target/floodlight.jar
Binary file not shown.

0 comments on commit 9e0357a

Please sign in to comment.