GPA in case of empty parameter

This commit is contained in:
Omar Kallel 2020-12-03 15:17:35 +01:00
parent be813a5501
commit 2ff9c07c28
2 changed files with 2 additions and 1 deletions

View file

@ -189,7 +189,7 @@ char* cwmp_get_parameter_names(char* object_name, bool next_level, json_object *
char* cwmp_get_parameter_attributes(char* parameter_name, json_object **parameters)
{
json_object *get_attributes_res = NULL;
int e = cwmp_ubus_call("usp.raw", "getm_attributes", CWMP_UBUS_ARGS{{"paths", {.array_value={{.str_value=parameter_name}}}, UBUS_Array_Str}}, 1, &get_attributes_res);
int e = cwmp_ubus_call("usp.raw", "getm_attributes", CWMP_UBUS_ARGS{{"paths", {.array_value={{.str_value=!parameter_name||parameter_name[0]=='\0'?DM_ROOT_OBJ:parameter_name}}}, UBUS_Array_Str}}, 1, &get_attributes_res);
if ( e < 0 || get_attributes_res == NULL)
return "9002";
json_object *fault_code = NULL;

View file

@ -6,6 +6,7 @@
#include "ubus.h"
#include "jshn.h"
#define DM_ROOT_OBJ "Device."
int cwmp_transaction_start();
int cwmp_transaction_commit();
int cwmp_transaction_abort();