Please give me channel info.

This commit is contained in:
Yaro Kasear 2025-04-11 10:50:25 -05:00
parent 225fb90854
commit 6e05d8942c

View file

@ -47,12 +47,17 @@ def analyze_radiotap_info(pcapng_path, limit=100):
else: else:
print(" Estimated SNR: [incomplete data]") print(" Estimated SNR: [incomplete data]")
channel_str = getattr(packet.radiotap, 'channel', None) channel_field = None
if channel_str:
try: try:
print(f" Channel/Frequency: {channel_str.showname_value}") for field in packet.radiotap._all_fields:
except AttributeError: if 'channel' in field.showname.lower():
print(f" Channel/Frequency: {str(channel_str)}") channel_field = field.showname
break
except Exception:
pass
if channel_field:
print(f" Channel/Frequency: {channel_field}")
else: else:
print(" Channel/Frequency: [unavailable]") print(" Channel/Frequency: [unavailable]")