I am planning to use Balena and Raspberry Pi for testing bluetooth devices on production line. Rasperry would provide a user interface, which uses dbus and bluez to scan and connect. Problem is that Bluez caches all devices to /var/lib/bluetooth/[adapter]/cache on Host OS and scan returns them all. One option is to constantly delete these cache files, but I hope there is a better way…
I found promising file from BlueZ source called main.conf, which has following settings:
[GATT] # GATT attribute cache. # Possible values: # always: Always cache attributes even for devices not paired, this is # recommended as it is best for interoperability, with more consistent # reconnection times and enables proper tracking of notifications for all # devices. # yes: Only cache attributes of paired devices. # no: Never cache attributes # Default: always # Cache = always
If I have understood correctly, it should be placed in Host OS path /etc/bluetooth/, but there is only input.conf and network.conf and the file system is read only so there is nothing I can do.
Does anyone know how to disable the cache?