Flush Bluetooth Cache
I was trying to get a shell script using hcitool to perfom consecutive inquiries to discover adjacent bluetooth devices. Unfortunately, hcitool will only inquire every 10 seconds, returning previous results if called before.
I read that bluetooth daemon stores a cache at /var/lib/bluetooth, however, deleting its contents proved to have no effect. I also tried to change the configuration of bluetooth but I found no option to remove this caching effect.
I was wondering if anyone knew how to solve this problem.
Thanks in advance.
Even if you delete a file, if another application has it open, it will only be removed from the director, not from the system.
Anyway, I use the gnome bluetooth-applet to deal with my BT connections. In any case, it talks to the bluetooth daemon (/usr/sbin/bluetoothd) to get information about devices. I'm not sure that hcitool does or not also. You can check if bluetoothd is running. If so, then that is holding the cache file open.
If that's the case then the only solution would be restarting the daemon every time I run hcitool, but that doesn't seem a good way to do it.
I was hoping there was some sort of configuration or command to deal with this.
Thanks for your help.