|
@ -764,6 +764,25 @@ void wifiSetup() { |
|
|
jw.enableSTA(true); |
|
|
jw.enableSTA(true); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Note that maximum amount of stations is set by `WiFi.softAP(...)` call, but justwifi handles that.
|
|
|
|
|
|
// Default is 4, which we use here. However, maximum is 8. ref:
|
|
|
|
|
|
// https://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/soft-access-point-class.html#softap
|
|
|
|
|
|
#if WIFI_AP_LEASES_SUPPORT
|
|
|
|
|
|
for (unsigned char index = 0; index < 4; ++index) { |
|
|
|
|
|
auto lease = getSetting({"wifiApLease", index}); |
|
|
|
|
|
if (12 != lease.length()) { |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
uint8_t mac[6] = {0}; |
|
|
|
|
|
if (!hexDecode(lease.c_str(), lease.length(), mac, sizeof(mac))) { |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
wifi_softap_add_dhcps_lease(mac); |
|
|
|
|
|
} |
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
#if JUSTWIFI_ENABLE_SMARTCONFIG
|
|
|
#if JUSTWIFI_ENABLE_SMARTCONFIG
|
|
|
if (_wifi_smartconfig_initial) jw.startSmartConfig(); |
|
|
if (_wifi_smartconfig_initial) jw.startSmartConfig(); |
|
|
#endif
|
|
|
#endif
|
|
|