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();
|
|
|
|
|
|
2021-01-08 22:25:44 -08:00
|
|
|
class WebServerThread : private concurrency::OSThread
|
|
|
|
|
{
|
2025-10-06 13:52:40 +03:00
|
|
|
private:
|
|
|
|
|
uint32_t lastActivityTime = 0;
|
2021-01-08 22:25:44 -08:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
WebServerThread();
|
2022-01-05 22:12:32 -08:00
|
|
|
uint32_t requestRestart = 0;
|
2025-10-06 13:52:40 +03:00
|
|
|
void markActivity();
|
2021-01-08 22:25:44 -08:00
|
|
|
|
|
|
|
|
protected:
|
2022-01-24 17:24:40 +00:00
|
|
|
virtual int32_t runOnce() override;
|
2025-10-06 13:52:40 +03:00
|
|
|
int32_t getAdaptiveInterval();
|
2021-01-08 22:25:44 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
extern WebServerThread *webServerThread;
|