我感兴趣的是监控丢失的/重新传输的/其他数据,以便将文件从PC传输到智能手机。
操作系统: Ubuntu 20.04.1 LTS
智能手机:小米pocophone f1
我知道如何传输文件(使用Blueman),但我真正需要的是某种软件,比如hcitool,它可能有助于发送数据+检测数据包丢失/重新传输。
任何可能有帮助的软件都会很有帮助。
发布于 2021-02-03 09:07:49
为了传输数据,我只在Ubuntu上使用了Blueman。然后,在WireShark中,我使用过滤器btl2cap.retransmittimeout嗅探bluetooth0接口。为了实现自动化,我编写了一个使用pyshark的Python脚本。
import pyshark
class SniffPacket(object):
def sniff(self):
capture = pyshark.LiveCapture(interface='bluetooth0', display_filter='btl2cap.retransmittimeout')
try:
capture.sniff(timeout=20)
except:
pass
return capture
if __name__ == '__main__':
print(f'Initiate sniffer...')
capture = SniffPacket().sniff()
print('Sniffer complete, parse data...')
ct = 0
try:
while True:
res = str(capture.next_packet())
ct += 1
except:
pass
print('Retransmitted packets: ' + str(ct))https://askubuntu.com/questions/1312950
复制相似问题