SuperHouse / esp-open-rtos

Open source FreeRTOS-based ESP8266 software framework
BSD 3-Clause "New" or "Revised" License
1.52k stars 491 forks source link

wificfg: add shutdown hooks, and add support to wait until connected. #645

Closed ourairquality closed 6 years ago

ourairquality commented 6 years ago

Remove the wificfg_got_sta_connect() function and replace it with wificfg_wait_until_sta_connected(). This replaces a probe function with a wait function, and this better fits the wifi layer using an event model - the wait function can wait on a station connection event before returning. This helped get this working on the esp-idf framework - small steps in that direction.

The shutdown hooks are called when the wificfg restart function is used. It can be used to implement a cleaner restart, for example blocking further i2c and flash operations.