ESP3D/esp8266/webinterface.h
luc 9aaa045347 Add page to configure Access Point
Fix wrong size for SSID/password
Add minimum size for easy change
Workaround missing strncpy_P missig issue
2015-05-29 20:35:08 +08:00

47 lines
1.4 KiB
C++

/*
webinterface.h - esp8266 configuration class
Copyright (c) 2014 Luc Lebosse. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef WEBINTERFACE_h
#define WEBINTERFACE_h
#include <Arduino.h>
#include <WiFiClient.h>
#include <WiFiServer.h>
#include <ESP8266WebServer.h>
class WEBINTERFACE_CLASS
{
public:
WEBINTERFACE_CLASS (int port = 82);
ESP8266WebServer WebServer;
void flushbuffer();
void add4send(const char * data2send, bool bimmediatsend = false);
void urldecode(char *dst, const char *src);
bool isSSIDValid(const char * ssid);
bool isPasswordValid(const char * password);
bool isIPValid(const char * IP);
private:
String buffer2send;
bool bsendingstarted;
};
extern WEBINTERFACE_CLASS web_interface;
#endif