aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2015-11-26 12:04:43 +0000
committerJo-Philipp Wich <jow@openwrt.org>2015-11-26 12:04:43 +0000
commitd455818f82d871c6e28a9df3412f311568bdb99f (patch)
tree2f1239ebdc49aa0960f64508104eed7f4a8aed78
parent96eb44ff6bf7d1d6724ae6309e02b6ae1ee01b85 (diff)
downloadmaster-187ad058-d455818f82d871c6e28a9df3412f311568bdb99f.tar.gz
master-187ad058-d455818f82d871c6e28a9df3412f311568bdb99f.tar.bz2
master-187ad058-d455818f82d871c6e28a9df3412f311568bdb99f.zip
base-files: config_generate: support rssi leds
Add support for emitting rssi monitor and led configuration sections. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47656 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rwxr-xr-xpackage/base-files/files/bin/config_generate41
1 files changed, 39 insertions, 2 deletions
diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate
index 78315ff9f9..d5bc38ecd7 100755
--- a/package/base-files/files/bin/config_generate
+++ b/package/base-files/files/bin/config_generate
@@ -267,6 +267,26 @@ generate_switch() {
json_select ..
}
+generate_rssimon() {
+ local key="$1"
+ local cfg="rssid_$key"
+ local refresh threshold
+
+ json_select rssimon
+ json_select "$key"
+ json_get_vars refresh threshold
+ json_select ..
+ json_select ..
+
+ uci -q batch <<-EOF
+ delete system.$cfg
+ set system.$cfg='rssid'
+ set system.$cfg.dev='$key'
+ set system.$cfg.refresh='$refresh'
+ set system.$cfg.threshold='$threshold'
+ EOF
+}
+
generate_led() {
local key="$1"
local cfg="led_$key"
@@ -274,8 +294,6 @@ generate_led() {
json_select led
json_select "$key"
json_get_vars name sysfs type trigger device interface default port_mask
- json_select ..
- json_select ..
uci -q batch <<-EOF
delete system.$cfg
@@ -302,7 +320,23 @@ generate_led() {
set system.$cfg.interval='50'
EOF
;;
+
+ rssi)
+ local minq maxq offset factor
+ json_get_vars iface minq maxq offset factor
+ uci -q batch <<-EOF
+ 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
+ ;;
esac
+
+ json_select ..
+ json_select ..
}
json_init
@@ -316,6 +350,9 @@ for key in $keys; do generate_network $key; done
json_get_keys keys switch
for key in $keys; do generate_switch $key; done
+json_get_keys keys rssimon
+for key in $keys; do generate_rssimon $key; done
+
json_get_keys keys led
for key in $keys; do generate_led $key; done