Example:
+HWSUPP_LED_TYPE(OPT_MYOPT) = 'myopt'
: ', myopt'
Example:
if (opt_hwsupp)
then
depends on hwsupp version 4.0
foreach i in hwsupp_led_n
do
set action=hwsupp_led_%[i]
set param=hwsupp_led_%_param[i]
if (action == "myopt")
then
if (!(param =~ "(RE:MYOPT_LED_PARAM)"))
then
error "When HWSUPP_LED_\${i}='myopt', ...
must be entered in HWSUPP_LED_\${i}_PARAM"
fi
fi
done
fi
The LED number can be found in /var/run/hwsupp.conf.
Status can be off, on or blink.
Example:
if [ -f /var/run/hwsupp.conf ]
then
. /var/run/hwsupp.conf
[ 0$hwsupp_led_n -eq 0 ] || for i in `seq 1 $hwsupp_led_n`
do
eval action=\$hwsupp_led_${i}
eval param=\$hwsupp_led_${i}_param
if [ "$action" = "<opt>" ]
then
if [ <myexpression> ]
then
/usr/bin/hwsupp_setled $i on
else
/usr/bin/hwsupp_setled $i off
fi
fi
done
fi
The actual state of a LED can be queried with /usr/bin/hwsupp_getled <LED>/. The result will be off, on or blink.
Beispiel:
+HWSUPP_BUTTON_TYPE(OPT_MYOPT) = 'myopt'
: ', myopt'
Example:
if (opt_hwsupp)
then
depends on hwsupp version 4.0
foreach i in hwsupp_button_n
do
set action=hwsupp_buttonn_%[i]
set param=hwsupp_button_%_param[i]
if (action == "myopt")
then
add_to_opt "files/usr/bin/myopt_keyprog" "mode=555 flags=sh"
if (!(param =~ "(RE:MYOPT_BUTTON_PARAM)"))
then
error "When HWSUPP_BUTTON_\${i}='myopt', ...
must be entered in HWSUPP_BUTTON_\${i}_PARAM"
fi
fi
done
fi
The content of HWSUPP_BUTTON_x_PARAM is passed as a parameter.
Example:
##TODO## example