Created
May 27, 2022 00:29
-
-
Save damianjwilliams/0d2887b5677f2f32f185d451cf79524c to your computer and use it in GitHub Desktop.
Return BLE advertisement data from tshark
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
tsharkCall = ["C:\\Program Files\\Wireshark\\tshark.exe", "-i", "5","-l"] | |
tsharkProc = subprocess.Popen(tsharkCall, | |
bufsize=0, | |
shell=True, | |
stdout=subprocess.PIPE, | |
stderr=subprocess.PIPE, | |
stdin=subprocess.PIPE) | |
for packet in iter(tsharkProc.stdout.readline, b" "): | |
packet_string = packet.rstrip().decode("utf-8") #bytes to string | |
#packet_info | |
print(packet_string) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment