Can I update bluetooth services info without pairing again?

137 Views Asked by At

After pairing with a device, if I run bluetoothctl info on my device I get the list of available UUIDs on the remote:

root@device:~# bluetoothctl info
Device A4:6B:B6:EB:3D:08 (public)
        Alias: A4-6B-B6-EB-3D-08
        Class: 0x002a010c
        Icon: computer
        Paired: yes
        Trusted: yes
        Blocked: no
        Connected: yes
        LegacyPairing: no
        UUID: Service Discovery Serve.. (00001000-0000-1000-8000-00805f9b34fb)
        UUID: Audio Source              (0000110a-0000-1000-8000-00805f9b34fb)
        UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
        UUID: PANU                      (00001115-0000-1000-8000-00805f9b34fb)
        UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)
        UUID: Handsfree Audio Gateway   (0000111f-0000-1000-8000-00805f9b34fb)
        UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
        UUID: Vendor specific           (c7f94713-891e-496a-a0e7-983a0946126e)
 

If I later start a new service on the remote device, this list does not update. Running bluetoothctl info will show the same cached information, and doesn't try to discover changes.

The only way I have found to update it is pairing again (notice the new serial service available):

root@device:~# bluetoothctl info
Device A4:6B:B6:EB:3D:08 (public)
        Alias: A4-6B-B6-EB-3D-08
        Class: 0x002a010c
        Icon: computer
        Paired: yes
        Trusted: yes
        Blocked: no
        Connected: yes
        LegacyPairing: no
        UUID: Service Discovery Serve.. (00001000-0000-1000-8000-00805f9b34fb)
        UUID: Serial Port               (00001101-0000-1000-8000-00805f9b34fb)
        UUID: Audio Source              (0000110a-0000-1000-8000-00805f9b34fb)
        UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
        UUID: PANU                      (00001115-0000-1000-8000-00805f9b34fb)
        UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)
        UUID: Handsfree Audio Gateway   (0000111f-0000-1000-8000-00805f9b34fb)
        UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
        UUID: Vendor specific           (c7f94713-891e-496a-a0e7-983a0946126e)

Is there any way to update available services on the remote without pairing? I don't want to check the pin again etc.

1

There are 1 best solutions below

3
Risto On

BlueZ by default caches a lot of data. You can add a

[GATT]
Cache = no

in /etc/bluetooth/main.conf, which means that handles used between BlueZ and your application won't be cached.