2020-09-13 16:58:36 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
2020-10-11 22:13:14 -07:00
|
|
|
#include "PhoneAPI.h"
|
2021-01-01 12:31:46 -08:00
|
|
|
#include "concurrency/OSThread.h"
|
2020-09-13 16:58:36 -07:00
|
|
|
#include <Arduino.h>
|
|
|
|
|
#include <functional>
|
|
|
|
|
|
|
|
|
|
void initWebServer();
|
2020-10-07 22:02:53 -07:00
|
|
|
void createSSLCert();
|
|
|
|
|
|
2020-09-13 16:58:36 -07:00
|
|
|
void handleNotFound();
|
|
|
|
|
|
|
|
|
|
void handleWebResponse();
|
|
|
|
|
|
|
|
|
|
|
2021-01-08 22:25:44 -08:00
|
|
|
//void handleHotspot();
|
2020-09-13 16:58:36 -07:00
|
|
|
|
2021-01-08 22:25:44 -08:00
|
|
|
//void handleStyleCSS();
|
|
|
|
|
//void handleRoot();
|
2020-11-06 22:21:20 -08:00
|
|
|
|
2021-01-01 21:20:34 -08:00
|
|
|
|
|
|
|
|
// Interface to the PhoneAPI to access the protobufs with messages
|
2020-10-16 19:38:59 -07:00
|
|
|
class HttpAPI : public PhoneAPI
|
2020-10-11 20:38:09 -07:00
|
|
|
{
|
|
|
|
|
|
2020-10-11 22:13:14 -07:00
|
|
|
public:
|
2020-10-11 20:38:09 -07:00
|
|
|
// Nothing here yet
|
|
|
|
|
|
2020-10-11 22:13:14 -07:00
|
|
|
private:
|
2020-10-11 20:38:09 -07:00
|
|
|
// Nothing here yet
|
|
|
|
|
|
2020-10-11 22:13:14 -07:00
|
|
|
protected:
|
2020-10-11 20:38:09 -07:00
|
|
|
// Nothing here yet
|
2021-01-01 12:31:46 -08:00
|
|
|
};
|
2021-01-08 22:25:44 -08:00
|
|
|
|
|
|
|
|
class WebServerThread : private concurrency::OSThread
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
WebServerThread();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
virtual int32_t runOnce();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
extern WebServerThread *webServerThread;
|