You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/modules/wifi.md
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -662,7 +662,8 @@ Get information of APs cached by ESP8266 station.
662
662
- `1-5` index of AP. (the index corresponds to index used by [`wifi.sta.changeap()`](#wifistachangeap) and [`wifi.sta.getapindex()`](#wifistagetapindex))
663
663
- `ssid` ssid of Access Point
664
664
- `pwd` password for Access Point, `nil` if no password was configured
665
-
- `bssid` MAC address of Access Point, `nil` if no MAC address was configured
665
+
- `bssid` MAC address of Access Point
666
+
- `nil` will be returned if no MAC address was configured during station configuration.
666
667
667
668
#### Example
668
669
```lua
@@ -733,7 +734,9 @@ If `return_table` is `true`:
733
734
-`config_table`
734
735
- `ssid` ssid of Access Point.
735
736
- `pwd` password to Access Point, `nil` if no password was configured
736
-
- `bssid` MAC address of Access Point, `nil` if no MAC address was configured
737
+
- `bssid_set` will return `true` if the station was configured specifically to connect to the AP with the matching `bssid`.
738
+
- `bssid` If a connection has been made to the configured AP this field will contain the AP's MAC address. Otherwise "ff:ff:ff:ff:ff:ff" will be returned.
739
+
737
740
738
741
If `return_table` is `false`:
739
742
@@ -744,8 +747,8 @@ If `return_table` is `false`:
744
747
```lua
745
748
--Get current Station configuration (NEW FORMAT)
746
749
do
747
-
localdef_sta_config=wifi.sta.getconfig(true)
748
-
print(string.format("\tDefault station config\n\tssid:\"%s\"\tpassword:\"%s\"%s", def_sta_config.ssid, def_sta_config.pwd, (type(def_sta_config.bssid)=="string" and"\tbssid:\""..def_sta_config.bssid.."\""or"")))
750
+
localsta_config=wifi.sta.getconfig(true)
751
+
print(string.format("\tCurrent station config\n\tssid:\"%s\"\tpassword:\"%s\"\n\tbssid:\"%s\"\tbssid_set:%s", sta_config.ssid, sta_config.pwd, sta_config.bssid, (sta_config.bssid_setand"true"or"false")))
749
752
end
750
753
751
754
--Get current Station configuration (OLD FORMAT)
@@ -780,7 +783,8 @@ If `return_table` is `true`:
780
783
-`config_table`
781
784
- `ssid` ssid of Access Point.
782
785
- `pwd` password to Access Point, `nil` if no password was configured
783
-
- `bssid` MAC address of Access Point, `nil` if no MAC address was configured
786
+
- `bssid_set` will return `true` if the station was configured specifically to connect to the AP with the matching `bssid`.
787
+
- `bssid` If a connection has been made to the configured AP this field will contain the AP's MAC address. Otherwise "ff:ff:ff:ff:ff:ff" will be returned.
0 commit comments