mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-11-27 16:43:09 +02:00
base-files: uci-defaults for rssileds
Adds capability to add uci-defaults defining RSSI LEDs Signed-off-by: Daniel Golle <dgolle@allnet.de> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33164 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
c8a92d23e8
commit
c7af93aa5a
@ -94,6 +94,50 @@ EOF
|
||||
UCIDEF_LEDS_CHANGED=1
|
||||
}
|
||||
|
||||
ucidef_set_led_rssi() {
|
||||
local cfg="led_$1"
|
||||
local name=$2
|
||||
local sysfs=$3
|
||||
local iface=$4
|
||||
local minq=$5
|
||||
local maxq=$6
|
||||
local offset=$7
|
||||
local factor=$8
|
||||
|
||||
uci -q get system.$cfg && return 0
|
||||
|
||||
uci batch <<EOF
|
||||
set system.$cfg='led'
|
||||
set system.$cfg.name='$name'
|
||||
set system.$cfg.sysfs='$sysfs'
|
||||
set system.$cfg.trigger='rssi'
|
||||
set system.$cfg.iface='rssid_$iface'
|
||||
set system.$cfg.minq='$minq'
|
||||
set system.$cfg.maxq='$maxq'
|
||||
set system.$cfg.offset='$offset'
|
||||
set system.$cfg.factor='$factor'
|
||||
EOF
|
||||
UCIDEF_LEDS_CHANGED=1
|
||||
}
|
||||
|
||||
ucidef_set_rssimon() {
|
||||
local dev="$1"
|
||||
local refresh="$2"
|
||||
local threshold="$3"
|
||||
|
||||
local cfg="rssid_$dev"
|
||||
|
||||
uci -q get system.$cfg && return 0
|
||||
|
||||
uci batch <<EOF
|
||||
set system.$cfg='rssid'
|
||||
set system.$cfg.dev='$dev'
|
||||
set system.$cfg.refresh='$refresh'
|
||||
set system.$cfg.threshold='$threshold'
|
||||
EOF
|
||||
UCIDEF_LEDS_CHANGED=1
|
||||
}
|
||||
|
||||
ucidef_commit_leds()
|
||||
{
|
||||
[ "$UCIDEF_LEDS_CHANGED" == "1" ] && uci commit system
|
||||
|
Loading…
Reference in New Issue
Block a user