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# - SharpDX Toolkit models rendering inside out -

c# - ajax - How to receive data both html and json from server? -