From 7e5eac4675ab275aa9b70dfd022b11532bf0ade7 Mon Sep 17 00:00:00 2001 From: Kaj Schittecat Date: Tue, 4 Aug 2026 23:18:35 +0200 Subject: [PATCH] lua: mirror the P4's WiFiClient->C6Client alias so the host links The T-Display P4 failed to link with an undefined reference to luaNetWorkerService(C6Client&, HTTPClient&). On that board the C6 runs ESP-AT, so UITask.cpp does #define WiFiClient C6Client to route sockets through AT-over-SDIO. LuaAppHost.cpp forward-declares WiFiClient without the alias, so it emitted the definition as _Z19luaNetWorkerServiceR10WiFiClientR10HTTPClient while the caller referenced the C6Client& overload -- the symbol was present, just under the wrong type. Confirmed by reading both object files. Mirroring the alias fixes it. This TU only forwards the reference to luaStoreHttpGet, so an incomplete type is sufficient. Every S3 board built fine throughout, which is why it went unnoticed until the first P4 build of the Lua work. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/ui-touch/LuaAppHost.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ui-touch/LuaAppHost.cpp b/src/ui-touch/LuaAppHost.cpp index 82d0277..e37f94e 100644 --- a/src/ui-touch/LuaAppHost.cpp +++ b/src/ui-touch/LuaAppHost.cpp @@ -32,6 +32,15 @@ extern void luaHostRadioStats(float* rssi, float* noise, uint32_t* rx_air_s, uin extern void luaHostRadioStats2(uint32_t* rx_evt, uint32_t* rx_drop, uint32_t* tx_pkts, float* freq, float* bw, int* sf, int* duty_pct); extern void luaHostSelfInfo(char* name, size_t name_cap, double* lat, double* lon); +// On the T-Display P4 the C6 runs ESP-AT, so UITask.cpp rebinds every WiFiClient to +// C6Client (AT-over-SDIO sockets). That alias MUST be mirrored here: without it the +// worker entry point below mangles as luaNetWorkerService(WiFiClient&, ...) while the +// caller in UITask.cpp references the C6Client& overload, and the P4 fails to LINK +// while every S3 board builds fine. This TU only passes the reference through to +// luaStoreHttpGet, so an incomplete type is all it needs. +#if defined(HAS_TDISPLAY_P4) + #define WiFiClient C6Client +#endif class WiFiClient; class HTTPClient; extern int luaStoreHttpGet(WiFiClient& client, HTTPClient& http, const char* url, char* buf, size_t cap);