mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-16 00:00:02 +01:00
json: accept integers for floating point settings
This commit is contained in:
parent
a45b39b07a
commit
12973f9088
7 changed files with 17 additions and 17 deletions
|
@ -55,7 +55,7 @@ static int shift_ts_parse(struct hook *h, json_t *cfg)
|
|||
int ret;
|
||||
json_error_t err;
|
||||
|
||||
ret = json_unpack_ex(cfg, &err, 0, "{ s?: s, s: f }",
|
||||
ret = json_unpack_ex(cfg, &err, 0, "{ s?: s, s: F }",
|
||||
"mode", &mode,
|
||||
"offset", &offset
|
||||
);
|
||||
|
|
|
@ -24,7 +24,7 @@ int cbuilder_parse(struct node *n, json_t *cfg)
|
|||
size_t index;
|
||||
json_error_t err;
|
||||
|
||||
ret = json_unpack_ex(cfg, &err, 0, "{ s: f, s: s, s: b }",
|
||||
ret = json_unpack_ex(cfg, &err, 0, "{ s: F, s: s, s: b }",
|
||||
"timestep", &cb->timestep,
|
||||
"model", &model,
|
||||
"parameters", &cfg_params
|
||||
|
|
|
@ -90,7 +90,7 @@ int file_parse(struct node *n, json_t *cfg)
|
|||
f->epoch_mode = FILE_EPOCH_DIRECT;
|
||||
f->flush = 0;
|
||||
|
||||
ret = json_unpack_ex(cfg, &err, 0, "{ s: s, s?: b, s?: s, s?: f, s?: s, s?: f, s?: s }",
|
||||
ret = json_unpack_ex(cfg, &err, 0, "{ s: s, s?: b, s?: s, s?: F, s?: s, s?: F, s?: s }",
|
||||
"uri", &uri_tmpl,
|
||||
"flush", &f->flush,
|
||||
"eof", &eof,
|
||||
|
|
|
@ -418,7 +418,7 @@ int ngsi_parse(struct node *n, json_t *cfg)
|
|||
i->timeout = 1; /* default value */
|
||||
i->rate = 5; /* default value */
|
||||
|
||||
ret = json_unpack_ex(cfg, &err, 0, "{ s?: s, s: s, s: s, s: s, s?: b, s?: f, s?: f }",
|
||||
ret = json_unpack_ex(cfg, &err, 0, "{ s?: s, s: s, s: s, s: s, s?: b, s?: F, s?: F }",
|
||||
"access_token", &i->access_token,
|
||||
"endpoint", &i->endpoint,
|
||||
"entity_id", &i->entity_id,
|
||||
|
|
|
@ -67,7 +67,7 @@ int signal_parse(struct node *n, json_t *cfg)
|
|||
s->stddev = 0.2;
|
||||
s->offset = 0;
|
||||
|
||||
ret = json_unpack_ex(cfg, &err, 0, "{ s?: s, s?: b, s?: i, s?: i, s?: f, s?: f, s?: f, s?: f, s?: f }",
|
||||
ret = json_unpack_ex(cfg, &err, 0, "{ s?: s, s?: b, s?: i, s?: i, s?: F, s?: F, s?: F, s?: F, s?: F }",
|
||||
"signal", &type,
|
||||
"realtime", &s->rt,
|
||||
"limit", &s->limit,
|
||||
|
|
|
@ -88,7 +88,7 @@ int stats_node_parse(struct node *n, json_t *cfg)
|
|||
|
||||
const char *node;
|
||||
|
||||
ret = json_unpack_ex(cfg, &err, 0, "{ s: s, s: f }",
|
||||
ret = json_unpack_ex(cfg, &err, 0, "{ s: s, s: F }",
|
||||
"node", &node,
|
||||
"rate", &s->rate
|
||||
);
|
||||
|
|
|
@ -75,7 +75,7 @@ int test_rtt_parse(struct node *n, json_t *cfg)
|
|||
|
||||
t->cooldown = 1.0;
|
||||
|
||||
ret = json_unpack_ex(cfg, &err, 0, "{ s?: i, s?: s, s?: s, s: f, s: o, s: o }",
|
||||
ret = json_unpack_ex(cfg, &err, 0, "{ s?: i, s?: s, s?: s, s: F, s: o, s: o }",
|
||||
"limit", &limit,
|
||||
"output", &output,
|
||||
"format", &format,
|
||||
|
|
Loading…
Add table
Reference in a new issue