From 83c6396f022ae7fc759cff2f5bc595008472b8db Mon Sep 17 00:00:00 2001 From: mmmorks Date: Tue, 8 Sep 2026 00:10:52 -0700 Subject: [PATCH] Fix three build and link breaks in shared code ConfigSerializer.cpp calls atoi/atol/atof and reaches them through Arduino.h on MCU targets, but not in the host `native` googletest build. On macOS the whole suite fails to compile at ConfigSerializer.o, taking every unit test down with it. Include . LocationProvider::sendSentence() was declared virtual but never defined anywhere in the tree. It was the class's key function under the Itanium ABI, so the base vtable is un-emittable: any translation unit that emits it gets an undefined reference. Every current subclass overrides it, which is why no build has failed yet. Give it an empty default body, matching the no-op override in EnvironmentSensorManager.cpp. This is a latent hazard, not a host-test-build failure -- the native env compiles neither this header nor its users. CustomLLCC68Wrapper::doResetAGC() calls sx126xResetAGC() with one argument; the only overload takes (SX126x*, bool rx_boost_gain). No environment in the tree compiles this wrapper yet, which is why nothing has failed, but the first board to use it will not build. Pass getRxBoostedGainMode(), as the SX1262, SX1268 and STM32WLx wrappers do. --- src/helpers/ConfigSerializer.cpp | 3 +++ src/helpers/radiolib/CustomLLCC68Wrapper.h | 2 +- src/helpers/sensors/LocationProvider.h | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/helpers/ConfigSerializer.cpp b/src/helpers/ConfigSerializer.cpp index adff147f47..a0911303cd 100644 --- a/src/helpers/ConfigSerializer.cpp +++ b/src/helpers/ConfigSerializer.cpp @@ -1,5 +1,8 @@ #include "ConfigSerializer.h" +#include // atoi/atol/atof -- reaches these via Arduino.h on MCU + // targets, but not in the host `native` test build + bool ConfigSerializer::saveSerial(Stream& s) { Context context(&s, OP::WRITE); _context = &context; // set the context for structure() call diff --git a/src/helpers/radiolib/CustomLLCC68Wrapper.h b/src/helpers/radiolib/CustomLLCC68Wrapper.h index ae0fe0a253..d5f97c65fd 100644 --- a/src/helpers/radiolib/CustomLLCC68Wrapper.h +++ b/src/helpers/radiolib/CustomLLCC68Wrapper.h @@ -35,7 +35,7 @@ class CustomLLCC68Wrapper : public RadioLibWrapper { } uint8_t getSpreadingFactor() const override { return ((CustomLLCC68 *)_radio)->spreadingFactor; } - void doResetAGC() override { sx126xResetAGC((SX126x *)_radio); } + void doResetAGC() override { sx126xResetAGC((SX126x *)_radio, getRxBoostedGainMode()); } bool setRxBoostedGainMode(bool en) override { return ((CustomLLCC68 *)_radio)->setRxBoostedGainMode(en) == RADIOLIB_ERR_NONE; diff --git a/src/helpers/sensors/LocationProvider.h b/src/helpers/sensors/LocationProvider.h index 81d08652ed..488a755115 100644 --- a/src/helpers/sensors/LocationProvider.h +++ b/src/helpers/sensors/LocationProvider.h @@ -16,7 +16,7 @@ class LocationProvider { virtual long satellitesCount() = 0; virtual bool isValid() = 0; virtual long getTimestamp() = 0; - virtual void sendSentence(const char * sentence); + virtual void sendSentence(const char * sentence) {} virtual void reset() = 0; virtual void begin() = 0; virtual void stop() = 0;