From 84020281ee27a5568fab35f9bff920c786088421 Mon Sep 17 00:00:00 2001 From: jessikitty Date: Tue, 1 Sep 2026 22:42:49 +1000 Subject: [PATCH] Include btstack.h instead of uni.h; note the include-path prerequisite Nothing in the sketch calls a uni_ function - bd_addr_t, sscanf_bd_addr, gap_connect and the gatt_client calls are all BTstack. --- ps4_lego_onebrain/ps4_lego_onebrain.ino | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ps4_lego_onebrain/ps4_lego_onebrain.ino b/ps4_lego_onebrain/ps4_lego_onebrain.ino index 5293c76..586f89d 100644 --- a/ps4_lego_onebrain/ps4_lego_onebrain.ino +++ b/ps4_lego_onebrain/ps4_lego_onebrain.ino @@ -5,10 +5,16 @@ * LEGO Powered Up hubs over BLE, driven by a hand-rolled LWP3 GATT client that * runs on the same BTstack instance. * - * Board package: esp32_bluepad32 (NOT the plain esp32 package) + * Board package: esp32-bluepad32 4.1.0 (NOT the plain esp32 package) * Libraries: none. No Legoino, no NimBLE - they would be a second host * stack and that is exactly what we are avoiding. * + * BEFORE THIS WILL COMPILE: + * The board package ships the BTstack headers but does not put them on the + * include path. You must add a platform.local.txt to the package folder + * first - see docs/BUILD.md. Without it you get: + * fatal error: btstack.h: No such file or directory + * * THREADING - read this before changing anything: * BTstack is not thread-safe. loop() runs in the Arduino task, BTstack runs * in its own task. The only BTstack call allowed from loop() is @@ -26,7 +32,7 @@ */ #include -#include +#include // =========================================================== configuration