freecwmp
[Top] [All Lists]

[PATCH 10/27] Update misc script to support communicte data of get param

To: freecwmp@linux-mips.org
Subject: [PATCH 10/27] Update misc script to support communicte data of get parameter values to the core via ubus Contributed by Inteno Broadband Technology AB
From: Mohamed <mohamed.kallel@pivasoftware.com>
Date: Thu, 6 Dec 2012 16:54:35 +0100
Cc: freecwmp@lukaperkov.net, Mohamed <mohamed.kallel@pivasoftware.com>, Ahmed ZRIBI <ahmed.zribi@pivasoftware.com>
In-reply-to: <1354809292-2467-1-git-send-email-mohamed.kallel@pivasoftware.com>
Original-recipient: rfc822;freecwmp@linux-mips.org
References: <mohamed.kallel@pivasoftware.com> <1354809292-2467-1-git-send-email-mohamed.kallel@pivasoftware.com>
Sender: freecwmp-bounce@linux-mips.org
Signed-off-by: Ahmed ZRIBI <ahmed.zribi@pivasoftware.com>
Signed-off-by: Mohamed <mohamed.kallel@pivasoftware.com>
---
 ext/openwrt/scripts/functions/misc |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/ext/openwrt/scripts/functions/misc 
b/ext/openwrt/scripts/functions/misc
index 2e0210c..13f2142 100644
--- a/ext/openwrt/scripts/functions/misc
+++ b/ext/openwrt/scripts/functions/misc
@@ -3,21 +3,25 @@
 
 get_misc_cpu_usage() {
 local val=`uptime | awk -F'average: ' '{ print $2 }' | awk -F',' '{ print $1 
}' | awk -F'.' '{ print $2 }'`
-freecwmp_value_output "Device.DeviceInfo.ProcessStatus.CPUUsage" "$val"
+ubus_freecwmp_output "Device.DeviceInfo.ProcessStatus.CPUUsage" "$val"
 }
 
 get_misc_process_number() {
 local val=`ps | grep -v COMMAND | wc -l`
-freecwmp_value_output "Device.DeviceInfo.ProcessStatus.ProcessNumberOfEntries" 
"$val"
+local type="xsd:unsignedInt"
+ubus_freecwmp_output "Device.DeviceInfo.ProcessStatus.ProcessNumberOfEntries" 
"$val" "$type"
 }
 
 get_misc() {
 case "$1" in
        Device.DeviceInfo.ProcessStatus.CPUUsage)
        get_misc_cpu_usage
+       return $FAULT_CPE_NO_FAULT
        ;;
        Device.DeviceInfo.ProcessStatus.ProcessNumberOfEntries)
        get_misc_process_number
+       return $FAULT_CPE_NO_FAULT
        ;;
 esac
+return $FAULT_CPE_INVALID_PARAMETER_NAME
 }
-- 
1.7.4.1


<Prev in Thread] Current Thread [Next in Thread>