#include "AP_DAL_Beacon.h" #include #include #include "AP_DAL.h" 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; iget_vehicle_position_ned(_RBCH.vehicle_position_ned, _RBCH.accuracy_estimate); Location loc; _RBCH.get_origin_returncode = bcon->get_origin(loc); _RBCH.enabled = bcon->enabled(); _RBCH.origin_lat = loc.lat; _RBCH.origin_lng = loc.lng; _RBCH.origin_alt = loc.alt; } WRITE_REPLAY_BLOCK_IFCHANGED(RBCH, _RBCH, old); if (bcon == nullptr) { return; } for (uint8_t i=0; ibeacon_last_update_ms(i); RBCI.position = bcon->beacon_position(i); RBCI.distance = bcon->beacon_distance(i); RBCI.healthy = bcon->beacon_healthy(i); WRITE_REPLAY_BLOCK_IFCHANGED(RBCI, RBCI, old_RBCI); } }