SoftAP Callback or status?

I’ve implemented the new SoftAP web interface, which seems to work, but I can’t figure out how to tell on the Photon side of things that I’ve entered credentials.

According to the docs, the web interface is on when in listening mode, so I call WiFi.listen() to start it, which works.

The docs also say that WiFi.listen() blocks application code, so I was hoping I would be able to do what I want to do once connected by simply placing it after the listen call.

However, WiFi.listen() doesn’t seem to block my code at all, so it continues immediately, with the SoftAP still functioning.

Is that correct? Is there a way to determine when the user has entered credentials so I can connect and continue?

Thanks!

... unless you use SYSTEM_THREAD(ENABLED) and your page handler routine will be called anyway.
If you want to block, you can go non-threaded or add a while(!WiFi.listening()); after WiFi.listen()

Thanks!

I didn’t have the system thread enabled, so I’m not really sure why it wasn’t blocking.

However, I wanted to be able to cancel the WiFi setup, so I ended up enabling system mode and doing the blocking myself, along with a cancel button. It works!