From f76523ec12f05a19950d813f96b5154bb10696b3 Mon Sep 17 00:00:00 2001 From: Adrian Del Grosso <10929341+ad3154@users.noreply.github.com> Date: Sat, 9 Dec 2023 15:50:50 -0700 Subject: [PATCH] [Examples]: Return object pool to a known state if VT gets disconnected --- examples/seeder_example/vt_application.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/examples/seeder_example/vt_application.cpp b/examples/seeder_example/vt_application.cpp index 7d425fe9..602dc63a 100644 --- a/examples/seeder_example/vt_application.cpp +++ b/examples/seeder_example/vt_application.cpp @@ -380,6 +380,14 @@ void SeederVtApplication::update() update_alarms(); + if (!VTClientInterface.get_is_connected()) + { + for (std::uint32_t i = 0; i < static_cast(UpdateVTStateFlags::NumberOfFlags); i++) + { + txFlags.set_flag(i); // Set all flags to bring the pool up with a known state + } + } + slowUpdateTimestamp_ms = isobus::SystemTiming::get_timestamp_ms(); } speedMessages.update();