freecwmp
[Top] [All Lists]

ubus data model patch [10/27]

To: freecwmp@linux-mips.org, freecwmp@lukaperkov.net
Subject: ubus data model patch [10/27]
From: KALLEL Mohamed <mohamed.kallel@pivasoftware.com>
Date: Thu, 06 Dec 2012 14:45:37 +0100
Original-recipient: rfc822;freecwmp@linux-mips.org
Sender: freecwmp-bounce@linux-mips.org
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/17.0 Thunderbird/17.0
Hi Luka

  ubus data model patch [10/27] enclosed

Regards
MOHAMED Kallel

------------------------ubus data model patch [10/27] ---------------------------------


>From dfb8cb80b1353170d74cb15ebf1dc0b5d0254f41 Mon Sep 17 00:00:00 2001
From: Mohamed <mohamed.kallel@pivasoftware.com>
Date: Sat, 1 Dec 2012 21:11:29 +0100
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


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>
  • ubus data model patch [10/27], KALLEL Mohamed <=