Skip to content

Commit fd670b6

Browse files
committed
Merge branch 'Development'
2 parents 3acc5d9 + b297162 commit fd670b6

3 files changed

Lines changed: 19 additions & 0 deletions

File tree

click_binary_file/click_for_AR71xx

4.91 KB
Binary file not shown.

src/odinagent.cc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2373,6 +2373,23 @@ OdinAgent::read_handler(Element *e, void *user_data)
23732373
sa << agent->_tx_power << "\n";
23742374
break;
23752375
}
2376+
case handler_sta_rssi: {
2377+
// Disable scanning
2378+
agent->_active_AP_scanning = 0;
2379+
// Scanning result
2380+
for (HashTable<EtherAddress, StationStats>::const_iterator iter = agent->_scanned_station_stats.begin();iter.live(); iter++) {
2381+
OdinAgent::StationStats n = iter.value();
2382+
if(n._equipment=="STA"){
2383+
sa << iter.key().unparse_colon();
2384+
double rssi = floor(n._avg_signal*100 + 0.5)/100;
2385+
sa << " " << rssi << "\n"; // signal in dBm
2386+
}
2387+
}
2388+
2389+
if (agent->_debug_level % 10 > 0)
2390+
fprintf(stderr, "[Odinagent.cc] ########### Scanning: Sending AP scanning values \n");
2391+
break;
2392+
}
23762393
}
23772394

23782395
return sa.take_string();
@@ -2906,6 +2923,7 @@ OdinAgent::add_handlers()
29062923
add_read_handler("scan_APs", read_handler, handler_scan_APs);
29072924
add_read_handler("scanning_flags", read_handler, handler_scanning_flags);
29082925
add_read_handler("txpower", read_handler, handler_txpower);
2926+
add_read_handler("sta_rssi", read_handler, handler_sta_rssi);
29092927

29102928
add_write_handler("add_vap", write_handler, handler_add_vap);
29112929
add_write_handler("set_vap", write_handler, handler_set_vap);

src/odinagent.hh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ public:
148148
handler_send_measurement_beacon,
149149
handler_scanning_flags,
150150
handler_txpower,
151+
handler_sta_rssi,
151152
};
152153

153154
// Tx and Rx-stats about stations

0 commit comments

Comments
 (0)