小编ahm*_*man的帖子

使用hcitool扫描蓝牙低功耗?

当我运行此命令时,ble设备仅扫描5秒钟:

$ sudo timeout 5s hcitool -i hci0 lescan
Run Code Online (Sandbox Code Playgroud)

输出显示在终端屏幕中.

但是当我将输出重定向到文件以保存广告设备的地址时,每次运行该命令时,我发现文件为空,输出在终端或文件中都不可见.

我用的命令:

$ sudo timeout 5s hcitool -i hci0 lescan > file.txt
Run Code Online (Sandbox Code Playgroud)

为了hcitool正确地将其输出重定向到文件,我该怎么办?

linux shell ubuntu bluetooth bluetooth-lowenergy

3
推荐指数
1
解决办法
9682
查看次数

标签 统计

bluetooth ×1

bluetooth-lowenergy ×1

linux ×1

shell ×1

ubuntu ×1