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

swift - Button on Table View Cell connected to local function -

dns - Dokku server hosts two sites with TLD's, both domains are landing on only one app -

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