I have a code like this:
in user_init() I have:
Code: Select all
if (wifi_station_get_auto_connect() != 0)
wifi_station_set_auto_connect(0);
// register "init done callback"
system_init_done_cb(userInitDoneCb);
// MANDATORY INITIALIZATION BLOCK END
// disable WiFi
wifi_set_opmode_current(NULL_MODE);
// disable DHCP server
wifi_softap_dhcps_stop();
in "init done callback" I have:
Code: Select all
ETS_UART_INTR_DISABLE();
_bRes = wifi_set_opmode_current(SOFTAP_MODE);
ETS_UART_INTR_ENABLE();
// DHCP is automatically started, so it must be stopped
wifi_softap_dhcps_stop(); /*
after setting wifi mode, dhcps stop() is called immediately. But message that DHCP is started still appears on debug output, before softAP IP address on if1 is set.
Is there something else missing to prevent autostarting DHCPS?