mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-01-26 04:11:18 +00:00
SSDP
This commit is contained in:
@@ -18,11 +18,13 @@
|
||||
#include <ESP8266WebServer.h>
|
||||
#include <ESP8266HTTPClient.h>
|
||||
#include <ESP8266httpUpdate.h>
|
||||
#include <ESP8266SSDP.h>
|
||||
#elif defined(ESP32) // ARDUINO_ARCH_ESP32
|
||||
#include <WiFi.h>
|
||||
#include <WebServer.h>
|
||||
#include <HTTPClient.h>
|
||||
#include <HTTPUpdate.h>
|
||||
#include <ESP32SSDP.h>
|
||||
#else
|
||||
#warning "Unsupported board type"
|
||||
#endif
|
||||
@@ -120,6 +122,7 @@ private:
|
||||
void notFound();
|
||||
void redirectToMain();
|
||||
void robotstxt();
|
||||
void ssdpSchema();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -115,6 +115,8 @@ void AmsWebServer::setup(AmsConfiguration* config, GpioConfig* gpioConfig, Meter
|
||||
server.on(F("/library/test/success.html"), HTTP_GET, std::bind(&AmsWebServer::redirectToMain, this)); // Apple connectivity check: http://www.apple.com/library/test/success.html
|
||||
*/
|
||||
|
||||
server.on("/ssdp/schema.xml", HTTP_GET, std::bind(&AmsWebServer::ssdpSchema, this));
|
||||
|
||||
server.onNotFound(std::bind(&AmsWebServer::notFound, this));
|
||||
|
||||
server.begin(); // Web server start
|
||||
@@ -2329,4 +2331,8 @@ void AmsWebServer::configFileUpload() {
|
||||
void AmsWebServer::redirectToMain() {
|
||||
server.sendHeader(HEADER_LOCATION,F("/"));
|
||||
server.send(302);
|
||||
}
|
||||
|
||||
void AmsWebServer::ssdpSchema() {
|
||||
SSDP.schema(server.client());
|
||||
}
|
||||
Reference in New Issue
Block a user