From debaacd17271803520a264120165d19bf6d24c37 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Wed, 17 Apr 2024 11:44:26 +1200 Subject: [PATCH] info: add subscription for flight information (#341) This allows to get the flight information update once per second. Signed-off-by: Julian Oes --- protos/info/info.proto | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/protos/info/info.proto b/protos/info/info.proto index 2a677700..5a8db10b 100644 --- a/protos/info/info.proto +++ b/protos/info/info.proto @@ -19,6 +19,9 @@ service InfoService { rpc GetVersion(GetVersionRequest) returns(GetVersionResponse) { option (mavsdk.options.async_type) = SYNC; } // Get the speed factor of a simulation (with lockstep a simulation can run faster or slower than realtime). rpc GetSpeedFactor(GetSpeedFactorRequest) returns(GetSpeedFactorResponse) { option (mavsdk.options.async_type) = SYNC; } + + // Subscribe to 'flight information' updates. + rpc SubscribeFlightInformation(SubscribeFlightInformationRequest) returns(stream FlightInformationResponse) { option (mavsdk.options.async_type) = ASYNC; } } message GetFlightInformationRequest {} @@ -51,6 +54,11 @@ message GetSpeedFactorResponse { double speed_factor = 2; // Speed factor of simulation } +message SubscribeFlightInformationRequest {} +message FlightInformationResponse { + FlightInfo flight_info = 1; // The next flight information +} + // System flight information. message FlightInfo { uint32 time_boot_ms = 1; // Time since system boot