1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

api: provide node output signals

This commit is contained in:
Steffen Vogel 2022-03-28 10:42:56 +02:00
parent 9b9f880d18
commit c0bbcd910b

View file

@ -48,7 +48,16 @@ public:
if (body != nullptr)
throw BadRequest("Nodes endpoint does not accept any body data");
return new JsonResponse(session, HTTP_STATUS_OK, node->toJson());
auto *json_node = node->toJson();
auto sigs = node->getOutputSignals();
if (sigs) {
auto *json_out = json_object_get(json_node, "out");
if (json_out)
json_object_set_new(json_out, "signals", sigs->toJson());
}
return new JsonResponse(session, HTTP_STATUS_OK, json_node);
}
};