Thanks for the reply. I am unable to set new WiFi credentials while the WiFi controller is attempting to try to connect to WiFi. Here is the sequence:
//At this point if the device is unable to connect to the set WiFi, I want to save new credentials.
But calling setWiFi credentials while the WiFi controller is attempting to try a connection doesn’t work. I can’t even turn WiFi module off. None of the WiFi related API’s work when a WiFi controller is attempting to connect to a WiFi network.
But you are correct. Once the WiFi controller is connected to WiFi, you can call setWiFiCredentials and that works.