Prevent ble.shutdown() as it corrupts something...

This commit is contained in:
Philip Gladstone 2021-11-05 23:50:48 +00:00
parent b5c4082988
commit 4109e3053f
2 changed files with 6 additions and 1 deletions

View File

@ -995,6 +995,10 @@ static int lble_init(lua_State *L) {
}
static int lble_shutdown(lua_State *L) {
// It seems that shutting down the stack corrupts some critical data structures
// so, for now, don't allow it.
luaL_error(L, "Shutting down the BLE stack is currently not possible");
inited = SHUTTING;
ble_gap_adv_stop();

View File

@ -57,7 +57,8 @@ ble.advertise("foo")
## ble.shutdown()
Shuts down the BlueTooth controller and returns it to the state where another `init` ought to work (but currently doesn't).
Shuts down the BlueTooth controller and returns it to the state where another `init` ought to work (but currently doesn't). And, at the moment, shutting
it down doesn't work either -- it appears to corrupt some deep data structures.
#### Syntax
`ble.shutdown()`