freecwmp
[Top] [All Lists]

Re: [PATCH 10/27] Update misc script to support communicte data of get p

To: mohamed.kallel@pivasoftware.com
Subject: Re: [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: Luka Perkov <freecwmp@lukaperkov.net>
Date: Sat, 8 Dec 2012 11:40:25 +0100
Cc: freecwmp@linux-mips.org, ahmed.zribi@pivasoftware.com, freecwmp@lukaperkov.net, jogo@openwrt.org
In-reply-to: <1354809292-2467-11-git-send-email-mohamed.kallel@pivasoftware.com>
Mail-followup-to: mohamed.kallel@pivasoftware.com, freecwmp@linux-mips.org, ahmed.zribi@pivasoftware.com, jogo@openwrt.org
Original-recipient: rfc822;freecwmp@linux-mips.org
References: <mohamed.kallel@pivasoftware.com> <1354809292-2467-1-git-send-email-mohamed.kallel@pivasoftware.com> <1354809292-2467-11-git-send-email-mohamed.kallel@pivasoftware.com>
Sender: freecwmp-bounce@linux-mips.org
User-agent: Mutt/1.5.21 (2010-09-15)
On Thu, Dec 06, 2012 at 04:54:35PM +0100, Mohamed wrote:
> 
> Signed-off-by: Ahmed ZRIBI <ahmed.zribi@pivasoftware.com>
> Signed-off-by: Mohamed <mohamed.kallel@pivasoftware.com>

NACK. Look at comment from patch v4.

> ---
>  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

Luka 

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