diff --git a/components/modules/ble.c b/components/modules/ble.c index fa29cf97..8bb16df7 100644 --- a/components/modules/ble.c +++ b/components/modules/ble.c @@ -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(); diff --git a/docs/modules/ble.md b/docs/modules/ble.md index 24082a8a..7b7d8535 100644 --- a/docs/modules/ble.md +++ b/docs/modules/ble.md @@ -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()`