relevant code from my my class header file CfgServer.h:
#ifndef _CFGSERVER_h
#define _CFGSERVER_h
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <WiFiClient.h>
#include <EEPROM.h>
class CfgServer
{
public:
CfgServer();
void handleNotFound();
void handleAPClient();
void setupServer();
protected:
ESP8266WebServer APWebServer;
IPAddress myIP;
};
#endif
relevant code from the cpp file CfgServer.cpp:
#include "CfgServer.h"
#define DBG_OUTPUT_PORT Serial
CfgServer::CfgServer() {
hasData = false;
APWebServer = ESP8266WebServer(80);
}
void CfgServer::handleNotFound() {
/*
* this chunk has a means of finding page content indexed by the specified
* server path from an array of flash/progmem data. If the index is not
* found, it gives a 404
*/
}
void CfgServer::handleAPClient()
{
APWebServer.handleClient();
}
void CfgServer::setupServer() {
/* the following is producing an error */
APWebServer.onNotFound(handleNotFound);
APWebServer.begin();
DBG_OUTPUT_PORT.println("HTTP server started");
}
My cut/paste is not currently working from my vnc window to the machine running the Arduino ID, but the error I am getting back is 'no matching function call to 'ESP8266WebServer::onNotFound()'
I'm assuming this is because it's pointing at the internal class method and I'm doing it wrong. Is there a way to get this to work? Or am I going about it the wrong way?