Add BSSID to network.config() list
It is currently possible to see the list of available BSSIDs using network.scan(), and it is then possible to connect to a specific BSSID using network.connect(bssid=...), but it is not possible to see to which BSSID we are currently connected (while it is possible to see the SSID, using network.config('essid')).
A useful reason for this would be so that you can do network.connect(ssid=...) and then figure out which BSSID you are connected to.
I have been looking though the ESP32 port as that is the port that applies for me, but I can't figure out how to add this feature.
Would someone be able to help out here?
ports/esp32: Support additional scan options when connecting to WiFi.
Support setting scan_method and channel when using WLAN.connect() to connect to a WiFi access point.
Setting scan_method to esp.ALL_CHANNEL_SCAN will cause the ESP32 to connect to the access point with the strongest signal if there are multiple with the same SSID.
Setting channel allows for faster WiFi connections when the channel is known in advance (e.g. if it were previously discovered and cached). This is particularly valuable for battery powered devices. Without this, channels are always scanned sequentially leading to significant delays when the access point is on a high channel.
Also add support for retrieving the bssid from WLAN.config() as this is useful for debugging in environments with multiple access points.