From 6e05d8942c71eff2df330ff23b5577570c82fdc6 Mon Sep 17 00:00:00 2001 From: Yaro Kasear Date: Fri, 11 Apr 2025 10:50:25 -0500 Subject: [PATCH] Please give me channel info. --- panda_truth_probe.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/panda_truth_probe.py b/panda_truth_probe.py index 5203c12..84f3470 100755 --- a/panda_truth_probe.py +++ b/panda_truth_probe.py @@ -47,12 +47,17 @@ def analyze_radiotap_info(pcapng_path, limit=100): else: print(" Estimated SNR: [incomplete data]") - channel_str = getattr(packet.radiotap, 'channel', None) - if channel_str: - try: - print(f" Channel/Frequency: {channel_str.showname_value}") - except AttributeError: - print(f" Channel/Frequency: {str(channel_str)}") + 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]")