in a serving a rest api that returns wifi hotspots.
String* getWifiHotspots() {
// String* arr = new String[];
String arr[100];
Serial.print("Scan start ... ");
int n = WiFi.scanNetworks();
for (int i = 0; i < n; i++)
{
arr[i] = WiFi.SSID(i).c_str();
}
return arr;
}
But when in the setup function I try to setup server resource like this:
ap_server.on("/hotspots",HTTP_GET, [](AsyncWebServerRequest * request) {
request->send_P(200, "text/plain", getWifiHotspots);
});
I am getting this error
/libraries/ESPAsyncWebServer/src/ESPAsyncWebServer.h:244:10: note: void AsyncWebServerRequest::send_P(int, const String&, const char*, AwsTemplateProcessor)
void send_P(int code, const String& contentType, PGM_P content, AwsTemplateProcessor callback=nullptr);
^