freecwmp
[Top] [All Lists]

Re: [PATCH 05/27] Update device_info script to support communicte data o

To: mohamed.kallel@pivasoftware.com
Subject: Re: [PATCH 05/27] Update device_info 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:35:35 +0100
Cc: freecwmp@linux-mips.org, ahmed.zribi@pivasoftware.com, freecwmp@lukaperkov.net, jogo@openwrt.org
In-reply-to: <1354809292-2467-6-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-6-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:30PM +0100, Mohamed wrote:
> 
> Signed-off-by: Mohamed <mohamed.kallel@pivasoftware.com>
> Signed-off-by: Ahmed ZRIBI <ahmed.zribi@pivasoftware.com>

NACK. Look at comment from patch v4.

> ---
>  ext/openwrt/scripts/functions/device_info |   32 +++++++++++++++++++---------
>  1 files changed, 22 insertions(+), 10 deletions(-)
> 
> diff --git a/ext/openwrt/scripts/functions/device_info 
> b/ext/openwrt/scripts/functions/device_info
> index 4423b8b..86ff5c9 100644
> --- a/ext/openwrt/scripts/functions/device_info
> +++ b/ext/openwrt/scripts/functions/device_info
> @@ -3,7 +3,7 @@
>  
>  get_device_info_manufacturer() {
>  local val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get 
> freecwmp.@device[0].manufacturer 2> /dev/null`
> -freecwmp_output "InternetGatewayDevice.DeviceInfo.Manufacturer" "$val"
> +ubus_freecwmp_output "InternetGatewayDevice.DeviceInfo.Manufacturer" "$val"
>  }
>  
>  set_device_info_manufacturer() {
> @@ -12,7 +12,7 @@ set_device_info_manufacturer() {
>  
>  get_device_info_oui() {
>  local val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get 
> freecwmp.@device[0].oui 2> /dev/null`
> -freecwmp_output "InternetGatewayDevice.DeviceInfo.ManufacturerOUI" "$val"
> +ubus_freecwmp_output "InternetGatewayDevice.DeviceInfo.ManufacturerOUI" 
> "$val"
>  }
>  
>  set_device_info_oui() {
> @@ -21,7 +21,7 @@ set_device_info_oui() {
>  
>  get_device_info_product_class() {
>  local val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get 
> freecwmp.@device[0].product_class 2> /dev/null`
> -freecwmp_output "InternetGatewayDevice.DeviceInfo.ProductClass" "$val"
> +ubus_freecwmp_output "InternetGatewayDevice.DeviceInfo.ProductClass" "$val"  
>  }
>  
>  set_device_info_product_class() {
> @@ -30,7 +30,7 @@ set_device_info_product_class() {
>  
>  get_device_info_serial_number() {
>  local val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get 
> freecwmp.@device[0].serial_number 2> /dev/null`
> -freecwmp_output "InternetGatewayDevice.DeviceInfo.SerialNumber" "$val"
> +ubus_freecwmp_output "InternetGatewayDevice.DeviceInfo.SerialNumber" "$val"
>  }
>  
>  set_device_info_serial_number() {
> @@ -39,7 +39,7 @@ set_device_info_serial_number() {
>  
>  get_device_info_hardware_version() {
>  local val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get 
> freecwmp.@device[0].hardware_version 2> /dev/null`
> -freecwmp_output "InternetGatewayDevice.DeviceInfo.HardwareVersion" "$val"
> +ubus_freecwmp_output "InternetGatewayDevice.DeviceInfo.HardwareVersion" 
> "$val"
>  }
>  
>  set_device_info_hardware_version() {
> @@ -48,7 +48,7 @@ set_device_info_hardware_version() {
>  
>  get_device_info_software_version() {
>  local val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get 
> freecwmp.@device[0].software_version 2> /dev/null`
> -freecwmp_output "InternetGatewayDevice.DeviceInfo.SoftwareVersion" "$val"
> +ubus_freecwmp_output "InternetGatewayDevice.DeviceInfo.SoftwareVersion" 
> "$val"
>  }
>  
>  set_device_info_software_version() {
> @@ -57,7 +57,7 @@ set_device_info_software_version() {
>  
>  get_device_info_uptime() {
>  local val=`cat /proc/uptime | awk -F "." '{ print $1 }'`
> -freecwmp_output "InternetGatewayDevice.DeviceInfo.UpTime" "$val"
> +ubus_freecwmp_output "InternetGatewayDevice.DeviceInfo.UpTime" "$val"
>  }
>  
>  get_device_info_device_log() {
> @@ -67,7 +67,7 @@ if [ ${FLAGS_last} -eq ${FLAGS_TRUE} ]; then
>  else
>       val=`dmesg | tail -n10`
>  fi
> -freecwmp_output "InternetGatewayDevice.DeviceInfo.DeviceLog" "$val"
> +ubus_freecwmp_output "InternetGatewayDevice.DeviceInfo.DeviceLog" "$val"
>  }
>  
>  get_device_info() {
> @@ -81,6 +81,7 @@ case "$1" in
>       get_device_info_software_version
>       get_device_info_uptime
>       get_device_info_device_log
> +     return $FAULT_CPE_NO_FAULT
>       ;;
>       InternetGatewayDevice.DeviceInfo.)
>       get_device_info_manufacturer
> @@ -91,32 +92,42 @@ case "$1" in
>       get_device_info_software_version
>       get_device_info_uptime
>       get_device_info_device_log
> +     return $FAULT_CPE_NO_FAULT
>       ;;
>       InternetGatewayDevice.DeviceInfo.Manufacturer)
>       get_device_info_manufacturer
> +     return $FAULT_CPE_NO_FAULT
>       ;;
>       InternetGatewayDevice.DeviceInfo.ManufacturerOUI)
>       get_device_info_oui
> +     return $FAULT_CPE_NO_FAULT
>       ;;
>       InternetGatewayDevice.DeviceInfo.ProductClass)
>       get_device_info_product_class
> +     return $FAULT_CPE_NO_FAULT
>       ;;
>       InternetGatewayDevice.DeviceInfo.SerialNumber)
>       get_device_info_serial_number
> +     return $FAULT_CPE_NO_FAULT
>       ;;
>       InternetGatewayDevice.DeviceInfo.HardwareVersion)
>       get_device_info_hardware_version
> +     return $FAULT_CPE_NO_FAULT
>       ;;
>       InternetGatewayDevice.DeviceInfo.SoftwareVersion)
>       get_device_info_software_version
> +     return $FAULT_CPE_NO_FAULT
>       ;;
>       InternetGatewayDevice.DeviceInfo.UpTime)
>       get_device_info_uptime
> +     return $FAULT_CPE_NO_FAULT
>       ;;
>       InternetGatewayDevice.DeviceInfo.DeviceLog)
>       get_device_info_device_log
> +     return $FAULT_CPE_NO_FAULT
>       ;;
>  esac
> +return $FAULT_CPE_INVALID_PARAMETER_NAME
>  }
>  
>  set_device_info() {
> @@ -161,10 +172,11 @@ return 1
>  }
>  
>  get_device_info_generic() {
> -     check_parameter_device_info_generic "$1" ; _tmp=$? ; if [ "$_tmp" -eq 1 
> ]; then return 0; fi
> +     check_parameter_device_info_generic "$1" ; _tmp=$? ; if [ "$_tmp" -eq 1 
> ]; then return $FAULT_CPE_INVALID_PARAMETER_NAME; fi
>  
>       freecwmp_get_parameter_value "val" "$1"
> -     freecwmp_value_output "$1" "$val"
> +     ubus_freecwmp_output "$1" "$val"
> +     return $FAULT_CPE_NO_FAULT
>  }
>  
>  set_device_info_generic() {
> -- 
> 1.7.4.1

Luka 

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