Skip to main content
Topic: How does Connman interact with XF86WLAN and XF86Bluetooth? (Read 649 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How does Connman interact with XF86WLAN and XF86Bluetooth?

On my keyboard, I have a function key to toggle wifi and one to toggle bluetooth. xev tells me that they emit the XF86WLAN and XF86Bluetooth keysyms accordingly. I am using connman as a network manager.
I have configured connman so that both wifi and bluetooth are softblocked on boot and I have to manually enable them. I did this by modifying the file located at /var/lib/connman/settings

Code: [Select]
[global]
OfflineMode=false
IPv6.method=off
Timeservers=ca.pool.ntp.org

[Bluetooth]
Enable=false
Tethering=false

[WiFi]
Enable=false
Tethering=false

[Wired]
Enable=true
Tethering=false

When I press the wlan fn key, it toggles wifi on and off as expected. The output of rfkill confirms this as does the output of connmanctl technologies. However, when I press the bluetooth fn key, it attempts to bring up bluetooth, but fails to do so. The ouput of dmesg is this:

Code: [Select]
[ 2877.597244] usb 4-2: new full-speed USB device number 9 using uhci_hcd
[ 2877.779132] usb 4-2: New USB device found, idVendor=0a5c, idProduct=21e6, bcdDevice= 1.12
[ 2877.779149] usb 4-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2877.779157] usb 4-2: Product: BCM20702A0
[ 2877.779164] usb 4-2: Manufacturer: Broadcom Corp
[ 2877.779170] usb 4-2: SerialNumber: 342387FE99B3
[ 2877.820546] usb 4-2: USB disconnect, device number 9
[ 2879.847180] Bluetooth: hci0: command 0x0c03 tx timeout
[ 2887.953845] Bluetooth: hci0: BCM: Reset failed (-110

I'm assuming that connman blocks bluetooth due to how I have it configured. After  I run connmanctl enable bluetooth, bluetooth is brought up and the bluetooth fn key  works as expected. However, it also changes the bluetooth entry in /var/lib/connman/settings from

Code: [Select]
[Bluetooth]
Enable=false
Tethering=false

to

Code: [Select]
[Bluetooth]
Enable=true
Tethering=false

I don't want this because then bluetooth will be enabled by default on the next boot. Also, the wlan fn key has no trouble brining up wifi without changing the contents of /var/lib/connman/settings. I don't have to issue the connmanctl enable wifi command to bring up wifi either. The fn key seems to be able to bring it up in another way that doesn't change the contents of this file.

So what I'm wondering is, what is it that XF86WLAN is doing that XF86Bluetooth isn't? I would like for XF86Bluetooth to work the same way. I know there are ways around this such as issuing the connmanctl disable bluetooth every time on boot, and creating a script to toggle connmanctl enable/disable bluetooth that I then map to XF86Bluetooth, but I would prefer to not have to do it this way. Instead I want the bluetooth fn key to behave the same way as the wifi fn key. Currently I don't have acpid installed; however I do have udev installed and udevd running. I am using runnit as the init system.