Skip to content

Commit

Permalink
exp rssi
Browse files Browse the repository at this point in the history
  • Loading branch information
Consti10 committed Aug 8, 2023
1 parent 383ef60 commit b07fec4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/RSSIForWifiCard.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class RSSIAccumulator{
reset();
return tmp;
}
return std::nullopt;
}
void reset(){
m_rssi_sum=0;
Expand Down
7 changes: 7 additions & 0 deletions src/WBTxRx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,13 +396,20 @@ void WBTxRx::on_new_packet(const uint8_t wlan_idx, const pcap_pkthdr &hdr,
auto opt_minmaxavg=this_wifi_card_stats.rssi_for_wifi_card.m_rssi_antenna1.add_and_recalculate_if_needed(rssi);
if(opt_minmaxavg.has_value()){
this_wifi_card_stats.antenna1_dbm=opt_minmaxavg.value().avg;
if(m_options.debug_rssi){
m_console->debug("Antenna1{}:{}",0, min_max_avg_as_string(opt_minmaxavg.value(), false));
}
}

}
if(parsedPacket->allAntennaValues.size()>=3){
const auto rssi=parsedPacket->allAntennaValues[2].rssi;
auto opt_minmaxavg=this_wifi_card_stats.rssi_for_wifi_card.m_rssi_antenna2.add_and_recalculate_if_needed(rssi);
if(opt_minmaxavg.has_value()){
this_wifi_card_stats.antenna2_dbm=opt_minmaxavg.value().avg;
if(m_options.debug_rssi){
m_console->debug("Antenna2{}:{}",1, min_max_avg_as_string(opt_minmaxavg.value(), false));
}
}
}
const auto best_rssi=wifibroadcast::pcap_helper::get_best_rssi_of_card(parsedPacket->allAntennaValues,m_options.rtl8812au_rssi_fixup);
Expand Down

0 comments on commit b07fec4

Please sign in to comment.