diff --git a/panda_truth_probe.py b/panda_truth_probe.py index 84f3470..0fb5628 100755 --- a/panda_truth_probe.py +++ b/panda_truth_probe.py @@ -23,7 +23,7 @@ def analyze_radiotap_info(pcapng_path, limit=100): # Grab what you can from radiotap signal = getattr(packet.radiotap, 'dbm_antsignal', None) noise = getattr(packet.radiotap, 'dbm_antnoise', None) - channel = getattr(packet.radiotap, 'channel', None) + channel = getattr(packet.radiotap, 'channel_freq', None) rate = getattr(packet.radiotap, 'rate', None) antenna = getattr(packet.radiotap, 'antenna', None) flags = getattr(packet.radiotap, 'flags', None) @@ -38,28 +38,10 @@ def analyze_radiotap_info(pcapng_path, limit=100): else: print(" Noise Level: [missing or fake]") - if signal and noise: - try: - snr = int(signal) - int(noise) - print(f" Estimated SNR: {snr} dB") - except ValueError: - print(" Estimated SNR: [could not compute]") - else: - print(" Estimated SNR: [incomplete data]") - - channel_field = None - try: - for field in packet.radiotap._all_fields: - if 'channel' in field.showname.lower(): - channel_field = field.showname - break - except Exception: - pass - - if channel_field: - print(f" Channel/Frequency: {channel_field}") - else: - print(" Channel/Frequency: [unavailable]") + if channel: + print(f" Channel Frequency: {channel} MHz") + else: + print(" Channel Frequency: [unavailable]") if rate: print(f" Data Rate: {rate} Mbps")