change exp thr to mbit/sec

This commit is contained in:
PolynomialDivision 2018-03-20 17:30:04 +01:00
parent 4e975b5829
commit 28c71fa44e
3 changed files with 13 additions and 1 deletions

View file

@ -10,4 +10,11 @@
*/
double iee80211_calculate_bitrate(uint8_t supp_rate_val);
/**
* Calculate expected throughput in Mbit/sec.
* @param exp_thr
* @return
*/
double iee80211_calculate_expected_throughput_mbit(int exp_thr)
#endif //DAWN_IEEE80211_UTILS_H

View file

@ -419,7 +419,7 @@ void kick_clients(uint8_t bssid[], uint32_t id) {
// update rssi
int rssi = get_rssi_iwinfo(client_array[j].client_addr);
int exp_thr = get_expected_throughput_iwinfo(client_array[j].client_addr);
printf("Expectd throughput %d\n", exp_thr);
printf("Expectd throughput %f Mbit/sec\n", iee80211_calculate_expected_throughput_mbit(exp_thr));
if (rssi != INT_MIN) {
pthread_mutex_unlock(&probe_array_mutex);

View file

@ -5,4 +5,9 @@
double iee80211_calculate_bitrate(uint8_t supp_rate_val)
{
return ((double) supp_rate_val) / 2;
}
double iee80211_calculate_expected_throughput_mbit(int exp_thr)
{
return (((double) exp_thr)/ 1000);
}