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

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -