@@ -161,9 +161,9 @@ being removed in the SDK/IDF. After start-up it is necessary to call
- `sort_by` optional string value for preferential selection of AP. Must be one of `"rssi"` or `"authmode"` if present.
- `threshold_rssi` optional integer value to limit APs to only those which have a signal stronger than this value.
- `threshold_authmode` optional value to limit APs to those with an authentication mode of at least this settings. One of `wifi.AUTH_OPEN`, `wifi.AUTH_WEP`, `wifi.AUTH_WPA_PSK`, `wifi.AUTH_WPA2_PSK`, `wifi.AUTH_WPA_WPA2_PSK`, `wifi.AUTH_WPA2_ENTERPRISE`, `wifi.AUTH_WPA3_PSK`, `wifi.AUTH_WPA2_WPA3_PSK`, `wifi.AUTH_WAPI_PSK`.
- `rm` optional integer value, set to 1 to enable Radio Measurements
- `btm` optional integer value, set to 1 to enable BSS Transition Management
- `mbo` optional integer value, set to 1 to enable Multi-Band Operation
- `rm` optional boolean, set to `true` to enable Radio Measurements
- `btm` optional boolean, set to `true` to enable BSS Transition Management
- `mbo` optional boolean, set to `true` to enable Multi-Band Operation
- `sae_pwe` optional, configures WPA3 SAE Password Element setting. One of `wifi.SAE_PWE_UNSPECIFIED`, `wifi.SAE_PWE_HUNT_AND_PECK`, `wifi.SAE_PWE_HASH_TO_ELEMENT` or `wifi.SAE_PWE_BOTH`.
@@ -231,6 +231,17 @@ Equivalent to `luaL_newmetatable()` for ROTable metatables. Adds key / ROTable
This macro executes `luaL_unref(L, t, r)` and then assigns `r = LUA_NOREF`.
#### luaL_totoggle
` bool luaL_totoggle(lua_State *L, int idx)`
There are several ways of indicating a configuration toggle value:
- The modern Lua way, with a boolean (`true`/`false`)
- The "classic" Lua way, with `1`/`nil`
- The "C" way, with `1`/`0`
When implementing C modules for NodeMCU and needing to indicate an on/off setting, the preference is to do it as a boolean. In the interest of ease of use on the other hand, it is however nice to also support the other styles. The `luaL_totoggle` function provides just that.
### Declaring modules and ROTables in NodeMCU
All NodeMCU C library modules should include the standard header "`module.h`". This internally includes `lnodemcu.h` and these together provide the macros to enable declaration of NodeMCU modules and ROTables within them. All ROtable support macros are either prefixed by `LRO_` (Lua Read Only) or in the case of table entries `LROT_`.