Skip to content

Commit

Permalink
exp rssi
Browse files Browse the repository at this point in the history
  • Loading branch information
Consti10 committed Aug 9, 2023
1 parent 491db5d commit e95becd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/RSSIForWifiCard.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class RSSIAccumulator{
if(rssi<=INT8_MIN || rssi>=0){
// RSSI should always be negative and in range [-127,-1]
if(m_debug_invalid_rssi){
wifibroadcast::log::get_default()->debug("Invalid rssi {}",rssi);
wifibroadcast::log::get_default()->debug("Invalid rssi on id {}, {}",m_rssi_identifier,rssi);
}
return ;
}
Expand Down Expand Up @@ -76,8 +76,9 @@ class RSSIAccumulator{
m_rssi_min=INT8_MAX;
m_rssi_max=INT8_MIN;
}
void set_debug_invalid_rssi(bool enable){
void set_debug_invalid_rssi(bool enable,int rssi_identifier){
m_debug_invalid_rssi=enable;
m_rssi_identifier=rssi_identifier;
}
private:
int m_rssi_sum=0;
Expand All @@ -86,6 +87,7 @@ class RSSIAccumulator{
int8_t m_rssi_max=INT8_MIN;
std::chrono::steady_clock::time_point m_last_recalculation=std::chrono::steady_clock::now();
bool m_debug_invalid_rssi= false;
int m_rssi_identifier=0;
};

#endif // WIFIBROADCAST_RSSIFORWIFICARD_HPP
6 changes: 3 additions & 3 deletions src/WBTxRx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ WBTxRx::WBTxRx(std::vector<std::string> wifi_cards,Options options1)
for(int i=0;i<m_wifi_cards.size();i++){
auto tmp=std::make_shared<PerCardCalculators>();
tmp->seq_nr.set_store_and_debug_gaps(i,m_options.debug_packet_gaps);
tmp->card_rssi.set_debug_invalid_rssi(m_options.debug_rssi>=1);
tmp->antenna1_rssi.set_debug_invalid_rssi(m_options.debug_rssi>=1);
tmp->antenna2_rssi.set_debug_invalid_rssi(m_options.debug_rssi>=1);
tmp->card_rssi.set_debug_invalid_rssi(0,m_options.debug_rssi>=1);
tmp->antenna1_rssi.set_debug_invalid_rssi(1,m_options.debug_rssi>=1);
tmp->antenna2_rssi.set_debug_invalid_rssi(2,m_options.debug_rssi>=1);
m_per_card_calc.push_back(tmp);
m_card_is_disconnected[i]=false;
}
Expand Down

0 comments on commit e95becd

Please sign in to comment.