mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2026-02-01 19:53:09 +01:00
Device.DeviceInfo.BootFirmwareImage: return error in case the set method does not work properly
This commit is contained in:
parent
f347d9d011
commit
b37728698f
3 changed files with 19 additions and 6 deletions
|
|
@ -274,7 +274,10 @@ int dm_entry_apply(struct dmctx *ctx, int cmd, char *arg1, char *arg2)
|
|||
ctx->in_value = n->value ? n->value : "";
|
||||
ctx->stop = false;
|
||||
fault = dm_entry_set_value(ctx);
|
||||
if (fault) break;
|
||||
if (fault) {
|
||||
add_list_fault_param(ctx, ctx->in_param, usp_fault_map(fault));
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!fault) {
|
||||
dmuci_set_value("cwmp", "acs", "ParameterKey", arg1 ? arg1 : "");
|
||||
|
|
|
|||
|
|
@ -144,9 +144,14 @@ static int set_device_boot_fwimage(char *refparam, struct dmctx *ctx, void *data
|
|||
adm_entry_get_linker_value(ctx, value, &linker);
|
||||
if (linker && *linker) {
|
||||
char *bank_id = strchr(linker, ':');
|
||||
if (bank_id)
|
||||
dmubus_call_set("fwbank", "set_bootbank", UBUS_ARGS{{"bank", bank_id+1, Integer}}, 1);
|
||||
dmfree(linker);
|
||||
if (bank_id) {
|
||||
json_object *res = NULL;
|
||||
|
||||
dmubus_call("fwbank", "set_bootbank", UBUS_ARGS{{"bank", bank_id+1, Integer}}, 1, &res);
|
||||
char *success = dmjson_get_value(res, 1, "success");
|
||||
if (strcmp(success, "true") != 0)
|
||||
return FAULT_9001;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1700,8 +1700,13 @@ static int mparam_set_value(DMPARAM_ARGS)
|
|||
return fault;
|
||||
}
|
||||
add_set_list_tmp(dmctx, dmctx->in_param, dmctx->in_value);
|
||||
} else if (dmctx->setaction == VALUESET)
|
||||
(set_cmd)(refparam, dmctx, data, instance, dmctx->in_value, VALUESET);
|
||||
} else if (dmctx->setaction == VALUESET) {
|
||||
int fault = (set_cmd)(refparam, dmctx, data, instance, dmctx->in_value, VALUESET);
|
||||
if (fault) {
|
||||
dmfree(refparam);
|
||||
return fault;
|
||||
}
|
||||
}
|
||||
dmfree(refparam);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue