diff --git a/flake.lock b/flake.lock index 62a870f..a18b93b 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "dump-dvb-rust": { "flake": false, "locked": { - "lastModified": 1669668329, - "narHash": "sha256-d/PkmW8YCg7GLF/Q/M5orksJyVfry6E/PmCq25UV4/s=", + "lastModified": 1670404851, + "narHash": "sha256-wcb5tVLzNguCitu1KP62WvzzUTJgvqBYU2MoGecpZgA=", "owner": "dump-dvb", "repo": "dump-dvb.rs", - "rev": "b9eff8854baef32a8c4d18857f7a9645a7efff20", + "rev": "862237541cd5d1923e1369feb24f5cfdc6df09ee", "type": "github" }, "original": { @@ -34,11 +34,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1670009809, - "narHash": "sha256-yt/dQ32Vz4WenDLu4XeHbnXFxiHbTcnU0WwiLW5Ce6c=", + "lastModified": 1670276674, + "narHash": "sha256-FqZ7b2RpoHQ/jlG6JPcCNmG/DoUPCIvyaropUDFhF3Q=", "owner": "nixos", "repo": "nixpkgs", - "rev": "660e7737851506374da39c0fa550c202c824a17c", + "rev": "52e3e80afff4b16ccb7c52e9f0f5220552f03d04", "type": "github" }, "original": { diff --git a/src/broadcast_server.cpp b/src/broadcast_server.cpp index 26b6ff8..114054a 100644 --- a/src/broadcast_server.cpp +++ b/src/broadcast_server.cpp @@ -232,9 +232,7 @@ void BroadcastServer::queue_telegram(const dvbdump::R09GrpcTelegram* telegram) n enriched_telegram.set_train_length(telegram->train_length()); enriched_telegram.set_vehicle_number(telegram->vehicle_number()); enriched_telegram.set_operator_(telegram->operator_()); - - auto list_of_values = enriched_telegram.add_enriched(); - list_of_values->set_historical_time(extracted.historical_time()); + enriched_telegram.set_allocated_enriched(&extracted); google::protobuf::util::MessageToJsonString(enriched_telegram, &enriched_serialized, options); } diff --git a/test.py b/test.py index aa70c31..d4eea9a 100755 --- a/test.py +++ b/test.py @@ -16,7 +16,9 @@ async def hello(uri): async with connect(uri) as websocket: await websocket.send(raw_config) while True: - print(await websocket.recv()) + data = json.loads(await websocket.recv()) + if "enriched" in data.keys(): + print(data["enriched"]) asyncio.run(hello("wss://socket.staging.dvb.solutions")) #asyncio.run(hello("ws://127.0.0.1:9001"))