[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Halevt-dev] Wifi killswitch events
From: |
Patrice Dumas |
Subject: |
Re: [Halevt-dev] Wifi killswitch events |
Date: |
Tue, 26 Jan 2010 20:00:06 +0100 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
On Tue, Jan 26, 2010 at 09:56:11AM -0500, Ben Rich wrote:
> Hi,
>
> $ hal-device /org/freedesktop/Hal/devices/pci_8086_84_rfkill_phy1_wlan
> udi = '/org/freedesktop/Hal/devices/pci_8086_84_rfkill_phy1_wlan'
> info.vendor = 'Intel Corporation' (string)
> linux.hotplug_type = 2 (0x2) (int)
> linux.subsystem = 'rfkill' (string)
> info.interfaces = { 'org.freedesktop.Hal.Device.KillSwitch' } (string list)
> killswitch.type = 'wlan' (string)
> killswitch.state = 1 (0x1) (int)
> killswitch.access_method = 'rfkill' (string)
> killswitch.name = 'phy1' (string)
> info.subsystem = 'rfkill' (string)
> info.product = 'phy1 wlan Killswitch' (string)
> linux.sysfs_path =
> '/sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/ieee80211/phy1/rfkill1'
> (string)
> info.parent = '/org/freedesktop/Hal/devices/pci_8086_84' (string)
> info.udi = '/org/freedesktop/Hal/devices/pci_8086_84_rfkill_phy1_wlan'
> (string)
> info.addons.singleton = { 'hald-addon-rfkill-killswitch' } (string list)
> info.category = 'killswitch' (string)
> info.capabilities = { 'killswitch' } (string list)
>
> When the wifi is on, the killswitch.state property is set to 1, and
> when it is off it is set to 2. So, I created the following
> configuration file:
>
> $ cat /etc/halevt/wifi_rfkill.xml
> <?xml version="1.0" encoding="UTF-8"?>
> <halevt:Configuration version="0.1"
> xmlns:halevt="http://www.environnement.ens.fr/perso/dumas/halevt.html">
>
> <halevt:Device match="hal.killswitch.type = wlan">
> <halevt:Property name="hal.killswitch.state">
> <halevt:Action value="1" exec="/etc/rc.d/net-profiles restart"/>
> </halevt:Property>
> </halevt:Device>
>
> <halevt:Device match="hal.killswitch.type = wlan">
> <halevt:Property name="hal.killswitch.state">
> <halevt:Action value="2" exec="/etc/rc.d/net-profiles stop"/>
> </halevt:Property>
> </halevt:Device>
>
> </halevt:Configuration>
>
> At the moment this is not working. Maybe someone can tell me if I at
> least have the right idea. The other thing I would like to know is
This looks very right to me.
> how to debug such a script. Does halevt log its actions?
Not that much when in the normal course of action. However you
can start it with -i and it will show you what it receives when
you turn the switch on and off.
I could add some debug switch that turns on reporting while still
processing the config file and running scripts, but I don't think
this is needed right now.
--
Pat