在此之前需要安装pyshark库
import pyshark
def capture_bluetooth_packets():
# 捕获蓝牙接口的数据包
capture = pyshark.LiveCapture(interface='your_bluetooth_interface')
for packet in capture.sniff_continuously():
print(packet)if __name__ == "__main__":
capture_bluetooth_packets()