Skip to content

Commit

Permalink
simplify, r.n we don't need more
Browse files Browse the repository at this point in the history
  • Loading branch information
Consti10 committed Oct 7, 2023
1 parent 694eb7d commit 1c259f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/WBTxRx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ void WBTxRx::on_new_packet(const uint8_t wlan_idx,const uint8_t *pkt,const int p
radiotap::rx::process_received_radiotap_packet(pkt,pkt_len);
if (parsedPacket == std::nullopt) {
if(m_options.advanced_debugging_rx){
m_console->warn("Discarding packet due to pcap parsing error!");
m_console->warn("Discarding packet due to radiotap parsing error!");
}
return;
}
Expand Down
31 changes: 1 addition & 30 deletions src/radiotap/RadiotapHeaderRx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct ParsedRxRadiotapPacket {

// Returns std::nullopt if radiotap was unable to parse the header
// else return the *parsed information*
// To avoid confusion it might help to treat this method as a big black Box :)
// This method is intentionally simple in that it only looks for data relevant to us (right now) inside the radiotap header.
static std::optional<ParsedRxRadiotapPacket> process_received_radiotap_packet(const uint8_t *pkt,const int pkt_len) {
//int pktlen = hdr.caplen;
int pktlen=pkt_len;
Expand Down Expand Up @@ -77,7 +77,6 @@ static std::optional<ParsedRxRadiotapPacket> process_received_radiotap_packet(co
const auto antenna_idx= (int8_t)iterator.this_arg[0];
const int8_t antenna_nr=antenna_idx+1;
if(antenna_nr>n_antennas)n_antennas=antenna_nr;
//n_antennas=std::max(n_antennas,antenna_idx+1);
}
break;
case IEEE80211_RADIOTAP_DBM_ANTSIGNAL:{
Expand All @@ -94,34 +93,6 @@ static std::optional<ParsedRxRadiotapPacket> process_received_radiotap_packet(co
case IEEE80211_RADIOTAP_FLAGS:
tmp_copy_IEEE80211_RADIOTAP_FLAGS = *(uint8_t *) (iterator.this_arg);
break;
case IEEE80211_RADIOTAP_MCS:
{
uint8_t known = iterator.this_arg[0];
uint8_t flags = iterator.this_arg[1];
uint8_t mcs = iterator.this_arg[2];
if(known & IEEE80211_RADIOTAP_MCS_HAVE_MCS){
// Not needed for now
//parsed_adapter.mcs_index=static_cast<uint16_t>(mcs);
}
if (known & IEEE80211_RADIOTAP_MCS_HAVE_BW) {
const uint8_t bandwidth = flags & IEEE80211_RADIOTAP_MCS_BW_MASK;
switch (bandwidth) {
case IEEE80211_RADIOTAP_MCS_BW_20:
case IEEE80211_RADIOTAP_MCS_BW_20U:
case IEEE80211_RADIOTAP_MCS_BW_20L:
// Not needed for now
//parsed_adapter.channel_width=static_cast<uint16_t>(20);
break;
case IEEE80211_RADIOTAP_MCS_BW_40:
// Not needed for now
//parsed_adapter.channel_width=static_cast<uint16_t>(40);
break;
default:
break ;
}
}
}
break;
case IEEE80211_RADIOTAP_LOCK_QUALITY:{
//int8_t value;
uint16_t value;
Expand Down

0 comments on commit 1c259f8

Please sign in to comment.