Skip to content

Commit

Permalink
MobilityManager: Fix bug, updating scan results properly by means of
Browse files Browse the repository at this point in the history
updateStatsWithReassignment.
  • Loading branch information
luissequeira committed Jan 24, 2017
1 parent 304bacf commit 40e638b
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,12 @@ private void handler (OdinEventSubscription oes, NotificationCallbackContext cnt
log.info("MobilityManager: Scanning client " + cntx.clientHwAddress + " in agent " + agentAddr + " and channel " + getChannelFromAgent(cntx.agent.getIpAddress()));
lastScanningResult = scanClientFromAgent(agentAddr, cntx.clientHwAddress, getChannelFromAgent(cntx.agent.getIpAddress()), this.SCANNING_TIME);
//scan = false; // For testing only once
if (lastScanningResult >= stats.scanningResult) {
updateStatsWithReassignment(stats, cntx.value, currentTimestamp, agentAddr, lastScanningResult);
if (lastScanningResult >= stats.signalStrength) {
//if (lastScanningResult >= 50) { // testing
updateStatsWithReassignment(stats, lastScanningResult, currentTimestamp, agentAddr, lastScanningResult);
}
else {
updateStatsWithReassignment(stats, cntx.value, currentTimestamp, stats.agentAddr, stats.scanningResult);
}
log.info("MobilityManager: Scaned client " + cntx.clientHwAddress + " in agent " + agentAddr + " and channel " + getChannelFromAgent(cntx.agent.getIpAddress()) + " with power " + lastScanningResult);
}
Expand Down Expand Up @@ -184,12 +188,12 @@ private void channelAssignment () {
log.info("MobilityManager: Agent IP: " + agentAddr.getHostAddress());
if (agentAddr.getHostAddress().equals("192.168.1.9")){
log.info ("MobilityManager: Agent channel: " + getChannelFromAgent(agentAddr));
setChannelToAgent(agentAddr, 4);
setChannelToAgent(agentAddr, 1);
log.info ("MobilityManager: Agent channel: " + getChannelFromAgent(agentAddr));
}
if (agentAddr.getHostAddress().equals("192.168.1.10")){
log.info ("MobilityManager: Agent channel: " + getChannelFromAgent(agentAddr));
setChannelToAgent(agentAddr, 10);
setChannelToAgent(agentAddr, 11);
log.info ("MobilityManager: Agent channel: " + getChannelFromAgent(agentAddr));
}

Expand Down

0 comments on commit 40e638b

Please sign in to comment.