mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
Device.DeviceInfo.ProcessStatus.Process.{i}.State: change the value to 'Idle' if the state is unknown
This commit is contained in:
parent
d73e353113
commit
8d293b4b3f
1 changed files with 2 additions and 1 deletions
|
|
@ -194,7 +194,8 @@ int os__get_process_cpu_time(char* refparam, struct dmctx *ctx, void *data, char
|
|||
/*#Device.DeviceInfo.ProcessStatus.Process.{i}.State!UBUS:router.system/processes//processes[@i-1].state*/
|
||||
int os__get_process_state(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 1, "state");
|
||||
char *state = dmjson_get_value((json_object *)data, 1, "state");
|
||||
*value = (state && strcmp(state, "Unknown") == 0) ? "Idle" : state;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue