I have a question regarding the AP cache for station mode. I understand that ESP8266 can cache up to 5 APs is was successfully connected to. The SDK says:
wifi_station_ap_number_set
Sets the number of APs that will be cached for ESP8266 Station mode. Whenever
ESP8266 Station connects to an AP, it caches a record of this AP’s SSID and
password. The cached ID index starts from 0.
What I don't understand: Once cached, does ESP automatically connect to any of the cached APs if it comes into range? Or only the first (or zeroth) one? Is it my task to switch between them?
SDK says:
wifi_station_set_auto_connect
Set the ESP8266 Station to connect to the AP (whose ID is cached) automatically
or not when powered on. Auto-connection is enabled by default.
wifi_station_ap_change
Switch ESP8266 Station connection to AP as specified.
uint8 new_ap_id: AP’s record ID; start counting from 0.
wifi_station_get_current_ap_id
Get the current cached ID of AP. ESP8266 records the ID of each AP it connects
with. The ID number starts from 1.
Now that totally confuses me. The ID number, does it start from 0 or 1??