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 -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -