From 7b08053ef288416d47ec6e822cf5e91d69c06f89 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 27 Nov 2020 10:53:36 +1100 Subject: [PATCH] AP_DAL: guarantee that the beacon count cannot change after startup --- libraries/AP_DAL/AP_DAL_Beacon.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/AP_DAL/AP_DAL_Beacon.cpp b/libraries/AP_DAL/AP_DAL_Beacon.cpp index 3b0f88c6e2..9058f05758 100644 --- a/libraries/AP_DAL/AP_DAL_Beacon.cpp +++ b/libraries/AP_DAL/AP_DAL_Beacon.cpp @@ -7,9 +7,13 @@ AP_DAL_Beacon::AP_DAL_Beacon() { +#if !APM_BUILD_TYPE(APM_BUILD_AP_DAL_Standalone) && !APM_BUILD_TYPE(APM_BUILD_Replay) + const auto *bcon = AP::beacon(); + _RBCH.count = bcon->count(); for (uint8_t i=0; icount(); _RBCH.get_vehicle_position_ned_returncode = bcon->get_vehicle_position_ned(_RBCH.vehicle_position_ned, _RBCH.accuracy_estimate); - Location loc; _RBCH.get_origin_returncode = bcon->get_origin(loc); _RBCH.enabled = bcon->enabled();