mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
json.reserve: skip disabled signals
This commit is contained in:
parent
0273e97c06
commit
5ed12a4590
1 changed files with 13 additions and 2 deletions
|
@ -51,6 +51,9 @@ static int json_reserve_pack_sample(struct io *io, json_t **j, struct sample *sm
|
|||
sig = NULL;
|
||||
|
||||
if (sig) {
|
||||
if (!sig->enabled)
|
||||
continue;
|
||||
|
||||
json_name = json_string(sig->name);
|
||||
json_unit = json_string(sig->unit);
|
||||
}
|
||||
|
@ -141,8 +144,16 @@ static int json_reserve_unpack_sample(struct io *io, json_t *json_smp, struct sa
|
|||
if (ret)
|
||||
return -1;
|
||||
|
||||
idx = list_lookup_index(io->input.signals, name);
|
||||
if (idx < 0) {
|
||||
struct signal *sig;
|
||||
|
||||
sig = (struct signal *) list_lookup(io->input.signals, name);
|
||||
if (sig) {
|
||||
if (!sig->enabled)
|
||||
continue;
|
||||
|
||||
idx = list_index(io->input.signals, sig);
|
||||
}
|
||||
else {
|
||||
ret = sscanf(name, "signal_%d", &idx);
|
||||
if (ret != 1)
|
||||
continue;
|
||||
|
|
Loading…
Add table
Reference in a new issue