mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-03-09 15:40:12 +00:00
refactor compare station count
This commit is contained in:
parent
061a477a20
commit
50167ac917
1 changed files with 13 additions and 30 deletions
|
@ -267,10 +267,6 @@ int compare_station_count(uint8_t *bssid_addr_own, uint8_t *bssid_addr_to_compar
|
|||
printf("Comparing own %d to %d\n", ap_entry_own.station_count, ap_entry_to_compre.station_count);
|
||||
|
||||
|
||||
if (automatic_kick) {
|
||||
return ((int)ap_entry_own.station_count - 1) > (int)ap_entry_to_compre.station_count;
|
||||
} else {
|
||||
|
||||
int sta_count = ap_entry_own.station_count;
|
||||
int sta_count_to_compare = ap_entry_to_compre.station_count;
|
||||
if(is_connected(bssid_addr_own, client_addr))
|
||||
|
@ -284,24 +280,11 @@ int compare_station_count(uint8_t *bssid_addr_own, uint8_t *bssid_addr_to_compar
|
|||
printf("COMPARE IS ALREADY CONNECTED! DECREASE COUNTER!!!\n");
|
||||
sta_count_to_compare--;
|
||||
}
|
||||
printf("AFTER: Comparing own %d to %d\n", sta_count, sta_count_to_compare);
|
||||
|
||||
return sta_count > sta_count_to_compare;
|
||||
}
|
||||
|
||||
/*
|
||||
int own_count = ap_entry_own.station_count;
|
||||
if(automatic_kick)
|
||||
{
|
||||
own_count--;
|
||||
}
|
||||
if (is_connected(bssid_addr_to_compare, client_addr))
|
||||
{
|
||||
own_count--;
|
||||
}
|
||||
|
||||
return own_count > ap_entry_to_compre.station_count;*/
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue