wireless acpi scripts
84yelo3 at gmail.com
Wed Nov 29 11:14:52 GMT 2006
I will explain the bugs I found:
/etc/acpi/wireless.sh should change the radio status (on,off) and
inform who is calling him what he did (0 if he switched the radio, 1
if he turned it on, "" if no wireless device is present).
the script might echo "00101..." if more wireless devices are found.
One number per device. This might not be a problem if well interpreted
by the caller.
A true bug is instead that he notifies the action he did, without
checking errors. (example: he detects radio on, he launches the
command to disable it and finally he echos 0. Instead of this last
action he should check the current status and if it's not the same as
the expected one he should echo an error, for example -1!)
other few problems are in /etc/acpi/asus-wireless.sh. It calls
wireless.sh and sets the laptop led.
What he does is not right: he puts the result of wireless.sh in a
variable and if it's not 0 he enables the led. Unfortunately he will
enable the led if no wireless device is found, because "" is not 0 :)
moreover these scripts are not using the functions defined in
/usr/share/acpi-support/state-funcs so there is duplication of code.
Looking in the functions defined in this file we can see other errors:
isAnyWirelessPoweredOn returns true only if every (and not any) device
is powered on, moreover again it returns true even if there are no
I would also add a function that syncs the leds using the
isAnyWirelessPoweredOn and setLEDAsusWireless
More information about the laptop-testing-team