feat(ble): expose isInitialized and reclaim memory before radios start

The controller and the WiFi driver each need a large aggregate allocation,
which a live app sitting on garbage can deny - that is why a failed connect
often succeeded on retry. Both bindings now collect before initializing, and
the tree reserves its node and spec capacity so a build does not reallocate
into a tight heap.
This commit is contained in:
2026-08-04 13:10:18 -04:00
parent 3416f54c83
commit bf286eefa6
7 changed files with 37 additions and 3 deletions
+4
View File
@@ -19,6 +19,10 @@ function ble.init(name) end
---Stops the BLE stack and releases its memory.
function ble.deinit() end
---Whether the BLE stack is running.
---@return boolean
function ble.isInitialized() end
---Scans for advertising devices.
---@param durationMs? integer Defaults to 3000.
---@return BleDevice[]? devices