Skip to content

Retrieving softAP SSID #4230

Closed
Closed
@jsphuebner

Description

@jsphuebner

Hi,

added a function to ESP8266WifiAP.cpp for retrieving the stored softAP SSID

Sketch

#include <Arduino.h>
#include <ESP8266WiFi.h>

void setup() {
  Serial.begin(115200);
  Serial.print("softAP SSID: ");
  Serial.print(WiFi.softAPSSID());
}

void loop() {

}

Add to ESP8266WifiAP.cpp

String ESP8266WiFiAPClass::softAPSSID() {
    struct softap_config config;
    String ssid = "";
    
    if (wifi_softap_get_config(&config))
        ssid = reinterpret_cast<char*>(config.ssid);
    return ssid;
}

Add to ESP8266WifiAP.h

String softAPSSID();

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions