linux - Scan bluetooth low energy using hcitool? -
when run command makes ble device scanning 5 seconds only:
$ sudo timeout 5s hcitool -i hci0 lescan
the output shown in terminal screen.
but when redirect output file save addresses of advertising devices, every time run command find file empty , output isn't visible in terminal nor in file.
the command used:
$ sudo timeout 5s hcitool -i hci0 lescan > file.txt
what have in order make hcitool
correctly redirect ouput file?
timeout
default sends sigterm program. looks hcitool
doesn't handle gracefully. instead use sigint (equivalent ctrl-c).
sudo timeout -s sigint 5s hcitool -i hci0 lescan > file.txt
Comments
Post a Comment