【发布时间】:2015-08-30 18:52:10
【问题描述】:
当我运行这个使 ble 设备只扫描 5 秒的命令时:
$ sudo timeout 5s hcitool -i hci0 lescan
输出显示在终端屏幕中。
但是当我将输出重定向到一个文件以保存广告设备的地址时,每次我运行命令时,我发现文件是空的,并且输出在终端和文件中都不可见。
我使用的命令:
$ sudo timeout 5s hcitool -i hci0 lescan > file.txt
我必须做什么才能使hcitool 正确地将其输出重定向到文件?
【问题讨论】:
-
hcitool不再被开发并与 libbluetooth 一起运行。在我看来,您最好使用bluetoothctl。
标签: linux shell ubuntu bluetooth bluetooth-lowenergy