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) <noreply@anthropic.com>
This commit is contained in:
Kaj Schittecat
2026-08-04 23:18:35 +02:00
co-authored by Claude Opus 4.8
parent 372abb0479
commit 7e5eac4675
+9
View File
@@ -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);