I am using SYSTEM_THREAD(ENABLED) and 0.8.0-RC.10
I have a user command that allows existing WAP credentials to be cleared. Excerpt as shown below. This works first time through but then on the second use will hang the photon. Is this because A. Particle.disconnect() is application thread blocking and B. WiFi.clearCredentials() has already disconnected the cloud connection?
if (WiFi.clearCredentials())
{
statusMessage("All WAP Credentials Cleared");
hasStoredCredentials = false;
Particle.disconnect();
WiFi.disconnect();
isTriedConnectOnce = false; //to ensure when reconnecting that particle connect is called once
WiFi.off();
WiFi.on(); //bounce required to ensure the wifi module forgets it had creds
}
Would a solution be to test if connected before the Particle.disconnect();?