From 0fd9b0cf2ae0c74ab5cd22e19489786f31281b2f Mon Sep 17 00:00:00 2001 From: Pete A Date: Sun, 1 Oct 2023 23:21:37 +0100 Subject: [PATCH] Fix betaflight telematry by supporting source_sysid of 0 --- app/telemetry/MavlinkTelemetry.cpp | 11 +++++++++++ app/telemetry/models/fcmavlinksystem.cpp | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/telemetry/MavlinkTelemetry.cpp b/app/telemetry/MavlinkTelemetry.cpp index f5ae11567..b9bd9d5f5 100644 --- a/app/telemetry/MavlinkTelemetry.cpp +++ b/app/telemetry/MavlinkTelemetry.cpp @@ -105,6 +105,17 @@ void MavlinkTelemetry::process_mavlink_message(const mavlink_message_t& msg) m_fc_comp_id=source_compid; m_fc_found=true; } + else if(source_sysid==0){ + qDebug()<<"Found betaflight FC:"< FCMavlinkSystem::get_fc_sys_id() return std::nullopt; } auto sys_id=m_sys_id; - assert(sys_id>0); + assert(sys_id>=0); return sys_id; } bool FCMavlinkSystem::set_system_id(int sys_id) { - if(sys_id<=0 || sys_id >= UINT8_MAX){ + if(sys_id<0 || sys_id >= UINT8_MAX){ qWarning()<<"Invalid sys id"; return false; }