hal: Branch 'master'

Danny Kukawka dkukawka at kemper.freedesktop.org
Tue Mar 4 10:08:34 PST 2008


 tools/linux/hal-system-killswitch-get-power-linux |    8 ++++++++
 tools/linux/hal-system-killswitch-set-power-linux |    8 ++++++++
 2 files changed, 16 insertions(+)

New commits:
commit 61b11fce9d85d5f36cd4a7e6240cb2a2dd1c7b54
Author: Ben Liblit <liblit at cs.wisc.edu>
Date:   Tue Mar 4 19:08:29 2008 +0100

    added support for software bluetooth killswitch for ThinkPads
    
    Added support for software bluetooth killswitch for ThinkPads to
    hal-system-killswitch-*et-power-linux. Needs an actual hal-info
    package to work.

diff --git a/tools/linux/hal-system-killswitch-get-power-linux b/tools/linux/hal-system-killswitch-get-power-linux
index 46a5388..efd0eab 100755
--- a/tools/linux/hal-system-killswitch-get-power-linux
+++ b/tools/linux/hal-system-killswitch-get-power-linux
@@ -34,6 +34,14 @@ if [ "$HAL_PROP_KILLSWITCH_TYPE" = "bluetooth" ]; then
 	    echo "org.freedesktop.Hal.Device.KillSwitch.NotSupported" >&2
 	    echo "dellWirelessCtl returned $value" >&2
 	fi
+    elif [ "$HAL_PROP_KILLSWITCH_ACCESS_METHOD" = thinkpad -a -r "$HAL_PROP_LINUX_SYSFS_PATH" ]; then
+        value="`cat "$HAL_PROP_LINUX_SYSFS_PATH"`"
+	if [ $? -eq 0 ]; then
+	    exit $value
+	else
+            echo "org.freedesktop.Hal.Device.KillSwitch.NotSupported" >&2
+            echo "cannot read $HAL_PROP_LINUX_SYSFS_PATH" >&2
+        fi
     else
 	echo "org.freedesktop.Hal.Device.KillSwitch.NotSupported" >&2
 	echo "Access type not supported" >&2
diff --git a/tools/linux/hal-system-killswitch-set-power-linux b/tools/linux/hal-system-killswitch-set-power-linux
index 049bcea..f68e00a 100755
--- a/tools/linux/hal-system-killswitch-set-power-linux
+++ b/tools/linux/hal-system-killswitch-set-power-linux
@@ -37,6 +37,14 @@ if [ "$HAL_PROP_KILLSWITCH_TYPE" = "bluetooth" ]; then
 	    echo "org.freedesktop.Hal.Device.KillSwitch.NotSupported" >&2
 	    echo "dellWirelessCtl returned $ret" >&2
 	fi
+    elif [ "$HAL_PROP_KILLSWITCH_ACCESS_METHOD" = thinkpad -a -w "$HAL_PROP_LINUX_SYSFS_PATH" ]; then
+        if [ "$value" = true ]; then bit=1; else bit=0; fi
+        echo $bit >$HAL_PROP_LINUX_SYSFS_PATH
+        if [ $? -ne 0 ]; then
+            echo "org.freedesktop.Hal.Device.KillSwitch.NotSupported" >&2
+	    echo "cannot write $bit into $HAL_PROP_LINUX_SYSFS_PATH" >&2
+	    exit 1
+	fi
     else
 	echo "org.freedesktop.Hal.Device.KillSwitch.NotSupported" >&2
 	echo "Access type not supported" >&2


More information about the hal-commit mailing list