Bug 8570

Summary: Have a way to turn Bluetooth on/off using software
Product: hal Reporter: Bastien Nocera <bugzilla>
Component: haldAssignee: David Zeuthen (not reading bugmail) <zeuthen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: high CC: bugzilla, marcandre.lureau
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: hal-bluetooth-button-1.patch
hal-bluetooth-button-2.patch
hal-bluetooth-button-3.patch
hal-info-bluetooth-switch.patch
hal-bluetooth-button-6.patch

Description Bastien Nocera 2006-10-09 10:07:13 UTC
Similar to what sonypi allows using "spicctrl -l 0/1".
This should probably be attached to the Computer object, and not to the
Bluetooth USB device, as it will appear and disappear (as if physically
disconnected).
Comment 1 Alex Deucher 2006-10-10 08:19:27 UTC
On thinkpads with ibm-acpi (http://ibm-acpi.sourceforge.net/) loaded, you can
control bluetooth with:

echo enable > /proc/acpi/ibm/bluetooth
echo disable > /proc/acpi/ibm/bluetooth

There are also similar methods for the WLAN and WWAN modules.
Comment 2 Bastien Nocera 2007-02-07 07:52:15 UTC
Created attachment 8626 [details] [review]
hal-bluetooth-button-1.patch

First go at it.
Comment 3 Bastien Nocera 2007-02-07 07:57:12 UTC
(In reply to comment #2)
> Created an attachment (id=8626) [details]
> hal-bluetooth-button-1.patch
> 
> First go at it.

This patch is obviously far from finished:
- getting errors trying to call the methods (no method with signature...)
- move sony matching to hal-info
- the scripts need to be written
- how to get the UDI of the actual bluetooth device
- spicctrl -L might answer rubbish on the first go, as sonypi doesn't detect the presence of the Bluetooth dongle, just assumes on/off depending on module params
Comment 4 Bastien Nocera 2007-02-07 10:12:37 UTC
<davidz> hadess: it looks kinda good I think; probably the matching needs to be more precise than just "laptop" and "Sony" but, yeah
[...]
<davidz> e.g. RFKillSwitch and have a rfkillswitch.type = 'bluetooth'
<davidz> instead of BluetoothButton
[...]
<davidz> but I think "bool IsRFDisableBySoftware()" and "void setRFDisabledBySoftware(bool should_disable)" is what we want
Comment 5 Bastien Nocera 2007-02-08 17:02:45 UTC
Comments for self:
Acer support:
http://www.archernar.co.uk/acer_acpi/acer_acpi_main.html
The very hacky dmabt for Toshiba laptops:
http://www.holtmann.org/linux/bluetooth/toshiba.html
IBM and Sony ones already mentioned...
Comment 6 Bastien Nocera 2007-02-14 11:28:55 UTC
Created attachment 8706 [details] [review]
hal-bluetooth-button-2.patch

Second try. This one will allow you to set the bluetooth device on/off by hand.
Comment 7 Bastien Nocera 2007-02-20 08:57:56 UTC
Created attachment 8787 [details] [review]
hal-bluetooth-button-3.patch

Patch for sonypic support of the Bluetooth Killswitch. Get/set works.
Comment 8 Bastien Nocera 2007-02-20 09:03:13 UTC
Created attachment 8788 [details] [review]
hal-info-bluetooth-switch.patch

hal-info patch to allow sony laptops to create a bluetooth rfkill switch
Comment 9 Bastien Nocera 2007-02-21 09:32:37 UTC
Created attachment 8802 [details]
hal-bluetooth-button-6.patch
Comment 10 Bastien Nocera 2007-02-21 10:18:08 UTC
Closing this bug, as David committed the patch.

Opened bug #10053 to track IBM laptops support through ibm_apci
Opened bug #10054 to track the needed documentation addition

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.