mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-18 00:41:43 +10:00
added ability to set custom config for access point
This commit is contained in:
@@ -34,6 +34,12 @@ void WiFiManager::begin(char const *apName) {
|
||||
|
||||
DEBUG_PRINT("Configuring access point... ");
|
||||
DEBUG_PRINT(_apName);
|
||||
//optional soft ip config
|
||||
if (_ip) {
|
||||
DEBUG_PRINT("Custom IP/GW/Subnet");
|
||||
WiFi.softAPConfig(_ip, _gw, _sn);
|
||||
}
|
||||
|
||||
WiFi.softAP(_apName);//TODO: add password option
|
||||
delay(500); // Without delay I've seen the IP address blank
|
||||
DEBUG_PRINT("AP IP address: ");
|
||||
@@ -250,6 +256,12 @@ void WiFiManager::setDebugOutput(boolean debug) {
|
||||
_debug = debug;
|
||||
}
|
||||
|
||||
void WiFiManager::setAPConfig(IPAddress ip, IPAddress gw, IPAddress sn) {
|
||||
_ip = ip;
|
||||
_gw = gw;
|
||||
_sn = sn;
|
||||
}
|
||||
|
||||
|
||||
/** Handle root or redirect to captive portal */
|
||||
void WiFiManager::handleRoot() {
|
||||
|
||||
Reference in New Issue
Block a user