Skip to content

Change AP static IP configuration  #76

Closed
@luc-github

Description

@luc-github

Seems there is no function to change AP IP configuration, currently setting IP/GW/Subnet works only for Station.
I have modified ESP8266Wifi.cpp/.h to add the missing function and it works so far, it would be good to add it I think.

void ESP8266WiFiClass::configAP(IPAddress local_ip, IPAddress gateway, IPAddress subnet)
{
    struct ip_info info;
    info.ip.addr = static_cast<uint32_t>(local_ip);
    info.gw.addr = static_cast<uint32_t>(gateway);
    info.netmask.addr = static_cast<uint32_t>(subnet);
    wifi_softap_dhcps_stop();
    wifi_set_ip_info(SOFTAP_IF, &info);
    wifi_softap_dhcps_start();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions