Bluetooth stays discoverable
I have an inspiron 3521 with a Broadcom BCM43142 (mini PCI Express card doing wifi/bluetooth) running archlinux and kernel 4.16.8-1-ARCH with bluez-5.49-3 and gnome 3.28.2.
This is also happening in Ubuntu 18.04 (kernel 4.15.0.20.23, bluez 5.48-0ubuntu3, gnome-control-center 1:3.28.1-0ubuntu1)
TLDR;
So in Gnome Control Center (aka GCC), if I go to Bluetooth tab, bluetooth is set to discoverable, and my laptop is visible to other bluetooth devices. This is expected.
What is not, is that said latpop stays visble/discoverable even when,
- I close GCC or change to another tab (in GCC)
- or I turn off bluetooth in GCC (sic!)
All is behaving correctly when dealt from the command line with bluetoothctl/rfkill
Complete details
I run in parallel bluetoothctl in a terminal when I do the following:
- When I close GCC or go to another tab (in GCC), bluetoothctl shows
[CHG] Controller XX:XX:XX:XX:XX:XX Discoverable: no
[CHG] Controller XX:XX:XX:XX:XX:XX Discoverable: yes
One can see that discoverable is set to no, but then set to yes instantly after that. So laptop is still discoverable when it should not.
I can recover from that by issuing a `discoverable no` in bluetoothctl and that fixes it.
-
When I turn off bluetooth in GCC, bluetoothctl shows:
[CHG] Controller XX:XX:XX:XX:XX:XX Class: 0x00000000 [CHG] Controller XX:XX:XX:XX:XX:XX Powered: no [CHG] Controller XX:XX:XX:XX:XX:XX Discovering: no [CHG] Controller XX:XX:XX:XX:XX:XX DiscoverableTimeout: 0x00000000 [CHG] Controller XX:XX:XX:XX:XX:XX Discoverable: no [CHG] Controller XX:XX:XX:XX:XX:XX DiscoverableTimeout: 0x00000000
`rfkill list` shows hci0 as blocked. *bluetoothctl* is misleading because it shows controller as non discoverable!
but **laptop is still discoverable**
And I can fix this by doing
```rfkill unblock 0
bluetoothtl discoverable no
rfkill block 0```
To sum it up, cli commands rfkill/bluetoothctl work as expected, GCC doesn't.